Average Error: 14.3 → 8.3
Time: 1.4min
Precision: binary64
Cost: 49100
\[ \begin{array}{c}[M, D] = \mathsf{sort}([M, D])\\ \end{array} \]
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
\[\begin{array}{l} t_0 := w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;\frac{D}{d \cdot \frac{1}{w0 \cdot \frac{M}{\sqrt{\frac{\ell \cdot -4}{h}}}}}\\ \mathbf{elif}\;t_0 \leq 10^{+306}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}\\ \mathbf{elif}\;t_0 \leq \infty:\\ \;\;\;\;\frac{-D}{\frac{\frac{d}{w0}}{\sqrt{-0.25 \cdot \frac{M \cdot h}{\frac{\ell}{M}}}}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
(FPCore (w0 M D h l d)
 :precision binary64
 (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))
(FPCore (w0 M D h l d)
 :precision binary64
 (let* ((t_0
         (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l)))))))
   (if (<= t_0 (- INFINITY))
     (/ D (* d (/ 1.0 (* w0 (/ M (sqrt (/ (* l -4.0) h)))))))
     (if (<= t_0 1e+306)
       (* w0 (sqrt (- 1.0 (* (/ h l) (pow (* (/ D 2.0) (/ M d)) 2.0)))))
       (if (<= t_0 INFINITY)
         (/ (- D) (/ (/ d w0) (sqrt (* -0.25 (/ (* M h) (/ l M))))))
         w0)))))
double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = w0 * sqrt((1.0 - (pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = D / (d * (1.0 / (w0 * (M / sqrt(((l * -4.0) / h))))));
	} else if (t_0 <= 1e+306) {
		tmp = w0 * sqrt((1.0 - ((h / l) * pow(((D / 2.0) * (M / d)), 2.0))));
	} else if (t_0 <= ((double) INFINITY)) {
		tmp = -D / ((d / w0) / sqrt((-0.25 * ((M * h) / (l / M)))));
	} else {
		tmp = w0;
	}
	return tmp;
}
public static double code(double w0, double M, double D, double h, double l, double d) {
	return w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
}
public static double code(double w0, double M, double D, double h, double l, double d) {
	double t_0 = w0 * Math.sqrt((1.0 - (Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))));
	double tmp;
	if (t_0 <= -Double.POSITIVE_INFINITY) {
		tmp = D / (d * (1.0 / (w0 * (M / Math.sqrt(((l * -4.0) / h))))));
	} else if (t_0 <= 1e+306) {
		tmp = w0 * Math.sqrt((1.0 - ((h / l) * Math.pow(((D / 2.0) * (M / d)), 2.0))));
	} else if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = -D / ((d / w0) / Math.sqrt((-0.25 * ((M * h) / (l / M)))));
	} else {
		tmp = w0;
	}
	return tmp;
}
def code(w0, M, D, h, l, d):
	return w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
def code(w0, M, D, h, l, d):
	t_0 = w0 * math.sqrt((1.0 - (math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l))))
	tmp = 0
	if t_0 <= -math.inf:
		tmp = D / (d * (1.0 / (w0 * (M / math.sqrt(((l * -4.0) / h))))))
	elif t_0 <= 1e+306:
		tmp = w0 * math.sqrt((1.0 - ((h / l) * math.pow(((D / 2.0) * (M / d)), 2.0))))
	elif t_0 <= math.inf:
		tmp = -D / ((d / w0) / math.sqrt((-0.25 * ((M * h) / (l / M)))))
	else:
		tmp = w0
	return tmp
function code(w0, M, D, h, l, d)
	return Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
end
function code(w0, M, D, h, l, d)
	t_0 = Float64(w0 * sqrt(Float64(1.0 - Float64((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l)))))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(D / Float64(d * Float64(1.0 / Float64(w0 * Float64(M / sqrt(Float64(Float64(l * -4.0) / h)))))));
	elseif (t_0 <= 1e+306)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h / l) * (Float64(Float64(D / 2.0) * Float64(M / d)) ^ 2.0)))));
	elseif (t_0 <= Inf)
		tmp = Float64(Float64(-D) / Float64(Float64(d / w0) / sqrt(Float64(-0.25 * Float64(Float64(M * h) / Float64(l / M))))));
	else
		tmp = w0;
	end
	return tmp
end
function tmp = code(w0, M, D, h, l, d)
	tmp = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
end
function tmp_2 = code(w0, M, D, h, l, d)
	t_0 = w0 * sqrt((1.0 - ((((M * D) / (2.0 * d)) ^ 2.0) * (h / l))));
	tmp = 0.0;
	if (t_0 <= -Inf)
		tmp = D / (d * (1.0 / (w0 * (M / sqrt(((l * -4.0) / h))))));
	elseif (t_0 <= 1e+306)
		tmp = w0 * sqrt((1.0 - ((h / l) * (((D / 2.0) * (M / d)) ^ 2.0))));
	elseif (t_0 <= Inf)
		tmp = -D / ((d / w0) / sqrt((-0.25 * ((M * h) / (l / M)))));
	else
		tmp = w0;
	end
	tmp_2 = tmp;
