Finding the "truncated" polynomial that is closest to a function

Finding the ”truncated” polynomial that is closest to a
function
Nicolas Brisebarre, Jean-Michel Muller
To cite this version:
Nicolas Brisebarre, Jean-Michel Muller. Finding the ”truncated” polynomial that is closest to
a function. RR-4787, INRIA. 2003. <inria-00071799>
HAL Id: inria-00071799
https://hal.inria.fr/inria-00071799
Submitted on 23 May 2006
HAL is a multi-disciplinary open access
archive for the deposit and dissemination of scientific research documents, whether they are published or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.
L’archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d’enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.
INSTITUT NATIONAL DE RECHERCHE EN INFORMATIQUE ET EN AUTOMATIQUE
Finding the “truncated” polynomial that is
closest to a function
Nicolas Brisebarre , Jean-Michel Muller
No 4787
Avril 2003
ISSN 0249-6399
ISRN INRIA/RR--4787--FR+ENG
THÈME 2
apport
de recherche
Finding the “truncated” polynomial that is closest to a
function
Nicolas Brisebarre∗ , Jean-Michel Muller†
Thème 2 — Génie logiciel
et calcul symbolique
Projet Arénaire
Rapport de recherche n˚4787 — Avril 2003 — 15 pages
Abstract: When implementing regular enough functions (e.g., elementary or special functions) on a computing system, we frequently use polynomial approximations. In most
cases, the polynomial that best approximates (for a given distance and in a given interval) a function has coefficients that are not exactly representable with a finite number of
bits. And yet, the polynomial approximations that are actually implemented do have coefficients that are represented with a finite - and sometimes small - number of bits: this is due
to the finiteness of the floating-point representations (for software implementations), and
to the need to have small, hence fast and/or inexpensive, multipliers (for hardware implementations). We then have to consider polynomial approximations for which the degree i
coefficient has at most mi fractional bits (in other words, it is a rational number with denominator 2mi ).We provide a method for finding the best polynomial approximation under
this constraint.
Key-words: Computer arithmetic, polynomial approximations
(Résumé : tsvp)
∗ LArAl, Université Jean Monnet, 23, rue du Dr P. Michelon, F-42023 Saint-Étienne Cedex, France
and LIP/Arénaire (CNRS-ENS Lyon-INRIA-UCBL), 46 Allée d’Italie, F-69364 Lyon Cedex 07 F RANCE ,
[email protected]
† LIP/Arénaire (CNRS-ENS Lyon-INRIA-UCBL), 46 Allée d’Italie, F-69364 Lyon Cedex 07 F RANCE , [email protected]
Unité de recherche INRIA Rhône-Alpes
655, avenue de l’Europe, 38330 MONTBONNOT ST MARTIN (France)
Téléphone : 04 76 61 52 00 - International : +33 4 76 61 52 00
Télécopie : 04 76 61 52 52 - International : +33 4 76 61 52 52
Obtenir le polynôme “tronqué” le plus proche d’une
fonction
Résumé : Lorsque l’on implante des fonctions suffisament régulières (par exemple des
fonctions élémentaires ou spéciales) dans un système de calcul, on utilise souvent des
approximations polynomiales. La plupart du temps, le polynôme qui approche le mieux
(pour une distance et dans un intervalle donnés) une fonction a des coefficients qui ne
sont pas représentables sur un nombre fini de bits. Cependant, les approximations polynomiales utilisées en pratique ont des coefficients écrits sur un nombre fini – souvent petit –
de bits : ceci est dû à la finitude des représentations virgule flottante (pour les implantations logicielles) et au besoin d’avoir des circuits multiplieurs de petite taille, donc rapides
et/ou peu coûteux (pour les implantations matérielles). Nous devons donc considérer des
approximations polynomiales dont le ième coefficient a au plus mi bits fractionnaires (autrement dit, est un nombre rationnel de dénominateur 2mi ). Nous proposons une méthode
permettant d’obtenir le polynôme de meilleure approximation d’une fonction sous cette
contrainte.
Mots-clé : Arithmétique des ordinateurs, approximations polynomiales
Finding the “truncated” polynomial that is closest to a function
3
Introduction
All the functions considered in this article are real valued functions of the real variable
and all the polynomials have real coefficients.
After an initial range reduction step [3, 4, 5], the problem of evaluating a function ϕ in
a large domain on a computer system is reduced to the problem of evaluating a possibly different function f in a small domain, that is generally of the form [0, a]. Polynomial
approximations are among the most frequently chosen ways of performing this last approximation.
Two kinds of polynomial approximations are used : the approximations that minimize
the “average error,” called least squares approximations, and the approximations that minimize the worst-case error, called least maximum approximations, or minimax approximations.
In both cases, we want to minimize a distance ||p − f ||, where p is a polynomial of a given
degree. For least squares approximations, that distance is :
||p − f ||2,[0,a] =
Z
a
2
w(x) (f (x) − p(x)) dx
0
1/2
,
where w is a continuous weight function, that can be used to select parts of [0, a] where we
want the approximation to be more accurate. For minimax approximations, the distance is :
||p − f ||∞,[0,a] = max |p(x) − f (x)|.
0≤x≤a
The least squares approximations are computed by a projection method using orthogonal
polynomials. Minimax approximations are computed using an algorithm due to Remez [6,
7]. See [8, 9] for recent presentations of elementary function algorithms.
In this paper, we are concerned with minimax approximations. Our approximations
will be used in finite-precision arithmetic. Hence, the computed polynomial coefficients
are usually rounded : the coefficient pi of the minimax approximation
p(x) = p0 + p1 x + · · · + pn xn
is rounded to, say, the nearest multiple of 2−mi . By doing that, we obtain a slightly different
polynomial approximation p̂. But we have no guarantee that p̂ is the best minimax approximation
to f among the polynomials whose degree i coefficient is a multiple of 2−mi . The aim of this paper
is to give a way of finding this “best truncated approximation”. We have two goals in mind :
– rather low precision (say, around 15 bits), hardware-oriented, for specific-purpose
implementations. In such cases, to minimize multiplier sizes (which increases speed
and save silicon area), the values of mi , for i ≥ 1, should be very small. The degrees of
the polynomial approximations are low. Typical recent examples are given in [10, 11].
Roughly speaking, what matters here is to reduce the cost (in terms of delay and area)
without making the accuracy unacceptable ;
– single-precision or double-precision, software-oriented, general-purpose implementations for implementation on current microprocessors. Using Table-driven methods,
RR n˚4787
Nicolas Brisebarre , Jean-Michel Muller
4
such as the ones suggested by Tang [13, 14, 15, 16], the degree of the polynomial approximations can be made rather low. Roughly speaking, what matters in that case is
to get very high accuracy, without making the cost (in terms of delay and memory)
unacceptable.
The outline of the paper is the following. We give an account of Chebyshev polynomials
and some of their properties in Section 1. Then, in Section 2, we provide a general method
that finds the “best truncated approximation” of a function f over a compact interval [0, a].
Sometimes, the cost of our method is too big. Thus, we end this section by a remark that
explains how to get in a faster time a “good truncated approximation”. Eventually, we deal
with two examples, one using our general method and another that uses the remark.
Our method is implemented in Maple programs that can be downloaded from
http ://www.ens-lyon.fr/˜nbriseba/trunc.html
We plan to prepare a C version of these programs which should be much faster.
1 Some reminders on Chebyshev polynomials
Definition 1 (Chebyshev polynomials) The Chebyshev polynomials can be defined either
by the recurrence relation

 T0 (x) = 1
