?

Average Error: 13.9 → 6.8
Time: 24.5s
Precision: binary64
Cost: 14856

?

\[ \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 := \sqrt{-0.25 \cdot \frac{h}{\ell}}\\ t_1 := \frac{M \cdot D}{2 \cdot d}\\ \mathbf{if}\;t_1 \leq -1 \cdot 10^{+153}:\\ \;\;\;\;D \cdot \left(t_0 \cdot \frac{-M \cdot w0}{d}\right)\\ \mathbf{elif}\;t_1 \leq 5 \cdot 10^{+152}:\\ \;\;\;\;w0 \cdot \sqrt{1 - h \cdot \frac{{\left(M \cdot \frac{D}{2 \cdot d}\right)}^{2}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;D \cdot \left(t_0 \cdot \frac{M \cdot w0}{d}\right)\\ \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 (sqrt (* -0.25 (/ h l)))) (t_1 (/ (* M D) (* 2.0 d))))
   (if (<= t_1 -1e+153)
     (* D (* t_0 (/ (- (* M w0)) d)))
     (if (<= t_1 5e+152)
       (* w0 (sqrt (- 1.0 (* h (/ (pow (* M (/ D (* 2.0 d))) 2.0) l)))))
       (* D (* t_0 (/ (* M w0) d)))))))
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 = sqrt((-0.25 * (h / l)));
	double t_1 = (M * D) / (2.0 * d);
	double tmp;
	if (t_1 <= -1e+153) {
		tmp = D * (t_0 * (-(M * w0) / d));
	} else if (t_1 <= 5e+152) {
		tmp = w0 * sqrt((1.0 - (h * (pow((M * (D / (2.0 * d))), 2.0) / l))));
	} else {
		tmp = D * (t_0 * ((M * w0) / d));
	}
	return tmp;
}
real(8) function code(w0, m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    code = w0 * sqrt((1.0d0 - ((((m * d) / (2.0d0 * d_1)) ** 2.0d0) * (h / l))))
end function
real(8) function code(w0, m, d, h, l, d_1)
    real(8), intent (in) :: w0
    real(8), intent (in) :: m
    real(8), intent (in) :: d
    real(8), intent (in) :: h
    real(8), intent (in) :: l
    real(8), intent (in) :: d_1
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = sqrt(((-0.25d0) * (h / l)))
    t_1 = (m * d) / (2.0d0 * d_1)
    if (t_1 <= (-1d+153)) then
        tmp = d * (t_0 * (-(m * w0) / d_1))
    else if (t_1 <= 5d+152) then
        tmp = w0 * sqrt((1.0d0 - (h * (((m * (d / (2.0d0 * d_1))) ** 2.0d0) / l))))
    else
        tmp = d * (t_0 * ((m * w0) / d_1))
    end if
    code = tmp
end function
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 = Math.sqrt((-0.25 * (h / l)));
	double t_1 = (M * D) / (2.0 * d);
	double tmp;
	if (t_1 <= -1e+153) {
		tmp = D * (t_0 * (-(M * w0) / d));
	} else if (t_1 <= 5e+152) {
		tmp = w0 * Math.sqrt((1.0 - (h * (Math.pow((M * (D / (2.0 * d))), 2.0) / l))));
	} else {
		tmp = D * (t_0 * ((M * w0) / d));
	}
	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 = math.sqrt((-0.25 * (h / l)))
	t_1 = (M * D) / (2.0 * d)
	tmp = 0
	if t_1 <= -1e+153:
		tmp = D * (t_0 * (-(M * w0) / d))
	elif t_1 <= 5e+152:
		tmp = w0 * math.sqrt((1.0 - (h * (math.pow((M * (D / (2.0 * d))), 2.0) / l))))
	else:
		tmp = D * (t_0 * ((M * w0) / d))
	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 = sqrt(Float64(-0.25 * Float64(h / l)))
	t_1 = Float64(Float64(M * D) / Float64(2.0 * d))
	tmp = 0.0
	if (t_1 <= -1e+153)
		tmp = Float64(D * Float64(t_0 * Float64(Float64(-Float64(M * w0)) / d)));
	elseif (t_1 <= 5e+152)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(h * Float64((Float64(M * Float64(D / Float64(2.0 * d))) ^ 2.0) / l)))));
	else
		tmp = Float64(D * Float64(t_0 * Float64(Float64(M * w0) / d)));
	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 = sqrt((-0.25 * (h / l)));
	t_1 = (M * D) / (2.0 * d);
	tmp = 0.0;
	if (t_1 <= -1e+153)
		tmp = D * (t_0 * (-(M * w0) / d));
	elseif (t_1 <= 5e+152)
		tmp = w0 * sqrt((1.0 - (h * (((M * (D / (2.0 * d))) ^ 2.0) / l))));
	else
		tmp = D * (t_0 * ((M * w0) / d));
	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[Sqrt[N[(-0.25 * N[(h / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+153], N[(D * N[(t$95$0 * N[((-N[(M * w0), $MachinePrecision]) / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+152], N[(w0 * N[Sqrt[N[(1.0 - N[(h * N[(N[Power[N[(M * N[(D / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(D * N[(t$95$0 * N[(N[(M * w0), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}}
\begin{array}{l}
t_0 := \sqrt{-0.25 \cdot \frac{h}{\ell}}\\
t_1 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+153}:\\
\;\;\;\;D \cdot \left(t_0 \cdot \frac{-M \cdot w0}{d}\right)\\

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

\mathbf{else}:\\
\;\;\;\;D \cdot \left(t_0 \cdot \frac{M \cdot w0}{d}\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 (/.f64 (*.f64 M D) (*.f64 2 d)) < -1e153

    1. Initial program 63.7

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

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

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

      [Start]61.1

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

      rational_best-simplify-3 [=>]61.1

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

      rational_best-simplify-47 [<=]61.3

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

      rational_best-simplify-2 [<=]61.3

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

      rational_best-simplify-47 [=>]61.4

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

      rational_best-simplify-47 [<=]63.7

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

      rational_best-simplify-2 [<=]63.7

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

      rational_best-simplify-47 [=>]61.4

      \[ w0 \cdot \sqrt{1 - h \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2}}{\ell}} \]
    4. Taylor expanded in M around -inf 64.0

      \[\leadsto w0 \cdot \color{blue}{\left(-1 \cdot \left(\frac{\sqrt{-0.25} \cdot \left(D \cdot M\right)}{d} \cdot \sqrt{\frac{h}{\ell}}\right)\right)} \]
    5. Simplified39.0

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

      [Start]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-12 [=>]64.0

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

      rational_best-simplify-9 [=>]64.0

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

      rational_best-simplify-47 [<=]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-47 [=>]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-47 [=>]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      exponential-simplify-19 [=>]39.0

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

      rational_best-simplify-48 [=>]39.0

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

      rational_best-simplify-2 [=>]39.0

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

      rational_best-simplify-12 [=>]39.0

      \[ w0 \cdot \left(\left(M \cdot \sqrt{-0.25 \cdot \frac{h}{\ell}}\right) \cdot \frac{D}{\color{blue}{-d}}\right) \]
    6. Taylor expanded in w0 around 0 64.0

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

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

      [Start]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-44 [<=]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-44 [<=]64.0

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

      rational_best-simplify-47 [=>]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-12 [=>]64.0

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

      rational_best-simplify-8 [<=]64.0

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

      rational_best-simplify-48 [=>]64.0

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

      rational_best-simplify-2 [<=]64.0

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

      rational_best-simplify-13 [<=]64.0

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

      rational_best-simplify-47 [<=]64.0

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

    if -1e153 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 5e152

    1. Initial program 6.7

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

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

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

      [Start]7.3

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

      rational_best-simplify-3 [=>]7.3

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

      rational_best-simplify-47 [<=]3.5

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

      rational_best-simplify-2 [<=]3.5

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

      rational_best-simplify-47 [=>]3.4

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

      rational_best-simplify-47 [<=]2.9

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

      rational_best-simplify-2 [<=]2.9

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

      rational_best-simplify-47 [=>]3.4

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

    if 5e152 < (/.f64 (*.f64 M D) (*.f64 2 d))

    1. Initial program 63.9

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

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

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

      [Start]59.2

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

      rational_best-simplify-3 [=>]59.2

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

      rational_best-simplify-47 [<=]59.7

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

      rational_best-simplify-2 [<=]59.7

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

      rational_best-simplify-47 [=>]59.3

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

      rational_best-simplify-47 [<=]63.9

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

      rational_best-simplify-2 [<=]63.9

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

      rational_best-simplify-47 [=>]59.3

      \[ w0 \cdot \sqrt{1 - h \cdot \frac{{\color{blue}{\left(M \cdot \frac{D}{2 \cdot d}\right)}}^{2}}{\ell}} \]
    4. Taylor expanded in M around inf 64.0

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

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

      [Start]64.0

      \[ w0 \cdot \left(\frac{D \cdot \left(\sqrt{-0.25} \cdot M\right)}{d} \cdot \sqrt{\frac{h}{\ell}}\right) \]

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-44 [<=]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-47 [=>]64.0

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

      rational_best-simplify-2 [=>]64.0

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

      rational_best-simplify-44 [=>]64.0

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

      rational_best-simplify-47 [=>]64.0

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

      exponential-simplify-19 [=>]40.4

      \[ w0 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \color{blue}{\sqrt{-0.25 \cdot \frac{h}{\ell}}}\right) \]
    6. Applied egg-rr31.2

      \[\leadsto \color{blue}{\sqrt{-0.25 \cdot \frac{h}{\ell}} \cdot \left(M \cdot \left(D \cdot \frac{w0}{d}\right)\right) + 0} \]
    7. Simplified29.5

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

      [Start]31.2

      \[ \sqrt{-0.25 \cdot \frac{h}{\ell}} \cdot \left(M \cdot \left(D \cdot \frac{w0}{d}\right)\right) + 0 \]

      rational_best-simplify-3 [=>]31.2

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

      rational_best-simplify-44 [=>]31.0

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

      rational_best-simplify-44 [=>]29.9

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

      rational_best-simplify-47 [<=]29.5

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

      rational_best-simplify-2 [=>]29.5

      \[ D \cdot \left(\sqrt{-0.25 \cdot \frac{h}{\ell}} \cdot \frac{\color{blue}{M \cdot w0}}{d}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification6.8

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

Alternatives

Alternative 1
Error13.6
Cost7492
\[\begin{array}{l} \mathbf{if}\;M \cdot D \leq -1 \cdot 10^{+261}:\\ \;\;\;\;D \cdot \left(\sqrt{-0.25 \cdot \frac{h}{\ell}} \cdot \frac{M \cdot w0}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
Alternative 2
Error13.7
Cost64
\[w0 \]

Error

Reproduce?

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