?

Average Error: 27.0 → 13.7
Time: 44.3s
Precision: binary64
Cost: 104529

?

\[\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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_3 := \left(t_2 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot t_0\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_1 \cdot \frac{D \cdot \frac{M}{d}}{\frac{\ell \cdot -8}{\frac{M}{d} \cdot \left(h \cdot D\right)}}\right)\\ \mathbf{elif}\;t_3 \leq -1 \cdot 10^{-247} \lor \neg \left(t_3 \leq 10^{-151}\right) \land t_3 \leq 4 \cdot 10^{+280}:\\ \;\;\;\;t_0 \cdot \left(t_2 \cdot t_1\right)\\ \mathbf{else}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\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 (* (/ h l) (* (pow (/ (* M D) (* d 2.0)) 2.0) -0.5))))
        (t_1 (sqrt (/ d l)))
        (t_2 (pow (/ d h) 0.5))
        (t_3 (* (* t_2 (pow (/ d l) 0.5)) t_0)))
   (if (<= t_3 (- INFINITY))
     (*
      (sqrt (/ d h))
      (* t_1 (/ (* D (/ M d)) (/ (* l -8.0) (* (/ M d) (* h D))))))
     (if (or (<= t_3 -1e-247) (and (not (<= t_3 1e-151)) (<= t_3 4e+280)))
       (* t_0 (* t_2 t_1))
       (fabs (* d (pow (* h l) -0.5)))))))
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 + ((h / l) * (pow(((M * D) / (d * 2.0)), 2.0) * -0.5));
	double t_1 = sqrt((d / l));
	double t_2 = pow((d / h), 0.5);
	double t_3 = (t_2 * pow((d / l), 0.5)) * t_0;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = sqrt((d / h)) * (t_1 * ((D * (M / d)) / ((l * -8.0) / ((M / d) * (h * D)))));
	} else if ((t_3 <= -1e-247) || (!(t_3 <= 1e-151) && (t_3 <= 4e+280))) {
		tmp = t_0 * (t_2 * t_1);
	} else {
		tmp = fabs((d * pow((h * l), -0.5)));
	}
	return tmp;
}
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 = 1.0 + ((h / l) * (Math.pow(((M * D) / (d * 2.0)), 2.0) * -0.5));
	double t_1 = Math.sqrt((d / l));
	double t_2 = Math.pow((d / h), 0.5);
	double t_3 = (t_2 * Math.pow((d / l), 0.5)) * t_0;
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.sqrt((d / h)) * (t_1 * ((D * (M / d)) / ((l * -8.0) / ((M / d) * (h * D)))));
	} else if ((t_3 <= -1e-247) || (!(t_3 <= 1e-151) && (t_3 <= 4e+280))) {
		tmp = t_0 * (t_2 * t_1);
	} else {
		tmp = Math.abs((d * Math.pow((h * l), -0.5)));
	}
	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 = 1.0 + ((h / l) * (math.pow(((M * D) / (d * 2.0)), 2.0) * -0.5))
	t_1 = math.sqrt((d / l))
	t_2 = math.pow((d / h), 0.5)
	t_3 = (t_2 * math.pow((d / l), 0.5)) * t_0
	tmp = 0
	if t_3 <= -math.inf:
		tmp = math.sqrt((d / h)) * (t_1 * ((D * (M / d)) / ((l * -8.0) / ((M / d) * (h * D)))))
	elif (t_3 <= -1e-247) or (not (t_3 <= 1e-151) and (t_3 <= 4e+280)):
		tmp = t_0 * (t_2 * t_1)
	else:
		tmp = math.fabs((d * math.pow((h * l), -0.5)))
	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(1.0 + Float64(Float64(h / l) * Float64((Float64(Float64(M * D) / Float64(d * 2.0)) ^ 2.0) * -0.5)))
	t_1 = sqrt(Float64(d / l))
	t_2 = Float64(d / h) ^ 0.5
	t_3 = Float64(Float64(t_2 * (Float64(d / l) ^ 0.5)) * t_0)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(sqrt(Float64(d / h)) * Float64(t_1 * Float64(Float64(D * Float64(M / d)) / Float64(Float64(l * -8.0) / Float64(Float64(M / d) * Float64(h * D))))));
	elseif ((t_3 <= -1e-247) || (!(t_3 <= 1e-151) && (t_3 <= 4e+280)))
		tmp = Float64(t_0 * Float64(t_2 * t_1));
	else
		tmp = abs(Float64(d * (Float64(h * l) ^ -0.5)));
	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 = 1.0 + ((h / l) * ((((M * D) / (d * 2.0)) ^ 2.0) * -0.5));
	t_1 = sqrt((d / l));
	t_2 = (d / h) ^ 0.5;
	t_3 = (t_2 * ((d / l) ^ 0.5)) * t_0;
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = sqrt((d / h)) * (t_1 * ((D * (M / d)) / ((l * -8.0) / ((M / d) * (h * D)))));
	elseif ((t_3 <= -1e-247) || (~((t_3 <= 1e-151)) && (t_3 <= 4e+280)))
		tmp = t_0 * (t_2 * t_1);
	else
		tmp = abs((d * ((h * l) ^ -0.5)));
	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[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(d * 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$1 * N[(N[(D * N[(M / d), $MachinePrecision]), $MachinePrecision] / N[(N[(l * -8.0), $MachinePrecision] / N[(N[(M / d), $MachinePrecision] * N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$3, -1e-247], And[N[Not[LessEqual[t$95$3, 1e-151]], $MachinePrecision], LessEqual[t$95$3, 4e+280]]], N[(t$95$0 * N[(t$95$2 * t$95$1), $MachinePrecision]), $MachinePrecision], N[Abs[N[(d * N[Power[N[(h * l), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]]
\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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\\
t_1 := \sqrt{\frac{d}{\ell}}\\
t_2 := {\left(\frac{d}{h}\right)}^{0.5}\\
t_3 := \left(t_2 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot t_0\\
\mathbf{if}\;t_3 \leq -\infty:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_1 \cdot \frac{D \cdot \frac{M}{d}}{\frac{\ell \cdot -8}{\frac{M}{d} \cdot \left(h \cdot D\right)}}\right)\\

\mathbf{elif}\;t_3 \leq -1 \cdot 10^{-247} \lor \neg \left(t_3 \leq 10^{-151}\right) \land t_3 \leq 4 \cdot 10^{+280}:\\
\;\;\;\;t_0 \cdot \left(t_2 \cdot t_1\right)\\

\mathbf{else}:\\
\;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 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)))) < -inf.0

    1. Initial program 64.0

      \[\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. Simplified62.0

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

      [Start]64.0

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

      associate-*l* [=>]64.0

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

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

      unpow1/2 [=>]64.0

      \[ \color{blue}{\sqrt{\frac{d}{h}}} \cdot \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 [=>]64.0

      \[ \sqrt{\frac{d}{h}} \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) \]

      unpow1/2 [=>]64.0

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

      cancel-sign-sub-inv [=>]64.0

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

      +-commutative [=>]64.0

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

      *-commutative [=>]64.0

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

      distribute-rgt-neg-in [=>]64.0

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

      associate-*l* [=>]64.0

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

      fma-def [=>]64.0

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

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(-0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)}\right) \]
    4. Simplified58.9

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\left(\left(\left(\left(D \cdot \frac{M}{d}\right) \cdot \left(D \cdot \frac{M}{d}\right)\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)}\right) \]
      Proof

      [Start]59.9

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(-0.125 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2} \cdot \ell}\right)\right) \]

      *-commutative [=>]59.9

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

      associate-*l/ [=>]59.9

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

      times-frac [=>]60.8

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

      associate-*r* [=>]61.1

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

      associate-/l* [=>]61.0

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

      associate-/r/ [=>]63.1

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

      unpow2 [=>]63.1

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

      *-commutative [=>]63.1

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

      unpow2 [=>]63.1

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

      unpow2 [=>]63.1

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\frac{\left(M \cdot M\right) \cdot \color{blue}{\left(D \cdot D\right)}}{d \cdot d} \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      swap-sqr [<=]61.3

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\frac{\color{blue}{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}}{d \cdot d} \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      times-frac [=>]59.6

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\color{blue}{\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{d}\right)} \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      associate-/l* [=>]59.7

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\left(\color{blue}{\frac{M}{\frac{d}{D}}} \cdot \frac{M \cdot D}{d}\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      associate-/r/ [=>]59.6

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\left(\color{blue}{\left(\frac{M}{d} \cdot D\right)} \cdot \frac{M \cdot D}{d}\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      *-commutative [=>]59.6

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\left(\color{blue}{\left(D \cdot \frac{M}{d}\right)} \cdot \frac{M \cdot D}{d}\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      associate-/l* [=>]59.1

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\left(\left(D \cdot \frac{M}{d}\right) \cdot \color{blue}{\frac{M}{\frac{d}{D}}}\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      associate-/r/ [=>]58.9

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\left(\left(D \cdot \frac{M}{d}\right) \cdot \color{blue}{\left(\frac{M}{d} \cdot D\right)}\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]

      *-commutative [=>]58.9

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(\left(\left(\left(D \cdot \frac{M}{d}\right) \cdot \color{blue}{\left(D \cdot \frac{M}{d}\right)}\right) \cdot h\right) \cdot \frac{-0.125}{\ell}\right)\right) \]
    5. Applied egg-rr43.8

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\frac{D \cdot \frac{M}{d}}{\frac{\ell \cdot -8}{\frac{M}{d} \cdot \left(D \cdot h\right)}}}\right) \]

    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)))) < -1e-247 or 9.9999999999999994e-152 < (*.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)))) < 4.0000000000000001e280

    1. Initial program 0.8

      \[\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. Applied egg-rr29.0

      \[\leadsto \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)} - 1\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) \]
    3. Simplified0.8

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

      [Start]29.0

      \[ \left({\left(\frac{d}{h}\right)}^{\left(\frac{1}{2}\right)} \cdot \left(e^{\mathsf{log1p}\left(\sqrt{\frac{d}{\ell}}\right)} - 1\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) \]

      expm1-def [=>]2.9

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

      expm1-log1p [=>]0.8

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

    if -1e-247 < (*.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)))) < 9.9999999999999994e-152 or 4.0000000000000001e280 < (*.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 51.9

      \[\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. Simplified52.1

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

      [Start]51.9

      \[ \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 [=>]51.9

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

      unpow1/2 [=>]51.9

      \[ \left(\color{blue}{\sqrt{\frac{d}{h}}} \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 [=>]51.9

      \[ \left(\sqrt{\frac{d}{h}} \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) \]

      unpow1/2 [=>]51.9

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

      associate-*l* [=>]51.9

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

      metadata-eval [=>]51.9

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

      times-frac [=>]52.1

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

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    4. Simplified41.2

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
      Proof

      [Start]41.3

      \[ \sqrt{\frac{1}{\ell \cdot h}} \cdot d \]

      *-commutative [=>]41.3

      \[ \color{blue}{d \cdot \sqrt{\frac{1}{\ell \cdot h}}} \]

      associate-/r* [=>]41.2

      \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{\ell}}{h}}} \]
    5. Applied egg-rr45.1

      \[\leadsto d \cdot \color{blue}{{\left({\left(\frac{1}{\ell \cdot h}\right)}^{1.5}\right)}^{0.3333333333333333}} \]
    6. Taylor expanded in l around 0 48.5

      \[\leadsto d \cdot {\color{blue}{\left(e^{1.5 \cdot \left(-1 \cdot \log \ell + \log \left(\frac{1}{h}\right)\right)}\right)}}^{0.3333333333333333} \]
    7. Simplified45.1

      \[\leadsto d \cdot {\color{blue}{\left({\left(\ell \cdot h\right)}^{-1.5}\right)}}^{0.3333333333333333} \]
      Proof

      [Start]48.5

      \[ d \cdot {\left(e^{1.5 \cdot \left(-1 \cdot \log \ell + \log \left(\frac{1}{h}\right)\right)}\right)}^{0.3333333333333333} \]

      distribute-lft-in [=>]48.5

      \[ d \cdot {\left(e^{\color{blue}{1.5 \cdot \left(-1 \cdot \log \ell\right) + 1.5 \cdot \log \left(\frac{1}{h}\right)}}\right)}^{0.3333333333333333} \]

      associate-*r* [=>]48.5

      \[ d \cdot {\left(e^{\color{blue}{\left(1.5 \cdot -1\right) \cdot \log \ell} + 1.5 \cdot \log \left(\frac{1}{h}\right)}\right)}^{0.3333333333333333} \]

      metadata-eval [=>]48.5

      \[ d \cdot {\left(e^{\color{blue}{-1.5} \cdot \log \ell + 1.5 \cdot \log \left(\frac{1}{h}\right)}\right)}^{0.3333333333333333} \]

      log-rec [=>]48.5

      \[ d \cdot {\left(e^{-1.5 \cdot \log \ell + 1.5 \cdot \color{blue}{\left(-\log h\right)}}\right)}^{0.3333333333333333} \]

      mul-1-neg [<=]48.5

      \[ d \cdot {\left(e^{-1.5 \cdot \log \ell + 1.5 \cdot \color{blue}{\left(-1 \cdot \log h\right)}}\right)}^{0.3333333333333333} \]

      associate-*r* [=>]48.5

      \[ d \cdot {\left(e^{-1.5 \cdot \log \ell + \color{blue}{\left(1.5 \cdot -1\right) \cdot \log h}}\right)}^{0.3333333333333333} \]

      metadata-eval [=>]48.5

      \[ d \cdot {\left(e^{-1.5 \cdot \log \ell + \color{blue}{-1.5} \cdot \log h}\right)}^{0.3333333333333333} \]

      distribute-lft-in [<=]48.5

      \[ d \cdot {\left(e^{\color{blue}{-1.5 \cdot \left(\log \ell + \log h\right)}}\right)}^{0.3333333333333333} \]

      log-prod [<=]45.1

      \[ d \cdot {\left(e^{-1.5 \cdot \color{blue}{\log \left(\ell \cdot h\right)}}\right)}^{0.3333333333333333} \]

      log-pow [<=]45.0

      \[ d \cdot {\left(e^{\color{blue}{\log \left({\left(\ell \cdot h\right)}^{-1.5}\right)}}\right)}^{0.3333333333333333} \]

      rem-exp-log [=>]45.1

      \[ d \cdot {\color{blue}{\left({\left(\ell \cdot h\right)}^{-1.5}\right)}}^{0.3333333333333333} \]
    8. Applied egg-rr23.9

      \[\leadsto \color{blue}{\left|{\left(\ell \cdot h\right)}^{-0.5} \cdot d\right|} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification13.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 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \leq -\infty:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{D \cdot \frac{M}{d}}{\frac{\ell \cdot -8}{\frac{M}{d} \cdot \left(h \cdot D\right)}}\right)\\ \mathbf{elif}\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \leq -1 \cdot 10^{-247} \lor \neg \left(\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \leq 10^{-151}\right) \land \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \leq 4 \cdot 10^{+280}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \end{array} \]

