20void binomialSimple() {
24 printf(
"\nTMath::Binomial simple test\n");
25 printf(
"Build the Tartaglia triangle\n");
26 printf(
"============================\n");
31 for(j=0;j<(
max-i);j++) printf(
" ");
44 const Int_t nmax=10000;
45 printf(
"\nTMath::Binomial fancy test\n");
46 printf(
"Verify Newton formula for (x+y)^n\n");
47 printf(
"x,y in [-2,2] and n from 0 to 9 \n");
48 printf(
"=================================\n");
50 for(
Int_t i=0; i<nmax; i++) {
55 for(
Int_t j=0; j<10; j++) {
58 for(
Int_t k=0; k<=j; k++)
61 printf(
"res1=%e res2=%e x=%e y=%e err=%e j=%d\n",res1,res2,
x,
y,
err,j);
65 printf(
"Average Error = %e\n",serr/nmax);
68void pdf004_Binomial () {
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
This is the base class for the ROOT Random number generators.
__device__ AFloat max(AFloat x, AFloat y)
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Double_t Binomial(Int_t n, Int_t k)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.