A Survey of Gaussian Convolution Algorithms
Functions
erfc_cody.c File Reference

W.J. Cody's approximation of the complementary error function (erfc) More...

Detailed Description

W.J. Cody's approximation of the complementary error function (erfc)

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.cmla..nosp@m.ens-.nosp@m.cacha.nosp@m.n.fr

Copyright (c) 2012, Pascal Getreuer All rights reserved.

This program is free software: you can redistribute it and/or modify it under, at your option, the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or the terms of the simplified BSD license.

You should have received a copy of these licenses along with this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.

Definition in file erfc_cody.c.

#include "erfc_cody.h"

Go to the source code of this file.

Functions

static double erfc_cody_rpoly (const double *P, const double *Q, int N, double x)
 Evaluate rational polynomial for erfc approximation. More...
 
double erfc_cody (double x)
 Complementary error function. More...
 

Function Documentation

double erfc_cody ( double  x)

Complementary error function.

Based on the public domain NETLIB (Fortran) code by W. J. Cody Applied Mathematics Division Argonne National Laboratory Argonne, IL 60439

From the original documentation: The main computation evaluates near-minimax approximations from "Rational Chebyshev approximations for the error function" by W. J. Cody, Math. Comp., 1969, PP. 631-638. This transportable program uses rational functions that theoretically approximate erf(x) and erfc(x) to at least 18 significant decimal digits. The accuracy achieved depends on the arithmetic system, the compiler, the intrinsic functions, and proper selection of the machine-dependent constants.

Definition at line 65 of file erfc_cody.c.

static double erfc_cody_rpoly ( const double *  P,
const double *  Q,
int  N,
double  x 
)
static

Evaluate rational polynomial for erfc approximation.

Parameters
Pnumerator coefficients
Qdenominator coefficients
Norder
xx-value at which to evaluate the rational polynomial

Evaluates rational polynomial

\[ \frac{P[N+1] x^{N+1} + P[0] x^N + \cdots + P[N-1] x + P[N]} {x^{N+1} + Q[0] x^N + \cdots + Q[N-1] x + Q[N]}. \]

Definition at line 33 of file erfc_cody.c.