]> git.mxchange.org Git - simgear.git/blob - simgear/math/fastmath.hxx
Add some fast math functions
[simgear.git] / simgear / math / fastmath.hxx
1 /*
2  * \file fastmath.hxx
3  * fast mathematics routines.
4  *
5  * Refferences:
6  *
7  * A Fast, Compact Approximation of the Exponential Function
8  * Nicol N. Schraudolph
9  * IDSIA, Lugano, Switzerland
10  * http://www.inf.ethz.ch/~schraudo/pubs/exp.pdf
11  *
12  * Fast log() Function, by Laurent de Soras:
13  * http://www.flipcode.com/cgi-bin/msg.cgi?showThread=Tip-Fastlogfunction&forum=totd&id=-1
14  *
15  */
16
17 /*
18  * $Id$
19  */
20
21 #ifndef _SG_FMATH_HXX
22 #define _SG_FMATH_HXX 1
23
24 #ifndef __cplusplus
25 # error This library requires C++
26 #endif
27
28
29 #include <math.h>
30
31 double fast_exp(double y);
32 double fast_log(double val);
33 double fast_log2 (double val);
34 double fast_log10(double val);
35 void fast_BSL(double &x, register unsigned long shiftAmount);
36 void fast_BSR(double &x, register unsigned long shiftAmount);
37
38 #endif // !_SG_FMATH_HXX
39