\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}
\begin{array}{l}
t_0 := a \cdot {k}^{m}\\
\mathbf{if}\;k \leq 9.832168212624921 \cdot 10^{-24}:\\
\;\;\;\;t_0 \cdot \left(1 - k \cdot 10\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{k}{t_0}\\
\frac{1}{\mathsf{fma}\left(k, t_1, \mathsf{fma}\left(10, t_1, \frac{1}{t_0}\right)\right)}
\end{array}\\
\end{array}
(FPCore (a k m) :precision binary64 (/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))
(FPCore (a k m)
:precision binary64
(let* ((t_0 (* a (pow k m))))
(if (<= k 9.832168212624921e-24)
(* t_0 (- 1.0 (* k 10.0)))
(let* ((t_1 (/ k t_0))) (/ 1.0 (fma k t_1 (fma 10.0 t_1 (/ 1.0 t_0))))))))double code(double a, double k, double m) {
return (a * pow(k, m)) / ((1.0 + (10.0 * k)) + (k * k));
}
double code(double a, double k, double m) {
double t_0 = a * pow(k, m);
double tmp;
if (k <= 9.832168212624921e-24) {
tmp = t_0 * (1.0 - (k * 10.0));
} else {
double t_1 = k / t_0;
tmp = 1.0 / fma(k, t_1, fma(10.0, t_1, (1.0 / t_0)));
}
return tmp;
}



Bits error versus a



Bits error versus k



Bits error versus m
if k < 9.8321682126249208e-24Initial program 1.3
Applied clear-num_binary641.3
Simplified1.3
Taylor expanded in k around 0 36.6
Simplified0.2
if 9.8321682126249208e-24 < k Initial program 11.4
Applied clear-num_binary6411.5
Simplified11.5
Taylor expanded in k around 0 11.5
Simplified0.4
Final simplification0.2
herbie shell --seed 2022068
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))