1
0
Fork 0

Adding upstream version 1.9.14.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-05 13:10:21 +01:00
parent ddf4b25f8f
commit 49fcf7364a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
88 changed files with 62468 additions and 0 deletions

32
nist/special-functions.c Normal file
View 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