?

Average Error: 25.8 → 19.7
Time: 29.5s
Precision: binary64
Cost: 90380

?

\[\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 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_1 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ t_2 := {\left(\frac{d}{\ell}\right)}^{0.5}\\ t_3 := \left(t_0 \cdot t_2\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_4 := t_0 \cdot \left(t_2 - \left(0 - \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \left(t_2 \cdot -0.5\right)\right)\right)\right)\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{-205}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq 10^{+264}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \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 (pow (/ d h) 0.5))
        (t_1 (* (sqrt (/ 1.0 (* l h))) d))
        (t_2 (pow (/ d l) 0.5))
        (t_3
         (*
          (* t_0 t_2)
          (- 1.0 (* (* 0.5 (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
        (t_4
         (*
          t_0
          (-
           t_2
           (-
            0.0
            (* (/ h l) (* (pow (/ (* M D) (+ d d)) 2.0) (* t_2 -0.5))))))))
   (if (<= t_3 -5e-205)
     t_4
     (if (<= t_3 0.0) t_1 (if (<= t_3 1e+264) t_4 t_1)))))
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 = pow((d / h), 0.5);
	double t_1 = sqrt((1.0 / (l * h))) * d;
	double t_2 = pow((d / l), 0.5);
	double t_3 = (t_0 * t_2) * (1.0 - ((0.5 * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double t_4 = t_0 * (t_2 - (0.0 - ((h / l) * (pow(((M * D) / (d + d)), 2.0) * (t_2 * -0.5)))));
	double tmp;
	if (t_3 <= -5e-205) {
		tmp = t_4;
	} else if (t_3 <= 0.0) {
		tmp = t_1;
	} else if (t_3 <= 1e+264) {
		tmp = t_4;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_0 = (d / h) ** 0.5d0
    t_1 = sqrt((1.0d0 / (l * h))) * d
    t_2 = (d / l) ** 0.5d0
    t_3 = (t_0 * t_2) * (1.0d0 - ((0.5d0 * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
    t_4 = t_0 * (t_2 - (0.0d0 - ((h / l) * ((((m * d_1) / (d + d)) ** 2.0d0) * (t_2 * (-0.5d0))))))
    if (t_3 <= (-5d-205)) then
        tmp = t_4
    else if (t_3 <= 0.0d0) then
        tmp = t_1
    else if (t_3 <= 1d+264) then
        tmp = t_4
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.pow((d / h), 0.5);
	double t_1 = Math.sqrt((1.0 / (l * h))) * d;
	double t_2 = Math.pow((d / l), 0.5);
	double t_3 = (t_0 * t_2) * (1.0 - ((0.5 * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
	double t_4 = t_0 * (t_2 - (0.0 - ((h / l) * (Math.pow(((M * D) / (d + d)), 2.0) * (t_2 * -0.5)))));
	double tmp;
	if (t_3 <= -5e-205) {
		tmp = t_4;
	} else if (t_3 <= 0.0) {
		tmp = t_1;
	} else if (t_3 <= 1e+264) {
		tmp = t_4;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(d, h, l, M, D):
	return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
def code(d, h, l, M, D):
	t_0 = math.pow((d / h), 0.5)
	t_1 = math.sqrt((1.0 / (l * h))) * d
	t_2 = math.pow((d / l), 0.5)
	t_3 = (t_0 * t_2) * (1.0 - ((0.5 * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
	t_4 = t_0 * (t_2 - (0.0 - ((h / l) * (math.pow(((M * D) / (d + d)), 2.0) * (t_2 * -0.5)))))
	tmp = 0
	if t_3 <= -5e-205:
		tmp = t_4
	elif t_3 <= 0.0:
		tmp = t_1
	elif t_3 <= 1e+264:
		tmp = t_4
	else:
		tmp = t_1
	return tmp
function code(d, h, l, M, D)
	return Float64(Float64((Float64(d / h) ^ Float64(1.0 / 2.0)) * (Float64(d / l) ^ Float64(1.0 / 2.0))) * Float64(1.0 - Float64(Float64(Float64(1.0 / 2.0) * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
end
function code(d, h, l, M, D)
	t_0 = Float64(d / h) ^ 0.5
	t_1 = Float64(sqrt(Float64(1.0 / Float64(l * h))) * d)
	t_2 = Float64(d / l) ^ 0.5
	t_3 = Float64(Float64(t_0 * t_2) * Float64(1.0 - Float64(Float64(0.5 * (Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0)) * Float64(h / l))))
	t_4 = Float64(t_0 * Float64(t_2 - Float64(0.0 - Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d + d)) ^ 2.0) * Float64(t_2 * -0.5))))))
	tmp = 0.0
	if (t_3 <= -5e-205)
		tmp = t_4;
	elseif (t_3 <= 0.0)
		tmp = t_1;
	elseif (t_3 <= 1e+264)
		tmp = t_4;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp = code(d, h, l, M, D)
	tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = (d / h) ^ 0.5;
	t_1 = sqrt((1.0 / (l * h))) * d;
	t_2 = (d / l) ^ 0.5;
	t_3 = (t_0 * t_2) * (1.0 - ((0.5 * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
	t_4 = t_0 * (t_2 - (0.0 - ((h / l) * ((((M * D) / (d + d)) ^ 2.0) * (t_2 * -0.5)))));
	tmp = 0.0;
	if (t_3 <= -5e-205)
		tmp = t_4;
	elseif (t_3 <= 0.0)
		tmp = t_1;
	elseif (t_3 <= 1e+264)
		tmp = t_4;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$1 = N[(N[Sqrt[N[(1.0 / N[(l * h), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * d), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$0 * t$95$2), $MachinePrecision] * N[(1.0 - N[(N[(0.5 * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 * N[(t$95$2 - N[(0.0 - N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d + d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(t$95$2 * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-205], t$95$4, If[LessEqual[t$95$3, 0.0], t$95$1, If[LessEqual[t$95$3, 1e+264], t$95$4, t$95$1]]]]]]]]
\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 := {\left(\frac{d}{h}\right)}^{0.5}\\
t_1 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\
t_2 := {\left(\frac{d}{\ell}\right)}^{0.5}\\
t_3 := \left(t_0 \cdot t_2\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\
t_4 := t_0 \cdot \left(t_2 - \left(0 - \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \left(t_2 \cdot -0.5\right)\right)\right)\right)\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-205}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;t_3 \leq 0:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_3 \leq 10^{+264}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. 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)))) < -5.00000000000000001e-205 or 0.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)))) < 1.00000000000000004e264

    1. Initial program 8.4

      \[\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) \]
    2. Simplified8.6

      \[\leadsto \color{blue}{{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} \]
      Proof

      [Start]8.4

      \[ \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) \]

      rational_best_45_simplify-91 [=>]8.4

      \[ \color{blue}{\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]

      rational_best_45_simplify-25 [=>]8.6

      \[ \color{blue}{{\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right)} \]

      metadata-eval [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \cdot \left(\left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \cdot {\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\right)}\right) \]

      rational_best_45_simplify-91 [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{0.5} \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{\left(\frac{1}{2}\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)\right)} \]

      metadata-eval [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}} \cdot \left(1 - \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\right) \]

      rational_best_45_simplify-91 [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{h}{\ell} \cdot \left(\frac{1}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}\right)\right) \]

      rational_best_45_simplify-25 [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{\frac{1}{2} \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)}\right)\right) \]

      metadata-eval [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - \color{blue}{0.5} \cdot \left(\frac{h}{\ell} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right)\right)\right) \]

      rational_best_45_simplify-91 [=>]8.6

      \[ {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(1 - 0.5 \cdot \color{blue}{\left({\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\right)}\right)\right) \]
    3. Applied egg-rr11.8

      \[\leadsto {\left(\frac{d}{h}\right)}^{0.5} \cdot \color{blue}{\left({\left(\frac{d}{\ell}\right)}^{0.5} - {\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\right)\right)} \]
    4. Applied egg-rr8.4

      \[\leadsto {\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} - \color{blue}{\left(0 - \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot -0.5\right)\right)\right)}\right) \]

    if -5.00000000000000001e-205 < (*.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)))) < 0.0 or 1.00000000000000004e264 < (*.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))))

    1. Initial program 56.7

      \[\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) \]
    2. Simplified56.7

      \[\leadsto \color{blue}{\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)} \]
      Proof

      [Start]56.7

      \[ \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) \]

      metadata-eval [=>]56.7

      \[ \left({\left(\frac{d}{h}\right)}^{\color{blue}{0.5}} \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) \]

      metadata-eval [=>]56.7

      \[ \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{\color{blue}{0.5}}\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) \]

      metadata-eval [=>]56.7

      \[ \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(\color{blue}{0.5} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]

      rational_best_45_simplify-91 [=>]56.7

      \[ \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{\color{blue}{d \cdot 2}}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Taylor expanded in d around inf 39.9

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification19.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq -5 \cdot 10^{-205}:\\ \;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} - \left(0 - \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot -0.5\right)\right)\right)\right)\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 0:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \leq 10^{+264}:\\ \;\;\;\;{\left(\frac{d}{h}\right)}^{0.5} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} - \left(0 - \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot -0.5\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \end{array} \]

