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



Bits error versus a



Bits error versus k



Bits error versus m
Results
if k < 4.1034082139038655e147Initial program 0.1
Simplified0.1
if 4.1034082139038655e147 < k Initial program 9.9
rmApplied clear-num_binary64_21239.9
Simplified9.9
Taylor expanded around inf 9.9
Simplified0.4
rmApplied div-inv_binary64_21210.4
Applied div-inv_binary64_21210.4
Applied distribute-rgt-out_binary64_20770.4
Applied associate-*r*_binary64_20640.4
Simplified0.4
Final simplification0.1
herbie shell --seed 2020346
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))