Average Error: 26.7 → 13.7
Time: 51.5s
Precision: binary64
Cost: 27984
\[\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 := \sqrt{-d}\\ t_1 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_2 := \mathsf{fma}\left(-0.5, \frac{t_1}{\frac{\ell}{h \cdot t_1}}, 1\right)\\ t_3 := \sqrt{\frac{d}{\ell}} \cdot t_2\\ \mathbf{if}\;d \leq -1.45 \cdot 10^{+46}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{-h}}{t_0}} \cdot t_3\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_2 \cdot \frac{t_0}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-144}:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{+191}:\\ \;\;\;\;t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \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 (sqrt (- d)))
        (t_1 (* D (* (/ M d) 0.5)))
        (t_2 (fma -0.5 (/ t_1 (/ l (* h t_1))) 1.0))
        (t_3 (* (sqrt (/ d l)) t_2)))
   (if (<= d -1.45e+46)
     (* (/ 1.0 (/ (sqrt (- h)) t_0)) t_3)
     (if (<= d -2e-310)
       (* (sqrt (/ d h)) (* t_2 (/ t_0 (sqrt (- l)))))
       (if (<= d 1.15e-144)
         (*
          -0.125
          (pow (* (* D (/ M (sqrt d))) (/ (pow h 0.25) (pow l 0.75))) 2.0))
         (if (<= d 6.5e+191)
           (* t_3 (/ (sqrt d) (sqrt h)))
           (/ d (* (sqrt h) (sqrt l)))))))))
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 = sqrt(-d);
	double t_1 = D * ((M / d) * 0.5);
	double t_2 = fma(-0.5, (t_1 / (l / (h * t_1))), 1.0);
	double t_3 = sqrt((d / l)) * t_2;
	double tmp;
	if (d <= -1.45e+46) {
		tmp = (1.0 / (sqrt(-h) / t_0)) * t_3;
	} else if (d <= -2e-310) {
		tmp = sqrt((d / h)) * (t_2 * (t_0 / sqrt(-l)));
	} else if (d <= 1.15e-144) {
		tmp = -0.125 * pow(((D * (M / sqrt(d))) * (pow(h, 0.25) / pow(l, 0.75))), 2.0);
	} else if (d <= 6.5e+191) {
		tmp = t_3 * (sqrt(d) / sqrt(h));
	} else {
		tmp = d / (sqrt(h) * sqrt(l));
	}
	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 = sqrt(Float64(-d))
	t_1 = Float64(D * Float64(Float64(M / d) * 0.5))
	t_2 = fma(-0.5, Float64(t_1 / Float64(l / Float64(h * t_1))), 1.0)
	t_3 = Float64(sqrt(Float64(d / l)) * t_2)
	tmp = 0.0
	if (d <= -1.45e+46)
		tmp = Float64(Float64(1.0 / Float64(sqrt(Float64(-h)) / t_0)) * t_3);
	elseif (d <= -2e-310)
		tmp = Float64(sqrt(Float64(d / h)) * Float64(t_2 * Float64(t_0 / sqrt(Float64(-l)))));
	elseif (d <= 1.15e-144)
		tmp = Float64(-0.125 * (Float64(Float64(D * Float64(M / sqrt(d))) * Float64((h ^ 0.25) / (l ^ 0.75))) ^ 2.0));
	elseif (d <= 6.5e+191)
		tmp = Float64(t_3 * Float64(sqrt(d) / sqrt(h)));
	else
		tmp = Float64(d / Float64(sqrt(h) * sqrt(l)));
	end
	return 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[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$1 = N[(D * N[(N[(M / d), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-0.5 * N[(t$95$1 / N[(l / N[(h * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$3 = N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision]}, If[LessEqual[d, -1.45e+46], N[(N[(1.0 / N[(N[Sqrt[(-h)], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[d, -2e-310], N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$2 * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.15e-144], N[(-0.125 * N[Power[N[(N[(D * N[(M / N[Sqrt[d], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Power[h, 0.25], $MachinePrecision] / N[Power[l, 0.75], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 6.5e+191], N[(t$95$3 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $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 := \sqrt{-d}\\
t_1 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\
t_2 := \mathsf{fma}\left(-0.5, \frac{t_1}{\frac{\ell}{h \cdot t_1}}, 1\right)\\
t_3 := \sqrt{\frac{d}{\ell}} \cdot t_2\\
\mathbf{if}\;d \leq -1.45 \cdot 10^{+46}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{-h}}{t_0}} \cdot t_3\\

\mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\
\;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_2 \cdot \frac{t_0}{\sqrt{-\ell}}\right)\\

\mathbf{elif}\;d \leq 1.15 \cdot 10^{-144}:\\
\;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\

\mathbf{elif}\;d \leq 6.5 \cdot 10^{+191}:\\
\;\;\;\;t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\

\mathbf{else}:\\
\;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\


\end{array}

Error

Derivation

  1. Split input into 5 regimes
  2. if d < -1.4500000000000001e46

    1. Initial program 24.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. Simplified24.2

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

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

      associate-*l* [=>]24.5

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

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

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

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

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

      sub-neg [=>]24.5

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

      +-commutative [=>]24.5

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

      associate-*l* [=>]24.5

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

      distribute-lft-neg-in [=>]24.5

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

      fma-def [=>]24.5

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

      metadata-eval [=>]24.5

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

      metadata-eval [=>]24.5

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

      associate-*l/ [<=]24.2

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

      *-commutative [=>]24.2

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

      associate-/l/ [<=]24.2

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right) \]
    3. Applied egg-rr22.3

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}}, 1\right)\right) \]
    4. Applied egg-rr21.2

      \[\leadsto \color{blue}{\frac{1}{\sqrt{\frac{h}{d}}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right) \]
    5. Applied egg-rr9.7

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

    if -1.4500000000000001e46 < d < -1.999999999999994e-310

    1. Initial program 28.6

      \[\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. Simplified29.4

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

      [Start]28.6

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

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

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

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

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

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

      sub-neg [=>]28.7

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

      +-commutative [=>]28.7

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

      associate-*l* [=>]28.7

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

      distribute-lft-neg-in [=>]28.7

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

      fma-def [=>]28.7

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

      metadata-eval [=>]28.7

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

      metadata-eval [=>]28.7

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

      associate-*l/ [<=]29.4

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

      *-commutative [=>]29.4

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

      associate-/l/ [<=]29.4

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right) \]
    3. Applied egg-rr25.4

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}}, 1\right)\right) \]
    4. Applied egg-rr18.9

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

    if -1.999999999999994e-310 < d < 1.15e-144

    1. Initial program 40.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. Taylor expanded in d around 0 52.0

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

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

      [Start]52.0

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

      associate-/l* [=>]52.9

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

      unpow2 [=>]52.9

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

      unpow2 [=>]52.9

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

      \[\leadsto -0.125 \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot {\left(\frac{D}{\sqrt{d}} \cdot M\right)}^{2}\right)} - 1\right)} \]
    5. Simplified34.2

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

      [Start]43.0

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

      expm1-def [=>]36.5

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

      expm1-log1p [=>]35.5

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

      associate-*l/ [=>]34.2

      \[ -0.125 \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot {\color{blue}{\left(\frac{D \cdot M}{\sqrt{d}}\right)}}^{2}\right) \]
    6. Applied egg-rr22.3

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

    if 1.15e-144 < d < 6.50000000000000008e191

    1. Initial program 19.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. Simplified20.6

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

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

      associate-*l* [=>]20.2

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

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

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

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

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

      sub-neg [=>]20.2

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

      +-commutative [=>]20.2

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

      associate-*l* [=>]20.2

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

      distribute-lft-neg-in [=>]20.2

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

      fma-def [=>]20.2

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

      metadata-eval [=>]20.2

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

      metadata-eval [=>]20.2

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

      associate-*l/ [<=]20.6

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

      *-commutative [=>]20.6

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

      associate-/l/ [<=]20.6

      \[ \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, {\left(D \cdot \color{blue}{\frac{\frac{M}{d}}{2}}\right)}^{2} \cdot \frac{h}{\ell}, 1\right)\right) \]
    3. Applied egg-rr16.7

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \color{blue}{\frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}}, 1\right)\right) \]
    4. Applied egg-rr11.1

      \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \frac{1}{\sqrt{h}}\right)} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right) \]
    5. Simplified11.0

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

      [Start]11.1

      \[ \left(\sqrt{d} \cdot \frac{1}{\sqrt{h}}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{\left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right) \cdot h}}, 1\right)\right) \]

      associate-*r/ [=>]11.0

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

      *-rgt-identity [=>]11.0

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

    if 6.50000000000000008e191 < d

    1. Initial program 30.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. Taylor expanded in d around inf 15.4

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Simplified15.0

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

      [Start]15.4

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

      *-commutative [=>]15.4

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

      associate-/l/ [<=]15.0

      \[ d \cdot \sqrt{\color{blue}{\frac{\frac{1}{h}}{\ell}}} \]
    4. Applied egg-rr14.8

      \[\leadsto \color{blue}{\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}} \]
    5. Simplified4.8

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

      [Start]14.8

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

      associate-/l/ [=>]4.8

      \[ \color{blue}{\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification13.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1.45 \cdot 10^{+46}:\\ \;\;\;\;\frac{1}{\frac{\sqrt{-h}}{\sqrt{-d}}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{h \cdot \left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right)}}, 1\right)\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{h \cdot \left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right)}}, 1\right) \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 1.15 \cdot 10^{-144}:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{+191}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{D \cdot \left(\frac{M}{d} \cdot 0.5\right)}{\frac{\ell}{h \cdot \left(D \cdot \left(\frac{M}{d} \cdot 0.5\right)\right)}}, 1\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]

