fast math?

Luigi Dalmazio daldel at
Mon Feb 3 04:46:22 PST 2003

I am developing several programs (in C++ with GCC under Linux, Athlon processor) that make intense usage of sqrt(), sin(), atan() and other math functions. Under Linux there is a compiler flag (fast_math) which works greatly and (apparently) without loss of precision makes double precision math functions much faster then fixed point, low precision functions. I would like to know if the Risc OS implementation of the compiler offers this flag or other useful alternatives to improve floating point performances even loosing some bit of precision. As I said above, I make a lot of math calculations and I need an acceptable fp performance even with some restrictions on precision with respect to the standard. Also I would like to know if there is some fixed point math library available with good speed and support for 64-bit integers (fixed point routines in format 16.16 or 24.8 do not help because I need to cope with large numbers and a wider precision). I think this is a fundamental need for the Risc OS platform because any good graphic application needs fast floating-point or at least fast 64 bit fixed point math functions (Yes I know Artworks is fast, but it uses -I think- low precision 24.8 fixed point math and graphic functions -- it cannot zoom more than 4000% because drawing would start to show inaccuracies and approximations). With 32bit floating-points numbers and an internal accuracy of 72000 dpi you can zoom up to 60000% without any visible inaccuracy --- with doubles (64bit precision) you can zoom to millions. Moreover there are many math calculations (sqrt, exp, and trigonometric functions) which my programs need to perform on large numbers with acceptable acuuracy and 24.8 fixed point format is not acceptable. It is now almost 4 years I do not use my Risc PC; now that finally there is a proper C++ compiler available I would be very happy to start using it again.  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gcc mailing list