Average Error: 13.7 → 9.7
Time: 22.4s
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 := \frac{M \cdot D}{2 \cdot d}\\ \mathbf{if}\;t_0 \leq -5 \cdot 10^{+178}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(D \cdot \left(\frac{D}{d} \cdot \left(\frac{M}{d} \cdot \left(M \cdot h\right)\right)\right)\right)}{\ell}}\\ \mathbf{elif}\;t_0 \leq 10^{+103}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h \cdot {\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right)}^{2}}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \left(\sqrt{\frac{-0.25}{\ell}} \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \sqrt{h}\right)\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 (/ (* M D) (* 2.0 d))))
   (if (<= t_0 -5e+178)
     (* w0 (sqrt (- 1.0 (/ (* 0.25 (* D (* (/ D d) (* (/ M d) (* M h))))) l))))
     (if (<= t_0 1e+103)
       (* w0 (sqrt (- 1.0 (/ (* h (pow (* (* M D) (/ 0.5 d)) 2.0)) l))))
       (* w0 (* (sqrt (/ -0.25 l)) (* (* M (/ D d)) (sqrt h))))))))
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 = (M * D) / (2.0 * d);
	double tmp;
	if (t_0 <= -5e+178) {
		tmp = w0 * sqrt((1.0 - ((0.25 * (D * ((D / d) * ((M / d) * (M * h))))) / l)));
	} else if (t_0 <= 1e+103) {
		tmp = w0 * sqrt((1.0 - ((h * pow(((M * D) * (0.5 / d)), 2.0)) / l)));
	} else {
		tmp = w0 * (sqrt((-0.25 / l)) * ((M * (D / d)) * sqrt(h)));
	}
	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) :: tmp
    t_0 = (m * d) / (2.0d0 * d_1)
    if (t_0 <= (-5d+178)) then
        tmp = w0 * sqrt((1.0d0 - ((0.25d0 * (d * ((d / d_1) * ((m / d_1) * (m * h))))) / l)))
    else if (t_0 <= 1d+103) then
        tmp = w0 * sqrt((1.0d0 - ((h * (((m * d) * (0.5d0 / d_1)) ** 2.0d0)) / l)))
    else
        tmp = w0 * (sqrt(((-0.25d0) / l)) * ((m * (d / d_1)) * sqrt(h)))
    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 = (M * D) / (2.0 * d);
	double tmp;
	if (t_0 <= -5e+178) {
		tmp = w0 * Math.sqrt((1.0 - ((0.25 * (D * ((D / d) * ((M / d) * (M * h))))) / l)));
	} else if (t_0 <= 1e+103) {
		tmp = w0 * Math.sqrt((1.0 - ((h * Math.pow(((M * D) * (0.5 / d)), 2.0)) / l)));
	} else {
		tmp = w0 * (Math.sqrt((-0.25 / l)) * ((M * (D / d)) * Math.sqrt(h)));
	}
	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 = (M * D) / (2.0 * d)
	tmp = 0
	if t_0 <= -5e+178:
		tmp = w0 * math.sqrt((1.0 - ((0.25 * (D * ((D / d) * ((M / d) * (M * h))))) / l)))
	elif t_0 <= 1e+103:
		tmp = w0 * math.sqrt((1.0 - ((h * math.pow(((M * D) * (0.5 / d)), 2.0)) / l)))
	else:
		tmp = w0 * (math.sqrt((-0.25 / l)) * ((M * (D / d)) * math.sqrt(h)))
	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(Float64(M * D) / Float64(2.0 * d))
	tmp = 0.0
	if (t_0 <= -5e+178)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(0.25 * Float64(D * Float64(Float64(D / d) * Float64(Float64(M / d) * Float64(M * h))))) / l))));
	elseif (t_0 <= 1e+103)
		tmp = Float64(w0 * sqrt(Float64(1.0 - Float64(Float64(h * (Float64(Float64(M * D) * Float64(0.5 / d)) ^ 2.0)) / l))));
	else
		tmp = Float64(w0 * Float64(sqrt(Float64(-0.25 / l)) * Float64(Float64(M * Float64(D / d)) * sqrt(h))));
	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 = (M * D) / (2.0 * d);
	tmp = 0.0;
	if (t_0 <= -5e+178)
		tmp = w0 * sqrt((1.0 - ((0.25 * (D * ((D / d) * ((M / d) * (M * h))))) / l)));
	elseif (t_0 <= 1e+103)
		tmp = w0 * sqrt((1.0 - ((h * (((M * D) * (0.5 / d)) ^ 2.0)) / l)));
	else
		tmp = w0 * (sqrt((-0.25 / l)) * ((M * (D / d)) * sqrt(h)));
	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[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+178], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(0.25 * N[(D * N[(N[(D / d), $MachinePrecision] * N[(N[(M / d), $MachinePrecision] * N[(M * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+103], N[(w0 * N[Sqrt[N[(1.0 - N[(N[(h * N[Power[N[(N[(M * D), $MachinePrecision] * N[(0.5 / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(w0 * N[(N[Sqrt[N[(-0.25 / l), $MachinePrecision]], $MachinePrecision] * N[(N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision] * N[Sqrt[h], $MachinePrecision]), $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 := \frac{M \cdot D}{2 \cdot d}\\
\mathbf{if}\;t_0 \leq -5 \cdot 10^{+178}:\\
\;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(D \cdot \left(\frac{D}{d} \cdot \left(\frac{M}{d} \cdot \left(M \cdot h\right)\right)\right)\right)}{\ell}}\\

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

\mathbf{else}:\\
\;\;\;\;w0 \cdot \left(\sqrt{\frac{-0.25}{\ell}} \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \sqrt{h}\right)\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)) < -4.9999999999999999e178

    1. Initial program 64.0

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

      \[\leadsto w0 \cdot \sqrt{1 - \color{blue}{\frac{{\left(\left(M \cdot D\right) \cdot \frac{0.5}{d}\right)}^{2} \cdot h}{\ell}}} \]
    3. Taylor expanded in M around 0 63.1

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

      \[\leadsto w0 \cdot \sqrt{1 - \frac{\color{blue}{0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d \cdot d} \cdot h\right)}}{\ell}} \]
      Proof
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (*.f64 D M) (*.f64 D M)) (*.f64 d d)) h)): 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))) (*.f64 d d)) h)): 43 points increase in error, 9 points decrease in error
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (*.f64 M M)) (*.f64 d d)) h)): 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))) (*.f64 d d)) h)): 0 points increase in error, 0 points decrease in error
      (*.f64 1/4 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) (Rewrite<= unpow2_binary64 (pow.f64 d 2))) h)): 0 points increase in error, 0 points decrease in error
      (*.f64 1/4 (Rewrite<= associate-/r/_binary64 (/.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) (/.f64 (pow.f64 d 2) h)))): 9 points increase in error, 6 points decrease in error
      (*.f64 1/4 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (*.f64 (pow.f64 D 2) (pow.f64 M 2)) h) (pow.f64 d 2)))): 11 points increase in error, 10 points decrease in error
      (*.f64 1/4 (/.f64 (Rewrite<= associate-*r*_binary64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h))) (pow.f64 d 2))): 11 points increase in error, 5 points decrease in error
    5. Applied egg-rr64.0

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

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

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

    if -4.9999999999999999e178 < (/.f64 (*.f64 M D) (*.f64 2 d)) < 1e103

    1. Initial program 7.0

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

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

    if 1e103 < (/.f64 (*.f64 M D) (*.f64 2 d))

    1. Initial program 52.2

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

      \[\leadsto \color{blue}{w0 \cdot \sqrt{-\mathsf{fma}\left({\left(M \cdot \frac{D}{2 \cdot d}\right)}^{2}, \frac{h}{\ell}, -1\right)}} \]
      Proof
      (*.f64 w0 (sqrt.f64 (neg.f64 (fma.f64 (pow.f64 (*.f64 M (/.f64 D (*.f64 2 d))) 2) (/.f64 h l) -1)))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (neg.f64 (fma.f64 (pow.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 D (*.f64 2 d)) M)) 2) (/.f64 h l) -1)))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (neg.f64 (fma.f64 (pow.f64 (Rewrite<= associate-/r/_binary64 (/.f64 D (/.f64 (*.f64 2 d) M))) 2) (/.f64 h l) -1)))): 6 points increase in error, 4 points decrease in error
      (*.f64 w0 (sqrt.f64 (neg.f64 (fma.f64 (pow.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 D M) (*.f64 2 d))) 2) (/.f64 h l) -1)))): 6 points increase in error, 6 points decrease in error
      (*.f64 w0 (sqrt.f64 (neg.f64 (fma.f64 (pow.f64 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 M D)) (*.f64 2 d)) 2) (/.f64 h l) -1)))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (neg.f64 (fma.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l) (Rewrite<= metadata-eval (neg.f64 1)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (neg.f64 (Rewrite<= fma-neg_binary64 (-.f64 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) 1))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (Rewrite<= sub0-neg_binary64 (-.f64 0 (-.f64 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) 1))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (Rewrite<= associate-+l-_binary64 (+.f64 (-.f64 0 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))) 1)))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (+.f64 (Rewrite<= neg-sub0_binary64 (neg.f64 (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (+.f64 (Rewrite<= distribute-lft-neg-out_binary64 (*.f64 (neg.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l))) 1))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (Rewrite<= +-commutative_binary64 (+.f64 1 (*.f64 (neg.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2)) (/.f64 h l)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 w0 (sqrt.f64 (Rewrite<= cancel-sign-sub-inv_binary64 (-.f64 1 (*.f64 (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 inf 62.6

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

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

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

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

      \[\leadsto w0 \cdot \left(\sqrt{\frac{-0.25}{\ell}} \cdot \color{blue}{\left(\left(M \cdot \frac{D}{d}\right) \cdot \sqrt{h}\right)}\right) \]
      Proof
      (*.f64 (*.f64 M (/.f64 D d)) (sqrt.f64 h)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 D d) M)) (sqrt.f64 h)): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 D M) d)) (sqrt.f64 h)): 25 points increase in error, 23 points decrease in error
  3. Recombined 3 regimes into one program.
  4. Final simplification9.7

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

Alternatives

Alternative 1
Error14.5
Cost7880
\[\begin{array}{l} \mathbf{if}\;w0 \leq 5.718178619063704 \cdot 10^{-269}:\\ \;\;\;\;w0\\ \mathbf{elif}\;w0 \leq 1.8553604854384032 \cdot 10^{-245}:\\ \;\;\;\;w0 \cdot \sqrt{\frac{M \cdot \left(M \cdot \frac{D}{\frac{d}{h}}\right)}{\frac{d}{D}} \cdot \frac{-0.25}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
Alternative 2
Error12.3
Cost7876
\[\begin{array}{l} \mathbf{if}\;M \leq -15200000000000:\\ \;\;\;\;w0\\ \mathbf{else}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{0.25 \cdot \left(D \cdot \left(\frac{D}{d} \cdot \left(\frac{M}{d} \cdot \left(M \cdot h\right)\right)\right)\right)}{\ell}}\\ \end{array} \]
Alternative 3
Error13.6
Cost64
\[w0 \]

Error

Reproduce

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