Comprises wrapper functions for mathematical functions taken from libraries (Boost.Math, GSL), and several other mathematical functions. More...
Classes | |
struct | FactOverflow |
Functions | |
int | sign (double) |
int | fcmp (double, double, double) |
template<class T > | |
const T | sqr (T x) |
double | sqr (double x) |
double | sqrAbs (const dcomp &) |
double | fact (unsigned) throw (FactOverflow) |
double | choose (unsigned, unsigned) |
template<typename T > | |
bool | parity (T n) |
int | round (double r) |
template<typename T > | |
char | minusOneToThePowerOf (T n) |
dcomp | coherentElement (unsigned long n, const dcomp &alpha) |
Calculates relying on the Stirling formula if is too large for explicit calculation of factorial. More... | |
Variables | |
const double | PI |
const double | SQRTPI |
const double | EULER |
Comprises wrapper functions for mathematical functions taken from libraries (Boost.Math, GSL), and several other mathematical functions.
Calculates relying on the Stirling formula if is too large for explicit calculation of factorial.
The point of switching is determined by boost::math::max_factorial
.
The Stirling formula is a very good approximation already for moderate values: