41a02f62fd9cb61865c5f83a4e4056d9e9c2f32d
1 #include "00_pi_tools.h"
9 /*----------------------------------------------------------------------*\
11 \*---------------------------------------------------------------------*/
13 /*--------------------------------------*\
15 \*-------------------------------------*/
19 return 4 / (1 + x
* x
);
22 bool isAlgoPI_OK(AlgoPI algoPI
, int n
, string title
)
24 cout
<< endl
<< "[" << title
<< " running ...]" << endl
;
25 cout
<< "n=" << n
<< endl
;
28 double piHat
= algoPI(n
);
32 cout
<< "Pi hat = " << piHat
<< endl
;
33 cout
<< "Pi true = " << PI
<< endl
;
35 bool isOk
= MathTools::isEquals(piHat
, PI
, 1e-6);
36 cout
<< "isOk = " << isOk
<< endl
;
39 chrono
.print("time : ");
44 /*--------------------------------------*\
46 \*-------------------------------------*/
48 /*----------------------------------------------------------------------*\
50 \*---------------------------------------------------------------------*/