right, im not a maths guy but id go for the BigInteger way, or if speed was paramount id build a lookup table for the expected values of T.
That link in your question also points to the algo for sqrt(x), should be possible to optimize for 1-sqrt(1/2) but as i said im not into maths