Average Error: 26.7 → 12.4
Time: 35.1s
Precision: binary64
Cost: 27976
\[ \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 := 0.5 \cdot \left(\frac{M}{d} \cdot D\right)\\ t_1 := 1 + 0.5 \cdot \left(h \cdot \left(t_0 \cdot \left(t_0 \cdot \frac{-1}{\ell}\right)\right)\right)\\ t_2 := \sqrt{-d}\\ \mathbf{if}\;d \leq -1.35 \cdot 10^{-45}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t_2}{\sqrt{-h}} \cdot t_1\right)\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-311}:\\ \;\;\;\;\frac{t_2}{\sqrt{-\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 + 0.5 \cdot \left(\frac{\frac{h}{d} \cdot \left(M \cdot D\right)}{d \cdot \frac{\ell}{M \cdot D}} \cdot -0.25\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{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 (* 0.5 (* (/ M d) D)))
        (t_1 (+ 1.0 (* 0.5 (* h (* t_0 (* t_0 (/ -1.0 l)))))))
        (t_2 (sqrt (- d))))
   (if (<= d -1.35e-45)
     (* (sqrt (/ d l)) (* (/ t_2 (sqrt (- h))) t_1))
     (if (<= d -5e-311)
       (*
        (/ t_2 (sqrt (- l)))
        (*
         (sqrt (/ d h))
         (+
          1.0
          (* 0.5 (* (/ (* (/ h d) (* M D)) (* d (/ l (* M D)))) -0.25)))))
       (* (/ (sqrt d) (sqrt l)) (* t_1 (/ (sqrt d) (sqrt h))))))))
