Why is std.math slower than the C baseline?
jmh530
john.michael.hall at gmail.com
Fri Jun 5 20:05:56 UTC 2020
On Friday, 5 June 2020 at 19:39:26 UTC, Andrei Alexandrescu wrote:
> [snip]
>
> This needs to change. It's one thing to offer more precision to
> the user who consciously uses 80-bit reals, and it's an
> entirely different thing to force that bias on the user who's
> okay with double precision.
I agree with you that more precision should be opt-in.
However, I have always been sympathetic to Walter's argument in
favor doing intermediates at the highest precision. There are
many good reasons why critical calculations need to be done at
the highest precision possible.
In addition, the current PR to remove this behavior will make
opt-ing in more difficult. Users will need to either put their
own casts everwhere, or basically re-implement what is currently
in std.math. It may be a good idea to release std.math in its
current state as a separate module, similar to stdx.allocator,
(the real versions can just call the real versions in phobos to
reduce the maintenance cost). Shame to just get rid of it if
there are some people who might use it as is.
More information about the Digitalmars-d
mailing list