![]() |
The Gaudi Framework
v28r0
|
Classes | |
class | Lomont |
The equality comparison of double numbers using as the metric the maximal number of Units in the Last Place (ULP). More... | |
class | Lomont< double > |
the specialization for double numbers More... | |
class | Lomont< float > |
the specialization for float numbers More... | |
Functions | |
GAUDI_API bool | lomont_compare_float (const float af, const float bf, const unsigned short maxULPs) |
equality comparison of float numbers using as the metric the maximal number of Units in the Last Place (ULP). More... | |
GAUDI_API bool | lomont_compare_double (const double af, const double bf, const unsigned int maxULPs) |
equality comparison of double numbers using as the metric the maximal number of Units in the Last Place (ULP). More... | |
GAUDI_API float | next_float (const float af, const short ulps) |
Get the floating number that representation is different with respect to the argument for the certain number of "Units in the Last Position". More... | |
GAUDI_API double | next_double (const double af, const short ulps) |
Get the floating number that representation is different with respect to the argument for the certain number of "Units in the Last Position". More... | |
bool Gaudi::Math::lomont_compare_double | ( | const double | af, |
const double | bf, | ||
const unsigned int | maxULPs | ||
) |
equality comparison of double numbers using as the metric the maximal number of Units in the Last Place (ULP).
It is a slightly modified version of very efficient implementation of the initial Bruce Dawson's algorithm by Chris Lomont.
C.Lomont claims the algorithm is factor 2-10 more efficient with respect to classical Knuth's algorithm for comparison of the floating number using the relative precision.
The effective relative difference depends on the choice of maxULPS
:
af | the first number |
bf | the second number |
maxULPs | the maximal metric deviation in the terms of maximal number of units in the last place |
the final check
Definition at line 289 of file Lomont.cpp.
bool Gaudi::Math::lomont_compare_float | ( | const float | af, |
const float | bf, | ||
const unsigned short | maxULPs | ||
) |
equality comparison of float numbers using as the metric the maximal number of Units in the Last Place (ULP).
It is a slightly modified version of very efficient implementation of the initial Bruce Dawson's algorithm by Chris Lomont.
C.Lomont claims the algorithm is factor 2-10 more efficient with respect to classical Knuth's algorithm for comparison of the floating number using the relative precision.
The effective relative difference depends on the choice of maxULPS
:
af | the first number |
bf | the second number |
maxULPs | the maximal metric deviation in the terms of maximal number of units in the last place |
Definition at line 193 of file Lomont.cpp.
double Gaudi::Math::next_double | ( | const double | af, |
const short | ulps | ||
) |
Get the floating number that representation is different with respect to the argument for the certain number of "Units in the Last Position".
For ulps=1, it is just next float number, for ulps=-1 is is the previous one.
This routine is very convenient to test the parameter maxULPS for the routine Gaudi::Math::lomont_compare_double
af | the reference number |
ulps | the bias |
the final check
Definition at line 342 of file Lomont.cpp.
float Gaudi::Math::next_float | ( | const float | af, |
const short | ulps | ||
) |
Get the floating number that representation is different with respect to the argument for the certain number of "Units in the Last Position".
For ulps=1, it is just next float number, for ulps=-1 is is the previous one.
This routine is very convenient to test the parameter maxULPS for the routine Gaudi::Math::lomont_compare_float
af | the reference number |
ulps | the bias |
the final check
Definition at line 245 of file Lomont.cpp.