Exact and mid-point rounding cases of power(x,y) - ENS de Lyon - École normale supérieure de Lyon Access content directly
Preprints, Working Papers, ... Year :

Exact and mid-point rounding cases of power(x,y)


Correct rounding of the power function is currently based on an iterative process computing more and more accurate intermediate approximations to x^y until rounding correctly becomes possible. It terminates iff the value of the function is not exactly a floating-point number or an midpoint of two floating-point numbers of the format. For other elementary functions such as exp(x), arguments for which f(x) is such an exact case are, few. They can be filtered out by simple tests. The power function has at least 2^35 such arguments. Simple tests on x and y do not suffice here. This article presents an algorithm for performing such an exact case test. It is combined with an approach that allows for fast rejection of cases that are not exact or mid-point. The correctness is completely proven. It makes no usage of costly operations such as divisions, remainders or square roots as previous approaches do. The algorithm yields a speed-up of 1.8 on average in comparison to another implementation for the same final target format. It reduces also the percentage of average time needed for the exactness test from 38% at each call to 31% under unlikely conditions. The algorithm is given for double precision but adapts and scales perfectly for higher precisions such as double-extended and quad precision. Its complexity is linear in the precision.
Fichier principal
Vignette du fichier
pow.lip.pdf (250.4 Ko) Télécharger le fichier
Origin : Files produced by the author(s)

Dates and versions

ensl-00117433 , version 1 (01-12-2006)


  • HAL Id : ensl-00117433 , version 1


Christoph Lauter. Exact and mid-point rounding cases of power(x,y). 2006. ⟨ensl-00117433⟩
242 View
227 Download


Gmail Facebook Twitter LinkedIn More