On Mon, Jun 30, 2014 at 05:18:43PM -0500, Andrei Alexandrescu via Digitalmars-d 
wrote:
> On 6/30/14, 2:20 AM, Don wrote:
> >For me, a stronger argument is that you can get *higher* precision
> >using doubles, in many cases. The reason is that FMA gives you an
> >intermediate value with 128 bits of precision; it's available in SIMD
> >but not on x87.
> >
> >So, if we want to use the highest precision supported by the
> >hardware, that does *not* mean we should always use 80 bits.
> >
> >I've experienced this in CTFE, where the calculations are currently
> >done in 80 bits, I've seen cases where the 64-bit runtime results
> >were more accurate, because of those 128 bit FMA temporaries. 80 bits
> >are not enough!!
> 
> Interesting. Maybe we should follow a simple principle - define
> overloads and intrinsic operations such that real is only used if (a)
> requested explicitly (b) it brings about an actual advantage.
> 
> I.e. most of the time not using real in user code means it's never
> real throughout.
[...]

Iain's PR to provide overloads of std.math functions for float/double
has already been merged, so all that remains is for float literals to
default to double unless suffixed with L, or contain too many digits to
accurately represent in double.


T

-- 
Never step over a puddle, always step around it. Chances are that whatever made 
it is still dripping.

Reply via email to