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



Bits error versus a



Bits error versus k



Bits error versus m
Results
if k < 5.95740836316349033e156Initial program 0.2
Simplified0.1
if 5.95740836316349033e156 < k Initial program 11.8
Simplified11.8
rmApplied clear-num_binary64_179811.8
rmApplied *-un-lft-identity_binary64_179911.8
Applied times-frac_binary64_180511.8
Taylor expanded around inf 11.8
Simplified0.4
Final simplification0.2
herbie shell --seed 2020288
(FPCore (a k m)
:name "Falkner and Boettcher, Appendix A"
:precision binary64
(/ (* a (pow k m)) (+ (+ 1.0 (* 10.0 k)) (* k k))))