How do I go about calculating exp(i * x) where |x| >> 2 pi?
I know that it can be done with an arbitrary precision library, but is there an algorithm to do it stably (without roundoff errors) that doesn’t require a library?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
exp(i*x)iscos(x)+i*sin(x). A good math library will calculatecos(x)andsin(x)correctly even whenxis large. E.g., you should get correct results with the OS X or iOS standard math library, within a few ULP.In C, this should work: