\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{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_1 := t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\\
\mathbf{if}\;\frac{c0}{2 \cdot w} \cdot t_1 \leq 1.3564940205041007 \cdot 10^{+168}:\\
\;\;\;\;\frac{c0 \cdot t_1}{2 \cdot w}\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \left(M \cdot \left(h \cdot M\right)\right)\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 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_1 (+ t_0 (sqrt (- (* t_0 t_0) (* M M))))))
(if (<= (* (/ c0 (* 2.0 w)) t_1) 1.3564940205041007e+168)
(/ (* c0 t_1) (* 2.0 w))
(* 0.25 (* (/ D d) (* (/ D d) (* M (* h M))))))))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 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_1 = t_0 + sqrt(((t_0 * t_0) - (M * M)));
double tmp;
if (((c0 / (2.0 * w)) * t_1) <= 1.3564940205041007e+168) {
tmp = (c0 * t_1) / (2.0 * w);
} else {
tmp = 0.25 * ((D / d) * ((D / d) * (M * (h * M))));
}
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 (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 1.3564940205041007e168Initial program 34.7
Applied associate-*l/_binary6434.5
if 1.3564940205041007e168 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) Initial program 63.7
Taylor expanded in c0 around -inf 34.3
Applied unpow2_binary6434.3
Applied associate-*l*_binary6431.5
Applied add-sqr-sqrt_binary6447.7
Applied unpow-prod-down_binary6447.7
Applied times-frac_binary6445.2
Simplified45.2
Simplified24.9
Applied associate-*r*_binary6420.9
Final simplification22.9
herbie shell --seed 2022127
(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))))))