import numpy as np

def Z(t, n_terms=30):
    """
    Z(t) ≈ Σ cos(π/4 - t*log(n)) / √n  for n = 1 to n_terms
    """
    t = float(t)
    result = 0.0
    for n in range(1, n_terms + 1):
        result += np.cos(np.pi/4 - t * np.log(n)) / np.sqrt(n)
    return 2 * result

# Verify
print(f"Z(14.134725) = {Z(14.134725):.6f}")
print(f"Z(21.022040) = {Z(21.022040):.6f}")
print(f"Z(30.424826) = {Z(30.424826):.6f}")
print(f"Z(1.936804) = {Z(1.936804):.6f}")
