\frac{a \cdot {k}^{m}}{\left(1 + 10 \cdot k\right) + k \cdot k}\begin{array}{l}
\mathbf{if}\;k \le 8.31726067928948193 \cdot 10^{150}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(k, k, \mathsf{fma}\left(10, k, 1\right)\right)} \cdot \left(a \cdot {k}^{m}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{k}, \frac{a}{k}, 99 \cdot \frac{a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{{k}^{4}} - 10 \cdot \frac{a \cdot e^{-1 \cdot \left(m \cdot \log \left(\frac{1}{k}\right)\right)}}{{k}^{3}}\right)\\
\end{array}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 temp;
if ((k <= 8.317260679289482e+150)) {
temp = ((1.0 / fma(k, k, fma(10.0, k, 1.0))) * (a * pow(k, m)));
} else {
temp = fma((exp((-1.0 * (m * log((1.0 / k))))) / k), (a / k), ((99.0 * ((a * exp((-1.0 * (m * log((1.0 / k)))))) / pow(k, 4.0))) - (10.0 * ((a * exp((-1.0 * (m * log((1.0 / k)))))) / pow(k, 3.0)))));
}
return temp;
}



Bits error versus a



Bits error versus k



Bits error versus m
Results
if k < 8.317260679289482e+150Initial program 0.1
rmApplied associate-/l*0.1
rmApplied div-inv0.1
Applied *-un-lft-identity0.1
Applied times-frac0.1
Simplified0.1
Simplified0.1
if 8.317260679289482e+150 < k Initial program 11.3
Taylor expanded around inf 11.3
Simplified0.2
Final simplification0.1
herbie shell --seed 2020057 +o rules:numerics
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1 (* 10 k)) (* k k))))