Adding upstream version 1.9.14.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
ddf4b25f8f
commit
49fcf7364a
88 changed files with 62468 additions and 0 deletions
32
nist/special-functions.c
Normal file
32
nist/special-functions.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
S P E C I A L F U N C T I O N S
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
#define LinuxorUnix
|
||||
#ifdef WIN
|
||||
#ifndef CYGWIN
|
||||
#undef LinuxorUnix
|
||||
/* same libraries are available*/
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LinuxorUnix
|
||||
double normal(double x)
|
||||
{
|
||||
double arg, result, sqrt2=1.414213562373095048801688724209698078569672;
|
||||
|
||||
if (x > 0) {
|
||||
arg = x/sqrt2;
|
||||
result = 0.5 * ( 1 + erf(arg) );
|
||||
}
|
||||
else {
|
||||
arg = -x/sqrt2;
|
||||
result = 0.5 * ( 1 - erf(arg) );
|
||||
}
|
||||
return( result);
|
||||
}
|
||||
|
||||
double normal2(double a)
|
||||
{ return (1.0-0.5*erfc(a/sqrt(2.0))); }
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue