\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 := \frac{D}{\sqrt[3]{d} \cdot \sqrt[3]{d}}\\
\mathbf{if}\;M \leq -3.6081226175982936 \cdot 10^{+174} \lor \neg \left(M \leq 2.071342702714757 \cdot 10^{+76}\right):\\
\;\;\;\;0.25 \cdot \left(t_0 \cdot \left(\frac{D}{\sqrt[3]{d}} \cdot \frac{M \cdot \left(M \cdot h\right)}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(t_0 \cdot \left(\left(h \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\sqrt[3]{d}}\right)\right)\\
\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 (/ D (* (cbrt d) (cbrt d)))))
(if (or (<= M -3.6081226175982936e+174) (not (<= M 2.071342702714757e+76)))
(* 0.25 (* t_0 (* (/ D (cbrt d)) (/ (* M (* M h)) d))))
(* 0.25 (* t_0 (* (* h (/ D d)) (/ (* M M) (cbrt 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 = D / (cbrt(d) * cbrt(d));
double tmp;
if ((M <= -3.6081226175982936e+174) || !(M <= 2.071342702714757e+76)) {
tmp = 0.25 * (t_0 * ((D / cbrt(d)) * ((M * (M * h)) / d)));
} else {
tmp = 0.25 * (t_0 * ((h * (D / d)) * ((M * M) / cbrt(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
Results
if M < -3.6081226175982936e174 or 2.07134270271475704e76 < M Initial program 63.7
Taylor expanded in c0 around -inf 57.3
Applied add-sqr-sqrt_binary6460.9
Applied unpow-prod-down_binary6460.9
Applied times-frac_binary6460.4
Simplified60.4
Simplified56.3
Applied add-cube-cbrt_binary6456.3
Applied times-frac_binary6455.5
Applied associate-*l*_binary6454.4
Applied associate-*r*_binary6442.1
if -3.6081226175982936e174 < M < 2.07134270271475704e76Initial program 58.9
Taylor expanded in c0 around -inf 31.2
Applied add-sqr-sqrt_binary6447.4
Applied unpow-prod-down_binary6447.4
Applied times-frac_binary6445.6
Simplified45.6
Simplified27.6
Applied add-cube-cbrt_binary6427.6
Applied times-frac_binary6424.3
Applied associate-*l*_binary6422.8
Applied add-cube-cbrt_binary6422.9
Applied times-frac_binary6422.7
Applied associate-*r*_binary6421.8
Simplified20.8
Final simplification24.5
herbie shell --seed 2021329
(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))))))