def update_mean(t, z, mean):
    """Computes arithmetic-weighted mean.

    Args:
        t: Time step.
        z: New datapoint.
        mean: Current mean.

    Returns:
        Updated mean with `z` having equal weight to previous terms in
        the sequence.
    """
    return mean + (z - mean) / (t + 1)