Using 80-bit reals on x86 causes major performance degradations in std.math functions like atan(). This poor performance is on the brink of turning away a significant group of potential D users, and needs to be taken seriously:
Cf.: https://forum.dlang.org/post/[email protected]
It's about time we take off our blinders and stop pretending that 80-bit "extra" precision buys us anything. Let 80-bit be an option if the user wants to, sure. But can we please, pretty please, change the default type in std.math.* to double instead of real. This is making our "fast code fast" slogan look absolutely ridiculous when people run benchmarks like that linked to above, and see D performing horribly slow compared to C++.
Comment #1 by kinke — 2018-03-05T22:44:34Z
(In reply to hsteoh from comment #0)
> Let 80-bit be an option if the user
> wants to, sure. But can we please, pretty please, change the default type
> in std.math.* to double instead of real.
Performing the operation in the precision of the operands is what I'd expect. So having to cast explicitly to real if my data is stored as float/double and max precision is needed.
Some math functions are still only implemented for `real`, but they support reals in double/x87/quadruple precision for the different architectures, i.e., support for 64-bit doubles (proper constants, limits etc.) is already there. E.g., std.math.atan(real) could be generalized to a template (float/double/real) after adding single-precision support (from Cephes probably).
Comment #2 by iamthewilsonator — 2018-03-11T01:38:19Z