\left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)
\begin{array}{l}
t_0 := 1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\\
\mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot t_0 \leq \infty:\\
\;\;\;\;\begin{array}{l}
t_1 := \frac{\sqrt[3]{d}}{\sqrt[3]{h}}\\
t_0 \cdot \left(\left(\left|t_1\right| \cdot \sqrt{t_1}\right) \cdot \left({\left(\frac{1}{\sqrt[3]{\ell} \cdot \sqrt[3]{\ell}}\right)}^{0.5} \cdot {\left(\frac{d}{\sqrt[3]{\ell}}\right)}^{0.5}\right)\right)
\end{array}\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt{-\frac{\sqrt[3]{-1}}{\ell}} \cdot \left|\sqrt[3]{-1} \cdot \sqrt[3]{\frac{-d}{h}}\right|\right) \cdot \left(\sqrt[3]{d \cdot d} \cdot {\left(\frac{1}{h}\right)}^{0.16666666666666666}\right)\\
\end{array}
(FPCore (d h l M D) :precision binary64 (* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(FPCore (d h l M D)
:precision binary64
(let* ((t_0 (- 1.0 (* (* 0.5 (pow (/ (* M D) (* d 2.0)) 2.0)) (/ h l)))))
(if (<= (* (* (pow (/ d h) 0.5) (pow (/ d l) 0.5)) t_0) INFINITY)
(let* ((t_1 (/ (cbrt d) (cbrt h))))
(*
t_0
(*
(* (fabs t_1) (sqrt t_1))
(*
(pow (/ 1.0 (* (cbrt l) (cbrt l))) 0.5)
(pow (/ d (cbrt l)) 0.5)))))
(*
(*
(sqrt (- (/ (cbrt -1.0) l)))
(fabs (* (cbrt -1.0) (cbrt (/ (- d) h)))))
(* (cbrt (* d d)) (pow (/ 1.0 h) 0.16666666666666666))))))double code(double d, double h, double l, double M, double D) {
return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
double t_0 = 1.0 - ((0.5 * pow(((M * D) / (d * 2.0)), 2.0)) * (h / l));
double tmp;
if (((pow((d / h), 0.5) * pow((d / l), 0.5)) * t_0) <= ((double) INFINITY)) {
double t_1_1 = cbrt(d) / cbrt(h);
tmp = t_0 * ((fabs(t_1_1) * sqrt(t_1_1)) * (pow((1.0 / (cbrt(l) * cbrt(l))), 0.5) * pow((d / cbrt(l)), 0.5)));
} else {
tmp = (sqrt(-(cbrt(-1.0) / l)) * fabs(cbrt(-1.0) * cbrt(-d / h))) * (cbrt(d * d) * pow((1.0 / h), 0.16666666666666666));
}
return tmp;
}



Bits error versus d



Bits error versus h



Bits error versus l



Bits error versus M



Bits error versus D
Results
if (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) < +inf.0Initial program 19.2
Applied add-cube-cbrt_binary6419.5
Applied add-cube-cbrt_binary6419.7
Applied times-frac_binary6419.7
Applied unpow-prod-down_binary6413.0
Simplified12.3
Simplified12.3
Applied add-cube-cbrt_binary6412.4
Applied *-un-lft-identity_binary6412.4
Applied times-frac_binary6412.4
Applied unpow-prod-down_binary648.3
if +inf.0 < (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))) Initial program 64.0
Applied add-cube-cbrt_binary6464.0
Applied add-cube-cbrt_binary6464.0
Applied times-frac_binary6464.0
Applied unpow-prod-down_binary6464.0
Simplified64.0
Simplified64.0
Taylor expanded in d around -inf 63.6
Simplified58.5
Final simplification16.5
herbie shell --seed 2022077
(FPCore (d h l M D)
:name "Henrywood and Agarwal, Equation (12)"
:precision binary64
(* (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0))) (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))