1#include "CLHEP/GenericFunctions/GenericFunctions.hh"
2#include "CLHEP/GenericFunctions/Sin.hh"
3#include "CLHEP/GenericFunctions/Cos.hh"
4#include "CLHEP/GenericFunctions/defs.h"
18 for (
double x = 0; x < 100; x++) {
21 assert (fabs((
f*
g) (x) - (sin(x)*cos(x))) <= FLT_EPSILON);
22 assert (fabs((
f+
g) (x) - (sin(x)+cos(x))) <= FLT_EPSILON);
23 assert (fabs((
f-
g) (x) - (sin(x)-cos(x))) <= FLT_EPSILON);
24 assert (fabs((
f/
g) (x) - (sin(x)/cos(x))) <= FLT_EPSILON);
28 assert (fabs((p*
f)(x)- 4.0*sin(x)) <= FLT_EPSILON);
29 assert (fabs((
f*p)(x)- 4.0*sin(x)) <= FLT_EPSILON);
33 assert (fabs((
f*4.0)(x)- 4.0*sin(x)) <= FLT_EPSILON);
34 assert (fabs((4.0*
f)(x)- 4.0*sin(x)) <= FLT_EPSILON);
37 assert (fabs(((
f(
g))(x)) - sin(cos(x))) <= FLT_EPSILON);
43 assert (fabs((p*p).getValue()- 4.0*4.0) <= FLT_EPSILON);
46 assert (fabs((4*p).getValue()- 4.0*4.0) <= FLT_EPSILON);
47 assert (fabs((p*4).getValue()- 4.0*4.0) <= FLT_EPSILON);
50 std::cout <<
"GenericFunctions autotest has passed" << std::endl;