\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}
t_0 := \left(M \cdot M\right) \cdot h\\
\mathbf{if}\;c0 \leq -1.208739675252761 \cdot 10^{-87}:\\
\;\;\;\;0.25 \cdot \left(t_0 \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{D \cdot D}{d}\\
\mathbf{if}\;c0 \leq 3.803592874752181 \cdot 10^{-271}:\\
\;\;\;\;0.25 \cdot \frac{\left(M \cdot \left(M \cdot h\right)\right) \cdot t_1}{d}\\
\mathbf{elif}\;c0 \leq 1.5768310252267593 \cdot 10^{+165}:\\
\;\;\;\;0.25 \cdot \frac{\left(t_0 \cdot \frac{D}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\right) \cdot \frac{D}{\sqrt[3]{d}}}{d}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(M \cdot M\right) \cdot t_1\right)}{d}\\
\end{array}\\
\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
(let* ((t_0 (* (* M M) h)))
(if (<= c0 -1.208739675252761e-87)
(* 0.25 (* t_0 (* (/ D d) (/ D d))))
(let* ((t_1 (/ (* D D) d)))
(if (<= c0 3.803592874752181e-271)
(* 0.25 (/ (* (* M (* M h)) t_1) d))
(if (<= c0 1.5768310252267593e+165)
(*
0.25
(/ (* (* t_0 (/ D (* (cbrt d) (cbrt d)))) (/ D (cbrt d))) d))
(* 0.25 (/ (* h (* (* M M) t_1)) 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 t_0 = (M * M) * h;
double tmp;
if (c0 <= -1.208739675252761e-87) {
tmp = 0.25 * (t_0 * ((D / d) * (D / d)));
} else {
double t_1 = (D * D) / d;
double tmp_1;
if (c0 <= 3.803592874752181e-271) {
tmp_1 = 0.25 * (((M * (M * h)) * t_1) / d);
} else if (c0 <= 1.5768310252267593e+165) {
tmp_1 = 0.25 * (((t_0 * (D / (cbrt(d) * cbrt(d)))) * (D / cbrt(d))) / d);
} else {
tmp_1 = 0.25 * ((h * ((M * M) * t_1)) / d);
}
tmp = tmp_1;
}
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
Results
if c0 < -1.208739675252761e-87Initial program 60.2
Taylor expanded in c0 around -inf 44.0
Taylor expanded in c0 around 0 36.1
Applied unpow2_binary6436.1
Applied associate-/r*_binary6433.7
Simplified33.1
Applied *-un-lft-identity_binary6433.1
Applied times-frac_binary6433.9
Simplified33.9
Simplified28.9
if -1.208739675252761e-87 < c0 < 3.80359287475218101e-271Initial program 58.8
Taylor expanded in c0 around -inf 37.9
Taylor expanded in c0 around 0 33.3
Applied unpow2_binary6433.3
Applied associate-/r*_binary6431.8
Simplified31.5
Applied associate-*r*_binary6429.8
if 3.80359287475218101e-271 < c0 < 1.57683102522675927e165Initial program 59.2
Taylor expanded in c0 around -inf 39.7
Taylor expanded in c0 around 0 35.6
Applied unpow2_binary6435.6
Applied associate-/r*_binary6432.9
Simplified32.6
Applied add-cube-cbrt_binary6432.6
Applied times-frac_binary6429.5
Applied associate-*r*_binary6428.0
if 1.57683102522675927e165 < c0 Initial program 61.5
Taylor expanded in c0 around -inf 50.0
Taylor expanded in c0 around 0 37.4
Applied unpow2_binary6437.4
Applied associate-/r*_binary6434.1
Simplified33.4
Applied associate-*l*_binary6432.1
Final simplification29.2
herbie shell --seed 2021291
(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))))))