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);
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
This is the base class for the ROOT Random number generators.
double binomial(int n, int k)
Calculates the binomial coefficient n over k.
__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)
Calculates the binomial coefficient n over 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.