Extreme Optimization –Mathematical Constants and Basic Functions
- by JoshReuben
Machine constants
The MachineConstants class - contains constants for floating-point arithmetic because the CLS System.Single and Double floating-point types do not follow the standard conventions and are useless. machine constants for the Double type:
machine precision: Epsilon , SqrtEpsilon
CubeRootEpsilon
largest possible value: MaxDouble , SqrtMaxDouble, LogMaxDouble
smallest Double-precision floating point number that is greater than zero: MinDouble , SqrtMinDouble , LogMinDouble
A similar set of constants is available for the Single Datatype
Mathematical Constants
The Constants class contains static fields for many mathematical constants and common expressions involving small integers – if you are doing thousands of iterations, you wouldn't want to calculate OneOverSqrtTwoPi , Sqrt17 or Log17 !!!
Fundamental constants
E - The base for the natural logarithm, e (2.718...).
EulersConstant - (0.577...).
GoldenRatio - (1.618...).
Pi - the ratio between the circumference and the diameter of a circle (3.1415...).
Expressions involving fundamental constants: TwoPi, PiOverTwo, PiOverFour, LogTwoPi, PiSquared, SqrPi, SqrtTwoPi, OneOverSqrtPi, OneOverSqrtTwoPi
Square roots of small integers: Sqrt2, Sqrt3, Sqrt5, Sqrt7, Sqrt17
Logarithms of small integers: Log2, Log3, Log10, Log17, InvLog10
Elementary Functions
The IterativeAlgorithm<T> class in the Extreme.Mathematics namespace defines many elementary functions that are missing from System.Math.
Hyperbolic Trig Functions:
Cosh, Coth, Csch, Sinh, Sech, Tanh
Inverse Hyperbolic Trig Functions: Acosh, Acoth, Acsch, Asinh, Asech, Atanh
Exponential, Logarithmic and Miscellaneous Functions:
ExpMinus1 - The exponential function minus one, ex-1.
Hypot - The hypotenuse of a right-angled triangle with specified sides.
LambertW - Lambert's W function, the (real) solution W of x=WeW.
Log1PlusX - The natural logarithm of 1+x.
Pow - A number raised to an integer power.