double code(double d, double h, double l, double M, double D) {
	return (pow((d / h), (1.0 / 2.0)) * pow((d / l), (1.0 / 2.0))) * (1.0 - (((1.0 / 2.0) * pow(((M * D) / (2.0 * d)), 2.0)) * (h / l)));
}
double code(double d, double h, double l, double M, double D) {
	double t_0 = 0.5 * ((M / d) * D);
	double t_1 = 1.0 + (0.5 * (h * (t_0 * (t_0 * (-1.0 / l)))));
	double t_2 = sqrt(-d);
	double tmp;
	if (d <= -1.35e-45) {
		tmp = sqrt((d / l)) * ((t_2 / sqrt(-h)) * t_1);
	} else if (d <= -5e-311) {
		tmp = (t_2 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + (0.5 * ((((h / d) * (M * D)) / (d * (l / (M * D)))) * -0.25))));
	} else {
		tmp = (sqrt(d) / sqrt(l)) * (t_1 * (sqrt(d) / sqrt(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) :: tmp
    t_0 = 0.5d0 * ((m / d) * d_1)
    t_1 = 1.0d0 + (0.5d0 * (h * (t_0 * (t_0 * ((-1.0d0) / l)))))
    t_2 = sqrt(-d)
    if (d <= (-1.35d-45)) then
        tmp = sqrt((d / l)) * ((t_2 / sqrt(-h)) * t_1)
    else if (d <= (-5d-311)) then
        tmp = (t_2 / sqrt(-l)) * (sqrt((d / h)) * (1.0d0 + (0.5d0 * ((((h / d) * (m * d_1)) / (d * (l / (m * d_1)))) * (-0.25d0)))))
    else
        tmp = (sqrt(d) / sqrt(l)) * (t_1 * (sqrt(d) / sqrt(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 = 0.5 * ((M / d) * D);
	double t_1 = 1.0 + (0.5 * (h * (t_0 * (t_0 * (-1.0 / l)))));
	double t_2 = Math.sqrt(-d);
	double tmp;
	if (d <= -1.35e-45) {
		tmp = Math.sqrt((d / l)) * ((t_2 / Math.sqrt(-h)) * t_1);
	} else if (d <= -5e-311) {
		tmp = (t_2 / Math.sqrt(-l)) * (Math.sqrt((d / h)) * (1.0 + (0.5 * ((((h / d) * (M * D)) / (d * (l / (M * D)))) * -0.25))));
	} else {
		tmp = (Math.sqrt(d) / Math.sqrt(l)) * (t_1 * (Math.sqrt(d) / Math.sqrt(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 = 0.5 * ((M / d) * D)
	t_1 = 1.0 + (0.5 * (h * (t_0 * (t_0 * (-1.0 / l)))))
	t_2 = math.sqrt(-d)
	tmp = 0
	if d <= -1.35e-45:
		tmp = math.sqrt((d / l)) * ((t_2 / math.sqrt(-h)) * t_1)
	elif d <= -5e-311:
		tmp = (t_2 / math.sqrt(-l)) * (math.sqrt((d / h)) * (1.0 + (0.5 * ((((h / d) * (M * D)) / (d * (l / (M * D)))) * -0.25))))
	else:
		tmp = (math.sqrt(d) / math.sqrt(l)) * (t_1 * (math.sqrt(d) / math.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(0.5 * Float64(Float64(M / d) * D))
	t_1 = Float64(1.0 + Float64(0.5 * Float64(h * Float64(t_0 * Float64(t_0 * Float64(-1.0 / l))))))
	t_2 = sqrt(Float64(-d))
	tmp = 0.0
	if (d <= -1.35e-45)
		tmp = Float64(sqrt(Float64(d / l)) * Float64(Float64(t_2 / sqrt(Float64(-h))) * t_1));
	elseif (d <= -5e-311)
		tmp = Float64(Float64(t_2 / sqrt(Float64(-l))) * Float64(sqrt(Float64(d / h)) * Float64(1.0 + Float64(0.5 * Float64(Float64(Float64(Float64(h / d) * Float64(M * D)) / Float64(d * Float64(l / Float64(M * D)))) * -0.25)))));
	else
		tmp = Float64(Float64(sqrt(d) / sqrt(l)) * Float64(t_1 * Float64(sqrt(d) / sqrt(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 = 0.5 * ((M / d) * D);
	t_1 = 1.0 + (0.5 * (h * (t_0 * (t_0 * (-1.0 / l)))));
	t_2 = sqrt(-d);
	tmp = 0.0;
	if (d <= -1.35e-45)
		tmp = sqrt((d / l)) * ((t_2 / sqrt(-h)) * t_1);
	elseif (d <= -5e-311)
		tmp = (t_2 / sqrt(-l)) * (sqrt((d / h)) * (1.0 + (0.5 * ((((h / d) * (M * D)) / (d * (l / (M * D)))) * -0.25))));
	else
		tmp = (sqrt(d) / sqrt(l)) * (t_1 * (sqrt(d) / sqrt(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[(0.5 * N[(N[(M / d), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(0.5 * N[(h * N[(t$95$0 * N[(t$95$0 * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[(-d)], $MachinePrecision]}, If[LessEqual[d, -1.35e-45], N[(N[Sqrt[N[(d / l), $MachinePrecision]], $MachinePrecision] * N[(N[(t$95$2 / N[Sqrt[(-h)], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[d, -5e-311], N[(N[(t$95$2 / N[Sqrt[(-l)], $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[N[(d / h), $MachinePrecision]], $MachinePrecision] * N[(1.0 + N[(0.5 * N[(N[(N[(N[(h / d), $MachinePrecision] * N[(M * D), $MachinePrecision]), $MachinePrecision] / N[(d * N[(l / N[(M * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[l], $MachinePrecision]), $MachinePrecision] * N[(t$95$1 * N[(N[Sqrt[d], $MachinePrecision] / N[Sqrt[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 := 0.5 \cdot \left(\frac{M}{d} \cdot D\right)\\
t_1 := 1 + 0.5 \cdot \left(h \cdot \left(t_0 \cdot \left(t_0 \cdot \frac{-1}{\ell}\right)\right)\right)\\
t_2 := \sqrt{-d}\\
\mathbf{if}\;d \leq -1.35 \cdot 10^{-45}:\\
\;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\frac{t_2}{\sqrt{-h}} \cdot t_1\right)\\

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

\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_1 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if d < -1.34999999999999992e-45

    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)))))): 3 points increase in error, 8 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))))): 3 points increase in error, 3 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)): 13 points increase in error, 5 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)): 13 points increase in error, 14 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 M 1/2) (/.f64 D d))) 2) l)): 13 points increase in error, 20 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)): 26 points increase in error, 18 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) (/.f64 h l))): 37 points increase in error, 25 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.9

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

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

    if -1.34999999999999992e-45 < d < -5.00000000000023e-311

    1. Initial program 32.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. Simplified33.9

      \[\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)))))): 3 points increase in error, 8 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))))): 3 points increase in error, 3 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. Taylor expanded in M around 0 52.5

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

      \[\leadsto \sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \color{blue}{\left(0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{\ell} \cdot \frac{h}{d \cdot d}\right)\right)}\right)\right) \]
      Proof
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (*.f64 D M) (*.f64 D M)) l) (/.f64 h (*.f64 d d)))): 0 points increase in error, 0 points decrease in error
      (*.f64 1/4 (*.f64 (/.f64 (Rewrite<= unswap-sqr_binary64 (*.f64 (*.f64 D D) (*.f64 M M))) l) (/.f64 h (*.f64 d d)))): 36 points increase in error, 10 points decrease in error
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (*.f64 M M)) l) (/.f64 h (*.f64 d d)))): 0 points increase in error, 0 points decrease in error
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (Rewrite<= unpow2_binary64 (pow.f64 M 2))) l) (/.f64 h (*.f64 d d)))): 0 points increase in error, 0 points decrease in error
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) l) (/.f64 h (Rewrite<= unpow2_binary64 (pow.f64 d 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 1/4 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) h) (*.f64 l (pow.f64 d 2))))): 13 points increase in error, 11 points decrease in error
      (*.f64 1/4 (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h))) (*.f64 l (pow.f64 d 2)))): 11 points increase in error, 3 points decrease in error
      (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 d 2) l)))): 0 points increase in error, 0 points decrease in error
      (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 1/4 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) l))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 1/4 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h))) (Rewrite<= *-commutative_binary64 (*.f64 l (pow.f64 d 2)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (*.f64 l (pow.f64 d 2))))): 0 points increase in error, 0 points decrease in error
    5. Applied egg-rr32.5

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

    if -5.00000000000023e-311 < d

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

      \[\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)))))): 3 points increase in error, 8 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))))): 3 points increase in error, 3 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.2

      \[\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. Simplified25.9

      \[\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)): 13 points increase in error, 5 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)): 13 points increase in error, 14 points decrease in error
      (*.f64 h (/.f64 (pow.f64 (Rewrite<= associate-*r/_binary64 (*.f64 (*.f64 M 1/2) (/.f64 D d))) 2) l)): 13 points increase in error, 20 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)): 26 points increase in error, 18 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (pow.f64 (*.f64 (*.f64 M 1/2) (/.f64 D d)) 2) (/.f64 h l))): 37 points increase in error, 25 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.2

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

      \[\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(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \left(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \frac{1}{\ell}\right)\right)\right)\right)\right) \]
    7. Simplified17.5

      \[\leadsto \color{blue}{\frac{\sqrt{d}}{\sqrt{\ell}}} \cdot \left(\sqrt{\frac{d}{h}} \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \left(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \frac{1}{\ell}\right)\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)))): 16 points increase in error, 15 points decrease in error
    8. Applied egg-rr10.4

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

      \[\leadsto \frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(\color{blue}{\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 \left(\left(0.5 \cdot \left(\frac{M}{d} \cdot D\right)\right) \cdot \frac{1}{\ell}\right)\right)\right)\right)\right) \]
      Proof
      (/.f64 (sqrt.f64 d) (sqrt.f64 h)): 0 points increase in error, 0 points decrease in error
      (/.f64 (Rewrite<= *-rgt-identity_binary64 (*.f64 (sqrt.f64 d) 1)) (sqrt.f64 h)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/_binary64 (*.f64 (sqrt.f64 d) (/.f64 1 (sqrt.f64 h)))): 12 points increase in error, 15 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification12.4

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

