\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\begin{array}{l}
\mathbf{if}\;M \leq -1.360662088649393 \cdot 10^{+154}:\\
\;\;\;\;0.25 \cdot e^{\mathsf{fma}\left(2, \log \left(M \cdot D\right), \mathsf{fma}\left(\log d, -2, \log h\right)\right)}\\
\mathbf{elif}\;M \leq 7.0868357241638995 \cdot 10^{+140}:\\
\;\;\;\;\left(0.25 \cdot \left(D \cdot \frac{D}{d}\right)\right) \cdot \frac{h \cdot {M}^{2}}{d}\\
\mathbf{else}:\\
\;\;\;\;\left(0.25 \cdot \frac{{D}^{2}}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{d}\\
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(*
(/ c0 (* 2.0 w))
(+
(/ (* c0 (* d d)) (* (* w h) (* D D)))
(sqrt
(-
(*
(/ (* c0 (* d d)) (* (* w h) (* D D)))
(/ (* c0 (* d d)) (* (* w h) (* D D))))
(* M M))))))(FPCore (c0 w h D d M)
:precision binary64
(if (<= M -1.360662088649393e+154)
(* 0.25 (exp (fma 2.0 (log (* M D)) (fma (log d) -2.0 (log h)))))
(if (<= M 7.0868357241638995e+140)
(* (* 0.25 (* D (/ D d))) (/ (* h (pow M 2.0)) d))
(* (* 0.25 (/ (pow D 2.0) d)) (/ (* M (* M h)) d)))))double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M)));
}
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if (M <= -1.360662088649393e+154) {
tmp = 0.25 * exp(fma(2.0, log(M * D), fma(log(d), -2.0, log(h))));
} else if (M <= 7.0868357241638995e+140) {
tmp = (0.25 * (D * (D / d))) * ((h * pow(M, 2.0)) / d);
} else {
tmp = (0.25 * (pow(D, 2.0) / d)) * ((M * (M * h)) / d);
}
return tmp;
}



Bits error versus c0



Bits error versus w



Bits error versus h



Bits error versus D



Bits error versus d



Bits error versus M
if M < -1.3606620886493931e154Initial program 64.0
Taylor expanded in c0 around -inf 64.0
Taylor expanded in c0 around 0 64.0
Applied pow-to-exp_binary6464.0
Applied add-exp-log_binary6464.0
Applied pow-to-exp_binary6464.0
Applied prod-exp_binary6464.0
Applied pow-to-exp_binary6464.0
Applied prod-exp_binary6464.0
Applied div-exp_binary6464.0
Simplified58.2
if -1.3606620886493931e154 < M < 7.0868357241638995e140Initial program 58.8
Taylor expanded in c0 around -inf 38.5
Taylor expanded in c0 around 0 31.1
Applied unpow2_binary6431.1
Applied times-frac_binary6427.3
Applied associate-*r*_binary6427.3
Applied *-un-lft-identity_binary6427.3
Applied add-sqr-sqrt_binary6446.4
Applied unpow-prod-down_binary6446.4
Applied times-frac_binary6444.5
Simplified44.5
Simplified23.9
if 7.0868357241638995e140 < M Initial program 64.0
Taylor expanded in c0 around -inf 62.6
Taylor expanded in c0 around 0 61.6
Applied unpow2_binary6461.6
Applied times-frac_binary6461.3
Applied associate-*r*_binary6461.3
Applied sqr-pow_binary6461.3
Applied associate-*l*_binary6449.8
Simplified49.8
Final simplification28.5
herbie shell --seed 2022076
(FPCore (c0 w h D d M)
:name "Henrywood and Agarwal, Equation (13)"
:precision binary64
(* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))