Alternatives

Alternative 1
Error13.8
Cost96461
\[\begin{array}{l} t_0 := {\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\\ t_1 := t_0 \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right)\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{-247} \lor \neg \left(t_1 \leq 10^{-151}\right) \land t_1 \leq 4 \cdot 10^{+280}:\\ \;\;\;\;t_0 \cdot \left(1 - {\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(0.5 \cdot \frac{M \cdot D}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \end{array} \]
Alternative 2
Error21.5
Cost21665
\[\begin{array}{l} t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\ t_1 := \frac{h}{\ell} \cdot -0.5\\ t_2 := \left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ t_3 := \sqrt{\frac{d}{h}}\\ t_4 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;h \leq -1 \cdot 10^{+273}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq -1.35 \cdot 10^{+143}:\\ \;\;\;\;\left(1 + {\left(\frac{M \cdot D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.125\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -0.2:\\ \;\;\;\;\left(t_3 \cdot t_4\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right)\\ \mathbf{elif}\;h \leq -1.15 \cdot 10^{-103}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq -1.1 \cdot 10^{-197}:\\ \;\;\;\;t_3 \cdot \left(t_4 \cdot \left(1 + {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot t_1\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq 6 \cdot 10^{+194} \lor \neg \left(h \leq 1.45 \cdot 10^{+270}\right):\\ \;\;\;\;\left(1 + t_0 \cdot t_1\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 3
Error21.5
Cost21665
\[\begin{array}{l} t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\ t_1 := \left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ t_2 := \sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;h \leq -4.8 \cdot 10^{+273}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq -1.7 \cdot 10^{+143}:\\ \;\;\;\;\left(1 + {\left(\frac{M \cdot D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.125\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -2.7:\\ \;\;\;\;t_2 \cdot \left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right)\\ \mathbf{elif}\;h \leq -2.25 \cdot 10^{-101}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -9.5 \cdot 10^{-198}:\\ \;\;\;\;t_2 \cdot \left(1 + -0.5 \cdot \frac{t_0}{\frac{\ell}{h}}\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq 3.3 \cdot 10^{+194} \lor \neg \left(h \leq 3.4 \cdot 10^{+276}\right):\\ \;\;\;\;\left(1 + t_0 \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 4
Error22.6
Cost21533
\[\begin{array}{l} t_0 := \left(1 + {\left(\frac{M \cdot D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.125\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ t_1 := \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{if}\;h \leq -9 \cdot 10^{+273}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -3.2 \cdot 10^{+75}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq -1.8 \cdot 10^{-170}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \mathbf{elif}\;h \leq -3.1 \cdot 10^{-218}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq 6 \cdot 10^{+194} \lor \neg \left(h \leq 9.5 \cdot 10^{+270}\right):\\ \;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 5
Error21.2
Cost21533
\[\begin{array}{l} t_0 := \frac{h}{\ell} \cdot -0.5\\ t_1 := \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot t_0\right)\right)\\ t_2 := \left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \mathbf{if}\;h \leq -7.2 \cdot 10^{+272}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq -0.5:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -1.7 \cdot 10^{-101}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq -1.9 \cdot 10^{-197}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq 1.9 \cdot 10^{-302}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq 5.5 \cdot 10^{+194} \lor \neg \left(h \leq 3.4 \cdot 10^{+267}\right):\\ \;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot t_0\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 6
Error21.0
Cost21533
\[\begin{array}{l} t_0 := \frac{h}{\ell} \cdot -0.5\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \sqrt{\frac{d}{\ell}}\\ t_3 := \left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ t_4 := {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\\ \mathbf{if}\;h \leq -1.2 \cdot 10^{+274}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq -0.85:\\ \;\;\;\;\left(t_1 \cdot t_2\right) \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot t_4\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-101}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;h \leq -1.15 \cdot 10^{-198}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \left(1 + t_4 \cdot t_0\right)\right)\\ \mathbf{elif}\;h \leq 4.2 \cdot 10^{-307}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;h \leq 6 \cdot 10^{+194} \lor \neg \left(h \leq 8.8 \cdot 10^{+269}\right):\\ \;\;\;\;\left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot t_0\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 7
Error21.7
Cost21532
\[\begin{array}{l} t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ t_3 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;h \leq -1.6 \cdot 10^{+274}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq -1.35 \cdot 10^{+143}:\\ \;\;\;\;\left(1 + {\left(\frac{M \cdot D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.125\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -0.7:\\ \;\;\;\;\left(t_3 \cdot t_1\right) \cdot \left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right)\\ \mathbf{elif}\;h \leq -9.2 \cdot 10^{-91}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \mathbf{elif}\;h \leq -3.1 \cdot 10^{-218}:\\ \;\;\;\;t_3 \cdot \left(t_1 \cdot \mathsf{fma}\left(-0.125, \frac{M \cdot D}{\frac{\ell}{h} \cdot \left(\frac{d}{M} \cdot \frac{d}{D}\right)}, 1\right)\right)\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq 6 \cdot 10^{+194}:\\ \;\;\;\;\left(1 + t_0 \cdot \left(\frac{h}{\ell} \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 8
Error24.1
Cost14736
\[\begin{array}{l} t_0 := \left(1 + {\left(\frac{M \cdot D}{d}\right)}^{2} \cdot \left(\frac{h}{\ell} \cdot -0.125\right)\right) \cdot \sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ t_1 := \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{if}\;h \leq -3.4 \cdot 10^{+270}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;h \leq -1.62 \cdot 10^{+75}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq -3.1 \cdot 10^{-163}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \mathbf{elif}\;h \leq -3.1 \cdot 10^{-218}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq 5 \cdot 10^{-309}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 9
Error23.6
Cost13644
\[\begin{array}{l} \mathbf{if}\;h \leq -2 \cdot 10^{+264}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq -1.85 \cdot 10^{+75}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq 5 \cdot 10^{-309}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 10
Error23.6
Cost13580
\[\begin{array}{l} \mathbf{if}\;h \leq -1.8 \cdot 10^{+264}:\\ \;\;\;\;\sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{elif}\;h \leq -3.1 \cdot 10^{+75}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\left|d \cdot {\left(h \cdot \ell\right)}^{-0.5}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 11
Error23.7
Cost13516
\[\begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{if}\;h \leq -2 \cdot 10^{+264}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq -2.4 \cdot 10^{+75}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 12
Error27.4
Cost7308
\[\begin{array}{l} t_0 := \sqrt{\frac{1}{h \cdot \ell}} \cdot \left(-d\right)\\ \mathbf{if}\;h \leq -1.9 \cdot 10^{+264}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq -1.9 \cdot 10^{+75}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{elif}\;h \leq -5 \cdot 10^{-311}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
Alternative 13
Error33.6
Cost6980
\[\begin{array}{l} \mathbf{if}\;\ell \leq 2.45 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
Alternative 14
Error33.6
Cost6980
\[\begin{array}{l} \mathbf{if}\;\ell \leq 2.45 \cdot 10^{-247}:\\ \;\;\;\;\sqrt{\frac{d}{h \cdot \frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
Alternative 15
Error44.5
Cost6784
\[d \cdot {\left(h \cdot \ell\right)}^{-0.5} \]
Alternative 16
Error44.5
Cost6720
\[\frac{d}{\sqrt{h \cdot \ell}} \]
Alternative 17
Error61.5
Cost64
\[d \]

Error

Reproduce?

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