Alternatives

Alternative 1
Error13.9
Cost77452
\[\begin{array}{l} t_0 := 0.5 \cdot \left(\frac{M}{d} \cdot D\right)\\ t_1 := \left({\left(\frac{d}{h}\right)}^{0.5} \cdot {\left(\frac{d}{\ell}\right)}^{0.5}\right) \cdot \left(1 + \frac{h}{\ell} \cdot \left(-0.5 \cdot {\left(\frac{M \cdot D}{d \cdot 2}\right)}^{2}\right)\right)\\ t_2 := \sqrt{\frac{d}{h}}\\ t_3 := \sqrt{\frac{d}{\ell}}\\ t_4 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{-151}:\\ \;\;\;\;t_3 \cdot \left(\left(1 + 0.5 \cdot \left(h \cdot \left(t_0 \cdot \left(t_0 \cdot \frac{-1}{\ell}\right)\right)\right)\right) \cdot t_2\right)\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;t_4\\ \mathbf{elif}\;t_1 \leq 10^{+274}:\\ \;\;\;\;t_3 \cdot \left(t_2 \cdot \left(1 + 0.5 \cdot \left(\frac{\frac{h}{d} \cdot \left(M \cdot D\right)}{d \cdot \frac{\ell}{M \cdot D}} \cdot -0.25\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_4\\ \end{array} \]
Alternative 2
Error15.2
Cost21840
\[\begin{array}{l} t_0 := \sqrt{-d}\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := 0.5 \cdot \left(\frac{M}{d} \cdot D\right)\\ t_3 := 1 + 0.5 \cdot \left(h \cdot \left(t_2 \cdot \left(t_2 \cdot \frac{-1}{\ell}\right)\right)\right)\\ t_4 := \sqrt{\frac{d}{h}}\\ t_5 := t_4 \cdot \left(1 + 0.5 \cdot \left(\frac{\frac{h}{d} \cdot \left(M \cdot D\right)}{d \cdot \frac{\ell}{M \cdot D}} \cdot -0.25\right)\right)\\ \mathbf{if}\;\ell \leq -1000000000000:\\ \;\;\;\;t_1 \cdot \left(\frac{t_0}{\sqrt{-h}} \cdot t_3\right)\\ \mathbf{elif}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{t_0}{\sqrt{-\ell}} \cdot t_5\\ \mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-206}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_4 \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(t_2 \cdot \frac{\frac{M}{d} \cdot \left(0.5 \cdot D\right)}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 3.2 \cdot 10^{+108}:\\ \;\;\;\;t_1 \cdot \left(t_3 \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{elif}\;\ell \leq 2.2 \cdot 10^{+135}:\\ \;\;\;\;t_5 \cdot \left(\sqrt{d} \cdot {\ell}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 2.5 \cdot 10^{+170}:\\ \;\;\;\;\frac{d \cdot {\ell}^{-0.5}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 3
Error16.8
Cost21708
\[\begin{array}{l} t_0 := \sqrt{\frac{d}{h}}\\ t_1 := t_0 \cdot \left(1 + 0.5 \cdot \left(\frac{\frac{h}{d} \cdot \left(M \cdot D\right)}{d \cdot \frac{\ell}{M \cdot D}} \cdot -0.25\right)\right)\\ t_2 := 0.5 \cdot \left(\frac{M}{d} \cdot D\right)\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{-310}:\\ \;\;\;\;\frac{\sqrt{-d}}{\sqrt{-\ell}} \cdot t_1\\ \mathbf{elif}\;\ell \leq 2.55 \cdot 10^{-208}:\\ \;\;\;\;\frac{\sqrt{d}}{\sqrt{\ell}} \cdot \left(t_0 \cdot \left(1 - 0.5 \cdot \left(h \cdot \left(t_2 \cdot \frac{\frac{M}{d} \cdot \left(0.5 \cdot D\right)}{\ell}\right)\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 3.8 \cdot 10^{+108}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\left(1 + 0.5 \cdot \left(h \cdot \left(t_2 \cdot \left(t_2 \cdot \frac{-1}{\ell}\right)\right)\right)\right) \cdot \frac{\sqrt{d}}{\sqrt{h}}\right)\\ \mathbf{elif}\;\ell \leq 4 \cdot 10^{+135}:\\ \;\;\;\;t_1 \cdot \left(\sqrt{d} \cdot {\ell}^{-0.5}\right)\\ \mathbf{elif}\;\ell \leq 7.6 \cdot 10^{+168}:\\ \;\;\;\;\frac{d \cdot {\ell}^{-0.5}}{\sqrt{h}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + \left(-0.5 \cdot \frac{h}{\ell}\right) \cdot {\left(M \cdot \frac{0.5 \cdot D}{d}\right)}^{2}\right) \cdot \frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 4
Error22.2
Cost15580
\[\begin{array}{l} t_0 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \frac{\ell}{M \cdot D}\\ t_3 := \sqrt{\frac{d}{h}}\\ t_4 := t_1 \cdot \left(t_3 \cdot \left(1 + 0.5 \cdot \left(\frac{M \cdot D}{t_2 \cdot \frac{d \cdot d}{h}} \cdot -0.25\right)\right)\right)\\ t_5 := t_1 \cdot \left(t_3 \cdot \left(1 + 0.5 \cdot \left(\frac{\frac{h}{d} \cdot \left(M \cdot D\right)}{d \cdot t_2} \cdot -0.25\right)\right)\right)\\ \mathbf{if}\;\ell \leq -1.95 \cdot 10^{+276}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;\ell \leq -1.95 \cdot 10^{+184}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -1.35 \cdot 10^{+147}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;\ell \leq -2.65 \cdot 10^{+70}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -3 \cdot 10^{-265}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;\ell \leq 5.2 \cdot 10^{-184}:\\ \;\;\;\;\frac{{\ell}^{-0.5}}{\frac{\sqrt{h}}{d}}\\ \mathbf{elif}\;\ell \leq 5.6 \cdot 10^{+49}:\\ \;\;\;\;t_5\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 5
Error22.8
Cost15580
\[\begin{array}{l} t_0 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ t_1 := \frac{h}{d} \cdot \left(M \cdot D\right)\\ t_2 := \sqrt{\frac{d}{\ell}}\\ t_3 := \frac{\ell}{M \cdot D}\\ t_4 := \sqrt{\frac{d}{h}}\\ t_5 := t_2 \cdot \left(t_4 \cdot \left(1 + 0.5 \cdot \left(\frac{M \cdot D}{t_3 \cdot \frac{d \cdot d}{h}} \cdot -0.25\right)\right)\right)\\ \mathbf{if}\;\ell \leq -1.6 \cdot 10^{+276}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;\ell \leq -1.2 \cdot 10^{+184}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -1.8 \cdot 10^{+145}:\\ \;\;\;\;t_5\\ \mathbf{elif}\;\ell \leq -5.5 \cdot 10^{+70}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -3 \cdot 10^{-265}:\\ \;\;\;\;t_2 \cdot \left(t_4 \cdot \left(1 - 0.5 \cdot \left(0.25 \cdot \frac{t_1}{\frac{d \cdot \frac{\ell}{D}}{M}}\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 1.45 \cdot 10^{-187}:\\ \;\;\;\;\frac{{\ell}^{-0.5}}{\frac{\sqrt{h}}{d}}\\ \mathbf{elif}\;\ell \leq 4.9 \cdot 10^{+48}:\\ \;\;\;\;t_2 \cdot \left(t_4 \cdot \left(1 + 0.5 \cdot \left(\frac{t_1}{d \cdot t_3} \cdot -0.25\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 6
Error25.0
Cost15316
\[\begin{array}{l} t_0 := \left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ t_1 := \sqrt{\frac{d}{\ell}}\\ t_2 := \sqrt{\frac{d}{h}}\\ t_3 := t_1 \cdot \left(t_2 \cdot \left(1 + 0.5 \cdot \left(\frac{M \cdot D}{\frac{\ell}{M \cdot D} \cdot \frac{d \cdot d}{h}} \cdot -0.25\right)\right)\right)\\ \mathbf{if}\;\ell \leq -1.6 \cdot 10^{+276}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq -2.95 \cdot 10^{+184}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -3.6 \cdot 10^{+145}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;\ell \leq -4.8 \cdot 10^{+65}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;\ell \leq -1.06 \cdot 10^{-260}:\\ \;\;\;\;t_1 \cdot \left(t_2 \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)\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 7
Error21.0
Cost14920
\[\begin{array}{l} \mathbf{if}\;d \leq -2 \cdot 10^{+71}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{elif}\;d \leq -5.8 \cdot 10^{-110}:\\ \;\;\;\;\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)\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-299}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 8
Error20.6
Cost14916
\[\begin{array}{l} \mathbf{if}\;h \leq -5.5 \cdot 10^{-90}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \left(\sqrt{\frac{d}{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{-0.5}{\frac{\ell}{D} \cdot \frac{d}{M}}\right)\right)\right)\right)\\ \mathbf{elif}\;h \leq 6.4 \cdot 10^{-286}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 9
Error23.3
Cost13384
\[\begin{array}{l} \mathbf{if}\;h \leq -1.28 \cdot 10^{+144}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;h \leq 6.4 \cdot 10^{-286}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 10
Error22.6
Cost13384
\[\begin{array}{l} \mathbf{if}\;h \leq -7 \cdot 10^{+53}:\\ \;\;\;\;\sqrt{\frac{d}{\ell}} \cdot \sqrt{\frac{d}{h}}\\ \mathbf{elif}\;h \leq 6.4 \cdot 10^{-286}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \mathbf{else}:\\ \;\;\;\;\frac{d}{\sqrt{\ell} \cdot \sqrt{h}}\\ \end{array} \]
Alternative 11
Error27.3
Cost13252
\[\begin{array}{l} \mathbf{if}\;h \leq -2.15 \cdot 10^{+144}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;\left|\frac{d}{\sqrt{\ell \cdot h}}\right|\\ \end{array} \]
Alternative 12
Error27.5
Cost7176
\[\begin{array}{l} t_0 := \sqrt{\frac{1}{\ell \cdot h}}\\ \mathbf{if}\;h \leq -3.8 \cdot 10^{+142}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{elif}\;h \leq -2 \cdot 10^{-310}:\\ \;\;\;\;\left(-d\right) \cdot t_0\\ \mathbf{else}:\\ \;\;\;\;d \cdot t_0\\ \end{array} \]
Alternative 13
Error27.6
Cost7044
\[\begin{array}{l} \mathbf{if}\;d \leq -8.2 \cdot 10^{-280}:\\ \;\;\;\;\left(-d\right) \cdot \sqrt{\frac{\frac{1}{h}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \end{array} \]
Alternative 14
Error34.7
Cost6980
\[\begin{array}{l} \mathbf{if}\;d \leq -3.9 \cdot 10^{-205}:\\ \;\;\;\;\sqrt{d \cdot \frac{d}{\ell \cdot h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
Alternative 15
Error33.5
Cost6980
\[\begin{array}{l} \mathbf{if}\;h \leq -1.3 \cdot 10^{-283}:\\ \;\;\;\;\sqrt{d \cdot \frac{\frac{d}{\ell}}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
Alternative 16
Error33.4
Cost6980
\[\begin{array}{l} \mathbf{if}\;h \leq -1.3 \cdot 10^{-283}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot {\left(\ell \cdot h\right)}^{-0.5}\\ \end{array} \]
Alternative 17
Error33.5
Cost6980
\[\begin{array}{l} \mathbf{if}\;h \leq -1.3 \cdot 10^{-283}:\\ \;\;\;\;\sqrt{\frac{d}{\ell} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;d \cdot \sqrt{\frac{1}{\ell \cdot h}}\\ \end{array} \]
Alternative 18
Error43.6
Cost6784
\[d \cdot {\left(\ell \cdot h\right)}^{-0.5} \]
Alternative 19
Error43.6
Cost6720
\[\frac{d}{\sqrt{\ell \cdot h}} \]

Error

Reproduce

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