Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 14 Mar 2012 17:56:05 +0100
From: Szabolcs Nagy <>
Subject: correctly rounded sqrt

i tried to solve the sqrt issue with a wrapper
as discussed on irc, but i couldn't find a nice

if we check |x - y*y| and try to figure out
the rounding from that, then there are two

1) use the veltkamp-dekker exact multiplication formulas
(sq1 algorithm in my code)


2) use simpler method for y*y and use argumentum reduction
to handle large/small numbers (x*=2^2n, y*=2^-n)

i tried both: 1) only works correctly for subnormals
with double precision evaluation so it needs arg reduction
2) does not work in all cases (|x-y*y| and |x-y1*y1|
might be the same and resolving the tie is nontrivial)

so 1) with arg reduction is my current solution
and i don't know if it works in all cases
..and the code might be slow

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.