Average Error: 26.6 → 16.3
Time: 51.5s
Precision: binary64
Cost: 33796
\[ \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 := \sqrt{-d}\\ \mathbf{if}\;d \leq -1 \cdot 10^{+30}:\\ \;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \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 -3.9 \cdot 10^{-296}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t_0}{\sqrt{-\ell}}\right) \cdot \left(1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \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))))
   (if (<= d -1e+30)
     (*
      (/ t_0 (sqrt (- h)))
      (*
       (/ 1.0 (sqrt (/ l d)))
       (fma (pow (/ (/ D d) (/ 2.0 M)) 2.0) (* (/ h l) -0.5) 1.0)))
     (if (<= d -3.9e-296)
       (*
        (* (sqrt (/ d h)) (/ t_0 (sqrt (- l))))
        (+ 1.0 (/ (* (pow (* (/ D d) (/ M 2.0)) 2.0) (* h -0.5)) l)))
       (if (<= d 5e-199)
         (/ (* D (* M (/ (sqrt h) (pow l 1.5)))) (/ (/ d M) (* D -0.125)))
         (*
          (+ 1.0 (* (/ (pow (* (/ D d) (* M 0.5)) 2.0) l) (* h -0.5)))
          (/ 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 tmp;
	if (d <= -1e+30) {
		tmp = (t_0 / sqrt(-h)) * ((1.0 / sqrt((l / d))) * fma(pow(((D / d) / (2.0 / M)), 2.0), ((h / l) * -0.5), 1.0));
	} else if (d <= -3.9e-296) {
		tmp = (sqrt((d / h)) * (t_0 / sqrt(-l))) * (1.0 + ((pow(((D / d) * (M / 2.0)), 2.0) * (h * -0.5)) / l));
	} else if (d <= 5e-199) {
		tmp = (D * (M * (sqrt(h) / pow(l, 1.5)))) / ((d / M) / (D * -0.125));
	} else {
		tmp = (1.0 + ((pow(((D / d) * (M * 0.5)), 2.0) / l) * (h * -0.5))) * (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))
	tmp = 0.0
	if (d <= -1e+30)
		tmp = Float64(Float64(t_0 / sqrt(Float64(-h))) * Float64(Float64(1.0 / sqrt(Float64(l / d))) * fma((Float64(Float64(D / d) / Float64(2.0 / M)) ^ 2.0), Float64(Float64(h / l) * -0.5), 1.0)));
	elseif (d <= -3.9e-296)
		tmp = Float64(Float64(sqrt(Float64(d / h)) * Float64(t_0 / sqrt(Float64(-l)))) * Float64(1.0 + Float64(Float64((Float64(Float64(D / d) * Float64(M / 2.0)) ^ 2.0) * Float64(h * -0.5)) / l)));
	elseif (d <= 5e-199)
		tmp = Float64(Float64(D * Float64(M * Float64(sqrt(h) / (l ^ 1.5)))) / Float64(Float64(d / M) / Float64(D * -0.125)));
	else
		tmp = Float64(Float64(1.0 + Float64(Float64((Float64(Float64(D / d) * Float64(M * 0.5)) ^ 2.0) / l) * Float64(h * -0.5))) * 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]}, If[LessEqual[d, -1e+30], N[(N[(t$95$0 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 / N[Sqrt[N[(l / d), $MachinePrecision]], $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[d, -3.9e-296], N[(N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(t$95$0 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M / 2.0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 5e-199], N[(N[(D * N[(M * N[(N[Sqrt[h], $MachinePrecision] / N[Power[l, 1.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(d / M), $MachinePrecision] / N[(D * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(N[(N[Power[N[(N[(D / d), $MachinePrecision] * N[(M * 0.5), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision] * N[(h * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(d / N[(N[Sqrt[h], $MachinePrecision] * N[Sqrt[l], $MachinePrecision]), $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}\\
\mathbf{if}\;d \leq -1 \cdot 10^{+30}:\\
\;\;\;\;\frac{t_0}{\sqrt{-h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \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 -3.9 \cdot 10^{-296}:\\
\;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t_0}{\sqrt{-\ell}}\right) \cdot \left(1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\\

\mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\
\;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\

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


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. if d < -1e30

    1. Initial program 24.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. Simplified24.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))): 3 points increase in error, 5 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))): 5 points increase in error, 8 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, 4 points decrease in error
    3. Applied egg-rr23.4

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

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

    if -1e30 < d < -3.9000000000000001e-296

    1. Initial program 28.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. Applied egg-rr28.0

      \[\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-rr27.7

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

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

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

    if -3.9000000000000001e-296 < d < 4.9999999999999996e-199

    1. Initial program 40.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. Applied egg-rr40.5

      \[\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}{2} \cdot {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2}\right) \cdot \frac{h}{\ell}\right) \]
    3. Taylor expanded in d around 0 49.2

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

      \[\leadsto \color{blue}{\sqrt{\frac{h}{{\ell}^{3}}} \cdot \left(M \cdot \frac{D \cdot D}{\frac{\frac{d}{M}}{-0.125}}\right)} \]
      Proof
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (*.f64 M (/.f64 (*.f64 D D) (/.f64 (/.f64 d M) -1/8)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (*.f64 M (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (/.f64 (/.f64 d M) -1/8)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (*.f64 M (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) -1/8) (/.f64 d M))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (*.f64 M (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1/8 (pow.f64 D 2))) (/.f64 d M)))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (*.f64 -1/8 (pow.f64 D 2)) (/.f64 d M)) M))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (Rewrite<= associate-/r/_binary64 (/.f64 (*.f64 -1/8 (pow.f64 D 2)) (/.f64 (/.f64 d M) M)))): 19 points increase in error, 4 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (/.f64 (*.f64 -1/8 (pow.f64 D 2)) (Rewrite<= associate-/r*_binary64 (/.f64 d (*.f64 M M))))): 14 points increase in error, 3 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (/.f64 (*.f64 -1/8 (pow.f64 D 2)) (/.f64 d (Rewrite<= unpow2_binary64 (pow.f64 M 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (Rewrite<= associate-*r/_binary64 (*.f64 -1/8 (/.f64 (pow.f64 D 2) (/.f64 d (pow.f64 M 2)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (sqrt.f64 (/.f64 h (pow.f64 l 3))) (*.f64 -1/8 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) d)))): 4 points increase in error, 5 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) d)) (sqrt.f64 (/.f64 h (pow.f64 l 3))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r*_binary64 (*.f64 -1/8 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) d) (sqrt.f64 (/.f64 h (pow.f64 l 3)))))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr40.8

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

    if 4.9999999999999996e-199 < d

    1. Initial program 24.3

      \[\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-rr24.3

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

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

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

      \[\leadsto \color{blue}{{\left(\frac{d}{\sqrt{h} \cdot \sqrt{\ell}} \cdot \left(1 - \frac{{\left(\left(M \cdot 0.5\right) \cdot \frac{D}{d}\right)}^{2}}{\ell} \cdot \left(h \cdot 0.5\right)\right)\right)}^{1}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification16.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -1 \cdot 10^{+30}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \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 -3.9 \cdot 10^{-296}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \left(1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]

Alternatives

Alternative 1
Error20.1
Cost62600
\[\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 := t_0 \cdot \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right)\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+268}:\\ \;\;\;\;t_0 \cdot \left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 2
Error15.3
Cost27528
\[\begin{array}{l} t_0 := 1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\\ t_1 := \sqrt{-d}\\ \mathbf{if}\;h \leq -1 \cdot 10^{-120}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t_1}{\sqrt{-\ell}}\right) \cdot t_0\\ \mathbf{elif}\;h \leq 0:\\ \;\;\;\;t_0 \cdot \left(\frac{t_1}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 3
Error16.7
Cost27528
\[\begin{array}{l} t_0 := \sqrt{-d}\\ \mathbf{if}\;d \leq -1 \cdot 10^{-32}:\\ \;\;\;\;\left(\frac{t_0}{\sqrt{-h}} \cdot \sqrt{\frac{d}{\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 -3.9 \cdot 10^{-296}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{t_0}{\sqrt{-\ell}}\right) \cdot \left(1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 4
Error17.2
Cost27396
\[\begin{array}{l} \mathbf{if}\;d \leq -3.9 \cdot 10^{-296}:\\ \;\;\;\;\left(\sqrt{\frac{d}{h}} \cdot \frac{\sqrt{-d}}{\sqrt{-\ell}}\right) \cdot \left(1 + \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2} \cdot \left(h \cdot -0.5\right)}{\ell}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 5
Error20.6
Cost27268
\[\begin{array}{l} \mathbf{if}\;d \leq -3.9 \cdot 10^{-296}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \mathsf{fma}\left({\left(0.5 \cdot \frac{D \cdot M}{d}\right)}^{2}, \frac{h}{\ell} \cdot -0.5, 1\right)\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 6
Error22.6
Cost21132
\[\begin{array}{l} t_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}{h}} \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{if}\;d \leq -3.9 \cdot 10^{-296}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 1.12 \cdot 10^{-194}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{elif}\;d \leq 2.8 \cdot 10^{+84}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 7
Error23.1
Cost21132
\[\begin{array}{l} t_0 := {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := \sqrt{\frac{d}{\ell}}\\ \mathbf{if}\;d \leq -3.9 \cdot 10^{-296}:\\ \;\;\;\;t_1 \cdot \left(t_2 \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot t_0\right)\right)\\ \mathbf{elif}\;d \leq 1.12 \cdot 10^{-194}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{elif}\;d \leq 2.8 \cdot 10^{+84}:\\ \;\;\;\;\left(1 + \frac{t_0 \cdot \left(h \cdot -0.5\right)}{\ell}\right) \cdot \left(t_1 \cdot t_2\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 8
Error23.1
Cost21132
\[\begin{array}{l} t_0 := {\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}\\ t_1 := \sqrt{\frac{d}{h}}\\ \mathbf{if}\;d \leq -3.9 \cdot 10^{-296}:\\ \;\;\;\;t_1 \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot t_0\right)\right)\\ \mathbf{elif}\;d \leq 1.12 \cdot 10^{-194}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{elif}\;d \leq 2.8 \cdot 10^{+84}:\\ \;\;\;\;\left(1 + \frac{t_0 \cdot \left(h \cdot -0.5\right)}{\ell}\right) \cdot \left(t_1 \cdot \sqrt{\frac{d}{\ell}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 9
Error20.6
Cost21060
\[\begin{array}{l} \mathbf{if}\;d \leq -3.9 \cdot 10^{-296}:\\ \;\;\;\;\left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{D \cdot M}{d \cdot 2}\right)}^{2}\right)\right) \cdot \left(\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot {\left(\frac{d}{h}\right)}^{0.5}\right)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-199}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \frac{{\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}{\ell} \cdot \left(h \cdot -0.5\right)\right) \cdot \frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 10
Error25.6
Cost14088
\[\begin{array}{l} \mathbf{if}\;d \leq 2.2 \cdot 10^{-304}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq 1.12 \cdot 10^{-194}:\\ \;\;\;\;\frac{M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}}{\frac{\frac{d}{M}}{D} \cdot \frac{-8}{D}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 11
Error25.5
Cost14088
\[\begin{array}{l} \mathbf{if}\;d \leq 2.2 \cdot 10^{-304}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;d \leq 1.12 \cdot 10^{-194}:\\ \;\;\;\;\frac{D \cdot \left(M \cdot \frac{\sqrt{h}}{{\ell}^{1.5}}\right)}{\frac{\frac{d}{M}}{D \cdot -0.125}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 12
Error25.5
Cost13508
\[\begin{array}{l} \mathbf{if}\;\ell \leq 1.7 \cdot 10^{-277}:\\ \;\;\;\;\frac{1}{\sqrt{\frac{\ell}{d}}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 13
Error33.2
Cost13380
\[\begin{array}{l} \mathbf{if}\;d \leq 1.35 \cdot 10^{-252}:\\ \;\;\;\;\sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \frac{\sqrt{\frac{1}{\ell}}}{\sqrt{h}}\\ \end{array} \]
Alternative 14
Error25.6
Cost13380
\[\begin{array}{l} \mathbf{if}\;\ell \leq 1.7 \cdot 10^{-277}:\\ \;\;\;\;\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 15
Error33.4
Cost13252
\[\begin{array}{l} \mathbf{if}\;d \leq 1.75 \cdot 10^{-239}:\\ \;\;\;\;\sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h} \cdot \sqrt{\ell}}\\ \end{array} \]
Alternative 16
Error37.0
Cost6980
\[\begin{array}{l} \mathbf{if}\;\ell \leq -8.4 \cdot 10^{-246}:\\ \;\;\;\;\sqrt{\frac{d \cdot d}{h \cdot \ell}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{h \cdot \ell}}\\ \end{array} \]
Alternative 17
Error62.3
Cost6720
\[d \cdot \sqrt{h \cdot \ell} \]
Alternative 18
Error44.1
Cost6720
\[\frac{d}{\sqrt{h \cdot \ell}} \]

Error

Reproduce

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