Alternatives

Alternative 1
Error19.7
Cost83660
\[\begin{array}{l} t_0 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_1 := {\left(\frac{d}{\ell}\right)}^{0.5}\\ t_2 := t_0 \cdot t_1\\ t_3 := t_2 \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ t_4 := \sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{-205}:\\ \;\;\;\;t_2 \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_3 \leq 10^{+264}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M \cdot D}{d + d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 2
Error25.6
Cost20996
\[\begin{array}{l} \mathbf{if}\;\ell \leq 2.7 \cdot 10^{+231}:\\ \;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \left(0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right) \cdot \frac{h}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;\sqrt{\frac{1}{\ell \cdot h}} \cdot d\\ \end{array} \]
Alternative 3
Error29.2
Cost13576
\[\begin{array}{l} t_0 := \frac{1}{\ell \cdot h}\\ t_1 := {\left(\frac{d}{h}\right)}^{0.5} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;h \leq 1.35 \cdot 10^{-239}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq 5 \cdot 10^{+64}:\\ \;\;\;\;\sqrt{t_0 \cdot \left(t_0 \cdot \frac{1}{t_0 \cdot \left(t_0 \cdot \frac{1}{t_0}\right)}\right)} \cdot d\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error43.8
Cost6848
\[\sqrt{\frac{1}{\ell \cdot h}} \cdot d \]

Error

Reproduce?

herbie shell --seed 2023098 
(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)))))