Home > Archive > Fortran > March 2004 > source code for erfc with complex variable
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
source code for erfc with complex variable
|
|
| Haifang Li 2004-03-27, 12:17 am |
| Hi,
I need a Fortran routine to evaluate the complementary error function erfc
with complex variable. I found several routines with real variable only. Can
anyone point me to a routine which can evaluate erfc(z) where z is complex.
Thanks,
Haifang Li
| |
| Gerry Thomas 2004-03-27, 12:17 am |
|
"Haifang Li" <haifang.li@stonybrook.edu> wrote in message
news:405f1c93$1_1@marge.ic.sunysb.edu...
> Hi,
>
> I need a Fortran routine to evaluate the complementary error function
erfc
> with complex variable. I found several routines with real variable only.
Can
> anyone point me to a routine which can evaluate erfc(z) where z is
complex.
>
> Thanks,
>
> Haifang Li
>
>
Here's one http://www.netlib.org/toms/680 but there are lots of others so
Google around.
--
Ciao,
Gerry T.
______
"Competent engineers rightly distrust all numerical computations and s
corroboration from alternative numerical methods, from scale models, from
prototypes, from experience... ." -- William V. Kahan.
| |
| meek@skyway.usask.ca 2004-03-27, 12:17 am |
| In a previous article, "Haifang Li" <haifang.li@stonybrook.edu> wrote:
>Hi,
>
>I need a Fortran routine to evaluate the complementary error function erfc
>with complex variable. I found several routines with real variable only. Can
>anyone point me to a routine which can evaluate erfc(z) where z is complex.
>
>Thanks,
>
>Haifang Li
Numerical Recipes in Fortran (2nd Ed) has one.
Chris
| |
| J.-P. Grivet 2004-03-27, 12:18 am |
| Haifang Li wrote:
> Hi,
>
> I need a Fortran routine to evaluate the complementary error function erfc
> with complex variable. I found several routines with real variable only. Can
> anyone point me to a routine which can evaluate erfc(z) where z is complex.
>
> Thanks,
>
> Haifang Li
>
>
You could check:
A.K. Hui, B.H. Armstrong, and A.A. Wray (1978) Rapid computation of the
Voigt and complex error functions. J. Quant. Spectrosc. Radiat. Transf.
vol 19, pp 509-516.
F. Schreier (1992) The Voigt and complex error functions: A comparison
of computational methods. J. Quant. Spectrosc. Radiat. Transf. vol 48,
pp 743-762. The site http://www.op.dlr.de/ne-oe/ir/voigt.html
has a F77 listing of Humlicek's algorithm.
If you are interested in computing NMR lineshapes, you can have a look
at my paper
J.P. Grivet (1997) Accurate numerical approximation to the Gauss-Lorentz
lineshape J. Magn. Reson. vol 125, pp 102-106.
hth,
JP Grivet
| |
| Gerry Thomas 2004-03-27, 12:18 am |
|
"J.-P. Grivet " <grivet-ns@cnrs-orleans.fr> wrote in message
news:c3uugn$87l$1@isis.univ-orleans.fr...
> Haifang Li wrote:
erfc[color=darkred]
only. Can[color=darkred]
complex.[color=darkred]
>
> You could check:
> A.K. Hui, B.H. Armstrong, and A.A. Wray (1978) Rapid computation of the
> Voigt and complex error functions. J. Quant. Spectrosc. Radiat. Transf.
> vol 19, pp 509-516.
> F. Schreier (1992) The Voigt and complex error functions: A comparison
> of computational methods. J. Quant. Spectrosc. Radiat. Transf. vol 48,
> pp 743-762. The site http://www.op.dlr.de/ne-oe/ir/voigt.html
> has a F77 listing of Humlicek's algorithm.
> If you are interested in computing NMR lineshapes, you can have a look
> at my paper
> J.P. Grivet (1997) Accurate numerical approximation to the Gauss-Lorentz
> lineshape J. Magn. Reson. vol 125, pp 102-106.
>
Thanks for the nod to your paper. J.A.C. Weideman, "Computation of the
Complex Error Function," SIAM J. Numerical Analysis, Vol 31, No. 5, pp
1497-1518 has a Matlab m-file for w(x)=(e^(-x^2))*erf(-i*x) which IIRC
was of particular interest to the OP.
--
Ciao,
Gerry T.
|
|
|
|
|