You could try computing sin(pi/2)
(or cos(pi/2)
for that matter) using the (fairly) quickly converging power series for sin and cos. (Even better: use various doubling formulas to compute nearer x=0
for faster convergence.)
BTW, better than using series for tan(x)
is, with computing say cos(x)
as a black box (e.g. you could use taylor series as above) is to do root finding via Newton. There certainly are better algorithms out there, but if you don't want to verify tons of digits this should suffice (and it's not that tricky to implement, and you only need a bit of calculus to understand why it works.)