Computing exponentials and Trig functions

mr.janus at mr.janus at
Thu Dec 6 17:28:57 CET 2007


I'm trying to write a program in C using GMP as matlab is unable to handle the precision i need for solving my coupled equations accurately. However, one of the many problems i'm having is how to speed up the calculation of trig functions.

I often have to solve complex exponentials but the way i have coded it is painfully slow. I split the exponential into the real and imaginary parts and solve separately. I then solve using sin, cos, sinh, and cosh identities.

However the slowdown problem arises from my calculation of the trigonometric functions, which i do by Taylor expansion. Obviously, as I push the precision the Taylor expansion takes longer and longer to converge to the required precision. How does everyone else do this?

Many thanks


More information about the gmp-discuss mailing list