Geant4
10.03.p01
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
erfQ.cc
Go to the documentation of this file.
1
// $Id:$
2
// -*- C++ -*-
3
//
4
// -----------------------------------------------------------------------
5
// HEP Random
6
// --- erfQ ---
7
// method implementation file
8
// -----------------------------------------------------------------------
9
10
// Contains methods that do not depend on large tables.
11
//
12
// erfQ (double x)
13
14
// =======================================================================
15
// M Fischler - Created 1/26/00.
16
//
17
// =======================================================================
18
19
#include "
CLHEP/Random/Stat.h
"
20
#include <cmath>
21
22
namespace
CLHEP {
23
24
double
HepStat::erfQ
(
double
x) {
25
//
26
// erfQ is accurate to 7 places.
27
// See Numerical Recipes P 221
28
//
29
30
double
t, z, erfc;
31
32
z = std::abs(x);
33
t = 1.0/(1.0+.5*z);
34
35
erfc= t*std::exp(-z*z-1.26551223+t*(1.00002368+t*(0.37409196+t*(0.09678418+
36
t*(-0.18628806+t*(0.27886807+t*(-1.13520398+t*(1.48851587+
37
t*(-0.82215223+t*0.17087277 ))) ))) )));
38
39
// (The derivation of this formula should be obvious.)
40
41
if
( x < 0 ) erfc = 2.0 - erfc;
42
43
return
1 - erfc;
44
45
}
46
47
48
}
// namespace CLHEP
49
Stat.h
CLHEP::HepStat::erfQ
static double erfQ(double x)
Definition:
erfQ.cc:24
geant4.10.03.p01
source
externals
clhep
src
erfQ.cc
Generated on Thu Mar 16 2017 22:37:52 for Geant4 by
1.8.5