\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 -6.052953150875497 \cdot 10^{+209}:\\
\;\;\;\;0.25 \cdot \frac{e^{\mathsf{fma}\left(2, \log \left(M \cdot D\right), -\log \left(\frac{d}{h}\right)\right)}}{d}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{\left(\left(M \cdot \left(M \cdot h\right)\right) \cdot \frac{D}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D}{\sqrt[3]{d}}}{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 -6.052953150875497e+209)
(* 0.25 (/ (exp (fma 2.0 (log (* M D)) (- (log (/ d h))))) d))
(*
0.25
(/ (* (* (* M (* M h)) (/ D (* (cbrt d) (cbrt d)))) (/ D (cbrt d))) 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 <= -6.052953150875497e+209) {
tmp = 0.25 * (exp(fma(2.0, log(M * D), -log(d / h))) / d);
} else {
tmp = 0.25 * ((((M * (M * h)) * (D / (cbrt(d) * cbrt(d)))) * (D / cbrt(d))) / 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 < -6.05295315087549724e209Initial program 64.0
Taylor expanded in c0 around -inf 64.0
Applied unpow2_binary6464.0
Applied associate-/r*_binary6464.0
Simplified64.0
Applied add-exp-log_binary6464.0
Applied add-exp-log_binary6464.0
Applied add-exp-log_binary6464.0
Applied prod-exp_binary6464.0
Applied div-exp_binary6464.0
Applied add-exp-log_binary6464.0
Applied add-exp-log_binary6464.0
Applied prod-exp_binary6464.0
Applied add-exp-log_binary6464.0
Applied prod-exp_binary6464.0
Applied prod-exp_binary6464.0
Simplified51.4
if -6.05295315087549724e209 < M Initial program 59.3
Taylor expanded in c0 around -inf 35.0
Applied unpow2_binary6435.0
Applied associate-/r*_binary6432.2
Simplified31.6
Applied add-cube-cbrt_binary6431.7
Applied times-frac_binary6428.4
Applied associate-*r*_binary6426.9
Applied associate-*r*_binary6424.3
Simplified24.3
Final simplification25.5
herbie shell --seed 2022055
(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))))))