The relative accuracy of $(x+y)*(x-y)$ - Inria - Institut national de recherche en sciences et technologies du numérique Accéder directement au contenu
Pré-Publication, Document De Travail Année : 2019

The relative accuracy of $(x+y)*(x-y)$

Résumé

We consider the relative accuracy of evaluating $(x+y)(x-y)$ in IEEE floating-point arithmetic, when $x,y$ are two floating-point numbers and rounding is to nearest. This expression can be used, for example, as an efficient cancellation-free alternative to $x^2-y^2$ and (at least in the absence of underflow and overflow) is well known to have low relative error, namely, at most about $3u$ with $u$ the unit roundoff. In this paper we propose to complement this traditional analysis with a finer-grained one, aimed at improving and assessing the quality of that bound. Specifically, we show that if the tie-breaking rule is "to away" then the bound $3u$ is asymptotically optimal. In contrast, if the tie-breaking rule is "to even", we show that asymptotically optimal bounds are now $2.25u$ for base two and $2u$ for larger bases (such as base ten). In each case, asymptotic optimality is obtained by the explicit construction of a certificate, that is, some floating-point input $(x,y)$ parametrized by $u$ and for which the error of the result is equivalent to the error bound as $u$ tends to zero.
Fichier principal
Vignette du fichier
relative_accuracy_xy.pdf (313.4 Ko) Télécharger le fichier
Origine : Fichiers produits par l'(les) auteur(s)
Loading...

Dates et versions

hal-02100500 , version 1 (16-04-2019)
hal-02100500 , version 2 (12-11-2019)
hal-02100500 , version 3 (17-05-2021)

Identifiants

  • HAL Id : hal-02100500 , version 1

Citer

Claude-Pierre Jeannerod. The relative accuracy of $(x+y)*(x-y)$. 2019. ⟨hal-02100500v1⟩
863 Consultations
521 Téléchargements

Partager

Gmail Facebook X LinkedIn More