Let a ∈ R, and let k(a) be the largest constant such that sup|cos(na)− cos(nb)| < k(a) for b ∈ R implies that b ∈ ±a + 2πZ. We show that if a cosine sequence (C (n)) n∈Z with values in a Banach algebra A satisfies sup n≥1 C (n) −for every a ∈ R, this shows that if some cosine family (C (g )) g ∈G over an abelian group G in a Banach algebra satisfies sup g ∈G C (g ) − c(g ) < 5 2 for some scalar cosine family (c(g )) g ∈G , then C (g ) = c(g ) for g ∈ G, and the constant 5 2 is optimal. We also describe the set of all real numbers a ∈ [0, π] satisfying k(a) ≤ 3 2 .