T1 (x) = x
(1)

Tn (x) = 2xTn−1 (x) − Tn−2 (x);
or by
Tn (x) =
cos n cos−1 x cosh n cosh−1 x
(|x| ≤ 1)
(x > 1).
(2)
The first Chebyshev polynomials are listed below.
T0 (x)
T1 (x)
T2 (x)
T3 (x)
T4 (x)
T5 (x)
=
=
=
=
=
=
1,
x,
2x2 − 1,
4x3 − 3x,
8x4 − 8x2 + 1,
16x5 − 20x3 + 5x.
An example of Chebyshev polynomial (T7 ) is plotted in Fig. 1.
These polynomials play a central role in approximation theory. Among their many properties, the following ones will be useful in the sequel of this paper. A presentation of the
Chebyshev polynomials can be found in [1] and especially in [12].
INRIA
Finding the “truncated” polynomial that is closest to a function
5
Property 1 For n ≥ 0, we have
Tn (x) =
bn/2c
n X
(n − k − 1)!
(2x)n−2k .
(−1)k
2
k!(n − 2k)!
k=0
Hence, Tn has degree n and its leading coefficient is 2n−1 . It has n real roots, all strictly between
−1 and 1.
Property 2 There are exactly n + 1 values x0 , x1 , x2 , . . . , xn such that
−1 = x0 < x1 < x2 < · · · < xn = 1
such that
Tn (xi ) = (−1)n−i max |Tn (x)|
x∈[−1,1]
∀i, i = 0, . . . , n.
That is, the maximum absolute value of Tn is attained at the xi ’s, and the sign of Tn alternates at
these points.
We recall that a monic polynomial is a polynomial whose leading coefficient is 1.
Property 3 (Monic polynomials of smallest norm) Let a, b ∈ R, a ≤ b. The monic degreen polynomial having the smallest ||.||∞,[a,b] norm in [a, b] is
2x − b − a
(b − a)n
.
T
n
22n−1
b−a
The central result in polynomial approximation theory is the following theorem, due to
Chebyshev.
Theorem 1 (Chebyshev) Let a, b ∈ R, a ≤ b. The polynomial p is the minimax degree-n
approximation to a continuous function f on [a, b] if and only if there exist at least n + 2 values
a ≤ x0 < x1 < x2 < . . . < xn+1 ≤ b
such that :
p(xi ) − f (xi ) = (−1)i [p(x0 ) − f (x0 )] = ±||f − p||∞,[a,b] .
Throughout the paper, we will make frequent use of the polynomials
Tn∗ (x) = Tn (2x − 1).
The first polynomials Tn∗ are given below. We have (see [2, Chap. 3] for example) Tn∗ (x) =
T2n (x1/2 ), hence all the coefficients of Tn∗ are non zero integers.
RR n˚4787
Nicolas Brisebarre , Jean-Michel Muller
6
1
0.5
–1
–0.8
–0.6
–0.4
–0.2
0.2
0.4
0.6
0.8
1
x
–0.5
–1
F IG . 1 – Graph of the polynomial T7 (x).
INRIA
Finding the “truncated” polynomial that is closest to a function
T0∗ (x)
T1∗ (x)
T2∗ (x)
T3∗ (x)
T4∗ (x)
T5∗ (x)
=
=
=
=
=
=
7
1,
2x − 1,
8x2 − 8x + 1,
32x3 − 48x2 + 18x − 1,
128x4 − 256x3 + 160x2 − 32x + 1,
512x5 − 1280x4 + 1120x3 − 400x2 + 50x − 1.
Theorem 2 (Polynomial of smallest norm with degree-k coefficient equal to 1.) Let a ∈
(0, +∞), define
x
β0 + β1 x + β2 x2 + · · · + βn xn = Tn∗
.
a
Let k be an integer, 0 ≤ k ≤ n, the polynomial of degree at most n with a degree-k coefficient equal
to 1 that has the smallest ||.||∞,[0,a] norm in [0, a] is
1 ∗ x
.
T
βk n a
That norm is |1/βk |.
Proving this theorem first requires the following results.
Proposition 1 Let (δi )i=0,...,n be an increasing sequence of non negative integers and
P (x) = a0 xδ0 + · · · + an xδn ∈ R[x],
then either P = 0 or P has at most n zeros in (0, +∞).
Proof. By induction on n. For n = 0, it is obvious. Now we assume that the property is true
until the rank n. Let P (x) = a0 xδ0 +· · ·+an xδn +an+1 xδn+1 ∈ R[x] with 0 ≤ δ0 < · · · < δn+1
and a0 a1 . . . an+1 6= 0. Assume that P has at least n + 2 zeros in (0, +∞). Then P1 = P/xδ0
has at least n+2 zeros in (0, +∞). Thus, the non zero polynomial P10 (x) = (δ1 −δ0 )a1 xδ1 −δ0 +
· · · + (δn+1 − δ0 )an+1 xδn+1 −δ0 has, from Rolle’s Theorem, at least n + 1 zeros in (0, +∞),
which contradicts the induction hypothesis. Corollary 1 Let (δi )i=0,...,n be an increasing sequence of non negative integers and
P (x) = a0 xδ0 + · · · + an xδn ∈ R[x].
If P has at least n + 1 zeros in [0, +∞) and at most a simple zero in 0, then P = 0.
Proof. If P (0) 6= 0, then P has at least n + 1 zeros in (0, +∞), hence P = 0 from Proposition
n
X
ej xj . As P has at least n − 1
1. Suppose now that P (0) = 0. We can rewrite P as P (x) =
j=1
j6=k
zeros in (0, +∞), it must yet vanish identically from Proposition 1. RR n˚4787
Nicolas Brisebarre , Jean-Michel Muller
8
Proof of Theorem 2. We give the proof (which follows step by step the proof of Theorem
2.1 in [12]) in the case a = 1 (the general case is a straightforward generalization). Denote
n
X
Tn∗ (x) =
ak xk . From Property 2, there exist 0 = η0 < η1 < · · · < ηn = 1 such that
k=0
−1
∗
n−i
n−i
a−1
kTn∗ k∞,[0,1] = a−1
.
k Tn (ηi ) = ak (−1)
k (−1)
Let q(x) =
n
X
k
cj xj ∈ R[x] satisfy kxk − q(x)k∞,[0,1] ≤ |a−1
k |. We suppose that x − q 6=
j=0
j6=k
−1 ∗
∗
k
a−1
k Tn . Then the polynomial P (x) = ak Tn (x)−(x −q(x)) has the form
n
X
dj xj and is not
j=0
j6=k
identically zero. Hence there exist i and j, 0 ≤ i ≤ j ≤ n, such that P (η0 ) = · · · = P (ηi−1 ) =
0, P (ηi ) 6= 0 and P (ηj ) 6= 0, P (ηj+1 ) = · · · = P (ηn ) = 0 (otherwise, the polynomial q would
have at least n + 1 distinct roots in [0, 1] which contradicts Corollary 1). Let l such that
∗
n−l
P (ηl ) 6= 0 then sgn P (ηl ) = sgn a−1
sgn a−1
k Tn (ηl ) = (−1)
k . Let m such that P (ηl ) 6= 0,
P (ηl+1 ) = · · · = P (ηl+m−1 ) = 0, P (ηl+m ) 6= 0 : P has at least m − 1 zeros in [ηl , ηl+m ]. We
distinguish two cases :
– If m is even, we have sgn P (ηl ) = sgn P (ηl+m ) and thus, P must have an even number
of zeros (counted with multiplicity) in [ηl , ηl+m ].
– If m is odd, we have sgn P (ηl ) = − sgn P (ηl+m ) and thus, P must have an odd
number of zeros (counted with multiplicity) in [ηl , ηl+m ].
In both cases, we conclude that P has at least m zeros in [ηl , ηl+m ].
Then P has at least j − i zeros in [ηi , ηj ]. Finally, P has no less than i + (j − i) + n − j = n
zeros in [0, 1] (P has i zeros in [η0 , ηi ) and P has n − j zeros in (ηj , ηn ]). Note that we also
obtained that P has no less than n − 1 zeros in (0, 1]. Hence, we deduce from Corollary 1
that P vanishes identically. 2 Getting the “truncated” polynomial that is closest to a function in [0, a].
Let a ∈ (0, +∞), let f be a function defined on [0, a] and m0 , m1 , . . . , mn be n + 1
[m ,m ,...,mn ]
integers. Define Pn 0 1
as the set of the polynomials of degree less than or equal to
n whose degree-i coefficient is a multiple of 2−mi for all i between 0 and n (we will call
these polynomials “truncated polynomials”).
[m ,m ,...,mn ]
We are looking for a truncated polynomial p? ∈ Pn 0 1
such that
||f − p? ||∞,[0,a] =
min
[m0 ,m1 ,...,mn ]
||f − q||∞,[0,a] .
(3)
q∈Pn
INRIA
Finding the “truncated” polynomial that is closest to a function
9
Let p be the minimax approximation of f on [0, a]. Define p̂ as the polynomial whose
degree-i coefficient is obtained by rounding the degree-i coefficient of p to the nearest multiple of 2−mi (with an arbitrary choice in case of a tie) for i = 0, . . . , n : the polynomial p̂ is
[m ,m ,...,mn ]
an element of Pn 0 1
. It should be noticed that p̂ is not necessarily equal to p? . Also
define and ˆ as
= ||f − p||∞,[0,a] and ˆ = ||f − p̂||∞,[0,a] .
In the following, we compute bounds on the coefficients of a polynomial q such that if q is
not within these bounds, then
||f − q||∞,[0,a] > + ˆ.
Knowing these bounds will allow an exhaustive searching of p? . To do that, consider a
polynomial q whose degree-i coefficient is pi + δi . Let us see how close can q be to p. We
have
X
(q − p)(x) = δi xi +
(qj − pj )xj .
j6=i
Hence, ||q − p||∞,[0,a] is minimum implies that
||xi +
1 X
(qj − pj )xj ||∞,[0,a]
δi
j6=i
is minimum.
Hence, we have to find the polynomial of degree n, with fixed degree-i coefficient,
whose norm is smallest. This is given by Theorem 2. Therefore, we have
||xi +
1 X
1
(qj − pj )xj ||∞,[0,a] ≥
,
δi
|βi |
j6=i
where βi is the non-zero degree-i coefficient of Tn∗ (x/a).
||q − p||∞,[0,a] ≥
δi
.
|βi |
[m ,m ,...,m ]
n
Now, since p̂ ∈ Pn 0 1
, if a polynomial is at a distance greater than ˆ from p, it cannot
?
be p . Therefore, if there exists i, 0 ≤ i ≤ n, such that
|δi | > ( + ˆ)|βi |
then
||q − f || ≥ ||q − p|| − ||p − f || > ˆ :
[m ,m ,...,m ]
n
the polynomial q cannot be the element of Pn 0 1
that is closest to f . Hence, the i-th
?
coefficient of p necessarily lies in the interval [pi − ˆ|βi |, pi + ˆ|βi |]. Thus we have
d2mi pi − ( + ˆ)|βi |e ≤ 2mi p?i ≤ b2mi pi + ( + ˆ)|βi |c .
RR n˚4787
(4)
Nicolas Brisebarre , Jean-Michel Muller
10
Remark. As it can be seen in the examples, the number of polynomials to test given by the
conditions (4) may be too large to produce in a “reasonable time” the optimal polynomial.
And yet, we can perform a partial search which will not necessarily give the best truncated
polynomial but one better than p̂. To do so, we are going to search for, among the truncated
polynomials closer than p̂ to the minimax polynomial p, the one that is closest to f . This
polynomial will be denoted p× . We proceed as follows.
Define η as
η = ||p̂ − p||∞,[0,a] .
Now, we compute bounds on the coefficients of a polynomial q such that if q is not within
these bounds, then
||p − q||∞,[0,a] > η.
Knowing these bounds will allow an exhaustive searching of p× . To do that, consider a
polynomial q whose degree-i coefficient is pi + δi . Now, as in the previous section, we
obtain that, if there exists i, 0 ≤ i ≤ n, such that
|δi | > η|βi |
then q cannot be p× . Hence, the i-th coefficient of p× necessarily lies in the interval [pi −
η|βi |, pi + η|βi |]. Thus we have
mi
d2mi pi − η|βi |e ≤ 2mi p×
pi + η|βi |c .
i ≤ b2
3 Examples
3.1 Cosine function in [0, π/4] with a degree-3 polynomial.
In [0, π/4], the distance between the cosine function and its best degree-3 minimax
approximation is 0.00011. This means that such an approximation is not good enough
for single-precision implementation of the cosine function. It can be of interest for some
special-purpose implementations.
m := [12,10,6,4]:polstar(cos,Pi/4,3,m);
"minimax = ", .9998864206
+ (.00469021603 + (-.5303088665 + .06304636099 x) x) x
"Distance between f and p = ", .0001135879209
3
"hatp = ", 1/16 x
17 2
- -- x + 5/1024 x + 1
32
INRIA
Finding the “truncated” polynomial that is closest to a function
11
"Distance between f and hatp = ", .0006939707768
degree 0: 6 possible values between 4093/4096 and
2049/2048
degree 1: 38 possible values between -7/512 and
23/1024
degree 2: 8 possible values between -37/64 and
-15/32
degree 3: 1 possible values between 1/16 and
1/16
1824 polynomials need be checked
3
"pstar = ", 1/16 x
17 2
4095
- -- x + 3/512 x + ---32
4096
"Distance between f and pstar =", .0002441406250
"Time elapsed (in seconds)", 8.080
3.2 Exponential function in [0, log(1 + 1/2048)] with a degree-3 polynomial.
In [0, log(1+1/2048)], the distance between the exponential function and its best degree3 minimax approximation is around 1.8×10−17, which should be sufficienty for a faithfully
rounded double precision implementation with much care in the polynomial implementation. Unfortunately, the bounds given to get p? are too large (there are 18523896 polynomials to test). Hence, we will only try to determine the polynomial p× .
Digits:=30: m := [56,45,33,23]: poltimes(exp,log(1.+1./2048),3,m);
"minimax = ", .999999999999999981509827946165
+ (1.00000000000121203815619648271 + (.499999987586063030320493910112
+ .166707352549861488779274879363 x) x) x
-16
"Distance between f and p = ", .1849017208895 10
RR n˚4787
Nicolas Brisebarre , Jean-Michel Muller
12
1398443 3
4294967189 2
35184372088875
"hatp = ", ------- x + ---------- x + -------------- x
8388608
8589934592
35184372088832
72057594037927935
+ ----------------72057594037927936
-16
"Distance between f and hatp = ", .236242209693262352294431493060 10
-17
"Distance between p and hatp = ", .531982124948018688509983966915 10
degree 0: 1 possible values between 72057594037927935/72057594037927936
and 72057594037927935/72057594037927936
degree 1: 14 possible values between 8796093022217/8796093022208 and
351843720888
degree 2: 18 possible values between 4294967181/8589934592 and
2147483599/4294967296
degree 3: 24 possible values between 1398431/8388608 and
699227/4194304
6048 polynomials need be checked
1398443 3
2147483595 2
35184372088873
"ptimes = ", ------- x + ---------- x + -------------- x
8388608
4294967296
35184372088832
72057594037927935
+ ----------------72057594037927936
-16
"Distance between f and ptimes =", .202462803670964701822850663822 10
"Time elapsed (in seconds) =", 1970.699
Appendix : Maple program that computed the polynomial p?
with(numapprox);with(orthopoly);
polstar := proc(f,a,n,m)
INRIA
Finding the “truncated” polynomial that is closest to a function
local p, i, hatp, poltronq, hatepsilon, epsilon, beta, prod,
ecart, coeffp, temps;
global pstar, minpstar, smallest, largest, mm, aa;
temps:=time():
mm:=m; aa:=a;
p := minimax(f(x),x=0..a,[n,0],1,’epsilon’);
print("minimax = ",p);
print("Distance between f and p = ",epsilon);
for i from 0 to n do
hatp[i] := round(2^m[i+1]*coeff(p,x,i))/2^m[i+1];
od;
poltronq := add(hatp[i]*x^i,i=0..n);
print("hatp = ",sort(poltronq));
hatepsilon := infnorm(poltronq-f(x),x=0..a);
print("Distance between f and hatp = ",hatepsilon);
beta := T(n,2*(x/a)-1); prod := 1;
for i from 0 to n do
ecart := abs((epsilon+hatepsilon)*coeff(beta,x,i));
coeffp := coeff(p,x,i);
smallest[i] := ceil((coeffp-ecart)*2^m[i+1]);
largest[i] := floor((coeffp+ecart)*2^m[i+1]);
printf("degree %a: %a possible values between %a and
%a\n",i,largest[i]-smallest[i]+1,smallest[i]*2^(-m[i+1]),
largest[i]*2^(-m[i+1]));
prod := prod*(largest[i]-smallest[i]+1)
od;
printf("%a polynomials need be checked",prod);print();
pstar:=poltronq;
minpstar:=hatepsilon;
selpolstar(n,f,0);
print("pstar = ",sort(pstar));
print("Distance between f and pstar =",minpstar);
print("Time elapsed (in seconds)", time() - temps);
end:
selpolstar:=proc(k,f,P)
local i, reste;
global minpstar, pstar;
if k = -1 then reste:= infnorm(f(x)-P,x=0..aa);
if reste < minpstar
then minpstar:= reste;
pstar:= P;
fi
else for i from smallest[k] to largest[k]
do selpolstar(k-1,f,P+i*x^k/2^mm[k+1])
od
RR n˚4787
13
14
Nicolas Brisebarre , Jean-Michel Muller
fi
end:
Références
[1] P. Borwein and T. Erdélyi, Polynomials and Polynomials Inequalities, Graduate Texts
in Mathematics, 161, Springer-Verlag, 1995.
[2] L. Fox and I. B. Parker, Chebyshev Polynomials in Numerical Analysis, Oxford Mathematical Handbooks, Oxford University Press, 1972.
[3] M. Payne and R. Hanek. Radian reduction for trigonometric functions. SIGNUM Newsletter, 18 :19–24, 1983.
[4] K. C. Ng. Argument reduction for huge arguments : Good to the last bit (can be obtained by sending an e-mail to the author : [email protected]). Technical report,
SunPro, 1992.
[5] M. Daumas, C. Mazenc, X. Merrheim, and J.- M. Muller. Modular range reduction : A
new algorithm for fast and accurate computation of the elementary functions. Journal
of Universal Computer Science, 1(3) :162–175, March 1995.
[6] E. Remes. Sur un procédé convergent d’approximations successives pour déterminer
les polynômes d’approximation. C.R. Acad. Sci. Paris, 198, 1934, pp 2063–2065.
[7] J. F. Hart, E. W. Cheney, C. L. Lawson, H. J. Maehly, C. K. Mesztenyi, J. R. Rice, H. G.
Thacher, and C. Witzgall. Computer Approximations. Wiley, New York, 1968.
[8] J.-M. Muller. Elementary Functions, Algorithms and Implementation. Birkhauser, Boston,
1997.
[9] P. Markstein. IA-64 and Elementary Functions : Speed and Precision. Hewlett-Packard
Professional Books. Prentice Hall, 2000. ISBN : 0130183482.
[10] B. Wei, J. Cao and J. Cheng. High-performance architectures for elementary function
generation. In Burgess and Ciminiera, editors, Proc. of the 15th IEEE Symposium on Computer Arithmetic (Arith-15). IEEE Computer Society Press, 2001.
[11] J.A. Pineiro, J.D. Bruguera, and J.-M. Muller. Faithful powering computation using
table look-up and a fused accumulation tree. In Burgess and Ciminiera, editors, Proc.
of the 15th IEEE Symposium on Computer Arithmetic (Arith-15). IEEE Computer Society
Press, 2001.
[12] T. J. Rivlin. Chebyshev polynomials. From approximation theory to algebra and number
theory. Second edition. Pure and Applied Mathematics. John Wiley & Sons, Inc., New
York, 1990.
[13] P. T. P. Tang. Table-driven implementation of the exponential function in IEEE floatingpoint arithmetic. ACM Transactions on Mathematical Software, 15(2) :144–157, June 1989.
INRIA
Finding the “truncated” polynomial that is closest to a function
15
[14] P. T. P. Tang. Table-driven implementation of the logarithm function in IEEE floatingpoint arithmetic. ACM Transactions on Mathematical Software, 16(4) :378–400, December
1990.
[15] P. T. P. Tang. Table lookup algorithms for elementary functions and their error analysis. In P. Kornerup and D. W. Matula, editors, Proceedings of the 10th IEEE Symposium
on Computer Arithmetic, pages 232–236, Grenoble, France, June 1991. IEEE Computer
Society Press, Los Alamitos, CA.
[16] P. T. P. Tang. Table-driven implementation of the expm1 function in IEEE floatingpoint arithmetic. ACM Transactions on Mathematical Software, 18(2) :211–222, June 1992.
RR n˚4787
Unit´e de recherche INRIA Lorraine, Technopôle de Nancy-Brabois, Campus scientifique,
615 rue du Jardin Botanique, BP 101, 54600 VILLERS LÈS NANCY
Unit´e de recherche INRIA Rennes, Irisa, Campus universitaire de Beaulieu, 35042 RENNES Cedex
Unit´e de recherche INRIA Rhône-Alpes, 655, avenue de l’Europe, 38330 MONTBONNOT ST MARTIN
Unit´e de recherche INRIA Rocquencourt, Domaine de Voluceau, Rocquencourt, BP 105, 78153 LE CHESNAY Cedex
Unit´e de recherche INRIA Sophia-Antipolis, 2004 route des Lucioles, BP 93, 06902 SOPHIA-ANTIPOLIS Cedex
Éditeur
INRIA, Domaine de Voluceau, Rocquencourt, BP 105, 78153 LE CHESNAY Cedex (France)
http://www.inria.fr
ISSN 0249-6399