\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 -2.2465886711858938 \cdot 10^{+169}:\\
\;\;\;\;0.25 \cdot \frac{e^{\mathsf{fma}\left(2, \log \left(M \cdot D\right), \log h\right)}}{{d}^{2}}\\
\mathbf{elif}\;M \leq 1.3600844849868204 \cdot 10^{+138}:\\
\;\;\;\;0.25 \cdot \left(\frac{D}{\sqrt[3]{d} \cdot \sqrt[3]{d}} \cdot \left(\frac{D}{\sqrt[3]{d}} \cdot \frac{h \cdot \left(M \cdot M\right)}{d}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{{D}^{2} \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{d}^{2}}\\
\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 -2.2465886711858938e+169)
(* 0.25 (/ (exp (fma 2.0 (log (* M D)) (log h))) (pow d 2.0)))
(if (<= M 1.3600844849868204e+138)
(*
0.25
(* (/ D (* (cbrt d) (cbrt d))) (* (/ D (cbrt d)) (/ (* h (* M M)) d))))
(* 0.25 (/ (* (pow D 2.0) (* M (* M h))) (pow d 2.0))))))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 <= -2.2465886711858938e+169) {
tmp = 0.25 * (exp(fma(2.0, log(M * D), log(h))) / pow(d, 2.0));
} else if (M <= 1.3600844849868204e+138) {
tmp = 0.25 * ((D / (cbrt(d) * cbrt(d))) * ((D / cbrt(d)) * ((h * (M * M)) / d)));
} else {
tmp = 0.25 * ((pow(D, 2.0) * (M * (M * h))) / pow(d, 2.0));
}
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 < -2.2465886711858938e169Initial program 64.0
Taylor expanded in c0 around -inf 64.0
Taylor expanded in c0 around 0 64.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
Simplified56.1
if -2.2465886711858938e169 < M < 1.3600844849868204e138Initial program 59.0
Taylor expanded in c0 around -inf 38.5
Taylor expanded in c0 around 0 31.1
Applied add-sqr-sqrt_binary6447.5
Applied unpow-prod-down_binary6447.5
Applied times-frac_binary6445.7
Simplified45.7
Simplified27.5
Applied add-cube-cbrt_binary6427.5
Applied times-frac_binary6424.0
Applied associate-*l*_binary6422.4
if 1.3600844849868204e138 < M Initial program 64.0
Taylor expanded in c0 around -inf 61.7
Taylor expanded in c0 around 0 60.8
Applied unpow2_binary6460.8
Applied associate-*l*_binary6449.9
Final simplification26.3
herbie shell --seed 2021225
(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))))))