\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\begin{array}{l}
\mathbf{if}\;k \leq 2.0989642968183564 \cdot 10^{-27}:\\
\;\;\;\;\frac{a \cdot {k}^{m}}{1 + k \cdot 10}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{1}{a \cdot {k}^{m}} + \frac{k}{a \cdot {k}^{m}} \cdot \left(k + 10\right)}\\
\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 (if (<= k 2.0989642968183564e-27) (/ (* a (pow k m)) (+ 1.0 (* k 10.0))) (/ 1.0 (+ (/ 1.0 (* a (pow k m))) (* (/ k (* a (pow k m))) (+ k 10.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 tmp;
if (k <= 2.0989642968183564e-27) {
tmp = (a * pow(k, m)) / (1.0 + (k * 10.0));
} else {
tmp = 1.0 / ((1.0 / (a * pow(k, m))) + ((k / (a * pow(k, m))) * (k + 10.0)));
}
return tmp;
}



Bits error versus a



Bits error versus k



Bits error versus m
Results
if k < 2.0989642968183564e-27Initial program 0.1
Simplified0.0
Taylor expanded around 0 0.0
if 2.0989642968183564e-27 < k Initial program 4.6
Simplified4.6
rmApplied clear-num_binary64_14414.9
Taylor expanded around 0 4.9
Simplified0.6
Final simplification0.3
herbie shell --seed 2021032
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))