Define the function $[0,+\infty) \rightarrow R$:

$$ f = \cos (t) + \cos (\sqrt{2} t) + \cos (\sqrt{3} t) + \cos (\sqrt{5} t ) . $$

I want a number $t $ bigger than $10^7$ such that

$$ f(t) > 4 - 10^{-9} . $$

Can anyone give me such a number? Ultimately, I want an algorithm which works for arbitrary precision (say $10^{-900}$).