37 return new GammaFunction();
42 double DoEval (
double x)
const {
51 double dx = (x1-x0)/10;
52 for (
double x = x0;
x <
x1;
x+= dx ) {
57 double ey10 = c.
EvalErr(
x,10).second;
60 std::cout <<
" x = " <<
x <<
" true Val = " << fVal <<
" y = " << y <<
" +/- " << ey <<
" y@10 = " << y10 <<
" +/- " << ey10 << std::endl;
74 std::cout <<
"Test Cheb approx to step function :" << std::endl;
77 std::cout <<
"Test integral of step function :" << std::endl;
83 std::cout <<
"Test Cheb approx to Gamma function :" << std::endl;
87 std::cout <<
"Test derivative of gammma :" << std::endl;
Class describing a Chebyshev series which can be used to approximate a function in a defined range [a...
std::pair< double, double > EvalErr(double x) const
Evaluate the series at a given point x estimating both the series result and its absolute error...
Interface (abstract class) for generic functions objects of one-dimension Provides a method to evalua...
ChebyshevApprox * Integral()
Compute the integral of the series and return a pointer to a new Chebyshev series with the integral c...
double gamma_func(double x, void *)
double myfunc(double x, void *)
double tgamma(double x)
The gamma function is defined to be the extension of the factorial to real numbers.
double(* FP)(double, void *)
ChebyshevApprox * Deriv()
Compute the derivative of the series and return a pointer to a new Chebyshev series with the derivati...
static const double x1[5]
double func(double *x, double *p)
virtual double DoEval(double x) const =0
implementation of the evaluation function. Must be implemented by derived classes ...
int printCheb(const ROOT::Math::ChebyshevApprox &c, double x0, double x1, FP func=0)
virtual IBaseFunctionOneDim * Clone() const =0
Clone a function.