37 double exp1m(
double x);
44 double powi(
double x,
int p);
47 inline double pIntegrate(
double p,
double xl,
double xu) {
48 return p == -1.0? log(xu/xl): (pow(xu, p + 1.0) - pow(xl, p + 1.0))/(p + 1.0);
53 return p == -1? log(xu/xl): (
powi(xu, p + 1) -
powi(xl, p + 1))/
double(p + 1);
64 inline double pGenerate(
double p,
double xl,
double xu,
double rnd) {
65 return p == -1.0? xl*pow(xu/xl, rnd):
66 pow((1.0 - rnd)*pow(xl, p + 1.0) + rnd*pow(xu, p + 1.0), 1.0/(1.0 + p));
70 inline double pGenerate(
int p,
double xl,
double xu,
double rnd) {
71 return p == -1? xl*pow(xu/xl, rnd):
72 pow((1.0 - rnd)*
powi(xl, p + 1) + rnd*
powi(xu, p + 1), 1.0/
double(1 + p));
82 inline double pXGenerate(
double e,
double xl,
double dx,
double rnd) {
88 template <
typename FloatType>
90 return ( x == y ? 0.0 :
double((x - y)/(abs(x) + abs(y))) );
95 inline T
absmin(
const T & x,
const T & y) {
96 return abs(x) < abs(y)? x: y;
100 template <
typename T>
101 inline T
absmax(
const T & x,
const T & y) {
102 return abs(x) > abs(y)? x: y;
108 template <
typename T,
typename U>
110 return y > U()? abs(x): -abs(x);
118 template <
int N,
bool Inv>
145 static double pow(
double) {
return 1.0; }
154 static double pow(
double) {
return 1.0; }
166 namespace Functions {
174 return Pow<N+1>(x)/
double(N+1);
184 static double generate(
double x0,
double x1,
double R) {
197 return std::sqrt(x0*x0 + R*(x1*x1 - x0*x0));
205 return x0 + R*(x1 - x0);
229 return x0*pow(x1/x0, R);
237 return x0*x1/(x1 - R*(x1 - x0));
245 return x0*x1/std::sqrt(x1*x1 - R*(x1*x1 - x0*x0));
269 static double generate(
double x0,
double x1,
double R) {
280 return log(x/(1.0 - x));
285 return log(x1*(1.0 - x0)/(x0*(1.0 - x1)));
290 static double generate(
double x0,
double x1,
double R) {
291 double r = pow(x1*(1.0 - x0)/(x0*(1.0 - x1)), R)*x0/(1.0 - x0);
307 return exp(x1) - exp(x0);
312 static double generate(
double x0,
double x1,
double R) {
313 return log(exp(x0) + R*(exp(x1) - exp(x0)));
320 template <
int N,
int D>
325 double r = double(N)/double(D) + 1.0;
336 static double generate(
double x0,
double x1,
double R) {
337 double r = double(N)/double(D) + 1.0;
Class corresponding to functions of the form with integer N.
static double generate(double x0, double x1, double R)
Sample a distribution in a given interval given a flat random number R in the interval ]0...
Class corresponding to functions of the form with integer N.
static double integrate(double x0, double x1)
Integrate function in a given interval.
static double integrate(double x0, double x1)
Integrate function in a given interval.
static double primitive(double x)
The primitive function.
Class corresponding to functions of the form .
double pIntegrate(double p, double xl, double xu)
Return the integral of between xl and xu.
static double pow(double x)
Member for the power.
This is the main namespace within which all identifiers in ThePEG are declared.
static double pow(double)
Member for the power.
double exp1m(double x)
Return , with highest possible precision for .
static double pow(double x)
Member for the power.
T absmin(const T &x, const T &y)
Return x if |x|<|y|, else return y.
double pXIntegrate(double e, double xl, double dx)
Return the integral of between xl and xl+dx with highest possible precision for and/or ...
double log1m(double)
Return , with highest possible precision for .
Templated class for calculating integer powers.
static double integrate(double x0, double x1)
Integrate function in a given interval.
static double primitive(double x)
The primitive function.
Class corresponding to functions of the form with integer N and D.
static double primitive(double x)
The primitive function.
double relativeError(FloatType x, FloatType y)
Returns (x - y)/(|x| + |y|).
static double integrate(double x0, double x1)
Integrate function in a given interval.
double powi(double x, int p)
Return x rased to the integer power p, using recursion.
double gamma(double)
The gamma function.
double pXGenerate(double e, double xl, double dx, double rnd)
Generate an x between xl and xl + dx distributed as with highest possible precision for and/or * ...
static double pow(double)
Member for the power.
double pGenerate(double p, double xl, double xu, double rnd)
Generate an x between xl and xu distributed as .
Class corresponding to functions of the form .
static double primitive(double x)
The primitive function.
static double generate(double x0, double x1, double R)
Sample a distribution in a given interval given a flat random number R in the interval ]0...
MathType is an empty non-polymorphic base class for all mathematical function types.
static double primitive(double x)
The primitive function.
static double integrate(double x0, double x1)
Integrate function in a given interval.
double atanh(double)
Return .
static double generate(double x0, double x1, double R)
Sample a distribution in a given interval given a flat random number R in the interval ]0...
T sign(T x, U y)
Transfer the sign of the second argument to the first.
static double generate(double x0, double x1, double R)
Sample a distribution in a given interval given a flat random number R in the interval ]0...
double lngamma(double)
The log of the gamma function.
double Pow(double x)
Templated function to calculate integer powers known at compile-time.
static double generate(double x0, double x1, double R)
Sample a distribution in a given interval given a flat random number R in the interval ]0...
T absmax(const T &x, const T &y)
Return x if |x|>|y|, else return y.