Average Error: 26.2 → 14.8
Time: 36.6s
Precision: binary64
Cost: 33928
\[ \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{\frac{d}{h}}\\ t_1 := \frac{M}{d} \cdot D\\ t_2 := 1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot t_1\right) \cdot \frac{t_1 \cdot -0.5}{\ell}\right)\right)\\ t_3 := \sqrt{-d}\\ \mathbf{if}\;d \leq -6.2 \cdot 10^{-16}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t_3}{\sqrt{-h}} \cdot t_2\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{t_3}{\sqrt{-\ell}} \cdot \left(t_0 \cdot \left(1 + {\left(\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2} \cdot -0.5\right)\right)\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{+76}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_2 \cdot t_0\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
(FPCore (d h l M D)
 :precision binary64
 (*
  (* (pow (/ d h) (/ 1.0 2.0)) (pow (/ d l) (/ 1.0 2.0)))
  (- 1.0 (* (* (/ 1.0 2.0) (pow (/ (* M D) (* 2.0 d)) 2.0)) (/ h l)))))
(FPCore (d h l M D)
 :precision binary64
 (let* ((t_0 (sqrt (/ d h)))
        (t_1 (* (/ M d) D))
        (t_2 (+ 1.0 (* 0.5 (* h (* (* 0.5 t_1) (/ (* t_1 -0.5) l))))))
        (t_3 (sqrt (- d))))
   (if (<= d -6.2e-16)
     (* (sqrt (/ d l)) (* (/ t_3 (sqrt (- h))) t_2))
     (if (<= d -1e-310)
       (*
        (/ t_3 (sqrt (- l)))
        (*
         t_0
         (+ 1.0 (* (pow (* (* (* 0.5 M) (/ D d)) (sqrt (/ h l))) 2.0) -0.5))))
       (if (<= d 1.1e+76)
         (* (/ (sqrt d) (sqrt l)) (* t_2 t_0))
         (* d (* (pow l -0.5) (sqrt (/ 1.0 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 = sqrt((d / h));
	double t_1 = (M / d) * D;
	double t_2 = 1.0 + (0.5 * (h * ((0.5 * t_1) * ((t_1 * -0.5) / l))));
	double t_3 = sqrt(-d);
	double tmp;
	if (d <= -6.2e-16) {
		tmp = sqrt((d / l)) * ((t_3 / sqrt(-h)) * t_2);
	} else if (d <= -1e-310) {
		tmp = (t_3 / sqrt(-l)) * (t_0 * (1.0 + (pow((((0.5 * M) * (D / d)) * sqrt((h / l))), 2.0) * -0.5)));
	} else if (d <= 1.1e+76) {
		tmp = (sqrt(d) / sqrt(l)) * (t_2 * t_0);
	} else {
		tmp = d * (pow(l, -0.5) * sqrt((1.0 / h)));
	}
	return tmp;
}
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    code = (((d / h) ** (1.0d0 / 2.0d0)) * ((d / l) ** (1.0d0 / 2.0d0))) * (1.0d0 - (((1.0d0 / 2.0d0) * (((m * d_1) / (2.0d0 * d)) ** 2.0d0)) * (h / l)))
end function
real(8) function code(d, h, l, m, d_1)
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: m
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = sqrt((d / h))
    t_1 = (m / d) * d_1
    t_2 = 1.0d0 + (0.5d0 * (h * ((0.5d0 * t_1) * ((t_1 * (-0.5d0)) / l))))
    t_3 = sqrt(-d)
    if (d <= (-6.2d-16)) then
        tmp = sqrt((d / l)) * ((t_3 / sqrt(-h)) * t_2)
    else if (d <= (-1d-310)) then
        tmp = (t_3 / sqrt(-l)) * (t_0 * (1.0d0 + (((((0.5d0 * m) * (d_1 / d)) * sqrt((h / l))) ** 2.0d0) * (-0.5d0))))
    else if (d <= 1.1d+76) then
        tmp = (sqrt(d) / sqrt(l)) * (t_2 * t_0)
    else
        tmp = d * ((l ** (-0.5d0)) * sqrt((1.0d0 / h)))
    end if
    code = tmp
end function
public static double code(double d, double h, double l, double M, double D) {
	return (Math.pow((d / h), (1.0 / 2.0)) * Math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * Math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
public static double code(double d, double h, double l, double M, double D) {
	double t_0 = Math.sqrt((d / h));
	double t_1 = (M / d) * D;
	double t_2 = 1.0 + (0.5 * (h * ((0.5 * t_1) * ((t_1 * -0.5) / l))));
	double t_3 = Math.sqrt(-d);
	double tmp;
	if (d <= -6.2e-16) {
		tmp = Math.sqrt((d / l)) * ((t_3 / Math.sqrt(-h)) * t_2);
	} else if (d <= -1e-310) {
		tmp = (t_3 / Math.sqrt(-l)) * (t_0 * (1.0 + (Math.pow((((0.5 * M) * (D / d)) * Math.sqrt((h / l))), 2.0) * -0.5)));
	} else if (d <= 1.1e+76) {
		tmp = (Math.sqrt(d) / Math.sqrt(l)) * (t_2 * t_0);
	} else {
		tmp = d * (Math.pow(l, -0.5) * Math.sqrt((1.0 / h)));
	}
	return tmp;
}
def code(d, h, l, M, D):
	return (math.pow((d / h), (1.0 / 2.0)) * math.pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * math.pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)))
def code(d, h, l, M, D):
	t_0 = math.sqrt((d / h))
	t_1 = (M / d) * D
	t_2 = 1.0 + (0.5 * (h * ((0.5 * t_1) * ((t_1 * -0.5) / l))))
	t_3 = math.sqrt(-d)
	tmp = 0
	if d <= -6.2e-16:
		tmp = math.sqrt((d / l)) * ((t_3 / math.sqrt(-h)) * t_2)
	elif d <= -1e-310:
		tmp = (t_3 / math.sqrt(-l)) * (t_0 * (1.0 + (math.pow((((0.5 * M) * (D / d)) * math.sqrt((h / l))), 2.0) * -0.5)))
	elif d <= 1.1e+76:
		tmp = (math.sqrt(d) / math.sqrt(l)) * (t_2 * t_0)
	else:
		tmp = d * (math.pow(l, -0.5) * math.sqrt((1.0 / 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 = sqrt(Float64(d / h))
	t_1 = Float64(Float64(M / d) * D)
	t_2 = Float64(1.0 + Float64(0.5 * Float64(h * Float64(Float64(0.5 * t_1) * Float64(Float64(t_1 * -0.5) / l)))))
	t_3 = sqrt(Float64(-d))
	tmp = 0.0
	if (d <= -6.2e-16)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_3 / sqrt(Float64(-h))) * t_2));
	elseif (d <= -1e-310)
		tmp = Float64(Float64(t_3 / sqrt(Float64(-l))) * Float64(t_0 * Float64(1.0 + Float64((Float64(Float64(Float64(0.5 * M) * Float64(D / d)) * sqrt(Float64(h / l))) ^ 2.0) * -0.5))));
	elseif (d <= 1.1e+76)
		tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_2 * t_0));
	else
		tmp = Float64(d * Float64((l ^ -0.5) * sqrt(Float64(1.0 / h))));
	end
	return tmp
end
function tmp = code(d, h, l, M, D)
	tmp = (((d / h) ^ (1.0 / 2.0)) * ((d / l) ^ (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * (((M * D) / (2.0 * d)) ^ 2.0)) * (h / l)));
end
function tmp_2 = code(d, h, l, M, D)
	t_0 = sqrt((d / h));
	t_1 = (M / d) * D;
	t_2 = 1.0 + (0.5 * (h * ((0.5 * t_1) * ((t_1 * -0.5) / l))));
	t_3 = sqrt(-d);
	tmp = 0.0;
	if (d <= -6.2e-16)
		tmp = sqrt((d / l)) * ((t_3 / sqrt(-h)) * t_2);
	elseif (d <= -1e-310)
		tmp = (t_3 / sqrt(-l)) * (t_0 * (1.0 + (((((0.5 * M) * (D / d)) * sqrt((h / l))) ^ 2.0) * -0.5)));
	elseif (d <= 1.1e+76)
		tmp = (sqrt(d) / sqrt(l)) * (t_2 * t_0);
	else
		tmp = d * ((l ^ -0.5) * sqrt((1.0 / h)));
	end
	tmp_2 = tmp;
end
code[d_, h_, l_, M_, D_] := N[(N[(N[Power[N[(d / h), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[Power[N[(d / l), $MachinePrecision], N[(1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 - N[(N[(N[(1.0 / 2.0), $MachinePrecision] * N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[d_, h_, l_, M_, D_] := Block[{t$95$0 = N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(M / d), $MachinePrecision] * D), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(0.5 * N[(h * N[(N[(0.5 * t$95$1), $MachinePrecision] * N[(N[(t$95$1 * -0.5), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -6.2e-16], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$3 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -1e-310], N[(N[(t$95$3 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(1.0 + N[(N[Power[N[(N[(N[(0.5 * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(h / l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, 1.1e+76], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision], N[(d * N[(N[Power[l, -0.5], $MachinePrecision] * N[Sqrt[N[(1.0 / h), $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{\frac{d}{h}}\\
t_1 := \frac{M}{d} \cdot D\\
t_2 := 1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot t_1\right) \cdot \frac{t_1 \cdot -0.5}{\ell}\right)\right)\\
t_3 := \sqrt{-d}\\
\mathbf{if}\;d \leq -6.2 \cdot 10^{-16}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t_3}{\sqrt{-h}} \cdot t_2\right)\\

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

\mathbf{elif}\;d \leq 1.1 \cdot 10^{+76}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_2 \cdot t_0\right)\\

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


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 regimes
  2. if d < -6.2000000000000002e-16

    1. Initial program 22.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. Simplified22.1

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} \]
      Proof
      (*.f64 (sqrt.f64 (/.f64 d l)) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d l) 1/2)) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (Rewrite<= metadata-eval (/.f64 1 2))) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d h) 1/2)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (Rewrite<= metadata-eval (/.f64 1 2))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (*.f64 (Rewrite<= metadata-eval (/.f64 1 2)) (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (*.f64 (/.f64 1 2) (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 M D) (*.f64 2 d))) 2) (/.f64 h l)))))): 1 points increase in error, 3 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (Rewrite<= associate-*l*_binary64 (*.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 l) (/.f64 1 2)) (pow.f64 (/.f64 d h) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l))))): 9 points increase in error, 2 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.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)))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr22.1

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

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(h \cdot \frac{{\left(D \cdot \frac{0.5}{\frac{d}{M}}\right)}^{2}}{\ell}\right)}\right)\right) \]
      Proof
      (*.f64 h (/.f64 (pow.f64 (*.f64 D (/.f64 1/2 (/.f64 d M))) 2) l)): 0 points increase in error, 0 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (*.f64 D (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 1/2 M) d))) 2) l)): 7 points increase in error, 11 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (*.f64 D (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 M 1/2)) d)) 2) l)): 0 points increase in error, 0 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (*.f64 M 1/2) d) D)) 2) l)): 0 points increase in error, 0 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (*.f64 M 1/2) D) d)) 2) l)): 20 points increase in error, 12 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 M 1/2) (/.f64 D d))) 2) l)): 14 points increase in error, 10 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) l) h)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) h) l)): 10 points increase in error, 23 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) (/.f64 h l))): 38 points increase in error, 9 points decrease in error
      (Rewrite<= +-lft-identity_binary64 (+.f64 0 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) (/.f64 h l)))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr18.8

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \color{blue}{\left(\frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{1} \cdot \frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{\ell}\right)}\right)\right)\right) \]
    6. Applied egg-rr8.3

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

    if -6.2000000000000002e-16 < d < -9.999999999999969e-311

    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. Simplified32.3

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} \]
      Proof
      (*.f64 (sqrt.f64 (/.f64 d l)) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d l) 1/2)) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (Rewrite<= metadata-eval (/.f64 1 2))) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d h) 1/2)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (Rewrite<= metadata-eval (/.f64 1 2))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (*.f64 (Rewrite<= metadata-eval (/.f64 1 2)) (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (*.f64 (/.f64 1 2) (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 M D) (*.f64 2 d))) 2) (/.f64 h l)))))): 1 points increase in error, 3 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (Rewrite<= associate-*l*_binary64 (*.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 l) (/.f64 1 2)) (pow.f64 (/.f64 d h) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l))))): 9 points increase in error, 2 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.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)))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr30.3

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

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

    if -9.999999999999969e-311 < d < 1.1e76

    1. Initial program 26.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. Simplified27.1

      \[\leadsto \color{blue}{\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)\right)} \]
      Proof
      (*.f64 (sqrt.f64 (/.f64 d l)) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d l) 1/2)) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (Rewrite<= metadata-eval (/.f64 1 2))) (*.f64 (sqrt.f64 (/.f64 d h)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d h) 1/2)) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (Rewrite<= metadata-eval (/.f64 1 2))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (*.f64 (Rewrite<= metadata-eval (/.f64 1 2)) (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (*.f64 (/.f64 1 2) (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 M D) (*.f64 2 d))) 2) (/.f64 h l)))))): 1 points increase in error, 3 points decrease in error
      (*.f64 (pow.f64 (/.f64 d l) (/.f64 1 2)) (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (-.f64 1 (Rewrite<= associate-*l*_binary64 (*.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 l) (/.f64 1 2)) (pow.f64 (/.f64 d h) (/.f64 1 2))) (-.f64 1 (*.f64 (*.f64 (/.f64 1 2) (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l))))): 9 points increase in error, 2 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.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)))): 0 points increase in error, 0 points decrease in error
    3. Applied egg-rr27.1

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

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(h \cdot \frac{{\left(D \cdot \frac{0.5}{\frac{d}{M}}\right)}^{2}}{\ell}\right)}\right)\right) \]
      Proof
      (*.f64 h (/.f64 (pow.f64 (*.f64 D (/.f64 1/2 (/.f64 d M))) 2) l)): 0 points increase in error, 0 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (*.f64 D (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 1/2 M) d))) 2) l)): 7 points increase in error, 11 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (*.f64 D (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 M 1/2)) d)) 2) l)): 0 points increase in error, 0 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (*.f64 M 1/2) d) D)) 2) l)): 0 points increase in error, 0 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (*.f64 M 1/2) D) d)) 2) l)): 20 points increase in error, 12 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 M 1/2) (/.f64 D d))) 2) l)): 14 points increase in error, 10 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) l) h)): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) h) l)): 10 points increase in error, 23 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) (/.f64 h l))): 38 points increase in error, 9 points decrease in error
      (Rewrite<= +-lft-identity_binary64 (+.f64 0 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) (/.f64 h l)))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr24.6

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \color{blue}{\left(\frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{1} \cdot \frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{\ell}\right)}\right)\right)\right) \]
    6. Applied egg-rr19.0

      \[\leadsto \color{blue}{\left(\sqrt{d} \cdot \frac{1}{\sqrt{\ell}}\right)} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(\frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{1} \cdot \frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{\ell}\right)\right)\right)\right) \]
    7. Simplified18.9

      \[\leadsto \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(\frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{1} \cdot \frac{0.5 \cdot \left(\frac{M}{d} \cdot D\right)}{\ell}\right)\right)\right)\right) \]
      Proof
      (/.f64 (sqrt.f64 d) (sqrt.f64 l)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (sqrt.f64 d) 1)) (sqrt.f64 l)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (sqrt.f64 d) (/.f64 1 (sqrt.f64 l)))): 14 points increase in error, 21 points decrease in error

    if 1.1e76 < d

    1. Initial program 26.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. Simplified25.8

      \[\leadsto \color{blue}{\left(\sqrt{\frac{d}{h}} \cdot \sqrt{\frac{d}{\ell}}\right) \cdot \left(1 - 0.5 \cdot \left({\left(\frac{M}{2} \cdot \frac{D}{d}\right)}^{2} \cdot \frac{h}{\ell}\right)\right)} \]
      Proof
      (*.f64 (*.f64 (sqrt.f64 (/.f64 d h)) (sqrt.f64 (/.f64 d l))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d h) 1/2)) (sqrt.f64 (/.f64 d l))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 (pow.f64 (/.f64 d h) (Rewrite<= metadata-eval (/.f64 1 2))) (sqrt.f64 (/.f64 d l))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (Rewrite<= unpow1/2_binary64 (pow.f64 (/.f64 d l) 1/2))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (Rewrite<= metadata-eval (/.f64 1 2)))) (-.f64 1 (*.f64 1/2 (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (Rewrite<= metadata-eval (/.f64 1 2)) (*.f64 (pow.f64 (*.f64 (/.f64 M 2) (/.f64 D d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (*.f64 (/.f64 1 2) (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 M D) (*.f64 2 d))) 2) (/.f64 h l))))): 2 points increase in error, 3 points decrease in error
      (*.f64 (*.f64 (pow.f64 (/.f64 d h) (/.f64 1 2)) (pow.f64 (/.f64 d l) (/.f64 1 2))) (-.f64 1 (Rewrite<= associate-*l*_binary64 (*.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
    3. Taylor expanded in d around inf 18.6

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

      \[\leadsto \color{blue}{d \cdot \sqrt{\frac{\frac{1}{\ell}}{h}}} \]
      Proof
      (*.f64 d (sqrt.f64 (/.f64 (/.f64 1 l) h))): 0 points increase in error, 0 points decrease in error
      (*.f64 d (sqrt.f64 (Rewrite<= associate-/r*_binary64 (/.f64 1 (*.f64 l h))))): 18 points increase in error, 5 points decrease in error
      (Rewrite<= *-commutative_binary64 (*.f64 (sqrt.f64 (/.f64 1 (*.f64 l h))) d)): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr7.9

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;d \leq -6.2 \cdot 10^{-16}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot \left(1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot -0.5}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;d \leq -1 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + {\left(\left(\left(0.5 \cdot M\right) \cdot \frac{D}{d}\right) \cdot \sqrt{\frac{h}{\ell}}\right)}^{2} \cdot -0.5\right)\right)\\ \mathbf{elif}\;d \leq 1.1 \cdot 10^{+76}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\left(1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \frac{\left(\frac{M}{d} \cdot D\right) \cdot -0.5}{\ell}\right)\right)\right) \cdot \sqrt{\frac{d}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error13.3
Cost77580
\[\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 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\ t_1 := \frac{M}{d} \cdot D\\ t_2 := \sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot t_1\right) \cdot \frac{t_1 \cdot -0.5}{\ell}\right)\right)\right) \cdot \sqrt{\frac{d}{h}}\right)\\ t_3 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;t_0 \leq -2 \cdot 10^{-182}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t_0 \leq 0:\\ \;\;\;\;t_3\\ \mathbf{elif}\;t_0 \leq 10^{+252}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \]
Alternative 2
Error15.5
Cost21712
\[\begin{array}{l} t_0 := \frac{M}{d} \cdot D\\ t_1 := 1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot t_0\right) \cdot \frac{t_0 \cdot -0.5}{\ell}\right)\right)\\ t_2 := \sqrt{\frac{d}{\ell}} \cdot \left(\frac{\sqrt{-d}}{\sqrt{-h}} \cdot t_1\right)\\ \mathbf{if}\;h \leq -2.35 \cdot 10^{-38}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq -3.1 \cdot 10^{-209}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;h \leq 1.1 \cdot 10^{-31}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot \frac{\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right) \cdot \left(M \cdot \left(0.5 \cdot D\right)\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_1 \cdot \sqrt{\frac{d}{h}}\right)\\ \end{array} \]
Alternative 3
Error17.1
Cost21580
\[\begin{array}{l} t_0 := \frac{M}{d} \cdot D\\ t_1 := 1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot t_0\right) \cdot \frac{t_0 \cdot -0.5}{\ell}\right)\right)\\ \mathbf{if}\;h \leq -8.4 \cdot 10^{-41}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(t_1 \cdot \frac{1}{\sqrt{\frac{h}{d}}}\right)\\ \mathbf{elif}\;h \leq 6.2 \cdot 10^{-255}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{elif}\;h \leq 6.6 \cdot 10^{-25}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot \frac{\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right) \cdot \left(M \cdot \left(0.5 \cdot D\right)\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_1 \cdot \sqrt{\frac{d}{h}}\right)\\ \end{array} \]
Alternative 4
Error14.8
Cost21580
\[\begin{array}{l} t_0 := \frac{M}{d} \cdot D\\ t_1 := 1 + 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot t_0\right) \cdot \frac{t_0 \cdot -0.5}{\ell}\right)\right)\\ t_2 := t_1 \cdot \sqrt{\frac{d}{h}}\\ t_3 := \sqrt{-d}\\ \mathbf{if}\;d \leq -440000000:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t_3}{\sqrt{-h}} \cdot t_1\right)\\ \mathbf{elif}\;d \leq -6.5 \cdot 10^{-305}:\\ \;\;\;\;\frac{t_3}{\sqrt{-\ell}} \cdot t_2\\ \mathbf{elif}\;d \leq 3.6 \cdot 10^{+76}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot t_2\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 5
Error20.4
Cost15316
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := 1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\ell} \cdot \frac{h}{d \cdot d}\right)\right)\\ t_3 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;d \leq -1.12 \cdot 10^{+70}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;d \leq -4.2 \cdot 10^{-155}:\\ \;\;\;\;\left(t_0 \cdot t_1\right) \cdot t_2\\ \mathbf{elif}\;d \leq -2 \cdot 10^{-308}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;d \leq 1.26 \cdot 10^{-144}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(\frac{h}{\ell} \cdot -0.5\right) \cdot \frac{\left(M \cdot \left(D \cdot \frac{0.5}{d}\right)\right) \cdot \left(M \cdot \left(0.5 \cdot D\right)\right)}{d}\right)\\ \mathbf{elif}\;d \leq 4.8 \cdot 10^{+61}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot t_2\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 6
Error23.6
Cost15192
\[\begin{array}{l} t_0 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ t_1 := \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ t_2 := t_1 \cdot \left(1 + -0.125 \cdot \frac{\left(h \cdot \left(D \cdot D\right)\right) \cdot \left(M \cdot M\right)}{\ell \cdot \left(d \cdot d\right)}\right)\\ \mathbf{if}\;d \leq -8.2 \cdot 10^{+80}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.02 \cdot 10^{-48}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-156}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 2.1 \cdot 10^{-89}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 1.8 \cdot 10^{+24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 7 \cdot 10^{+58}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 7
Error21.1
Cost15184
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\ell} \cdot \frac{h}{d \cdot d}\right)\right)\right)\right)\\ t_1 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;d \leq -1.45 \cdot 10^{+68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -3.2 \cdot 10^{-155}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 9 \cdot 10^{-144}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 1.05 \cdot 10^{+64}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 8
Error21.1
Cost15184
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{\ell}}\\ t_1 := \sqrt{\frac{d}{h}}\\ t_2 := 1 - 0.5 \cdot \left(0.25 \cdot \left(\frac{\left(M \cdot D\right) \cdot \left(M \cdot D\right)}{\ell} \cdot \frac{h}{d \cdot d}\right)\right)\\ t_3 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;d \leq -5.5 \cdot 10^{+67}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;d \leq -1.3 \cdot 10^{-155}:\\ \;\;\;\;\left(t_0 \cdot t_1\right) \cdot t_2\\ \mathbf{elif}\;d \leq 6.5 \cdot 10^{-144}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;d \leq 5 \cdot 10^{+61}:\\ \;\;\;\;t_0 \cdot \left(t_1 \cdot t_2\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 9
Error23.3
Cost14928
\[\begin{array}{l} t_0 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;d \leq -3 \cdot 10^{+80}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -1.35 \cdot 10^{-45}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 4.8 \cdot 10^{-144}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 1.3 \cdot 10^{+74}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}} \cdot \left(1 + \left(-0.125 \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right) \cdot \frac{M \cdot \left(h \cdot M\right)}{\ell}\right)\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 10
Error23.1
Cost14600
\[\begin{array}{l} t_0 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;d \leq -4.4 \cdot 10^{+81}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq -6.2 \cdot 10^{-49}:\\ \;\;\;\;\left(1 + -0.5 \cdot \left(h \cdot \frac{{\left(\frac{D}{d} \cdot \frac{M}{2}\right)}^{2}}{\ell}\right)\right) \cdot \sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 2.2 \cdot 10^{-116}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 11
Error23.7
Cost13444
\[\begin{array}{l} \mathbf{if}\;d \leq 1.2 \cdot 10^{-115}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;d \cdot \left({\ell}^{-0.5} \cdot \sqrt{\frac{1}{h}}\right)\\ \end{array} \]
Alternative 12
Error23.4
Cost13252
\[\begin{array}{l} \mathbf{if}\;h \leq 4.6 \cdot 10^{-289}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 13
Error27.1
Cost13120
\[\left|\frac{d}{\sqrt{\ell \cdot h}}\right| \]
Alternative 14
Error35.2
Cost6980
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.6 \cdot 10^{-196}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
Alternative 15
Error33.6
Cost6980
\[\begin{array}{l} \mathbf{if}\;\ell \leq -3.6 \cdot 10^{-196}:\\ \;\;\;\;\sqrt{d \cdot \frac{\frac{d}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell \cdot h}}\\ \end{array} \]
Alternative 16
Error62.2
Cost6720
\[d \cdot \sqrt{\ell \cdot h} \]
Alternative 17
Error44.0
Cost6720
\[\frac{d}{\sqrt{\ell \cdot h}} \]

Error

Reproduce

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