[Beowulf] Optimized math routines/transcendentals

William Johnson meatheadmerlin at gmail.com
Fri Apr 29 18:06:10 PDT 2016

Due to the finite nature of number representation on computers,
any answer will be an approximation to some degree.
To me, it looks to be a non-issue to some 15 significant digits.
I would say it depends how accurate you need.
You could do long-hand general calculations that track percent error,
and see how it gets compounded in a particular series of calculations.

If you got right into the nuts and bolts of writing optimized functions,
there are many clever ways to calculate common functions
that you can find in certain math or algorithms & data structures texts.
You would also need intimate knowledge of the target chipset.
But it seems that would be way too much time in
research and development to reinvent the wheel.

On Fri, Apr 29, 2016 at 7:28 PM, Greg Lindahl <lindahl at pbm.com> wrote:

> On Sat, Apr 30, 2016 at 02:23:31AM +0800, C Bergström wrote:
> > Surprisingly, glibc does a pretty respectable job in terms of
> > accuracy, but alas it's certainly not the fastest.
> If you go look in the source comments I believe it says which paper's
> algorithm it is using... doing range reduction for sin(6e5) is
> expensive to do accurately. Which is why the x86 sin() hardware
> instruction does it inaccurately but quickly, and most people/codes
> don't care.
> -- greg
> _______________________________________________
> Beowulf mailing list, Beowulf at beowulf.org sponsored by Penguin Computing
> To change your subscription (digest mode or unsubscribe) visit
> http://www.beowulf.org/mailman/listinfo/beowulf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.beowulf.org/pipermail/beowulf/attachments/20160429/5d5c0824/attachment.html>

More information about the Beowulf mailing list