Plugins/GaussianScalarSplatter/vtkGaussianScalarSplatter.cxx
double vtkGaussianScalarSplatter_erf(double x)
{
  // constants
  double a1 =  0.254829592;
  double a2 = -0.284496736;
  double a3 =  1.421413741;
  double a4 = -1.453152027;
  double a5 =  1.061405429;
  double p  =  0.3275911;

  // Save the sign of x
  int sign = 1;
  if (x < 0)
    sign = -1;
  x = fabs(x);

  // A&S formula 7.1.26
  double t = 1.0/(1.0 + p*x);
  double y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);

  return sign*y;
}
// This is public domain code from John D. Cook based on
// the formula 7.1.26 in the Handbook of Mathematical Functions
// by Abramowitz and Stegun. http://www.johndcook.com/cpp_erf.html
// It really should be put somewhere better than here, but this will
// work for now.
This is public domain code from John D. Cook based on
the formula 7.1.26 in the Handbook of Mathematical Functions
by Abramowitz and Stegun.
This is public domain code from John D . Cook based on the formula 7 . 1 . 26 in the Handbook of Mathematical Functions by Abramowitz and Stegun .
double vtkGaussianScalarSplatter_erf(double x)
{
  double a1 =  0.254829592;
  double a2 = -0.284496736;
  double a3 =  1.421413741;
  double a4 = -1.453152027;
  double a5 =  1.061405429;
  double p  =  0.3275911;
  int sign = 1;
  if (x < 0)
    sign = -1;
  x = fabs(x);
  double t = 1.0/(1.0 + p*x);
  double y = 1.0 - (((((a5*t + a4)*t) + a3)*t + a2)*t + a1)*t*exp(-x*x);
  return sign*y;
}
double vtkGaussianScalarSplatter_erf ( double x ) { double a1 = 0.254829592 ; double a2 = -0.284496736 ; double a3 = 1.421413741 ; double a4 = -1.453152027 ; double a5 = 1.061405429 ; double p = 0.3275911 ; int sign = 1 ; if ( x < 0 ) sign = -1 ; x = fabs ( x ) ; double t = 1.0 / ( 1.0 + p * x ) ; double y = 1.0 - ( ( ( ( ( a5 * t + a4 ) * t ) + a3 ) * t + a2 ) * t + a1 ) * t * exp ( - x * x ) ; return sign * y ; }
This is public domain code from John D. Cook based on
the formula 7.1.26 in the Handbook of Mathematical Functions
by Abramowitz and Stegun.
This is public domain code from John D . Cook based on the formula 7 . 1 . 26 in the Handbook of Mathematical Functions by Abramowitz and Stegun .
// constants // Save the sign of x // A&S formula 7.1.26