Is there a GPL library or a piece of code freely available that implements the imaginary error function:
erfi(x)=-i*erf(i*x)
where x is any complex number (or at least real) and i is the imaginary unit?
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.
A free/open-source C++ implementation of all of the usual error functions for real and complex arguments, including both erfi and a scaled erfi (to cancel erfi’s exponential growth) (the Dawson function), including optimizations for erfi of real arguments, is available at http://ab-initio.mit.edu/Faddeeva
(Note that this implementation is actually used in the upcoming version 0.12 of SciPy, replacing the complex-erf code in earlier versions which had accuracy problems: http://projects.scipy.org/scipy/ticket/1207)
(Unfortunately, evaluating special functions of complex arguments isn’t as simple as plugging complex numbers into code for real arguments, which is why the templating in Boost’s real-valued erf is of no help here.)