[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GUB and mpfr/mpc

From: Masamichi HOSODA
Subject: Re: GUB and mpfr/mpc
Date: Fri, 05 Dec 2014 19:44:11 +0900 (JST)

>>> Also, the mention of optimization reminds me of one of the horrors of 
>>> floating point types: a value in a register can quietly be changed when it 
>>> is written to memory.  Take a look at some of the “myths” in section 1 of 
>>> .
> […]
>> I think that floating point can be used as long as it's used correct.
>> operator== shouldn't be used for comparison of floating point values.
>> operator!= shouldn't be used too.
>> operator< and operator> may be used.
> The issue is more complex than that.  Sit down and try this:
> Add looping and you’ve got fatal issues.  (And if you’re like me, steam will 
> erupt from your ears any second now...)

You're right of course.
A floating point operation has a margin of error always.
When the optimization is different, the margin of error may be also different,
because the bit width of floating point value is different
in a register and a memory.

Therefore, robust treating for margin of error is necessary.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]