Average Error: 26.5 → 18.8
Time: 1.2min
Precision: binary64
Cost: 40528
\[ \begin{array}{c}[M, D] = \mathsf{sort}([M, D])\\ \end{array} \]
\[\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{-h}\\ t_2 := \left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sqrt{-d}}{t_1} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\left(t_0 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - {\left(\frac{t_1}{\sqrt{-\ell}} \cdot t_2\right)}^{2}\right)\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;\ell \leq 10^{+75}:\\ \;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 - {\left(t_2 \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\ \mathbf{elif}\;\ell \leq 10^{+261}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell}} \cdot \frac{d}{\sqrt{h}}\\ \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 (- h)))
        (t_2 (* (* (/ D d) (/ M 2.0)) (sqrt 0.5))))
   (if (<= l -1e-48)
     (*
      (/ (sqrt (- d)) t_1)
      (*
       (sqrt (/ d l))
       (fma (pow (/ (/ D d) (/ 2.0 M)) 2.0) (* (/ h l) -0.5) 1.0)))
     (if (<= l 0.0)
       (*
        (* t_0 (pow (/ d l) 0.5))
        (- 1.0 (pow (* (/ t_1 (sqrt (- l))) t_2) 2.0)))
       (if (<= l 1e-85)
         (/ d (* (sqrt l) (sqrt h)))
         (if (<= l 1e+75)
           (*
            (* t_0 (/ (sqrt d) (sqrt l)))
            (- 1.0 (pow (* t_2 (sqrt (/ h l))) 2.0)))
           (if (<= l 1e+261)
             (/
              (*
               (/ d (sqrt l))
               (+ 1.0 (* (/ h l) (* -0.5 (pow (* 0.5 (/ (* D M) d)) 2.0)))))
              (sqrt h))
             (* (/ 1.0 (sqrt l)) (/ d (sqrt h))))))))))
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(-h);
	double t_2 = ((D / d) * (M / 2.0)) * sqrt(0.5);
	double tmp;
	if (l <= -1e-48) {
		tmp = (sqrt(-d) / t_1) * (sqrt((d / l)) * fma(pow(((D / d) / (2.0 / M)), 2.0), ((h / l) * -0.5), 1.0));
	} else if (l <= 0.0) {
		tmp = (t_0 * pow((d / l), 0.5)) * (1.0 - pow(((t_1 / sqrt(-l)) * t_2), 2.0));
	} else if (l <= 1e-85) {
		tmp = d / (sqrt(l) * sqrt(h));
	} else if (l <= 1e+75) {
		tmp = (t_0 * (sqrt(d) / sqrt(l))) * (1.0 - pow((t_2 * sqrt((h / l))), 2.0));
	} else if (l <= 1e+261) {
		tmp = ((d / sqrt(l)) * (1.0 + ((h / l) * (-0.5 * pow((0.5 * ((D * M) / d)), 2.0))))) / sqrt(h);
	} else {
		tmp = (1.0 / sqrt(l)) * (d / sqrt(h));
	}
	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 = sqrt(Float64(-h))
	t_2 = Float64(Float64(Float64(D / d) * Float64(M / 2.0)) * sqrt(0.5))
	tmp = 0.0
	if (l <= -1e-48)
		tmp = Float64(Float64(sqrt(Float64(-d)) / t_1) * Float64(sqrt(Float64(d / l)) * fma((Float64(Float64(D / d) / Float64(2.0 / M)) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0)));
	elseif (l <= 0.0)
		tmp = Float64(Float64(t_0 * (Float64(d / l) ^ 0.5)) * Float64(1.0 - (Float64(Float64(t_1 / sqrt(Float64(-l))) * t_2) ^ 2.0)));
	elseif (l <= 1e-85)
		tmp = Float64(d / Float64(sqrt(l) * sqrt(h)));
	elseif (l <= 1e+75)
		tmp = Float64(Float64(t_0 * Float64(sqrt(d) / sqrt(l))) * Float64(1.0 - (Float64(t_2 * sqrt(Float64(h / l))) ^ 2.0)));
	elseif (l <= 1e+261)
		tmp = Float64(Float64(Float64(d / sqrt(l)) * Float64(1.0 + Float64(Float64(h / l) * Float64(-0.5 * (Float64(0.5 * Float64(Float64(D * M) / d)) ^ 2.0))))) / sqrt(h));
	else
		tmp = Float64(Float64(1.0 / sqrt(l)) * Float64(d / sqrt(h)));
	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[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[(-h)], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e-48], N[(N[(N[Sqrt[(-d)], $MachinePrecision] / t$95$1), $MachinePrecision] * N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[Power[N[(N[(D / d), $MachinePrecision] / N[(2.0 / M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(N[(h / l), $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.0], N[(N[(t$95$0 * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Power[N[(N[(t$95$1 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e-85], N[(d / N[(N[Sqrt[l], $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+75], N[(N[(t$95$0 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[Power[N[(t$95$2 * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+261], N[(N[(N[(d / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(h / l), $MachinePrecision] * N[(-0.5 * N[Power[N[(0.5 * N[(N[(D * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[h], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(d / N[Sqrt[h], $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 := {\left(\frac{d}{h}\right)}^{0.5}\\
t_1 := \sqrt{-h}\\
t_2 := \left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\\
\mathbf{if}\;\ell \leq -1 \cdot 10^{-48}:\\
\;\;\;\;\frac{\sqrt{-d}}{t_1} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\

\mathbf{elif}\;\ell \leq 0:\\
\;\;\;\;\left(t_0 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - {\left(\frac{t_1}{\sqrt{-\ell}} \cdot t_2\right)}^{2}\right)\\

\mathbf{elif}\;\ell \leq 10^{-85}:\\
\;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\

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

\mathbf{elif}\;\ell \leq 10^{+261}:\\
\;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\

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


\end{array}

Error

Derivation

  1. Split input into 6 regimes
  2. if l < -9.9999999999999997e-49

    1. Initial program 25.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. Simplified26.0

      \[\leadsto \color{blue}{\sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)} \]
      Proof
      (*.f64 (sqrt.f64 (/.f64 d h)) (*.f64 (sqrt.f64 (/.f64 d l)) (fma.f64 (pow.f64 (/.f64 (/.f64 D d) (/.f64 2 M)) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d h) 1/2)) (*.f64 (sqrt.f64 (/.f64 d l)) (fma.f64 (pow.f64 (/.f64 (/.f64 D d) (/.f64 2 M)) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (Rewrite<= metadata-eval (/.f64 1 2))) (*.f64 (sqrt.f64 (/.f64 d l)) (fma.f64 (pow.f64 (/.f64 (/.f64 D d) (/.f64 2 M)) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d l) 1/2)) (fma.f64 (pow.f64 (/.f64 (/.f64 D d) (/.f64 2 M)) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (Rewrite<= metadata-eval (/.f64 1 2))) (fma.f64 (pow.f64 (/.f64 (/.f64 D d) (/.f64 2 M)) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (/.f64 D d) M) 2)) 2) (*.f64 (/.f64 h l) -1/2) 1))): 1 points increase in error, 11 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 M (/.f64 D d))) 2) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (/.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 M D) d)) 2) 2) (*.f64 (/.f64 h l) -1/2) 1))): 7 points increase in error, 7 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (Rewrite=> associate-/l/_binary64 (/.f64 (*.f64 M D) (*.f64 2 d))) 2) (*.f64 (/.f64 h l) -1/2) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (*.f64 (/.f64 h l) (Rewrite<= metadata-eval (neg.f64 1/2))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (*.f64 (/.f64 h l) (neg.f64 (Rewrite<= metadata-eval (/.f64 1 2)))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (/.f64 h l) (/.f64 1 2)))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (fma.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 1 2) (/.f64 h l)))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (neg.f64 (*.f64 (/.f64 1 2) (/.f64 h l)))) 1)))): 1 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (+.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (*.f64 (/.f64 1 2) (/.f64 h l))))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (+.f64 (neg.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 1 2)) (/.f64 h l)))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (+.f64 (neg.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2))) (/.f64 h l))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (+.f64 (Rewrite<= distribute-lft-neg-out_binary64 (*.f64 (neg.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2))) (/.f64 h l))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (Rewrite<= +-commutative_binary64 (+.f64 1 (*.f64 (neg.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2))) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.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 points increase in error, 6 points decrease in error
    3. Applied egg-rr17.9

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

    if -9.9999999999999997e-49 < l < 0.0

    1. Initial program 29.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. Applied egg-rr30.1

      \[\leadsto \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 - \color{blue}{{\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}}\right) \]
    3. Applied egg-rr22.9

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

    if 0.0 < l < 9.9999999999999998e-86

    1. Initial program 31.2

      \[\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 34.2

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Applied egg-rr33.6

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
    4. Applied egg-rr23.0

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

    if 9.9999999999999998e-86 < l < 9.99999999999999927e74

    1. Initial program 19.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. Applied egg-rr18.9

      \[\leadsto \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 - \color{blue}{{\left(\sqrt{\frac{h}{\ell}} \cdot \left(\left(\frac{M}{2} \cdot \frac{D}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}}\right) \]
    3. Applied egg-rr17.7

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

    if 9.99999999999999927e74 < l < 9.9999999999999993e260

    1. Initial program 26.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. Applied egg-rr26.6

      \[\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) \]
    3. Applied egg-rr19.2

      \[\leadsto \left(\color{blue}{\frac{\sqrt{d}}{\sqrt{h}}} \cdot \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) \]
    4. Applied egg-rr15.8

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

    if 9.9999999999999993e260 < l

    1. Initial program 31.5

      \[\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 28.2

      \[\leadsto \color{blue}{\sqrt{\frac{1}{\ell \cdot h}} \cdot d} \]
    3. Applied egg-rr28.2

      \[\leadsto \color{blue}{\frac{d}{\sqrt{\ell \cdot h}}} \]
    4. Applied egg-rr19.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - {\left(\frac{\sqrt{-h}}{\sqrt{-\ell}} \cdot \left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;\ell \leq 10^{+75}:\\ \;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 - {\left(\left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\ \mathbf{elif}\;\ell \leq 10^{+261}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell}} \cdot \frac{d}{\sqrt{h}}\\ \end{array} \]

Alternatives

Alternative 1
Error17.1
Cost40656
\[\begin{array}{l} t_0 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_1 := 1 - {\left(\left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\\ t_2 := \sqrt{-d}\\ t_3 := \sqrt{\frac{1}{\ell}}\\ \mathbf{if}\;d \leq -1 \cdot 10^{+46}:\\ \;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;d \leq -1:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-290}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \frac{t_2}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \left(\sqrt{d} \cdot t_3\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{t_3}{\sqrt{h}}\\ \end{array} \]
Alternative 2
Error19.0
Cost40528
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_2 := \frac{D}{d} \cdot \frac{M}{2}\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{-48}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t_0 \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\left(t_0 \cdot t_1\right) \cdot \left(1 - \frac{{t_2}^{2} \cdot \left(h \cdot 0.5\right)}{\ell}\right)\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;\ell \leq 10^{+75}:\\ \;\;\;\;\left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot \left(1 - {\left(\left(t_2 \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\ \mathbf{elif}\;\ell \leq 10^{+261}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\sqrt{\ell}} \cdot \frac{d}{\sqrt{h}}\\ \end{array} \]
Alternative 3
Error17.1
Cost40528
\[\begin{array}{l} t_0 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_1 := 1 - {\left(\left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\\ t_2 := \sqrt{-d}\\ \mathbf{if}\;d \leq -1 \cdot 10^{+46}:\\ \;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;d \leq -1:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-290}:\\ \;\;\;\;t_1 \cdot \left(t_0 \cdot \frac{t_2}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;\left(t_0 \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right) \cdot t_1\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 4
Error19.2
Cost34192
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_2 := \sqrt{-d}\\ \mathbf{if}\;d \leq -1 \cdot 10^{+46}:\\ \;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(t_0 \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-14}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{h}{d}}} \cdot \left(t_0 \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-146}:\\ \;\;\;\;\left(t_1 \cdot \frac{t_2}{\sqrt{-\ell}}\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 10^{+100}:\\ \;\;\;\;\left(t_1 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 - {\left(\left(\left(\frac{D}{d} \cdot \frac{M}{2}\right) \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 5
Error19.2
Cost33932
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ t_2 := \frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(t_0 \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ t_3 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_4 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\\ \mathbf{if}\;d \leq -1 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-14}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{h}{d}}} \cdot \left(t_0 \cdot t_1\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-290}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 10^{-160}:\\ \;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot t_3\right) \cdot t_4\\ \mathbf{elif}\;d \leq 10^{-63}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(t_3 \cdot t_1\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;t_4 \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 6
Error18.5
Cost28120
\[\begin{array}{l} t_0 := \frac{\sqrt{-d}}{\sqrt{-\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ t_3 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_4 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_5 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\\ \mathbf{if}\;d \leq -1.85 \cdot 10^{+142}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-14}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot t_0\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-290}:\\ \;\;\;\;\left(t_3 \cdot t_0\right) \cdot t_5\\ \mathbf{elif}\;d \leq 10^{-160}:\\ \;\;\;\;\left(t_3 \cdot t_4\right) \cdot t_5\\ \mathbf{elif}\;d \leq 10^{-63}:\\ \;\;\;\;t_1 \cdot \left(t_4 \cdot t_2\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;t_5 \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 7
Error19.5
Cost27928
\[\begin{array}{l} t_0 := \sqrt{-d}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ t_3 := \sqrt{\frac{d}{\ell}}\\ t_4 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\\ \mathbf{if}\;d \leq -1.85 \cdot 10^{+142}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq -10000000000000:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \frac{t_0}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq -1.1 \cdot 10^{-286}:\\ \;\;\;\;t_4 \cdot \left(\frac{t_0}{\sqrt{-h}} \cdot t_3\right)\\ \mathbf{elif}\;d \leq 10^{-160}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\ \mathbf{elif}\;d \leq 10^{-63}:\\ \;\;\;\;t_1 \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot t_2\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;t_4 \cdot \left(t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 8
Error19.5
Cost27928
\[\begin{array}{l} t_0 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_1 := \sqrt{-d}\\ t_2 := \sqrt{\frac{d}{h}}\\ t_3 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ t_4 := \sqrt{\frac{d}{\ell}}\\ t_5 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\\ \mathbf{if}\;d \leq -1.85 \cdot 10^{+142}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq -10000000000000:\\ \;\;\;\;t_2 \cdot \left(t_3 \cdot \frac{t_1}{\sqrt{-\ell}}\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-290}:\\ \;\;\;\;t_5 \cdot \left(\frac{t_1}{\sqrt{-h}} \cdot t_4\right)\\ \mathbf{elif}\;d \leq 10^{-160}:\\ \;\;\;\;\left({\left(\frac{d}{h}\right)}^{0.5} \cdot t_0\right) \cdot t_5\\ \mathbf{elif}\;d \leq 10^{-63}:\\ \;\;\;\;t_2 \cdot \left(t_0 \cdot t_3\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;t_5 \cdot \left(t_4 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 9
Error18.5
Cost27928
\[\begin{array}{l} t_0 := \frac{\sqrt{-d}}{\sqrt{-\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ t_3 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_4 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_5 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\\ \mathbf{if}\;d \leq -1.85 \cdot 10^{+142}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-14}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot t_0\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-290}:\\ \;\;\;\;\left(t_3 \cdot t_0\right) \cdot t_5\\ \mathbf{elif}\;d \leq 10^{-160}:\\ \;\;\;\;\left(t_3 \cdot t_4\right) \cdot t_5\\ \mathbf{elif}\;d \leq 10^{-63}:\\ \;\;\;\;t_1 \cdot \left(t_4 \cdot t_2\right)\\ \mathbf{elif}\;d \leq 10^{+100}:\\ \;\;\;\;t_5 \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 10
Error19.3
Cost27920
\[\begin{array}{l} t_0 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\\ t_1 := \sqrt{\frac{1}{\ell}}\\ t_2 := \sqrt{\frac{d}{h}}\\ t_3 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;h \leq -1 \cdot 10^{+137}:\\ \;\;\;\;t_2 \cdot \left(t_3 \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d}{\frac{D}{d} \cdot \frac{M}{\ell}}}\right), 1\right)\right)\\ \mathbf{elif}\;h \leq 0:\\ \;\;\;\;t_0 \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_3\right)\\ \mathbf{elif}\;h \leq 10^{-180}:\\ \;\;\;\;d \cdot \frac{t_1}{\sqrt{h}}\\ \mathbf{elif}\;h \leq 10^{+113}:\\ \;\;\;\;t_0 \cdot \left(\left(\sqrt{d} \cdot t_1\right) \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)\\ \mathbf{else}:\\ \;\;\;\;t_2 \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\right)\\ \end{array} \]
Alternative 11
Error19.7
Cost27468
\[\begin{array}{l} \mathbf{if}\;\ell \leq -1.12 \cdot 10^{+243}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq -2.65 \cdot 10^{+129}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \frac{1}{\frac{\sqrt{-\ell}}{\sqrt{-d}}}\\ \mathbf{elif}\;\ell \leq -1 \cdot 10^{-36}:\\ \;\;\;\;\mathsf{fma}\left(D \cdot \frac{M \cdot \left(D \cdot M\right)}{d}, \sqrt{\frac{h}{{\ell}^{3}}} \cdot 0.125, \left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\right)\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\left(1 - \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot 0.5\right)}{\ell}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\ \end{array} \]
Alternative 12
Error21.0
Cost21392
\[\begin{array}{l} t_0 := \sqrt{\frac{h}{d}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := 1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\\ t_3 := \left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{if}\;\ell \leq -1.85 \cdot 10^{+214}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq -9.5 \cdot 10^{-45}:\\ \;\;\;\;\frac{t_1 \cdot t_2}{t_0}\\ \mathbf{elif}\;\ell \leq -3.9 \cdot 10^{-162}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\left(1 - \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot 0.5\right)}{\ell}\right) \cdot \left(t_1 \cdot \frac{1}{t_0}\right)\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot t_2}{\sqrt{h}}\\ \end{array} \]
Alternative 13
Error21.3
Cost21268
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \frac{\sqrt{-\ell}}{\sqrt{-d}}\\ \mathbf{if}\;\ell \leq -7.5 \cdot 10^{+238}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{+83}:\\ \;\;\;\;\frac{t_0}{t_1}\\ \mathbf{elif}\;\ell \leq -1.2 \cdot 10^{+34}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.125 \cdot \left(M \cdot \left(M \cdot \frac{\frac{D}{\frac{d}{D}}}{\frac{\ell}{\frac{h}{d}}}\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;t_0 \cdot \frac{1}{t_1}\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{h}}\\ \end{array} \]
Alternative 14
Error21.2
Cost21264
\[\begin{array}{l} t_0 := \frac{\sqrt{\frac{d}{\ell}} \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}\right)\right)}{\sqrt{\frac{h}{d}}}\\ \mathbf{if}\;d \leq -1.85 \cdot 10^{+142}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;d \leq 1.35 \cdot 10^{-295}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 6 \cdot 10^{-62}:\\ \;\;\;\;\frac{1}{\sqrt{\ell}} \cdot \frac{d}{\sqrt{h}}\\ \mathbf{elif}\;d \leq 10^{+75}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 15
Error23.8
Cost20432
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \frac{\sqrt{-\ell}}{\sqrt{-d}}\\ t_2 := \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.125 \cdot \left(M \cdot \left(M \cdot \frac{\frac{D}{\frac{d}{D}}}{\frac{\ell}{\frac{h}{d}}}\right)\right)\right)\\ \mathbf{if}\;\ell \leq -7.5 \cdot 10^{+238}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{+83}:\\ \;\;\;\;\frac{t_0}{t_1}\\ \mathbf{elif}\;\ell \leq -1.2 \cdot 10^{+34}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;t_0 \cdot \frac{1}{t_1}\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;\ell \leq 10^{+90}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 16
Error23.8
Cost20304
\[\begin{array}{l} t_0 := \frac{\sqrt{\frac{d}{h}}}{\frac{\sqrt{-\ell}}{\sqrt{-d}}}\\ t_1 := \left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.125 \cdot \left(M \cdot \left(M \cdot \frac{\frac{D}{\frac{d}{D}}}{\frac{\ell}{\frac{h}{d}}}\right)\right)\right)\\ \mathbf{if}\;\ell \leq -7.5 \cdot 10^{+238}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{elif}\;\ell \leq -1.15 \cdot 10^{+83}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -1.2 \cdot 10^{+34}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;\ell \leq 10^{+90}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 17
Error24.3
Cost15184
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.9 \cdot 10^{-162}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\frac{\sqrt{\frac{d}{h}}}{\sqrt{\frac{\ell}{d}}}\\ \mathbf{elif}\;\ell \leq 10^{-85}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;\ell \leq 10^{+90}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right) \cdot \left(1 - 0.125 \cdot \left(M \cdot \left(M \cdot \frac{\frac{D}{\frac{d}{D}}}{\frac{\ell}{\frac{h}{d}}}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 18
Error22.6
Cost13512
\[\begin{array}{l} \mathbf{if}\;h \leq -2.9 \cdot 10^{+142}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq -1 \cdot 10^{-305}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 19
Error22.5
Cost13384
\[\begin{array}{l} \mathbf{if}\;h \leq -2.9 \cdot 10^{+142}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq -1 \cdot 10^{-305}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 20
Error24.1
Cost13252
\[\begin{array}{l} \mathbf{if}\;d \leq 8.9 \cdot 10^{-293}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{d}{\sqrt{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 21
Error23.2
Cost13252
\[\begin{array}{l} \mathbf{if}\;d \leq 8.9 \cdot 10^{-293}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 22
Error27.3
Cost7044
\[\begin{array}{l} \mathbf{if}\;d \leq -4.4 \cdot 10^{-267}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
Alternative 23
Error33.5
Cost6980
\[\begin{array}{l} \mathbf{if}\;d \leq 2.25 \cdot 10^{-240}:\\ \;\;\;\;\sqrt{\frac{\frac{d}{h}}{\frac{\ell}{d}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
Alternative 24
Error43.8
Cost6720
\[\frac{d}{\sqrt{\ell \cdot h}} \]

Error

Reproduce

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