Alternatives

Alternative 1
Error18.3
Cost89292
\[\begin{array}{l} t_0 := \frac{{h}^{0.25}}{{\ell}^{0.75}}\\ t_1 := \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(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot t_0\right)}^{2}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+299}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;-0.125 \cdot {\left(t_0 \cdot \left(M \cdot \frac{D}{\sqrt{d}}\right)\right)}^{2}\\ \end{array} \]
Alternative 2
Error15.8
Cost27984
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := 1 + -0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\\ t_2 := \sqrt{\frac{d}{\ell}}\\ t_3 := \sqrt{-d}\\ \mathbf{if}\;d \leq -2.3 \cdot 10^{+46}:\\ \;\;\;\;\left(t_2 \cdot \frac{t_3}{\sqrt{-h}}\right) \cdot t_1\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;t_1 \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{t_3}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 5.2 \cdot 10^{-145}:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\ \mathbf{elif}\;d \leq 1.5 \cdot 10^{+193}:\\ \;\;\;\;\left(t_2 \cdot \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 3
Error14.2
Cost27984
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\\ t_2 := \sqrt{\frac{d}{\ell}}\\ t_3 := \sqrt{-d}\\ \mathbf{if}\;d \leq -2.4 \cdot 10^{+51}:\\ \;\;\;\;\left(t_2 \cdot \frac{t_3}{\sqrt{-h}}\right) \cdot \left(1 + -0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_1 \cdot \frac{t_3}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 5.8 \cdot 10^{-145}:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\ \mathbf{elif}\;d \leq 8 \cdot 10^{+191}:\\ \;\;\;\;\left(t_2 \cdot t_1\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 4
Error13.7
Cost27984
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := \sqrt{-d}\\ t_2 := \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\\ t_3 := \sqrt{\frac{d}{\ell}} \cdot t_2\\ \mathbf{if}\;d \leq -9.2 \cdot 10^{+45}:\\ \;\;\;\;t_3 \cdot \frac{t_1}{\sqrt{-h}}\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_2 \cdot \frac{t_1}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 10^{-144}:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\ \mathbf{elif}\;d \leq 2.25 \cdot 10^{+192}:\\ \;\;\;\;t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 5
Error16.7
Cost27528
\[\begin{array}{l} t_0 := 1 + -0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\\ t_1 := \sqrt{-d}\\ \mathbf{if}\;d \leq -9 \cdot 10^{+43}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{t_1}{\sqrt{-h}}\right) \cdot t_0\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-310}:\\ \;\;\;\;t_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \frac{t_1}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 3.9 \cdot 10^{-216}:\\ \;\;\;\;-0.125 \cdot {\left(\left(D \cdot \frac{M}{\sqrt{d}}\right) \cdot \frac{{h}^{0.25}}{{\ell}^{0.75}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 6
Error19.1
Cost27024
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := {\left(\frac{d}{h}\right)}^{0.5}\\ \mathbf{if}\;d \leq -2 \cdot 10^{-154}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\right) \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{elif}\;d \leq -1.55 \cdot 10^{-229}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t_1\right) \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{-305}:\\ \;\;\;\;\left(t_1 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\ \mathbf{elif}\;d \leq 1.8 \cdot 10^{-172}:\\ \;\;\;\;-0.125 \cdot {\left(\frac{{h}^{0.25}}{{\ell}^{0.75}} \cdot \left(M \cdot \frac{D}{\sqrt{d}}\right)\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 7
Error20.2
Cost26960
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := {\left(\frac{d}{h}\right)}^{0.5}\\ \mathbf{if}\;d \leq -2 \cdot 10^{-154}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\right) \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{elif}\;d \leq -1.12 \cdot 10^{-229}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t_1\right) \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{elif}\;d \leq 2.4 \cdot 10^{-305}:\\ \;\;\;\;\left(t_1 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right)\\ \mathbf{elif}\;d \leq 2.3 \cdot 10^{-235}:\\ \;\;\;\;-0.125 \cdot \frac{\sqrt{h} \cdot {\left(M \cdot \frac{D}{\sqrt{d}}\right)}^{2}}{{\ell}^{1.5}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 8
Error20.7
Cost21716
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ t_2 := \sqrt{\frac{d}{h}}\\ t_3 := \sqrt{\frac{d}{\ell}}\\ t_4 := t_3 \cdot \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\\ \mathbf{if}\;d \leq -2 \cdot 10^{-154}:\\ \;\;\;\;t_4 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\\ \mathbf{elif}\;d \leq -6.8 \cdot 10^{-230}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot {\left(\frac{d}{h}\right)}^{0.5}\right) \cdot \left(1 + -0.125 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{M \cdot M}{\frac{\ell}{h}}\right)\right)\\ \mathbf{elif}\;d \leq 3.55 \cdot 10^{-264}:\\ \;\;\;\;t_2 \cdot \left(t_3 \cdot \left(1 + -0.125 \cdot \frac{\frac{M \cdot \left(h \cdot M\right)}{d \cdot \frac{\ell}{D \cdot D}}}{d}\right)\right)\\ \mathbf{elif}\;d \leq 1.9 \cdot 10^{-90}:\\ \;\;\;\;t_1 \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \mathbf{elif}\;d \leq 6.2 \cdot 10^{+61}:\\ \;\;\;\;t_4 \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 9
Error20.4
Cost21452
\[\begin{array}{l} t_0 := D \cdot \left(\frac{M}{d} \cdot 0.5\right)\\ t_1 := \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left(-0.5, \frac{t_0}{\frac{\ell}{h \cdot t_0}}, 1\right)\right) \cdot \sqrt{\frac{d}{h}}\\ t_2 := \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{if}\;d \leq 5.2 \cdot 10^{-236}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 7.5 \cdot 10^{-91}:\\ \;\;\;\;t_2 \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{+61}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 10
Error25.3
Cost21136
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -2.6 \cdot 10^{+83}:\\ \;\;\;\;t_0 \cdot t_1\\ \mathbf{elif}\;d \leq -7 \cdot 10^{-77}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}, -0.5, 1\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-154}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\ell}{D} \cdot \left(\frac{d}{h} \cdot \frac{d}{M \cdot M}\right)}\right)\right)\\ \mathbf{elif}\;d \leq 3.5 \cdot 10^{-267}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{\frac{M \cdot \left(h \cdot M\right)}{d \cdot \frac{\ell}{D \cdot D}}}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 11
Error20.9
Cost21060
\[\begin{array}{l} t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\ \mathbf{if}\;\ell \leq -5.6 \cdot 10^{-49}:\\ \;\;\;\;\left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)\\ \mathbf{elif}\;\ell \leq 7.8 \cdot 10^{-176}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + t_0 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 12
Error21.0
Cost21000
\[\begin{array}{l} t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;\ell \leq -5.2 \cdot 10^{-41}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right) \cdot \left(t_1 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)\\ \mathbf{elif}\;\ell \leq 6.7 \cdot 10^{-183}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right) \cdot \left(t_1 \cdot \sqrt{\frac{d}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + t_0 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 13
Error27.4
Cost20872
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -1.5 \cdot 10^{+83}:\\ \;\;\;\;t_0 \cdot t_1\\ \mathbf{elif}\;d \leq -7 \cdot 10^{-76}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \mathsf{fma}\left(\frac{h}{\ell} \cdot {\left(D \cdot \left(M \cdot \frac{0.5}{d}\right)\right)}^{2}, -0.5, 1\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-154}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\ell}{D} \cdot \left(\frac{d}{h} \cdot \frac{d}{M \cdot M}\right)}\right)\right)\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-192}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{\frac{M \cdot \left(h \cdot M\right)}{d \cdot \frac{\ell}{D \cdot D}}}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 14
Error21.9
Cost20872
\[\begin{array}{l} t_0 := -0.5 \cdot \frac{h}{\ell}\\ \mathbf{if}\;d \leq 2.4 \cdot 10^{-305}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \left(1 + t_0 \cdot {\left(M \cdot \frac{D}{d \cdot 2}\right)}^{2}\right)\right)\\ \mathbf{elif}\;d \leq 1.65 \cdot 10^{-240}:\\ \;\;\;\;-0.125 \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(D \cdot \left(M \cdot \left(\left(D \cdot M\right) \cdot \frac{1}{d}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2} \cdot t_0\right)\\ \end{array} \]
Alternative 15
Error21.4
Cost20872
\[\begin{array}{l} t_0 := {\left(M \cdot \left(0.5 \cdot \frac{D}{d}\right)\right)}^{2}\\ \mathbf{if}\;d \leq 2.4 \cdot 10^{-305}:\\ \;\;\;\;\left(1 - 0.5 \cdot \frac{h \cdot t_0}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\right)\\ \mathbf{elif}\;d \leq 3.1 \cdot 10^{-241}:\\ \;\;\;\;-0.125 \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(D \cdot \left(M \cdot \left(\left(D \cdot M\right) \cdot \frac{1}{d}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 + t_0 \cdot \left(-0.5 \cdot \frac{h}{\ell}\right)\right)\\ \end{array} \]
Alternative 16
Error27.4
Cost15056
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -9.2 \cdot 10^{+82}:\\ \;\;\;\;t_0 \cdot t_1\\ \mathbf{elif}\;d \leq -6.2 \cdot 10^{-76}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-154}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\ell}{D} \cdot \left(\frac{d}{h} \cdot \frac{d}{M \cdot M}\right)}\right)\right)\\ \mathbf{elif}\;d \leq 7.6 \cdot 10^{-192}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{\frac{M \cdot \left(h \cdot M\right)}{d \cdot \frac{\ell}{D \cdot D}}}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 17
Error27.0
Cost14924
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;\ell \leq 1.9 \cdot 10^{-284}:\\ \;\;\;\;t_0 \cdot t_1\\ \mathbf{elif}\;\ell \leq 3 \cdot 10^{+106}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \mathbf{elif}\;\ell \leq 3.6 \cdot 10^{+152}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(1 + -0.125 \cdot \frac{D}{\frac{\ell}{D} \cdot \left(\frac{d}{h} \cdot \frac{d}{M \cdot M}\right)}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 18
Error26.9
Cost14600
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -1.05 \cdot 10^{+83}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -7.2 \cdot 10^{-77}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}} \cdot \left(1 + -0.5 \cdot \left(\frac{h}{\ell} \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;d \leq 2.5 \cdot 10^{-256}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 19
Error26.6
Cost14348
\[\begin{array}{l} \mathbf{if}\;h \leq -8 \cdot 10^{-292}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq 3 \cdot 10^{+156}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \mathbf{elif}\;h \leq 5 \cdot 10^{+169}:\\ \;\;\;\;-0.125 \cdot \left(\frac{\sqrt{h}}{{\ell}^{1.5}} \cdot \left(D \cdot \left(M \cdot \left(\left(D \cdot M\right) \cdot \frac{1}{d}\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{h}}}{\sqrt{\ell}}\\ \end{array} \]
Alternative 20
Error26.2
Cost13380
\[\begin{array}{l} \mathbf{if}\;\ell \leq 1.9 \cdot 10^{-284}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 21
Error29.8
Cost13252
\[\begin{array}{l} \mathbf{if}\;\ell \leq 1.9 \cdot 10^{-284}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 22
Error33.4
Cost7113
\[\begin{array}{l} \mathbf{if}\;h \leq 1.05 \cdot 10^{-295} \lor \neg \left(h \leq 1.5 \cdot 10^{+239}\right):\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
Alternative 23
Error35.9
Cost6980
\[\begin{array}{l} \mathbf{if}\;h \leq -8.6 \cdot 10^{-257}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
Alternative 24
Error44.0
Cost6720
\[\frac{d}{\sqrt{h \cdot \ell}} \]
Alternative 25
Error61.5
Cost64
\[d \]

Error

Reproduce

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