Why don't we switch to C like floating pointed arithmetic instead of automatic expansion to reals?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 5 14:05:54 PDT 2016


On 8/5/2016 4:27 AM, Seb wrote:
> 1) There are some function (exp, pow, log, round, sqrt) for which using
> llvm_intrinsincs significantly increases your performance.
>
> It's a simple benchmark and might be flawed, but I hope it shows the point.

Speed is not the only criteria. Accuracy is as well. I've been using C math 
functions forever, and have constantly discovered that this or that math 
function on this or that platform produces bad results. This is why D's math 
functions are re-implemented in D rather than just forwarding to the C ones.


> 2) As mentioned before they can yield _different_ results
>
> https://dpaste.dzfl.pl/c0ab5131b49d

Ah, but which result is the correct one? I am interested in getting the 
functions correct to the last bit first, and performance second.


More information about the Digitalmars-d mailing list