1 /* Copyright (c) 2012 Massachusetts Institute of Technology
3 * Permission is hereby granted, free of charge, to any person obtaining
4 * a copy of this software and associated documentation files (the
5 * "Software"), to deal in the Software without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Software, and to
8 * permit persons to whom the Software is furnished to do so, subject to
9 * the following conditions:
11 * The above copyright notice and this permission notice shall be
12 * included in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 /* Available at: http://ab-initio.mit.edu/Faddeeva
25 Header file for Faddeeva.cc; see that file for more information. */
34 // compute w(z) = exp(-z^2) erfc(-iz) [ Faddeeva / scaled complex error func ]
35 extern std::complex<double> w(std::complex<double> z
,double relerr
=0);
36 extern double w_im(double x
); // special-case code for Im[w(x)] of real x
38 // Various functions that we can compute with the help of w(z)
40 // compute erfcx(z) = exp(z^2) erfc(z)
41 extern std::complex<double> erfcx(std::complex<double> z
, double relerr
=0);
42 extern double erfcx(double x
); // special case for real x
44 // compute erf(z), the error function of complex arguments
45 extern std::complex<double> erf(std::complex<double> z
, double relerr
=0);
46 extern double erf(double x
); // special case for real x
48 // compute erfi(z) = -i erf(iz), the imaginary error function
49 extern std::complex<double> erfi(std::complex<double> z
, double relerr
=0);
50 extern double erfi(double x
); // special case for real x
52 // compute erfc(z) = 1 - erf(z), the complementary error function
53 extern std::complex<double> erfc(std::complex<double> z
, double relerr
=0);
54 extern double erfc(double x
); // special case for real x
56 // compute Dawson(z) = sqrt(pi)/2 * exp(-z^2) * erfi(z)
57 extern std::complex<double> Dawson(std::complex<double> z
, double relerr
=0);
58 extern double Dawson(double x
); // special case for real x
60 } // namespace Faddeeva