end
code[w0_, M_, D_, h_, l_, d_] := N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w0_, M_, D_, h_, l_, d_] := Block[{t$95$0 = N[(w0 * N[Sqrt[N[(1.0 - N[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(D / N[(d * N[(1.0 / N[(w0 * N[(M / N[Sqrt[N[(N[(l * -4.0), $MachinePrecision] / h), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+306], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h / l), $MachinePrecision] * N[Power[N[(N[(D / 2.0), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, Infinity], N[((-D) / N[(N[(d / w0), $MachinePrecision] / N[Sqrt[N[(-0.25 * N[(N[(M * h), $MachinePrecision] / N[(l / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], w0]]]]
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\begin{array}{l}
t_0 := w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;\frac{D}{d \cdot \frac{1}{w0 \cdot \frac{M}{\sqrt{\frac{\ell \cdot -4}{h}}}}}\\

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

\mathbf{elif}\;t_0 \leq \infty:\\
\;\;\;\;\frac{-D}{\frac{\frac{d}{w0}}{\sqrt{-0.25 \cdot \frac{M \cdot h}{\frac{\ell}{M}}}}}\\

\mathbf{else}:\\
\;\;\;\;w0\\


\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 (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < -inf.0

    1. Initial program 64.0

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified62.2

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}}} \]
      Proof
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (*.f64 (/.f64 D 2) (/.f64 M d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D M) (*.f64 2 d))) 2) (/.f64 h l))))): 4 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.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 0 60.6

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\frac{D}{\frac{\ell}{D}} \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \cdot -0.25}}{d} \cdot w0} \]
      Proof
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 D (/.f64 l D)) (*.f64 M (*.f64 M h))) -1/4)) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D D) l)) (*.f64 M (*.f64 M h))) -1/4)) d) w0): 14 points increase in error, 4 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) l) (*.f64 M (*.f64 M h))) -1/4)) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 (pow.f64 D 2) l) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 M M) h))) -1/4)) d) w0): 8 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 (pow.f64 D 2) l) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 M 2)) h)) -1/4)) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 l (*.f64 (pow.f64 M 2) h)))) -1/4)) d) w0): 3 points increase in error, 12 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l)) -1/4)) d) w0): 2 points increase in error, 4 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l) (Rewrite<= metadata-eval (neg.f64 1/4)))) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l) 1/4)))) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l))))) d) w0): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 (sqrt.f64 (neg.f64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l)))) (/.f64 d w0))): 21 points increase in error, 4 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (sqrt.f64 (neg.f64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l)))) w0) d)): 2 points increase in error, 21 points decrease in error
    5. Taylor expanded in D around 0 56.1

      \[\leadsto \color{blue}{\frac{D \cdot \left(\sqrt{-0.25 \cdot \frac{{M}^{2} \cdot h}{\ell}} \cdot w0\right)}{d}} \]
    6. Simplified56.0

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

      \[\leadsto \frac{D}{\color{blue}{d \cdot \frac{1}{\frac{M}{\sqrt{\frac{\ell \cdot -4}{h}}} \cdot w0}}} \]

    if -inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < 1.00000000000000002e306

    1. Initial program 0.1

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified0.7

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}}} \]
      Proof
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (*.f64 (/.f64 D 2) (/.f64 M d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D M) (*.f64 2 d))) 2) (/.f64 h l))))): 4 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 M D)) (*.f64 2 d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error

    if 1.00000000000000002e306 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))))) < +inf.0

    1. Initial program 62.8

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified61.0

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}}} \]
      Proof
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (*.f64 (/.f64 D 2) (/.f64 M d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D M) (*.f64 2 d))) 2) (/.f64 h l))))): 4 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.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 0 60.1

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

      \[\leadsto \color{blue}{\frac{\sqrt{\left(\frac{D}{\frac{\ell}{D}} \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \cdot -0.25}}{d} \cdot w0} \]
      Proof
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 D (/.f64 l D)) (*.f64 M (*.f64 M h))) -1/4)) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D D) l)) (*.f64 M (*.f64 M h))) -1/4)) d) w0): 14 points increase in error, 4 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) l) (*.f64 M (*.f64 M h))) -1/4)) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 (pow.f64 D 2) l) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 M M) h))) -1/4)) d) w0): 8 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (*.f64 (/.f64 (pow.f64 D 2) l) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 M 2)) h)) -1/4)) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 D 2) (/.f64 l (*.f64 (pow.f64 M 2) h)))) -1/4)) d) w0): 3 points increase in error, 12 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l)) -1/4)) d) w0): 2 points increase in error, 4 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l) (Rewrite<= metadata-eval (neg.f64 1/4)))) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (Rewrite<= distribute-rgt-neg-in_binary64 (neg.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l) 1/4)))) d) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 (sqrt.f64 (neg.f64 (Rewrite<= *-commutative_binary64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l))))) d) w0): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/_binary64 (/.f64 (sqrt.f64 (neg.f64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l)))) (/.f64 d w0))): 21 points increase in error, 4 points decrease in error
      (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (sqrt.f64 (neg.f64 (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) l)))) w0) d)): 2 points increase in error, 21 points decrease in error
    5. Taylor expanded in D around -inf 56.4

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

      \[\leadsto \color{blue}{\frac{-D}{\frac{\frac{d}{w0}}{\sqrt{-0.25 \cdot \left(\frac{M \cdot M}{\ell} \cdot h\right)}}}} \]
      Proof
      (/.f64 (neg.f64 D) (/.f64 (/.f64 d w0) (sqrt.f64 (*.f64 -1/4 (*.f64 (/.f64 (*.f64 M M) l) h))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 D) (/.f64 (/.f64 d w0) (sqrt.f64 (*.f64 -1/4 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 M 2)) l) h))))): 0 points increase in error, 0 points decrease in error
      (/.f64 (neg.f64 D) (/.f64 (/.f64 d w0) (sqrt.f64 (*.f64 -1/4 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 M 2) (/.f64 l h))))))): 12 points increase in error, 6 points decrease in error
      (/.f64 (neg.f64 D) (/.f64 (/.f64 d w0) (sqrt.f64 (*.f64 -1/4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 M 2) h) l)))))): 11 points increase in error, 13 points decrease in error
      (/.f64 (neg.f64 D) (Rewrite<= associate-/r*_binary64 (/.f64 d (*.f64 w0 (sqrt.f64 (*.f64 -1/4 (/.f64 (*.f64 (pow.f64 M 2) h) l))))))): 3 points increase in error, 23 points decrease in error
      (/.f64 (neg.f64 D) (/.f64 d (Rewrite<= *-commutative_binary64 (*.f64 (sqrt.f64 (*.f64 -1/4 (/.f64 (*.f64 (pow.f64 M 2) h) l))) w0)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= distribute-neg-frac_binary64 (neg.f64 (/.f64 D (/.f64 d (*.f64 (sqrt.f64 (*.f64 -1/4 (/.f64 (*.f64 (pow.f64 M 2) h) l))) w0))))): 0 points increase in error, 0 points decrease in error
      (neg.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D (*.f64 (sqrt.f64 (*.f64 -1/4 (/.f64 (*.f64 (pow.f64 M 2) h) l))) w0)) d))): 8 points increase in error, 6 points decrease in error
      (Rewrite<= mul-1-neg_binary64 (*.f64 -1 (/.f64 (*.f64 D (*.f64 (sqrt.f64 (*.f64 -1/4 (/.f64 (*.f64 (pow.f64 M 2) h) l))) w0)) d))): 0 points increase in error, 0 points decrease in error
    7. Applied egg-rr51.4

      \[\leadsto \frac{-D}{\frac{\frac{d}{w0}}{\sqrt{-0.25 \cdot \color{blue}{\frac{h \cdot M}{\frac{\ell}{M}}}}}} \]

    if +inf.0 < (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)))))

    1. Initial program 64.0

      \[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
    2. Simplified61.1

      \[\leadsto \color{blue}{w0 \cdot \sqrt{1 - {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2} \cdot \frac{h}{\ell}}} \]
      Proof
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (*.f64 (/.f64 D 2) (/.f64 M d)) 2) (/.f64 h l))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D M) (*.f64 2 d))) 2) (/.f64 h l))))): 4 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (-.f64 1 (*.f64 (pow.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.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 0 13.8

      \[\leadsto \color{blue}{w0} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification8.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \leq -\infty:\\ \;\;\;\;\frac{D}{d \cdot \frac{1}{w0 \cdot \frac{M}{\sqrt{\frac{\ell \cdot -4}{h}}}}}\\ \mathbf{elif}\;w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \leq 10^{+306}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{2} \cdot \frac{M}{d}\right)}^{2}}\\ \mathbf{elif}\;w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \leq \infty:\\ \;\;\;\;\frac{-D}{\frac{\frac{d}{w0}}{\sqrt{-0.25 \cdot \frac{M \cdot h}{\frac{\ell}{M}}}}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]

Alternatives

Alternative 1
Error13.7
Cost64
\[w0 \]

Error

Reproduce

herbie shell --seed 2022325 
(FPCore (w0 M D h l d)
  :name "Henrywood and Agarwal, Equation (9a)"
  :precision binary64
  (* w0 (sqrt (- 1.0 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))))