There's a weird issue with the tangent function, where tan(pi/4) = 0, but using approximate values, like tan(0.7854), you get an answer close to 1. sin(pi/4) and cos(pi/4) are unaffected. I guess this might be some kind of floating point issue with the pi constant, and for that reason I'm not sure if it's a bug or a kind of user error.