diff --git a/paper/README.md b/paper/README.md index c13daf8..b478db9 100644 --- a/paper/README.md +++ b/paper/README.md @@ -1,12 +1,17 @@ # Error bounds for quad-double style arithmetic on floating-point expansions of any length -[expansion-error-bounds.pdf](expansion-error-bounds.pdf) proves error bounds for the quad-double style algorithms of -Hida, Li and Bailey carried to any number of parts, the algorithms `src/od.rs` runs at eight. Sums and products err by -at most u^n times the exact result plus a second term, at most 2^-15 of the first at eight parts in binary64. Simple -inputs reach the bound. A sum of K products accumulated in levels, as `OdAcc` does, errs by u^n times the exact sum -plus a term that grows like (Ku)^(n+1), and constructed inputs show the growth. The exponential and the logarithm, built from these -operations with part bounds carried through every step, err by at most 3.661 u^8 e^x + 2^-1071 and 9.926 u^8 |ln x| + -2^-509; the logarithm starts from a binary64 logarithm whose error is proved too. +[expansion-error-bounds.pdf](expansion-error-bounds.pdf) proves error bounds for a level scheme in the style of Hida, Li +and Bailey's quad-double algorithms, with TwoSum throughout, at any number of parts: the algorithms `src/od.rs` runs at +eight. It is not the QD library's own code at four parts, and Section II of the paper lists the differences. Sums and +products err by at most u^n times the exact result plus a second term of at most 2^-15 u^n times the operands' leading +parts, |a_0| + |b_0| for a sum and |a_0 b_0| for a product, at eight parts in binary64. Simple inputs reach the bound. A +sum of K products accumulated in levels, as `OdAcc` does, errs by u^n times the exact sum plus a term that grows like +(Ku)^(n+1) times the sum of the products' |a_0 b_0|, and constructed inputs show the growth. The sloppy multiply, +without the last level, errs by at most 2^31.93 u^8 |a_0 b_0|. The sine and cosine err by at most 3.17 u^8 and the +tangent by 6.42 u^8 relative, each with a term from the reduction's 1216 bits of pi/2. The exponential and the +logarithm, built from these operations with part bounds carried through every step, err by at most 3.661 u^8 e^x + +2^-1071 and 9.926 u^8 |ln x| + 2^-509; the logarithm starts from a binary64 logarithm whose error is bounded too. Each +constant is computed by a script of this folder from a proved recursion and printed rounded up. | File | Contents | |---|---| diff --git a/paper/expansion-error-bounds-appendix.tex b/paper/expansion-error-bounds-appendix.tex index 59e08dc..315e5de 100644 --- a/paper/expansion-error-bounds-appendix.tex +++ b/paper/expansion-error-bounds-appendix.tex @@ -376,7 +376,7 @@ \section{Error bounds for the operations} \begin{table}[tp] \centering -\caption{Theorem~\ref{thm:t3} at $n = 8$, $p = 53$. In units of $2^{-418}$, the leading term is $1/64$ unit. Below each row, the bound for $\theta = 2$.} +\caption{Theorem~\ref{thm:t3} at $n = 8$, $p = 53$ (computed, \texttt{constants.py}). In units of $2^{-418}$, the leading term is $1/64$ unit. Below each row, the bound for $\theta = 2$.} \label{tab:kappa} \small \begin{tabular}{@{}lcc@{}} @@ -443,8 +443,8 @@ \section{Error bounds for the operations} \end{proof} After cancellation in ADD or ADDF, $M/|x_0|$ is unbounded, and Theorem~\ref{thm:t5} bounds the parts relative to $M$ -only. A subtraction of nearly equal values, as in the remainders of long division, can therefore leave a result -outside $H(2)$, and the theorems above do not chain through it. +only. A subtraction of nearly equal values, as in the remainders of long division, is therefore not shown to return a result +in $H(2)$, and the theorems above do not chain through it. \section{Division} @@ -484,7 +484,7 @@ \section{Division} \Bigl|\frac ab - \sum_k x_k\Bigr| \le (u^n + \kdiv u^{n+1})\Bigl|\frac ab\Bigr|, \\ \kdiv = \frac{(1+u^n)\Theta\frac{1-\rho}{1-2\rho} + \Xi}{(1-2\rho)\,u^{n+1}}. \end{gather*} -At $n = 8$, $p = 53$: $\kdiv \le 2^{26.0}$ for $\theta = 1$ and $\kdiv \le 2^{27.48}$ for $\theta = 2$, so $|a/b - x| \le (1 + +At $n = 8$, $p = 53$ (computed, \texttt{div\_consts.py}): $\kdiv \le 2^{26.0}$ for $\theta = 1$ and $\kdiv \le 2^{27.48}$ for $\theta = 2$, so $|a/b - x| \le (1 + 2^{-25.5})\,2^{-424}|a/b|$ for ulp-nonoverlapping $a$ and $b$. \end{theorem} @@ -527,7 +527,7 @@ \section{Division} \begin{remark} The bound on the remainders grows by about $7u$ per update at $\theta = 2$ ($P^{(k)}_0 \approx 6.7^k u^k$ at $n = 8$), so $\kdiv$ grows like $7^{n+1}$ times the cost of an update, and $\kdiv u < 1$ for $n \le 13$ at $p = 53$ -($\kdiv u \le 2^{-8.1}$ at $n = 12$ and $2^{-3.4}$ at $n = 13$, $\theta = 2$). The remainders after cancellation do not satisfy $H(\theta)$ for a useful +($\kdiv u \le 2^{-8.1}$ at $n = 12$ and $2^{-3.4}$ at $n = 13$, $\theta = 2$). The remainders after cancellation are not shown to satisfy $H(\theta)$ for a useful $\theta$, so the proof carries part bounds $P^{(k)}$ relative to $|a_0|$ through Lemma~\ref{lem:o} instead of applying Theorem~\ref{thm:t3} to each update. The leading constant 1 is attained (Proposition~\ref{prop:sharp}(d)). \end{remark} @@ -561,7 +561,7 @@ \section{The square root} &\quad + \epsilon_d + \epsilon_r, \qquad \pi^{(k+1)} = \pi'. \end{align*} With $(\epsilon_z, \cdot) = G_{\rm MUL}(\pi^{(J)}, \bar a;\ 1 + E_J)$ and $\delta_J = E_J + \epsilon_z$, the result -satisfies $|\sqrt x - \sum_k \mathrm{SQRT}(x)_k| \le \delta_J\sqrt x$. At $n = 8$, $J = 4$, $p = 53$: $\delta_4 \le +satisfies $|\sqrt x - \sum_k \mathrm{SQRT}(x)_k| \le \delta_J\sqrt x$. At $n = 8$, $J = 4$, $p = 53$ (computed, \texttt{sqrt\_consts.py}): $\delta_4 \le 3.0000319\,u^8$ for $\theta = 2$ and $3.0000198\,u^8$ for $\theta = 1$. \end{theorem} @@ -626,7 +626,7 @@ \section{The square root} \end{align*} Let $E_2$ and $\pi^{(2)}$ be one step of Theorem~\ref{thm:t7} from $E_1$ and $\pi^{(1)}$, $(\epsilon_z, \cdot) = G_{\rm MUL}(\pi^{(2)}, \bar a;\ 1 + E_2)$ and $\delta^{\rm DD} = E_2 + \epsilon_z$. Then $|\sqrt x - \sum_k -\mathrm{SQRT}^{\rm DD}_n(x)_k| \le \delta^{\rm DD}\sqrt x$. At $n = 8$, $p = 53$: $E_0 \le 22.125\,u^2 + 72\,u^3$ for +\mathrm{SQRT}^{\rm DD}_n(x)_k| \le \delta^{\rm DD}\sqrt x$. At $n = 8$, $p = 53$ (computed, \texttt{sqrt\_consts.py}): $E_0 \le 22.125\,u^2 + 72\,u^3$ for $\theta = 2$ and $19.125\,u^2 + 58\,u^3$ for $\theta = 1$, $E_1 \le 2^{-303}$, and $\delta^{\rm DD} \le 3.0000319\,u^8$ for $\theta = 2$ and $3.0000198\,u^8$ for $\theta = 1$, the bounds of SQRT$_{8,4}$. \end{theorem} diff --git a/paper/expansion-error-bounds-explog.tex b/paper/expansion-error-bounds-explog.tex index fa703a9..284d749 100644 --- a/paper/expansion-error-bounds-explog.tex +++ b/paper/expansion-error-bounds-explog.tex @@ -138,8 +138,8 @@ \section{The exponential and the logarithm}\label{sec:explog} \] If the cases cover every $|r|$ that can select each $e$, $|y - e^x| \le \varepsilon_{\exp}e^x + n2^{-1074}$, with $\varepsilon_{\exp}$ the largest $\varepsilon$; the second term arises only where the result's parts fall below -$2^{-1022}$. At $n = 8$, $s = 6$, $d = 43$ and $\theta = 2$, $\varepsilon_{\exp} \le 3.661\,u^8$, the largest at $k -\ne 0$, $m = 5$, $r$ just above $-\frac12\ln 2$. +$2^{-1022}$. At $n = 8$, $s = 6$, $d = 43$ and $\theta = 2$ (computed, \texttt{explog\_consts.py}), $\varepsilon_{\exp} \le +3.661\,u^8$, the largest at $k \ne 0$, $m = 5$, $r$ just above $-\frac12\ln 2$. \end{theorem} \begin{proof} @@ -239,7 +239,8 @@ \section{The exponential and the logarithm}\label{sec:explog} \end{itemize} Then $|y - \ln x| \le \mathcal E(\ell)$ in the case of the run. With $\varepsilon_{\ln}$ and $\Phi$ defined from $\mathcal E$ in the proof, $|y - \ln x| \le \varepsilon_{\ln}|\ln x| + \Phi$, and at $n = 8$, $s = 6$, $d = 43$, $q -= 4$ and $\theta = 2$, $\varepsilon_{\ln} \le 9.926\,u^8$ and $\Phi \le 2^{-509}$. += 4$ and $\theta = 2$ (computed, \texttt{explog\_consts.py}), $\varepsilon_{\ln} \le 9.926\,u^8$ and $\Phi \le +2^{-509}$. \end{theorem} \begin{proof} @@ -330,7 +331,8 @@ \section{The exponential and the logarithm}\label{sec:explog} \mu = \RN(\sqrt 2)$, $m \gets m/2$ and $e \gets e + 1$; $s = \RN((m - 1)/\RN(m + 1))$ and $z = \RN(s^2)$; $v \gets c_9$ and $v \gets \RN(zv + c_j)$, a fused multiply-add, for $j = 8, \dots, 0$, with $c_j = \RN(1/(2j+1))$; and return $\RN(ec_{\rm L} + \RN(2sv))$, a fused multiply-add, with $c_{\rm L} = \RN(\ln 2)$. Then $\ln_{\rm b}(1) = 0$ and -$|\ln_{\rm b}(h) - \ln h| \le \eta_{\rm b}|\ln h|$ with $\eta_{\rm b} = 5.915\,u$ ($2^{-50.43}$). This is +$|\ln_{\rm b}(h) - \ln h| \le \eta_{\rm b}|\ln h|$ with $\eta_{\rm b} = 5.915\,u$ ($2^{-50.43}$; computed, +\texttt{explog\_consts.py}). This is multidouble's \texttt{ln\_f64}. \end{lemma} diff --git a/paper/expansion-error-bounds-sloppy.tex b/paper/expansion-error-bounds-sloppy.tex index c3211ac..da451da 100644 --- a/paper/expansion-error-bounds-sloppy.tex +++ b/paper/expansion-error-bounds-sloppy.tex @@ -46,7 +46,7 @@ \section{The sloppy multiply}\label{sec:sloppy} Theorem~\ref{thm:acc} with $\tau_l = \max(L_lu^l, \rho^l)$ for $l < n$, $\tau_n = 0$, and $E_{\rm prod} = (R_{\rm s} + \Delta_nu)u^nW$. \end{enumerate} -At $n = 8$ and $p = 53$, $Q = 64$, and $R_{\rm s} + \Delta_8u \le 2^{30.4117}$ for $\theta = 1$ and $2^{31.9242}$ for +At $n = 8$ and $p = 53$ (computed, \texttt{sloppy\_consts.py}), $Q = 64$, and $R_{\rm s} + \Delta_8u \le 2^{30.4117}$ for $\theta = 1$ and $2^{31.9242}$ for $\theta = 2$, of which $\Delta_8u$ is at most $2^{-50.41}$ and $2^{-41.41}$. \end{theorem} diff --git a/paper/expansion-error-bounds-trig.tex b/paper/expansion-error-bounds-trig.tex index 936c2d7..be36585 100644 --- a/paper/expansion-error-bounds-trig.tex +++ b/paper/expansion-error-bounds-trig.tex @@ -194,7 +194,7 @@ \section{Sine, cosine and tangent}\label{sec:trig} |\mathrm{COS}_n(x) - \cos x| \le C|\cos x| + 5E_\pi, \\ |\mathrm{TAN}_n(x) - \tan x| \le \Bigl(C^{\rm T} + \frac{5E_\pi}{|\sin x\cos x|}\Bigr)|\tan x|. \end{gather*} -At $n = 8$, $C \le 3.163168\,u^8$ and $C^{\rm T} \le 6.418351\,u^8$. With the double-word bounds of DWTimesDW3, +At $n = 8$ (computed, \texttt{trig\_consts.py}), $C \le 3.163168\,u^8$ and $C^{\rm T} \le 6.418351\,u^8$. With the double-word bounds of DWTimesDW3, $(4u^2 + u^3/2)/(1+u)^2$ \cite{MR22}, AccurateDWPlusDW, $3u^2/(1-4u)$, DWPlusFP, $2u^2$, and DWDivDW2, $15u^2 + 56u^3$ \cite{JMP17}, in place of Lemma~\ref{lem:g} and Theorem~\ref{thm:t6}, the bounds hold for multidouble's double-double functions of a double-word $x$ ($x_0 = \RN(x)$) with $C \le 7.841412\,u^2$ and $C^{\rm T} \le diff --git a/paper/expansion-error-bounds.pdf b/paper/expansion-error-bounds.pdf index aff6821..de475cb 100644 Binary files a/paper/expansion-error-bounds.pdf and b/paper/expansion-error-bounds.pdf differ diff --git a/paper/expansion-error-bounds.tex b/paper/expansion-error-bounds.tex index a609440..e2f30bd 100644 --- a/paper/expansion-error-bounds.tex +++ b/paper/expansion-error-bounds.tex @@ -56,16 +56,21 @@ \begin{abstract} \mdseries A floating-point expansion stores a number as an unevaluated sum of $n$ machine numbers, which gives about $n$ times -the precision of the hardware format. The quad-double algorithms of Hida, Li and Bailey are the most widely used way -to add, multiply, divide and take square roots of such sums, and they extend from four parts to any $n$. Bounds were known for -variants of them at any $n$, with leading constants that grow like $2^n$. We prove that, for the algorithms -themselves, the sum and the product of two $n$-part expansions err by at most $u^n$ times the exact result, where $u$ is the unit roundoff of the hardware -format. This is the bound of rounding to a format with $n$ times the precision. A second, much smaller term is added, -at most $2^{-15}$ of the first at eight parts in binary64, and measured against the operands' size for sums. Division -has the same bound, and the square root three times it. Simple -inputs reach the bound, so it cannot be improved. For sums of $K$ products accumulated in levels, as dot-product -kernels do, the second term grows like $(Ku)^{n+1}$ times the products' total size, and constructed inputs show that -this growth is real. The proofs rest on an analysis of renormalization that allows its input terms in any order. +the precision of the hardware format. The quad-double library of Hida, Li and Bailey adds, multiplies, divides and +takes square roots of four-part sums by a scheme of levels that extends to any $n$. Bounds were known for other +generalizations of it to any $n$, with leading constants that grow like $2^n$. We analyze a scheme of this style that +uses the error-free TwoSum throughout, which at $n = 8$ is the octo-double arithmetic of the multidouble library. We +prove that its sum and its product of two $n$-part expansions err by at most $u^n$ times the exact result, where $u$ +is the unit roundoff of the hardware format. This is the bound of rounding to a format with $n$ times the precision. A +second, much smaller term is added, at most $2^{-15}$ of the first at eight parts in binary64, and measured against +the operands' size for sums. Division has the same bound. Simple inputs reach it for the sum, the product and the +quotient, so its leading constant cannot be lowered. The square root's bound is three times it at eight parts. For +sums of $K$ products accumulated in levels, as dot-product kernels do, the second term grows like $(Ku)^{n+1}$ times +the products' total size, and constructed inputs show that this growth is real. The same analysis, with a bound on +each part carried through every step, covers a cheaper multiplication without the last level, within +$2^{31.93}u^8$ of the product, and the sine, cosine, tangent, exponential and logarithm built on these operations, +with relative constants from $3.17$ to $9.926$ at eight parts. The proofs rest on an analysis of renormalization that +allows its input terms in any order. \end{abstract} \section{Introduction} @@ -79,10 +84,10 @@ \section{Introduction} which is correct to about 32 decimal digits. Two parts give double-double arithmetic, four give quad-double, about 64 digits, and eight give octo-double, about 128. -The standard algorithms for expansions are those of the QD library of Hida, Li and Bailey~\cite{HLB01}. To multiply, -they form the products of the parts, sort them by size into \emph{levels}, add each level with error-free -transformations, and finally \emph{renormalize} the levels back into $n$ parts. The scheme works for any $n$, and the -octo-double arithmetic of the multidouble library uses it at $n = 8$~\cite{md}. +The QD library of Hida, Li and Bailey~\cite{HLB01} computes with four parts. To multiply, it forms the products of +the parts, sorts them by size into \emph{levels}, adds each level with error-free transformations, and finally +\emph{renormalizes} the levels back into four parts. The scheme extends to any $n$, and the octo-double arithmetic of +the multidouble library follows it at $n = 8$~\cite{md}, with the choices listed in Section~\ref{sec:qd}. How accurate is the result? The QD paper bounds its addition under the assumption that the renormalization works, and notes that this remains to be proven. Joldes, Marty, Muller and Popescu~\cite{JMMP16} proved properties of a different @@ -94,15 +99,22 @@ \section{Introduction} parts~\cite{Zhang25}. \begin{samepage} -We give proven bounds for the QD-style algorithms themselves, for every $n$: +We prove bounds for one scheme of this style, with $\TwoSum$ throughout, for every $n$. It is not QD's own code at +$n = 4$, and Section~\ref{sec:qd} lists the differences: \begin{itemize} \item addition and multiplication of two expansions, and of an expansion and a floating-point number, are accurate to - $u^n$ relative, plus a small second term (Theorem~\ref{thm:main}), a leading constant of 1 against $2^n$ and more - for the variants; + $u^n$ relative, plus a small second term (Theorem~\ref{thm:main}), a leading constant of 1 where the bounds known + for other generalizations have $2^n$ and more; \item division is accurate to $u^n$, and the square root to $3u^n$ at $n = 8$ (Theorem~\ref{thm:divsqrt}); -\item simple inputs reach the bound $u^n$, so it cannot be improved (Section~\ref{sec:example}); +\item simple inputs reach the bound $u^n$ for the sum, the product and the quotient, so its leading constant cannot + be lowered (Section~\ref{sec:example}); \item a sum of $K$ products accumulated in levels is accurate to $u^n$ plus a term that grows like $(Ku)^{n+1}$, which stays below $u^n$ up to about 50 products at $n = 8$, and inputs exist that show the growth (Section~\ref{sec:dot}); +\item a multiplication without the last level, as QD's sloppy one, is accurate to $2^{31.93}u^8|a_0b_0|$ at $n = 8$ + (Theorem~\ref{thm:sloppy}); +\item the sine and cosine, the tangent, the exponential and the logarithm built on these operations have relative + bounds of $3.17$, $6.42$, $3.661$ and $9.926$ times $u^8$ at $n = 8$, each with a small absolute term + (Theorems~\ref{thm:trig}, \ref{thm:exp} and~\ref{thm:log}); \item the renormalization is exact until its last step, whatever the order of its input terms (Theorem~\ref{thm:renorm}), and the other bounds rest on this. \end{itemize} @@ -126,7 +138,8 @@ \subsection{Floating point} |a_i| \le (2u)^i\,|a_0|. \] The appendix calls this hypothesis $H(2)$. The usual expansions satisfy it: every expansion whose parts are each at -most one ulp of the part above does, and those are what the algorithms return. The ladder also allows a part far below +most one ulp of the part above does. So do the products, and the sums of operands whose leading parts have one sign, +that the algorithms return at eight parts (Corollary~\ref{cor:closure}). The ladder also allows a part far below the one above it, and zero parts between nonzero ones (Figure~\ref{fig:ladder}). \nopagebreak @@ -279,9 +292,27 @@ \subsection{Renormalization} gives the same bits whenever $|\acc| \ge |v_j|$, which holds when the terms arrive in decreasing order. They need not: when an operand has a gap, a level can be larger than the level above it, and then only $\TwoSum$ is exact. +\subsection{Differences from QD}\label{sec:qd} + +\begin{samepage} +At $n = 4$ the scheme is not the QD library's code~\cite{HLB01}, whose bounds rest on a renormalization that its +authors left unproved. It differs in four ways: +\begin{itemize} +\item the renormalization uses $\TwoSum$ in both passes, where QD uses $\FastTwoSum$; +\item each level is summed by carries from one $\TwoSum$ to the next, where QD's multiplication sums its levels + with networks of three-input sums and its last level in plain arithmetic; +\item the addition is QD's faster one, which adds the parts in pairs, with every error kept in a level, and not its + accurate one, which merges the eight parts by size; +\item the square root takes Newton steps on the reciprocal root, as QD's does, but starts from a double-word square + root, with a step that keeps the second-order term (Theorem~\ref{thm:t8}). +\end{itemize} +\end{samepage} +The division is QD's long division with $n + 1$ quotient terms. + \section{The results} -The error of every operation has the same leading term: $u^n$ times the exact result. +The sum, the product and the quotient have the same leading term, $u^n$ times the exact result. The square root and +the elementary functions have a few times it (Table~\ref{tab:summary}). \begin{theorem}[Appendix, Theorem~\ref{thm:t3}]\label{thm:main} Let $Z$ be the exact sum or product of two expansions on the ladder, or of an expansion on the ladder and a @@ -301,8 +332,9 @@ \section{The results} \nopagebreak \begin{table}[H] \centering -\caption{Proven error bounds at $n = 8$ parts in binary64, where $u^8 = 2^{-424}$, for expansions $a$ and $b$ on the -ladder and a floating-point number $f$. $Z$ is the exact result. Each bound assumes no underflow inside the run; for +\caption{Error bounds at $n = 8$ parts in binary64, where $u^8 = 2^{-424}$, for expansions $a$ and $b$ on the +ladder and a floating-point number $f$. $Z$ is the exact result. Each bound is a proved recursion whose constant a +script evaluates in exact rational arithmetic and prints rounded up (Section~\ref{sec:comp}). Each bound assumes no underflow inside the run; for $e^a$ and $\ln a$ the scalings by powers of two may underflow, and their losses are in the bounds (Appendix, (A2$'$)). For the sine, cosine and tangent, $k$ is the multiple of $\pi/2$ that the reduction removes, and $x$ lies at least $2^{-650}$ from every nonzero multiple of $\pi/2$ (Theorem~\ref{thm:trig}). The inputs of the first five rows err by $u^8|Z|$ up to a factor $1 - O(u)$ (Proposition~\ref{prop:worst}); @@ -357,20 +389,21 @@ \section{The results} \begin{theorem}[Appendix, Theorems~\ref{thm:t6} and~\ref{thm:t8}]\label{thm:divsqrt} For expansions on the ladder, long division with $n+1$ quotient terms errs by at most $(u^n + \kdiv u^{n+1})|a/b|$, with -$\kdiv u = 2^{-25.5}$ at $n = 8$ and $\kdiv u < 1$ up to $n = 13$ in binary64. The square root by two Newton steps from the +$\kdiv u \le 2^{-25.5}$ at $n = 8$ and $\kdiv u < 1$ up to $n = 13$ in binary64. The square root by two Newton steps from the double-double square root, the first with its second-order term, errs by at most $3.00004\,u^8\sqrt a$ at $n = 8$. +The constants are computed from the proved recursions (Section~\ref{sec:comp}). \end{theorem} The exponential and the logarithm, built from these operations with each part's bound carried through every step, err by at most $3.661\,u^8e^a + 2^{-1071}$ and $9.926\,u^8|\ln a| + 2^{-509}$ at $n = 8$ (Theorems~\ref{thm:exp} -and~\ref{thm:log}). The logarithm starts from a binary64 logarithm of its own, whose error is proved too -(Lemma~\ref{lem:lnb}), so no bound rests on the platform's logarithm. +and~\ref{thm:log}, constants computed). The logarithm starts from a binary64 logarithm of its own, whose error is +bounded the same way (Lemma~\ref{lem:lnb}), so no bound rests on the platform's logarithm. The bounds chain. At eight parts in binary64, a product of two expansions on the ladder is again on the ladder, and so is a sum whose operands' leading parts have one sign (Corollary~\ref{cor:closure}), so the bounds apply at every step of such a computation. A -subtraction of nearly equal values can leave the ladder, and a computation that cancels needs its own analysis, as -the division's remainders receive in the appendix. +subtraction of nearly equal values is not shown to stay on the ladder, and a computation that cancels needs its own +analysis, as the division's remainders receive in the appendix. \section{A worked example}\label{sec:example} @@ -494,9 +527,9 @@ \section{Consequences and limits} bound still holds, but it is no longer close to $u^n$. \item \textbf{Dot products.} A level accumulator is accurate to about $u^n$ for up to about 50 products at eight parts. Random terms do not show its growth beyond that. -\item \textbf{Sloppy multiplication.} Summing the last level in plain arithmetic, as QD's sloppy multiplication - does, raises the multiplication's bound from about $u^8|Z|$ to $2^{31.93}u^8|a_0b_0|$ at eight parts - (Theorem~\ref{thm:sloppy}). +\item \textbf{Sloppy multiplication.} Dropping level $n$ and summing level $n - 1$ in plain arithmetic, as QD's + sloppy multiplication does at four parts, raises the multiplication's bound from about $u^8|Z|$ to + $2^{31.93}u^8|a_0b_0|$ at eight parts (Theorem~\ref{thm:sloppy}). \item \textbf{Elementary functions.} Built on these operations, with a reduction by $\pi/2$ to 1216 bits in exact integer arithmetic and Taylor series, the sine and cosine err by at most $3.17\,u^8|f(x)| + 5|k|2^{-1217}$ and the tangent by $(6.42\,u^8 + 5|k|2^{-1217}/|\sin x\cos x|)|\tan x|$, with $5|k|2^{-1217} < 2^{-1163}$, for $|x_0| \le @@ -512,7 +545,7 @@ \section{Consequences and limits} $2^{22.3}$. \end{itemize} -\section{Computations} +\section{Computations}\label{sec:comp} The constants were evaluated in exact rational arithmetic (\texttt{constants.py}, \texttt{div\_consts.py}, \texttt{sqrt\_consts.py}). A reviewer who had not seen the checks recomputed them from the definitions with separate