Average Error: 25.6 → 15.6
Time: 1.1min
Precision: binary64
Cost: 47240
\[ \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.25}\\ t_1 := 1 - {\left(\frac{1}{\sqrt{\frac{\ell}{h}}} \cdot \left(\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\\ t_2 := \sqrt{-d}\\ t_3 := \frac{t_2}{\sqrt{-\ell}}\\ \mathbf{if}\;d \leq -1 \cdot 10^{-66}:\\ \;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(t_3 \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 -6.6 \cdot 10^{-286}:\\ \;\;\;\;\left(t_3 \cdot \left(t_0 \cdot t_0\right)\right) \cdot t_1\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+41}:\\ \;\;\;\;t_1 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \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.25))
        (t_1
         (-
          1.0
          (pow
           (* (/ 1.0 (sqrt (/ l h))) (* (* (* D M) (/ 0.5 d)) (sqrt 0.5)))
           2.0)))
        (t_2 (sqrt (- d)))
        (t_3 (/ t_2 (sqrt (- l)))))
   (if (<= d -1e-66)
     (*
      (/ t_2 (sqrt (- h)))
      (* t_3 (fma -0.125 (* h (* M (/ D (* (/ l M) (/ (* d d) D))))) 1.0)))
     (if (<= d -6.6e-286)
       (* (* t_3 (* t_0 t_0)) t_1)
       (if (<= d 7.2e+41)
         (* t_1 (* (pow (/ d h) 0.5) (pow (/ d l) 0.5)))
         (/ d (* (sqrt l) (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.25);
	double t_1 = 1.0 - pow(((1.0 / sqrt((l / h))) * (((D * M) * (0.5 / d)) * sqrt(0.5))), 2.0);
	double t_2 = sqrt(-d);
	double t_3 = t_2 / sqrt(-l);
	double tmp;
	if (d <= -1e-66) {
		tmp = (t_2 / sqrt(-h)) * (t_3 * fma(-0.125, (h * (M * (D / ((l / M) * ((d * d) / D))))), 1.0));
	} else if (d <= -6.6e-286) {
		tmp = (t_3 * (t_0 * t_0)) * t_1;
	} else if (d <= 7.2e+41) {
		tmp = t_1 * (pow((d / h), 0.5) * pow((d / l), 0.5));
	} else {
		tmp = d / (sqrt(l) * 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.25
	t_1 = Float64(1.0 - (Float64(Float64(1.0 / sqrt(Float64(l / h))) * Float64(Float64(Float64(D * M) * Float64(0.5 / d)) * sqrt(0.5))) ^ 2.0))
	t_2 = sqrt(Float64(-d))
	t_3 = Float64(t_2 / sqrt(Float64(-l)))
	tmp = 0.0
	if (d <= -1e-66)
		tmp = Float64(Float64(t_2 / sqrt(Float64(-h))) * Float64(t_3 * fma(-0.125, Float64(h * Float64(M * Float64(D / Float64(Float64(l / M) * Float64(Float64(d * d) / D))))), 1.0)));
	elseif (d <= -6.6e-286)
		tmp = Float64(Float64(t_3 * Float64(t_0 * t_0)) * t_1);
	elseif (d <= 7.2e+41)
		tmp = Float64(t_1 * Float64((Float64(d / h) ^ 0.5) * (Float64(d / l) ^ 0.5)));
	else
		tmp = Float64(d / Float64(sqrt(l) * 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.25], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 - N[Power[N[(N[(1.0 / N[Sqrt[N[(l / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(N[(N[(D * M), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[d, -1e-66], N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(t$95$3 * N[(-0.125 * N[(h * N[(M * N[(D / N[(N[(l / M), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -6.6e-286], N[(N[(t$95$3 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[d, 7.2e+41], N[(t$95$1 * N[(N[Power[N[(d / h), $MachinePrecision], 0.5], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], 0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(d / N[(N[Sqrt[l], $MachinePrecision] * 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.25}\\
t_1 := 1 - {\left(\frac{1}{\sqrt{\frac{\ell}{h}}} \cdot \left(\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\\
t_2 := \sqrt{-d}\\
t_3 := \frac{t_2}{\sqrt{-\ell}}\\
\mathbf{if}\;d \leq -1 \cdot 10^{-66}:\\
\;\;\;\;\frac{t_2}{\sqrt{-h}} \cdot \left(t_3 \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 -6.6 \cdot 10^{-286}:\\
\;\;\;\;\left(t_3 \cdot \left(t_0 \cdot t_0\right)\right) \cdot t_1\\

\mathbf{elif}\;d \leq 7.2 \cdot 10^{+41}:\\
\;\;\;\;t_1 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\\

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


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. if d < -9.9999999999999998e-67

    1. Initial program 21.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. Simplified21.5

      \[\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))): 2 points increase in error, 4 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))): 6 points increase in error, 3 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)))): 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-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. Taylor expanded in D around 0 35.5

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

      \[\leadsto \sqrt{\frac{d}{h}} \cdot \left(\sqrt{\frac{d}{\ell}} \cdot \color{blue}{\mathsf{fma}\left(-0.125, h \cdot \left(\frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}} \cdot M\right), 1\right)}\right) \]
      Proof
      (fma.f64 -1/8 (*.f64 h (*.f64 (/.f64 D (*.f64 (/.f64 l M) (/.f64 (*.f64 d d) D))) M)) 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (/.f64 D (*.f64 (/.f64 l M) (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) D))) M)) 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (Rewrite<= associate-/l/_binary64 (/.f64 (/.f64 D (/.f64 (pow.f64 d 2) D)) (/.f64 l M))) M)) 1): 9 points increase in error, 5 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (/.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D D) (pow.f64 d 2))) (/.f64 l M)) M)) 1): 20 points increase in error, 1 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (/.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (pow.f64 d 2)) (/.f64 l M)) M)) 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (Rewrite=> associate-/r/_binary64 (*.f64 (/.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) l) M)) M)) 1): 2 points increase in error, 6 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (*.f64 (Rewrite<= associate-/r*_binary64 (/.f64 (pow.f64 D 2) (*.f64 (pow.f64 d 2) l))) M) M)) 1): 12 points increase in error, 2 points decrease in error
      (fma.f64 -1/8 (*.f64 h (*.f64 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 (*.f64 (pow.f64 d 2) l) M))) M)) 1): 7 points increase in error, 5 points decrease in error
      (fma.f64 -1/8 (*.f64 h (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 (/.f64 (*.f64 (pow.f64 d 2) l) M) M)))) 1): 10 points increase in error, 2 points decrease in error
      (fma.f64 -1/8 (*.f64 h (/.f64 (pow.f64 D 2) (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 (pow.f64 d 2) l) (*.f64 M M))))) 1): 12 points increase in error, 2 points decrease in error
      (fma.f64 -1/8 (*.f64 h (/.f64 (pow.f64 D 2) (/.f64 (*.f64 (pow.f64 d 2) l) (Rewrite<= unpow2_binary64 (pow.f64 M 2))))) 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 -1/8 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 D 2) (/.f64 (*.f64 (pow.f64 d 2) l) (pow.f64 M 2))) h)) 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 -1/8 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 (/.f64 (*.f64 (pow.f64 d 2) l) (pow.f64 M 2)) h))) 1): 7 points increase in error, 2 points decrease in error
      (fma.f64 -1/8 (/.f64 (pow.f64 D 2) (Rewrite<= associate-/r*_binary64 (/.f64 (*.f64 (pow.f64 d 2) l) (*.f64 (pow.f64 M 2) h)))) 1): 8 points increase in error, 5 points decrease in error
      (fma.f64 -1/8 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (*.f64 (pow.f64 d 2) l))) 1): 5 points increase in error, 11 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (*.f64 (pow.f64 d 2) l))) 1)): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1/8 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) l))) 1): 0 points increase in error, 0 points decrease in error
      (+.f64 (/.f64 (*.f64 -1/8 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h))) (Rewrite<= *-commutative_binary64 (*.f64 l (pow.f64 d 2)))) 1): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (*.f64 l (pow.f64 d 2))))) 1): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (Rewrite<= *-commutative_binary64 (*.f64 h (pow.f64 M 2)))) (*.f64 l (pow.f64 d 2)))) 1): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 d 2) l)))) 1): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 1 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l))))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr12.6

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

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

    if -9.9999999999999998e-67 < d < -6.5999999999999997e-286

    1. Initial program 33.1

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

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

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

    if -6.5999999999999997e-286 < d < 7.20000000000000051e41

    1. Initial program 27.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-rr25.7

      \[\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(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}}\right) \]
    3. Applied egg-rr25.6

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

    if 7.20000000000000051e41 < d

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1 \cdot 10^{-66}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \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)\\ \mathbf{elif}\;d \leq -6.6 \cdot 10^{-286}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left({\left(\frac{d}{h}\right)}^{0.25} \cdot {\left(\frac{d}{h}\right)}^{0.25}\right)\right) \cdot \left(1 - {\left(\frac{1}{\sqrt{\frac{\ell}{h}}} \cdot \left(\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right)\\ \mathbf{elif}\;d \leq 7.2 \cdot 10^{+41}:\\ \;\;\;\;\left(1 - {\left(\frac{1}{\sqrt{\frac{\ell}{h}}} \cdot \left(\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right)\right)}^{2}\right) \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]

Alternatives

Alternative 1
Error19.2
Cost104464
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_2 := 1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\\ t_3 := \left(t_1 \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot t_2\\ t_4 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;t_3 \leq -\infty:\\ \;\;\;\;t_4 \cdot \left(t_0 \cdot \left(\left(\frac{D}{\frac{\ell}{M}} \cdot \frac{D \cdot \left(h \cdot M\right)}{d}\right) \cdot \frac{-0.125}{d}\right)\right)\\ \mathbf{elif}\;t_3 \leq -5 \cdot 10^{-172}:\\ \;\;\;\;t_2 \cdot \left(t_1 \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right)\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;{\left(\sqrt[3]{\left(d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}\right) \cdot \left(-1 - \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right)}^{2}\right)\right)}\right)}^{3}\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{+231}:\\ \;\;\;\;t_4 \cdot \left(t_0 \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \]
Alternative 2
Error20.7
Cost62600
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \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{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right)\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \left(\left(\frac{D}{\frac{\ell}{M}} \cdot \frac{D \cdot \left(h \cdot M\right)}{d}\right) \cdot \frac{-0.125}{d}\right)\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+231}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \end{array} \]
Alternative 3
Error18.3
Cost34332
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_2 := \sqrt{-d}\\ t_3 := 1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\\ t_4 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ \mathbf{if}\;\ell \leq -2 \cdot 10^{-50}:\\ \;\;\;\;t_3 \cdot \left(\frac{t_2}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;\left(\frac{t_2}{\sqrt{-\ell}} \cdot t_4\right) \cdot t_0\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 10^{-224}:\\ \;\;\;\;t_3 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot t_1\right)\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-153}:\\ \;\;\;\;t_0 \cdot \left(t_4 \cdot t_1\right)\\ \mathbf{elif}\;\ell \leq 10^{-72}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \frac{D}{d}}}\right), 1\right)\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+132}:\\ \;\;\;\;\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) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 4
Error18.3
Cost34332
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_2 := \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\\ 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{-d}\\ \mathbf{if}\;\ell \leq -2 \cdot 10^{-50}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \cdot \left(\frac{t_4}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;\left(\frac{t_4}{\sqrt{-\ell}} \cdot t_3\right) \cdot t_0\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 10^{-224}:\\ \;\;\;\;t_0 \cdot \left(t_2 \cdot \left(\sqrt{d} \cdot \frac{1}{\sqrt{\ell}}\right)\right)\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-153}:\\ \;\;\;\;t_0 \cdot \left(t_3 \cdot t_1\right)\\ \mathbf{elif}\;\ell \leq 10^{-72}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \frac{D}{d}}}\right), 1\right)\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+132}:\\ \;\;\;\;\left(\sqrt{\frac{d}{\ell}} \cdot t_2\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 5
Error16.4
Cost34128
\[\begin{array}{l} t_0 := {\left(\frac{d}{h}\right)}^{0.5}\\ t_1 := \sqrt{-d}\\ t_2 := \frac{t_1}{\sqrt{-\ell}}\\ t_3 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;d \leq -1 \cdot 10^{-88}:\\ \;\;\;\;\frac{t_1}{\sqrt{-h}} \cdot \left(t_2 \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 0:\\ \;\;\;\;\left(t_2 \cdot t_0\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right)\\ \mathbf{elif}\;d \leq 4.6 \cdot 10^{-78}:\\ \;\;\;\;\left(\sqrt{d} \cdot \sqrt{\frac{1}{h}}\right) \cdot \left(t_3 \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 7.2 \cdot 10^{+41}:\\ \;\;\;\;\left(t_0 \cdot t_3\right) \cdot \left(1 - {\left(\left(\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right) \cdot \sqrt{0.5}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 6
Error23.6
Cost28124
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ t_2 := \sqrt{\frac{d}{\ell}}\\ t_3 := t_0 \cdot \left(t_2 \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{if}\;\ell \leq -4.5 \cdot 10^{+134}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq -1:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{h}{{\ell}^{3}}}, \left(M \cdot \left(M \cdot \frac{D}{\frac{d}{D}}\right)\right) \cdot 0.125, t_1\right)\\ \mathbf{elif}\;\ell \leq -2.8 \cdot 10^{-158}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq -3.8 \cdot 10^{-302}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;\ell \leq 10^{-230}:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 10^{-60}:\\ \;\;\;\;t_0 \cdot \left(\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \frac{D}{d}}}\right), 1\right)\right)\\ \mathbf{elif}\;\ell \leq 3.5 \cdot 10^{+97}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{h}} \cdot \left(\mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right) \cdot t_2\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 7
Error18.4
Cost28124
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{-d}\\ t_2 := 1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\\ 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 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ \mathbf{if}\;\ell \leq -2 \cdot 10^{-50}:\\ \;\;\;\;t_2 \cdot \left(\frac{t_1}{\sqrt{-h}} \cdot \frac{1}{\sqrt{\frac{\ell}{d}}}\right)\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;\left(\frac{t_1}{\sqrt{-\ell}} \cdot t_3\right) \cdot t_0\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 10^{-224}:\\ \;\;\;\;t_2 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot t_4\right)\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-153}:\\ \;\;\;\;t_0 \cdot \left(t_3 \cdot t_4\right)\\ \mathbf{elif}\;\ell \leq 10^{-72}:\\ \;\;\;\;t_0 \cdot \left(t_4 \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \frac{D}{d}}}\right), 1\right)\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+132}:\\ \;\;\;\;t_2 \cdot \left({\left(\frac{d}{\ell}\right)}^{0.5} \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 8
Error18.2
Cost28124
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \frac{\sqrt{d}}{\sqrt{\ell}}\\ t_2 := \sqrt{-d}\\ t_3 := {\left(\frac{d}{\ell}\right)}^{0.5}\\ t_4 := 1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\\ t_5 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{\ell}{M} \cdot \frac{d \cdot d}{D}}\right), 1\right)\\ \mathbf{if}\;\ell \leq -2 \cdot 10^{-50}:\\ \;\;\;\;t_4 \cdot \left(\frac{t_2}{\sqrt{-h}} \cdot t_3\right)\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-302}:\\ \;\;\;\;\left(\frac{t_2}{\sqrt{-\ell}} \cdot t_5\right) \cdot t_0\\ \mathbf{elif}\;\ell \leq 0:\\ \;\;\;\;\sqrt{\frac{d}{h} \cdot \frac{d}{\ell}} \cdot \left(1 - \frac{h}{\ell} \cdot \left(0.5 \cdot {\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right)}^{2}\right)\right)\\ \mathbf{elif}\;\ell \leq 10^{-224}:\\ \;\;\;\;t_4 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot t_1\right)\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-153}:\\ \;\;\;\;t_0 \cdot \left(t_5 \cdot t_1\right)\\ \mathbf{elif}\;\ell \leq 10^{-72}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \frac{D}{d}}}\right), 1\right)\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+132}:\\ \;\;\;\;t_4 \cdot \left(t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 9
Error16.5
Cost27856
\[\begin{array}{l} t_0 := \mathsf{fma}\left(-0.125, h \cdot \left(M \cdot \frac{D}{\frac{d \cdot \ell}{M \cdot \frac{D}{d}}}\right), 1\right)\\ t_1 := \sqrt{-d}\\ \mathbf{if}\;h \leq -2.8 \cdot 10^{-28}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{t_1}{\sqrt{-\ell}} \cdot t_0\right)\\ \mathbf{elif}\;h \leq 0:\\ \;\;\;\;\left(\frac{t_1}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{{\left(\left(D \cdot M\right) \cdot \frac{0.5}{d}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\\ \mathbf{elif}\;h \leq 10^{-84}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \mathbf{elif}\;h \leq 10^{+120}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left({\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2} \cdot -0.5\right)\right) \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot \frac{\sqrt{d}}{\sqrt{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sqrt{d} \cdot \frac{1}{\sqrt{h}}\right) \cdot \left(\sqrt{\frac{d}{\ell}} \cdot t_0\right)\\ \end{array} \]
Alternative 10
Error20.8
Cost27536
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \frac{D}{\frac{d}{D}}\\ \mathbf{if}\;d \leq -1 \cdot 10^{+66}:\\ \;\;\;\;\left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + -0.125 \cdot \left(M \cdot \left(M \cdot \frac{t_2}{\frac{\ell}{\frac{h}{d}}}\right)\right)\right)\\ \mathbf{elif}\;d \leq -1.35 \cdot 10^{-144}:\\ \;\;\;\;t_0 \cdot \left(t_1 \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}\;d \leq -1.1 \cdot 10^{-289}:\\ \;\;\;\;\mathsf{fma}\left(\sqrt{\frac{h}{{\ell}^{3}}}, \left(M \cdot \left(M \cdot t_2\right)\right) \cdot 0.125, \left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\right)\\ \mathbf{elif}\;d \leq 1.9 \cdot 10^{-33}:\\ \;\;\;\;\left(t_1 \cdot \mathsf{fma}\left({\left(\frac{\frac{D}{d}}{\frac{2}{M}}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right) \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 11
Error22.5
Cost21264
\[\begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\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)\\ t_1 := \left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -5.1 \cdot 10^{+169}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.96 \cdot 10^{+127}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.72 \cdot 10^{+50}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1 \cdot 10^{+20}:\\ \;\;\;\;\frac{\sqrt{\frac{d}{\ell}} \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)}{\sqrt{\frac{h}{d}}}\\ \mathbf{elif}\;d \leq -7.8 \cdot 10^{-46}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -9.2 \cdot 10^{-303}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 12
Error22.4
Cost15316
\[\begin{array}{l} t_0 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\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)\\ t_1 := \left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{if}\;d \leq -5.1 \cdot 10^{+169}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1.96 \cdot 10^{+127}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.2 \cdot 10^{+60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -1 \cdot 10^{+23}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq -7.8 \cdot 10^{-46}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -9.2 \cdot 10^{-303}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 13
Error22.0
Cost13384
\[\begin{array}{l} \mathbf{if}\;h \leq -2.1 \cdot 10^{+182}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq 0:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 14
Error22.9
Cost13252
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.8 \cdot 10^{-302}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 15
Error27.2
Cost7044
\[\begin{array}{l} \mathbf{if}\;\ell \leq 3.8 \cdot 10^{-285}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{1}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
Alternative 16
Error36.0
Cost6980
\[\begin{array}{l} \mathbf{if}\;d \leq -1.1 \cdot 10^{-252}:\\ \;\;\;\;\sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(h \cdot \ell\right)}^{-0.5}\\ \end{array} \]
Alternative 17
Error43.1
Cost6784
\[d \cdot {\left(h \cdot \ell\right)}^{-0.5} \]
Alternative 18
Error43.1
Cost6720
\[\frac{d}{\sqrt{h \cdot \ell}} \]

Error

Reproduce

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