Changeset 60 for mppenc/branches/r2d/libmpcpsy/fastmath.h
 Timestamp:
 09/28/06 18:15:21 (16 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

mppenc/branches/r2d/libmpcpsy/fastmath.h
r59 r60 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 021111307 USA 18 18 */ 19 20 21 // fast but maybe more inaccurate, use if you need speed 22 #if defined(__GNUC__) && !defined(__APPLE__) 23 # define SIN(x) sinf ((float)(x)) 24 # define COS(x) cosf ((float)(x)) 25 # define ATAN2(x,y) atan2f ((float)(x), (float)(y)) 26 # define SQRT(x) sqrtf ((float)(x)) 27 # define LOG(x) logf ((float)(x)) 28 # define LOG10(x) log10f ((float)(x)) 29 # define POW(x,y) expf (logf(x) * (y)) 30 # define POW10(x) expf (M_LN10 * (x)) 31 # define FLOOR(x) floorf ((float)(x)) 32 # define IFLOOR(x) (int) floorf ((float)(x)) 33 # define FABS(x) fabsf ((float)(x)) 34 #else 35 # define SIN(x) (float) sin (x) 36 # define COS(x) (float) cos (x) 37 # define ATAN2(x,y) (float) atan2 (x, y) 38 # define SQRT(x) (float) sqrt (x) 39 # define LOG(x) (float) log (x) 40 # define LOG10(x) (float) log10 (x) 41 # define POW(x,y) (float) pow (x,y) 42 # define POW10(x) (float) pow (10., (x)) 43 # define FLOOR(x) (float) floor (x) 44 # define IFLOOR(x) (int) floor (x) 45 # define FABS(x) (float) fabs (x) 46 #endif 47 48 #define SQRTF(x) SQRT (x) 49 #ifdef FAST_MATH 50 # define TABSTEP 64 51 # define COSF(x) my_cos ((float)(x)) 52 # define ATAN2F(x,y) my_atan2 ((float)(x), (float)(y)) 53 # define IFLOORF(x) my_ifloor ((float)(x)) 54 #else 55 # undef TABSTEP 56 # define COSF(x) COS (x) 57 # define ATAN2F(x,y) ATAN2 (x,y) 58 # define IFLOORF(x) IFLOOR (x) 59 #endif 19 60 20 61 #if 1
Note: See TracChangeset
for help on using the changeset viewer.