Average Error: 14.8 → 9.8
Time: 19.5s
Precision: binary64
Cost: 28296
\[w0 \cdot \sqrt{1 - {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}} \]
\[\begin{array}{l} t_0 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\ \mathbf{if}\;t_0 \leq -\infty:\\ \;\;\;\;w0 \cdot \sqrt{\frac{D \cdot \left(D \cdot \left(\frac{h}{\ell} \cdot \frac{M}{d}\right)\right)}{\frac{d}{M}} \cdot -0.25}\\ \mathbf{elif}\;t_0 \leq 2 \cdot 10^{-14}:\\ \;\;\;\;w0 \cdot \sqrt{1 - t_0}\\ \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 (* (pow (/ (* M D) (* 2.0 d)) 2.0) (/ h l))))
   (if (<= t_0 (- INFINITY))
     (* w0 (sqrt (* (/ (* D (* D (* (/ h l) (/ M d)))) (/ d M)) -0.25)))
     (if (<= t_0 2e-14) (* w0 (sqrt (- 1.0 t_0))) 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 = pow(((M * D) / (2.0 * d)), 2.0) * (h / l);
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = w0 * sqrt((((D * (D * ((h / l) * (M / d)))) / (d / M)) * -0.25));
	} else if (t_0 <= 2e-14) {
		tmp = w0 * sqrt((1.0 - t_0));
	} 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 = Math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l);
	double tmp;
	if (t_0 <= -Double.POSITIVE_INFINITY) {
		tmp = w0 * Math.sqrt((((D * (D * ((h / l) * (M / d)))) / (d / M)) * -0.25));
	} else if (t_0 <= 2e-14) {
		tmp = w0 * Math.sqrt((1.0 - t_0));
	} 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 = math.pow(((M * D) / (2.0 * d)), 2.0) * (h / l)
	tmp = 0
	if t_0 <= -math.inf:
		tmp = w0 * math.sqrt((((D * (D * ((h / l) * (M / d)))) / (d / M)) * -0.25))
	elif t_0 <= 2e-14:
		tmp = w0 * math.sqrt((1.0 - t_0))
	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((Float64(Float64(M * D) / Float64(2.0 * d)) ^ 2.0) * Float64(h / l))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(w0 * sqrt(Float64(Float64(Float64(D * Float64(D * Float64(Float64(h / l) * Float64(M / d)))) / Float64(d / M)) * -0.25)));
	elseif (t_0 <= 2e-14)
		tmp = Float64(w0 * sqrt(Float64(1.0 - t_0)));
	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 = (((M * D) / (2.0 * d)) ^ 2.0) * (h / l);
	tmp = 0.0;
	if (t_0 <= -Inf)
		tmp = w0 * sqrt((((D * (D * ((h / l) * (M / d)))) / (d / M)) * -0.25));
	elseif (t_0 <= 2e-14)
		tmp = w0 * sqrt((1.0 - t_0));
	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[(N[Power[N[(N[(M * D), $MachinePrecision] / N[(2.0 * d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] * N[(h / l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(w0 * N[Sqrt[N[(N[(N[(D * N[(D * N[(N[(h / l), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e-14], N[(w0 * N[Sqrt[N[(1.0 - t$95$0), $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 := {\left(\frac{M \cdot D}{2 \cdot d}\right)}^{2} \cdot \frac{h}{\ell}\\
\mathbf{if}\;t_0 \leq -\infty:\\
\;\;\;\;w0 \cdot \sqrt{\frac{D \cdot \left(D \cdot \left(\frac{h}{\ell} \cdot \frac{M}{d}\right)\right)}{\frac{d}{M}} \cdot -0.25}\\

\mathbf{elif}\;t_0 \leq 2 \cdot 10^{-14}:\\
\;\;\;\;w0 \cdot \sqrt{1 - t_0}\\

\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 3 regimes
  2. if (*.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. Simplified61.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)))): 8 points increase in error, 2 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)))): 4 points increase in error, 8 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.1

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

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

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

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

    if -inf.0 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l)) < 2e-14

    1. Initial program 0.1

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

    if 2e-14 < (*.f64 (pow.f64 (/.f64 (*.f64 M D) (*.f64 2 d)) 2) (/.f64 h l))

    1. Initial program 60.7

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

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

      \[\leadsto w0 \cdot \color{blue}{\mathsf{fma}\left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(\frac{h}{\ell} \cdot \left(M \cdot M\right)\right), -0.125, 1\right)} \]
      Proof
      (fma.f64 (*.f64 (*.f64 (/.f64 D d) (/.f64 D d)) (*.f64 (/.f64 h l) (*.f64 M M))) -1/8 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D D) (*.f64 d d))) (*.f64 (/.f64 h l) (*.f64 M M))) -1/8 1): 38 points increase in error, 1 points decrease in error
      (fma.f64 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (*.f64 d d)) (*.f64 (/.f64 h l) (*.f64 M M))) -1/8 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (/.f64 (pow.f64 D 2) (Rewrite<= unpow2_binary64 (pow.f64 d 2))) (*.f64 (/.f64 h l) (*.f64 M M))) -1/8 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (*.f64 (/.f64 h l) (Rewrite<= unpow2_binary64 (pow.f64 M 2)))) -1/8 1): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= associate-/r/_binary64 (/.f64 h (/.f64 l (pow.f64 M 2))))) -1/8 1): 2 points increase in error, 12 points decrease in error
      (fma.f64 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 h (pow.f64 M 2)) l))) -1/8 1): 5 points increase in error, 2 points decrease in error
      (fma.f64 (Rewrite<= times-frac_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l))) -1/8 1): 10 points increase in error, 9 points decrease in error
      (fma.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (Rewrite<= *-commutative_binary64 (*.f64 l (pow.f64 d 2)))) -1/8 1): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 l (pow.f64 d 2))) -1/8) 1)): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 l (pow.f64 d 2))))) 1): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (Rewrite=> *-commutative_binary64 (*.f64 (pow.f64 M 2) h))) (*.f64 l (pow.f64 d 2)))) 1): 0 points increase in error, 0 points decrease in error
      (Rewrite<= +-commutative_binary64 (+.f64 1 (*.f64 -1/8 (/.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
    4. Taylor expanded in w0 around 0 36.7

      \[\leadsto \color{blue}{\left(1 + -0.125 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2} \cdot \ell}\right) \cdot w0} \]
    5. Simplified30.5

      \[\leadsto \color{blue}{\mathsf{fma}\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{\ell \cdot d}\right), -0.125 \cdot w0, w0\right)} \]
      Proof
      (fma.f64 (*.f64 (*.f64 h (*.f64 M M)) (*.f64 (/.f64 D d) (/.f64 D (*.f64 l d)))) (*.f64 -1/8 w0) w0): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (*.f64 h (Rewrite<= unpow2_binary64 (pow.f64 M 2))) (*.f64 (/.f64 D d) (/.f64 D (*.f64 l d)))) (*.f64 -1/8 w0) w0): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (*.f64 h (pow.f64 M 2)) (*.f64 (/.f64 D d) (/.f64 D (Rewrite<= *-commutative_binary64 (*.f64 d l))))) (*.f64 -1/8 w0) w0): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (*.f64 h (pow.f64 M 2)) (Rewrite<= times-frac_binary64 (/.f64 (*.f64 D D) (*.f64 d (*.f64 d l))))) (*.f64 -1/8 w0) w0): 29 points increase in error, 1 points decrease in error
      (fma.f64 (*.f64 (*.f64 h (pow.f64 M 2)) (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 D 2)) (*.f64 d (*.f64 d l)))) (*.f64 -1/8 w0) w0): 0 points increase in error, 0 points decrease in error
      (fma.f64 (*.f64 (*.f64 h (pow.f64 M 2)) (/.f64 (pow.f64 D 2) (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 d d) l)))) (*.f64 -1/8 w0) w0): 8 points increase in error, 1 points decrease in error
      (fma.f64 (*.f64 (*.f64 h (pow.f64 M 2)) (/.f64 (pow.f64 D 2) (*.f64 (Rewrite<= unpow2_binary64 (pow.f64 d 2)) l))) (*.f64 -1/8 w0) w0): 0 points increase in error, 0 points decrease in error
      (fma.f64 (Rewrite<= *-commutative_binary64 (*.f64 (/.f64 (pow.f64 D 2) (*.f64 (pow.f64 d 2) l)) (*.f64 h (pow.f64 M 2)))) (*.f64 -1/8 w0) w0): 0 points increase in error, 0 points decrease in error
      (fma.f64 (Rewrite=> associate-*l/_binary64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l))) (*.f64 -1/8 w0) w0): 5 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l)) (*.f64 -1/8 w0)) w0)): 0 points increase in error, 0 points decrease in error
      (+.f64 (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l)) -1/8) w0)) w0): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l)))) w0) w0): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1/8 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2)))) (*.f64 (pow.f64 d 2) l))) w0) w0): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (/.f64 (*.f64 -1/8 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2)))) (Rewrite=> *-commutative_binary64 (*.f64 l (pow.f64 d 2)))) w0) w0): 0 points increase in error, 0 points decrease in error
      (+.f64 (*.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 l (pow.f64 d 2))))) w0) w0): 0 points increase in error, 0 points decrease in error
      (Rewrite=> distribute-lft1-in_binary64 (*.f64 (+.f64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 l (pow.f64 d 2)))) 1) w0)): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 (Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 -1/8 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2)))) (*.f64 l (pow.f64 d 2)))) 1) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 (/.f64 (*.f64 -1/8 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2)))) (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 d 2) l))) 1) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (+.f64 (Rewrite<= associate-*r/_binary64 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l)))) 1) w0): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= +-commutative_binary64 (+.f64 1 (*.f64 -1/8 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 h (pow.f64 M 2))) (*.f64 (pow.f64 d 2) l))))) w0): 0 points increase in error, 0 points decrease in error
    6. Taylor expanded in h around 0 18.2

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

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

Alternatives

Alternative 1
Error11.0
Cost14344
\[\begin{array}{l} \mathbf{if}\;\frac{h}{\ell} \leq -5 \cdot 10^{+281}:\\ \;\;\;\;w0\\ \mathbf{elif}\;\frac{h}{\ell} \leq -2 \cdot 10^{-136}:\\ \;\;\;\;w0 \cdot \sqrt{1 - \frac{h}{\ell} \cdot {\left(\frac{D}{d} \cdot \left(M \cdot 0.5\right)\right)}^{2}}\\ \mathbf{else}:\\ \;\;\;\;w0\\ \end{array} \]
Alternative 2
Error14.3
Cost64
\[w0 \]

Error

Reproduce

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