Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 26 Jun 2011 20:51:37 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: musl@...ts.openwall.com
Subject: Re: math argument reduction

* Rich Felker <dalias@...ifal.cx> [2011-06-26 14:33:44 -0400]:
> It's A%M and B%M, not A/M and B/M, which you have precalculated in
> your tables. And therefore, (A+B)%M is congruent to A%M + B%M. In
> general it could be outside the interval [0,M), but not by so much
> that it's hard to get a good answer.

the hard part is when there is a lot of leading zeros in the result

A%M + B%M can be just above M by a little so (A%M+B%M)%M is almost 0
eg: 0.00000000000000011111
to represent this number properly as float you need all those 1s eg
1.1111 * 2^-n

if A%M and B%M is not precise enough then those trailing 1s will get
lost so the abs value is about right but as a floating point value
the result does not have 53 correct bits..

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.