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



Bits error versus a



Bits error versus k



Bits error versus m
Results
if k < 4.1034082139038655e147Initial program 0.1
if 4.1034082139038655e147 < k Initial program 9.9
Simplified9.9
rmApplied clear-num_binary64_21239.9
Taylor expanded around inf 9.9
Simplified0.4
Final simplification0.2
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))))