I may need to rescind my contrition here.
I am interested in something called the error function. This following
bit of code uses the built-in versions of lcc-win32 to compute this:
i have "erf" too; i wrote it seeing my university book "analisi 1" the
integral:
oo
x 2 ---- k 2k + 1
/ -t \ (-1) x
| e dt = / --------------
/ ---- k k! (2k + 1)
0 0
in some other place i found
it seems x 2
2 / -t
erf(x)= -------- * | e dt
------ /
\/ Pi 0
erfc(x)= 1 - erf(x)
then an inplementation (don't know if is right it is all in "test"
here)
#include "num32.h"
int pause(void)
{int c;
P("\nPress enter to couninue...");
c=getchar_m(); R c;
}
int main(void)
{int i;
fnum x;
///////////
cout << "inserisci la precisione [\"0\" finisce]> ";
if(get_int(cin, &i, 0, 9000)==0) R 0;
set_precision10(i);
cout << "inserisci un numero > "; cin >> x;
cout << "erfc(" << x << ")==" << erfc(x) << "\n";
cout << "erf (" << x << ")==" << erf (x) << "\n";
pause(); R 0;
}
--------------------------------------------------
inserisci la precisione ["0" finisce]> assssffe err
Errore o importo fuori range: Riprova > -999999999999999999
Errore o importo fuori range: Riprova > -1
Errore o importo fuori range
DD:cont1=0 buffh_len1=4 buffh1=0x43285C
MEMORIA DINAMICA LIBERATA Tot=0.0080 Mb
inserisci la precisione ["0" finisce]> sii isisi uaia
Errore o importo fuori range: Riprova > 9999999999999999999999
Errore o importo fuori range: Riprova > 200
base_10=200 precision=21
inserisci un numero > 1.73
erfc(1.73)==0.014421500171819502568811928600244606213396306816246546707796466909
14859183973970631507594187479276740019642092608453769205806480452297025856609028
239617967907791293482074384255797294560459657354277808
erf(1.73)==0.985578499828180497431188071399755393786603693183753453292203533090
85140816026029368492405812520723259980357907391546230794193519547702974143390971
760382032092208706517925615744202705439540342645722192
Press enter to couninue...
DD:cont1=0 buffh_len1=26 buffh1=0x43263C
MEMORIA DINAMICA LIBERATA Tot=0.0080 Mb
inserisci la precisione ["0" finisce]> 20
base_10=20 precision=3
inserisci un numero > aaaa
erfc(0)==1
erf (0)==0
Press enter to couninue...
DD:cont1=0 buffh_len1=8 buffh1=0x43263C
MEMORIA DINAMICA LIBERATA Tot=0.0080 Mb
inserisci la precisione ["0" finisce]> 700
base_10=700 precision=73
inserisci un numero > 1.73
erfc(1.73)==0.014421500171819502568811928600244606213396306816246546707796466909
14859183973970631507594187479276740019642092608453769205806480452297025856609028
23961796790779129348207438425579729456045965735427780829276055456766177255810490
09489450899305874485241735734329902771642126578242826908491881699290363909702738
37485258369381146789843679628660206881332006907935825951089724201992511894706841
04923803455775165217127667997338419520875591912910520278572333408716697499401634
32239970196933678661287227224591967016761163282166438400430159370017368174950344
99480951075785283901779522028949334324485846719525271369786793031600737891870279
84437838261036547158831015418153908386052592280076111430463372003832425102
erf(1.73)==0.985578499828180497431188071399755393786603693183753453292203533090
85140816026029368492405812520723259980357907391546230794193519547702974143390971
76038203209220870651792561574420270543954034264572219170723944543233822744189509
90510549100694125514758264265670097228357873421757173091508118300709636090297261
62514741630618853210156320371339793118667993092064174048910275798007488105293158
95076196544224834782872332002661580479124408087089479721427666591283302500598365
67760029803066321338712772775408032983238836717833561599569840629982631825049655
00519048924214716098220477971050665675514153280474728630213206968399262108129720
15562161738963452841168984581846091613947407719923888569536627996167574897
Press enter to couninue...
DD:cont1=0 buffh_len1=89 buffh1=0x4327BC
MEMORIA DINAMICA LIBERATA Tot=0.0240 Mb