[opus] Antw: Re: [OPUS] celt_inner_prod() and dual_inner_prod() NEON intrinsics

Ian Malone ibmalone at gmail.com
Tue Jun 6 11:39:30 UTC 2017


On 6 June 2017 at 08:03, Ulrich Windl <Ulrich.Windl at rz.uni-regensburg.de> wrote:
>>>> Linfeng Zhang <linfengz at google.com> schrieb am 06.06.2017 um 06:46 in Nachricht
> <CAKoqLCAfj+fDUMLfN4dLNSZ4NNAZpaSt_BWZRp+7XBqfhiSqiQ at mail.gmail.com>:
>> Hi Jean-Marc,
>>
>> I tried "==" before, and it failed when both results are 0.0. Maybe the
>> exponent or sign has difference because of the different 0.0 representation
>> in NEON. If anybody know how to handle this 0.0 comparison, that would be
>> great.
>> Or just use if(a==b || (a==0.0 && b==0.0)) ... but I haven't try this.
>
>
> From some faint memory of my math lessions I had produced code like this to get the smallest floating-point number different from zero:
>
> double  EPS;            /* smallest number not equal to 0.0 */
>
> /* refined estimate of EPS */
> static  double  get_EPS(double eps)
> {
>
>         while ( 1.0 + eps != 1.0 )
>                 eps /= 2;
>         return(eps);
> }
>
> EPS = get_EPS(1.0);
>
> On the x86_64 platform I get:
> (gdb) p EPS
> $1 = 1.1102230246251565e-16
>

That's an estimate of the precision of the floating point
representation (does adding it change the value of 1.0), rather than
the smallest magnitude number representable not zero.

-- 
imalone
http://ibmalone.blogspot.co.uk


More information about the opus mailing list