<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Ages ago I used arbitrary precision (rational number) arithmetic via GMP to generate numbers from an exotic conditional probability distribution (pdf).  The application was generating random loops in (monte-carlo) polymer physics.  I remember that for even modest- sized loops (say N=15 segments) the pdf, which was a piecewise-defined polynomial, would have coefficients that looked like </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">  a0 = 99 999 999 999 999 999 991.0 / 99 999 999 999 999 999 999.0;</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">so double/double would fail to resolve.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Ergodically, it wasn't ok to say that this coefficient was zero, so instead of thinking about the numerical analysis, I took the lazy (and SLOW) way out and called all the coefficient's rational via GMP (<a href="https://gmplib.org/">https://gmplib.org/</a>).  It wasn't an optimal solution, but I finished my thesis.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Nathan</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 30, 2016 at 2:09 PM, C Bergström <span dir="ltr"><<a href="mailto:cbergstrom@pathscale.com" target="_blank">cbergstrom@pathscale.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">I was hoping for feedback, from scientists, about what level of<br>
accuracy their codes or fields of study typically require. Maybe the<br>
weekend wasn't the best time to post.. hmm..<br>
<div class=""><div class="h5"><br>
On Sun, May 1, 2016 at 1:31 AM, Peter St. John <<a href="mailto:peter.st.john@gmail.com">peter.st.john@gmail.com</a>> wrote:<br>
> A bit off the wall, and not much help for what you are doing now, but sooner<br>
> or later we won't be hand-crating ruthlessly optimal code; we'll be training<br>
> neural nets. You could do this now if you wanted: the objective function is<br>
> just accurate answers (which you get from sub-optimal but mathematically<br>
> correct existing code) and the wall clock (faster is better), and you train<br>
> with the target hardware. So in principle it's easy, and if you look at how<br>
> fast Deep Mind trained AlphaGo it begins to sound feasible to train for fast<br>
> fourier transforms or whatever.<br>
> Peter<br>
><br>
> On Fri, Apr 29, 2016 at 9:06 PM, William Johnson <<a href="mailto:meatheadmerlin@gmail.com">meatheadmerlin@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Due to the finite nature of number representation on computers,<br>
>> any answer will be an approximation to some degree.<br>
>> To me, it looks to be a non-issue to some 15 significant digits.<br>
>> I would say it depends how accurate you need.<br>
>> You could do long-hand general calculations that track percent error,<br>
>> and see how it gets compounded in a particular series of calculations.<br>
>><br>
>> If you got right into the nuts and bolts of writing optimized functions,<br>
>> there are many clever ways to calculate common functions<br>
>> that you can find in certain math or algorithms & data structures texts.<br>
>> You would also need intimate knowledge of the target chipset.<br>
>> But it seems that would be way too much time in<br>
>> research and development to reinvent the wheel.<br>
>><br>
>><br>
>> On Fri, Apr 29, 2016 at 7:28 PM, Greg Lindahl <<a href="mailto:lindahl@pbm.com">lindahl@pbm.com</a>> wrote:<br>
>>><br>
>>> On Sat, Apr 30, 2016 at 02:23:31AM +0800, C Bergström wrote:<br>
>>><br>
>>> > Surprisingly, glibc does a pretty respectable job in terms of<br>
>>> > accuracy, but alas it's certainly not the fastest.<br>
>>><br>
>>> If you go look in the source comments I believe it says which paper's<br>
>>> algorithm it is using... doing range reduction for sin(6e5) is<br>
>>> expensive to do accurately. Which is why the x86 sin() hardware<br>
>>> instruction does it inaccurately but quickly, and most people/codes<br>
>>> don't care.<br>
>>><br>
>>> -- greg<br>
>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">Beowulf@beowulf.org</a> sponsored by Penguin Computing<br>
>>> To change your subscription (digest mode or unsubscribe) visit<br>
>>> <a href="http://www.beowulf.org/mailman/listinfo/beowulf" rel="noreferrer" target="_blank">http://www.beowulf.org/mailman/listinfo/beowulf</a><br>
>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">Beowulf@beowulf.org</a> sponsored by Penguin Computing<br>
>> To change your subscription (digest mode or unsubscribe) visit<br>
>> <a href="http://www.beowulf.org/mailman/listinfo/beowulf" rel="noreferrer" target="_blank">http://www.beowulf.org/mailman/listinfo/beowulf</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">Beowulf@beowulf.org</a> sponsored by Penguin Computing<br>
> To change your subscription (digest mode or unsubscribe) visit<br>
> <a href="http://www.beowulf.org/mailman/listinfo/beowulf" rel="noreferrer" target="_blank">http://www.beowulf.org/mailman/listinfo/beowulf</a><br>
><br>
_______________________________________________<br>
Beowulf mailing list, <a href="mailto:Beowulf@beowulf.org">Beowulf@beowulf.org</a> sponsored by Penguin Computing<br>
To change your subscription (digest mode or unsubscribe) visit <a href="http://www.beowulf.org/mailman/listinfo/beowulf" rel="noreferrer" target="_blank">http://www.beowulf.org/mailman/listinfo/beowulf</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>- - - - - - -   - - - - - - -   - - - - - - - <br>Nathan Moore<br><div><span style="font-size:12.8px">Mississippi River and 44th Parallel</span><br></div><div>- - - - - - -   - - - - - - -   - - - - - - -</div><div><br></div></div></div></div></div></div>
</div></div>