Free fast math routines (libffm, preliminary version) being released !

Free fast math routines (libffm, preliminary version) being released !

Post by Joachim Wesne » Tue, 07 Jul 1998 04:00:00



Hi,                                                                            

Kazushige Goto and myself, we are now releasing a first version 0.10 of
free fast math routines to eventually replace/complement libm. These
routines are based on work I did years ago for another RISC CPU, but
those now use different (*better* !) approximations and some other ideas
that grew in the meantime. Kazushige Goto did a great job in optimizing
the assembler code, "vectorizing" polynomial evaluation code and
improving instruction scheduling to get the code so fast as it is now
!                                                    

Some of the routines seem to run even nearly twice as fast as the
already fast "Cray" routine I ported some weeks ago, at comparable
accuracy.            

This first version 0.10 of libffm only includes the common trig and
inverse trig functions and does not yet contain checking for invalid
arguments. That will be added soon, as also log, exp and sqrt will
follow shortly (and others later) (time permitting
!).                                              

It is basically released already now to show that work on a free fast
Alpha math lib is continuing and to help find possible bugs and other
problems as soon as possible. However, the routines should be pretty
stable and usable already
now.                                                                    

Further modification could be (besides the argument checking) the
fine-tuning of the last bits of the constants used and of the order of
evaluation to minimize or compensate the effect of rounding
errors.                          

In the preliminary versions, till the whole lib has stabilized, we would
like to keep the copyright on the routines to us. However, in the end,
this code will become full GPL. However, in the moment the routines can
be freely used in your programs. See file README in the archive for more
details.              

The routines can be downloaded
at                                              

http://people.frankfurt.netsurf.de/Joachim.Wesner/libffm.0.10.tar.gz

See file README for further instructions and
details.                          

Approximate running times in us in a tight loop for random arguments
0..10 (0..1 for asin/acos) on a 533MHz LX
21164                                

        libffm          libfm          
libm                                    

sin     0.12            0.22          
0.45                                    
cos     0.19            0.22          
0.46                                    
tan     0.13            0.27          
0.63                                    
asin    0.32            ----          
1.39                                    
acos    0.29            ----          
1.31                                    
atan    0.20            ----          
0.69                                    
atan2   0.23            ----          
0.86                                    

Have Fun !!!

Joachim                                                                        



 
 
 

Free fast math routines (libffm, preliminary version) being released !

Post by Joachim Wesne » Tue, 07 Jul 1998 04:00:00


Oops, the last part of my post seems to have been corrupted somehow.
The numbers should appear more like:

Approximate running times in us in a tight loop for random arguments
0..10 (0..1 for asin/acos) on a 533MHz LX 21164

         libffm         libfm           libm

 sin     0.12            0.22           0.45
 cos     0.19            0.22           0.46
 tan     0.13            0.27           0.63
 asin    0.32            ----           1.39
 acos    0.29            ----           1.31
 atan    0.20            ----           0.69
 atan2   0.23            ----           0.86

 Have Fun !!!

 Joachim

 
 
 

Free fast math routines (libffm, preliminary version) being released !

Post by Craig Burle » Wed, 08 Jul 1998 04:00:00



> In the preliminary versions, till the whole lib has stabilized, we would
> like to keep the copyright on the routines to us. However, in the end,
> this code will become full GPL. However, in the moment the routines can
> be freely used in your programs. See file README in the archive for more
> details.              

Please consider reviewing the license terms for the Linux libm
library routines, and using the same ones for your routines, to
improve their "drop-in-ability".  The GPL is, IMO, inappropriate
for anything that isn't a complete program (whatever *that* is,
but "I know one when I see one", as I think rms has said :),
because the language of the GPL revolves around the "program",
not "executable", "binary", or "object file" as the essential
indivisible "protected object".

E.g. libm might use the LGPL, and/or have special exception clauses
typical for Linux system libraries, in which case it'd be great
if you'd be willing to use the exact same licensing from the start,
so people wouldn't have to track whether the programs they distribute
fall under different licensing simply because they happened to link
in your parts of libm.

If you do really want to go with full GPL, I suggest you package
and distribute the new libffm as part of a program that has some
interactive interface to provide for calling all the library
routines, e.g. plug it into a variant of bc or dc or whatever.
That way, it's distributed as a complete "program", but people
can, of course, still copy just the libffm part into their
programs (GPL-compatible if they distribute them), etc.

I am not a lawyer, so consult one before you do anything rash.  :)

Oh, one more thing...

...in case it isn't obvious...

  THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

for releasing this work in the first place!!!

It'll allow GNU/Linux/Alpha/g77 users to stop criticizing g77 slowness
due to the libm speed, and focus on the actual performance problems
g77 has on Alphas, whatever they may be.  :)

Heck, if you and Goto want g77 T-shirts and such, please review
<ftp://alpha.gnu.org/g77.plan> (the "PROJECT THANK-YOU" section)
and email me as you see fit!
--

"Practice random senselessness and act kind of beautiful."

 
 
 

Free fast math routines (libffm, preliminary version) being released !

Post by Joachim Wesne » Wed, 08 Jul 1998 04:00:00



> Please consider reviewing the license terms for the Linux libm
> library routines, and using the same ones for your routines, to
> improve their "drop-in-ability".  The GPL is, IMO, inappropriate
> for anything that isn't a complete program (whatever *that* is,
> but "I know one when I see one", as I think rms has said :),
> because the language of the GPL revolves around the "program",
> not "executable", "binary", or "object file" as the essential
> indivisible "protected object".

> E.g. libm might use the LGPL, and/or have special exception clauses
> typical for Linux system libraries, in which case it'd be great
> if you'd be willing to use the exact same licensing from the start,
> so people wouldn't have to track whether the programs they distribute
> fall under different licensing simply because they happened to link
> in your parts of libm.

I think you are right, I should have read the xGPL license terms myself
more carefully. Yes, I think it should and must probably be LGPL
(I think this is the "deal" about being able to use it in an application
you can even charge for and not being forced to disclose all of it)
and I also can understand the interest of people using it right from the
start.

I'd say the next version in ~ 1-3 weeks, that will have some
improvements and log/exp, probably also a faster sqrt, will
have the "correct" licensing terms.

"Enjoy"

Joachim

 
 
 

Free fast math routines (libffm, preliminary version) being released !

Post by Hans-Willi Raed » Thu, 09 Jul 1998 04:00:00


Quote:

> I'd say the next version in ~ 1-3 weeks, that will have some
> improvements and log/exp, probably also a faster sqrt, will
> have the "correct" licensing terms.

> "Enjoy"

> Joachim

Don't forget to announce them here...

Regards

Hans-Willi Raedt