File indexing completed on 2024-05-12 15:27:05

0001 /* Copyright (c) 2012 Massachusetts Institute of Technology
0002  * 
0003  * Permission is hereby granted, free of charge, to any person obtaining
0004  * a copy of this software and associated documentation files (the
0005  * "Software"), to deal in the Software without restriction, including
0006  * without limitation the rights to use, copy, modify, merge, publish,
0007  * distribute, sublicense, and/or sell copies of the Software, and to
0008  * permit persons to whom the Software is furnished to do so, subject to
0009  * the following conditions:
0010  * 
0011  * The above copyright notice and this permission notice shall be
0012  * included in all copies or substantial portions of the Software.
0013  * 
0014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
0015  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
0016  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
0017  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
0018  * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
0019  * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
0020  * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 
0021  */
0022 
0023 /* Available at: http://ab-initio.mit.edu/Faddeeva
0024 
0025    Header file for Faddeeva.c; see Faddeeva.cc for more information. */
0026 
0027 #ifndef FADDEEVA_H
0028 #define FADDEEVA_H 1
0029 
0030 // Require C99 complex-number support
0031 #include <complex.h>
0032 
0033 #ifdef __cplusplus
0034 extern "C"
0035 {
0036 #endif /* __cplusplus */
0037 
0038 // compute w(z) = exp(-z^2) erfc(-iz) [ Faddeeva / scaled complex error func ]
0039 extern double complex Faddeeva_w(double complex z,double relerr);
0040 extern double Faddeeva_w_im(double x); // special-case code for Im[w(x)] of real x
0041 
0042 // Various functions that we can compute with the help of w(z)
0043 
0044 // compute erfcx(z) = exp(z^2) erfc(z)
0045 extern double complex Faddeeva_erfcx(double complex z, double relerr);
0046 extern double Faddeeva_erfcx_re(double x); // special case for real x
0047 
0048 // compute erf(z), the error function of complex arguments
0049 extern double complex Faddeeva_erf(double complex z, double relerr);
0050 extern double Faddeeva_erf_re(double x); // special case for real x
0051 
0052 // compute erfi(z) = -i erf(iz), the imaginary error function
0053 extern double complex Faddeeva_erfi(double complex z, double relerr);
0054 extern double Faddeeva_erfi_re(double x); // special case for real x
0055 
0056 // compute erfc(z) = 1 - erf(z), the complementary error function
0057 extern double complex Faddeeva_erfc(double complex z, double relerr);
0058 extern double Faddeeva_erfc_re(double x); // special case for real x
0059 
0060 // compute Dawson(z) = sqrt(pi)/2  *  exp(-z^2) * erfi(z)
0061 extern double complex Faddeeva_Dawson(double complex z, double relerr);
0062 extern double Faddeeva_Dawson_re(double x); // special case for real x
0063 
0064 #ifdef __cplusplus
0065 }
0066 #endif /* __cplusplus */
0067 
0068 #endif // FADDEEVA_H