Average Error: 59.4 → 18.7
Time: 27.5s
Precision: binary64
Cost: 30284
\[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
\[\begin{array}{l} t_0 := c0 \cdot \frac{d}{D}\\ t_1 := \frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\ t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := \frac{c0}{2 \cdot w} \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\ \mathbf{if}\;t_3 \leq -1 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{-23}:\\ \;\;\;\;h \cdot \frac{M \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M}}\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{M \cdot \left(\left(D \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot \left(h \cdot 0.25\right)\right)}{d}\\ \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (*
  (/ c0 (* 2.0 w))
  (+
   (/ (* c0 (* d d)) (* (* w h) (* D D)))
   (sqrt
    (-
     (*
      (/ (* c0 (* d d)) (* (* w h) (* D D)))
      (/ (* c0 (* d d)) (* (* w h) (* D D))))
     (* M M))))))
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (* c0 (/ d D)))
        (t_1 (* (/ t_0 (* w h)) (/ t_0 w)))
        (t_2 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_3 (* (/ c0 (* 2.0 w)) (+ t_2 (sqrt (- (* t_2 t_2) (* M M)))))))
   (if (<= t_3 -1e-25)
     t_1
     (if (<= t_3 5e-23)
       (* h (/ (* M (* D 0.25)) (* (/ d D) (/ d M))))
       (if (<= t_3 INFINITY)
         t_1
         (/ (* M (* (* D (* M (/ D d))) (* h 0.25))) d))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 * (d / D);
	double t_1 = (t_0 / (w * h)) * (t_0 / w);
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_3 = (c0 / (2.0 * w)) * (t_2 + sqrt(((t_2 * t_2) - (M * M))));
	double tmp;
	if (t_3 <= -1e-25) {
		tmp = t_1;
	} else if (t_3 <= 5e-23) {
		tmp = h * ((M * (D * 0.25)) / ((d / D) * (d / M)));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = (M * ((D * (M * (D / d))) * (h * 0.25))) / d;
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 * (d / D);
	double t_1 = (t_0 / (w * h)) * (t_0 / w);
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_3 = (c0 / (2.0 * w)) * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))));
	double tmp;
	if (t_3 <= -1e-25) {
		tmp = t_1;
	} else if (t_3 <= 5e-23) {
		tmp = h * ((M * (D * 0.25)) / ((d / D) * (d / M)));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = (M * ((D * (M * (D / d))) * (h * 0.25))) / d;
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))))
def code(c0, w, h, D, d, M):
	t_0 = c0 * (d / D)
	t_1 = (t_0 / (w * h)) * (t_0 / w)
	t_2 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_3 = (c0 / (2.0 * w)) * (t_2 + math.sqrt(((t_2 * t_2) - (M * M))))
	tmp = 0
	if t_3 <= -1e-25:
		tmp = t_1
	elif t_3 <= 5e-23:
		tmp = h * ((M * (D * 0.25)) / ((d / D) * (d / M)))
	elif t_3 <= math.inf:
		tmp = t_1
	else:
		tmp = (M * ((D * (M * (D / d))) * (h * 0.25))) / d
	return tmp
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 * Float64(d / D))
	t_1 = Float64(Float64(t_0 / Float64(w * h)) * Float64(t_0 / w))
	t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_3 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M)))))
	tmp = 0.0
	if (t_3 <= -1e-25)
		tmp = t_1;
	elseif (t_3 <= 5e-23)
		tmp = Float64(h * Float64(Float64(M * Float64(D * 0.25)) / Float64(Float64(d / D) * Float64(d / M))));
	elseif (t_3 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(Float64(M * Float64(Float64(D * Float64(M * Float64(D / d))) * Float64(h * 0.25))) / d);
	end
	return tmp
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 * (d / D);
	t_1 = (t_0 / (w * h)) * (t_0 / w);
	t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_3 = (c0 / (2.0 * w)) * (t_2 + sqrt(((t_2 * t_2) - (M * M))));
	tmp = 0.0;
	if (t_3 <= -1e-25)
		tmp = t_1;
	elseif (t_3 <= 5e-23)
		tmp = h * ((M * (D * 0.25)) / ((d / D) * (d / M)));
	elseif (t_3 <= Inf)
		tmp = t_1;
	else
		tmp = (M * ((D * (M * (D / d))) * (h * 0.25))) / d;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-25], t$95$1, If[LessEqual[t$95$3, 5e-23], N[(h * N[(N[(M * N[(D * 0.25), $MachinePrecision]), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] * N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$1, N[(N[(M * N[(N[(D * N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision]]]]]]]]
\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\begin{array}{l}
t_0 := c0 \cdot \frac{d}{D}\\
t_1 := \frac{t_0}{w \cdot h} \cdot \frac{t_0}{w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := \frac{c0}{2 \cdot w} \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{-25}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-23}:\\
\;\;\;\;h \cdot \frac{M \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M}}\\

\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;\frac{M \cdot \left(\left(D \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot \left(h \cdot 0.25\right)\right)}{d}\\


\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 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -1.00000000000000004e-25 or 5.0000000000000002e-23 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < +inf.0

    1. Initial program 53.3

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Simplified58.8

      \[\leadsto \color{blue}{\frac{\frac{c0}{w}}{2} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{c0}{w \cdot h}, \frac{d}{D} \cdot {\left(\frac{d}{D}\right)}^{3}, -M \cdot M\right)}\right)} \]
      Proof
      (*.f64 (/.f64 (/.f64 c0 w) 2) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 w (*.f64 h (*.f64 D D)))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 d D) (pow.f64 (/.f64 d D) 3)) (neg.f64 (*.f64 M M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite=> associate-/l/ (/.f64 c0 (*.f64 2 w))) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 w (*.f64 h (*.f64 D D)))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 d D) (pow.f64 (/.f64 d D) 3)) (neg.f64 (*.f64 M M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (Rewrite<= associate-*l* (*.f64 (*.f64 w h) (*.f64 D D)))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 d D) (pow.f64 (/.f64 d D) 3)) (neg.f64 (*.f64 M M)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 d D) (Rewrite<= cube-unmult (*.f64 (/.f64 d D) (*.f64 (/.f64 d D) (/.f64 d D))))) (neg.f64 (*.f64 M M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 d D) (*.f64 (/.f64 d D) (Rewrite<= times-frac (/.f64 (*.f64 d d) (*.f64 D D))))) (neg.f64 (*.f64 M M)))))): 2 points increase in error, 2 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (Rewrite<= associate-*l* (*.f64 (*.f64 (/.f64 d D) (/.f64 d D)) (/.f64 (*.f64 d d) (*.f64 D D)))) (neg.f64 (*.f64 M M)))))): 0 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (fma.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (Rewrite<= times-frac (/.f64 (*.f64 d d) (*.f64 D D))) (/.f64 (*.f64 d d) (*.f64 D D))) (neg.f64 (*.f64 M M)))))): 2 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (Rewrite<= fma-neg (-.f64 (*.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 c0 (*.f64 w h))) (*.f64 (/.f64 (*.f64 d d) (*.f64 D D)) (/.f64 (*.f64 d d) (*.f64 D D)))) (*.f64 M M)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (Rewrite<= swap-sqr (*.f64 (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 (*.f64 d d) (*.f64 D D))) (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 (*.f64 d d) (*.f64 D D))))) (*.f64 M M))))): 0 points increase in error, 7 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (Rewrite<= times-frac (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 (/.f64 c0 (*.f64 w h)) (/.f64 (*.f64 d d) (*.f64 D D)))) (*.f64 M M))))): 5 points increase in error, 1 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (fma.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (Rewrite<= times-frac (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))))) (*.f64 M M))))): 0 points increase in error, 10 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (Rewrite<= fma-def (+.f64 (*.f64 (*.f64 d d) (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D)))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))): 2 points increase in error, 6 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (Rewrite<= *-commutative (*.f64 (/.f64 c0 (*.f64 (*.f64 w h) (*.f64 D D))) (*.f64 d d))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (Rewrite=> associate-*l/ (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))): 0 points increase in error, 3 points decrease in error
    3. Taylor expanded in c0 around inf 56.2

      \[\leadsto \color{blue}{\frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}} \]
    4. Simplified54.1

      \[\leadsto \color{blue}{\frac{\frac{\frac{d \cdot d}{D}}{D} \cdot \left(c0 \cdot c0\right)}{w \cdot \left(w \cdot h\right)}} \]
      Proof
      (/.f64 (*.f64 (/.f64 (/.f64 (*.f64 d d) D) D) (*.f64 c0 c0)) (*.f64 w (*.f64 w h))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (/.f64 (/.f64 (Rewrite<= unpow2 (pow.f64 d 2)) D) D) (*.f64 c0 c0)) (*.f64 w (*.f64 w h))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (Rewrite<= associate-/r* (/.f64 (pow.f64 d 2) (*.f64 D D))) (*.f64 c0 c0)) (*.f64 w (*.f64 w h))): 14 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (/.f64 (pow.f64 d 2) (Rewrite<= unpow2 (pow.f64 D 2))) (*.f64 c0 c0)) (*.f64 w (*.f64 w h))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (/.f64 (pow.f64 d 2) (pow.f64 D 2)) (Rewrite<= unpow2 (pow.f64 c0 2))) (*.f64 w (*.f64 w h))): 0 points increase in error, 0 points decrease in error
      (/.f64 (*.f64 (/.f64 (pow.f64 d 2) (pow.f64 D 2)) (pow.f64 c0 2)) (Rewrite<= associate-*l* (*.f64 (*.f64 w w) h))): 3 points increase in error, 2 points decrease in error
      (/.f64 (*.f64 (/.f64 (pow.f64 d 2) (pow.f64 D 2)) (pow.f64 c0 2)) (*.f64 (Rewrite<= unpow2 (pow.f64 w 2)) h)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*r/ (*.f64 (/.f64 (pow.f64 d 2) (pow.f64 D 2)) (/.f64 (pow.f64 c0 2) (*.f64 (pow.f64 w 2) h)))): 6 points increase in error, 4 points decrease in error
      (Rewrite<= times-frac (/.f64 (*.f64 (pow.f64 d 2) (pow.f64 c0 2)) (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 w 2) h)))): 5 points increase in error, 7 points decrease in error
    5. Applied egg-rr23.3

      \[\leadsto \color{blue}{\frac{c0 \cdot \frac{d}{D}}{w \cdot h} \cdot \frac{c0 \cdot \frac{d}{D}}{w}} \]

    if -1.00000000000000004e-25 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < 5.0000000000000002e-23

    1. Initial program 24.8

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 35.3

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    3. Simplified33.5

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w \cdot h}{\frac{c0}{M \cdot M}}, c0 \cdot 0\right)} \]
      Proof
      (fma.f64 1/2 (*.f64 (*.f64 (/.f64 D d) (/.f64 D d)) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (Rewrite<= times-frac (/.f64 (*.f64 D D) (*.f64 d d))) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 45 points increase in error, 5 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (Rewrite<= unpow2 (pow.f64 D 2)) (*.f64 d d)) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (Rewrite<= unpow2 (pow.f64 d 2))) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (/.f64 (*.f64 w h) (/.f64 c0 (Rewrite<= unpow2 (pow.f64 M 2))))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= associate-/l* (/.f64 (*.f64 (*.f64 w h) (pow.f64 M 2)) c0))) (*.f64 c0 0)): 5 points increase in error, 4 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (/.f64 (Rewrite<= associate-*r* (*.f64 w (*.f64 h (pow.f64 M 2)))) c0)) (*.f64 c0 0)): 6 points increase in error, 8 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (/.f64 (*.f64 w (Rewrite=> *-commutative (*.f64 (pow.f64 M 2) h))) c0)) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (Rewrite<= times-frac (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0))) (*.f64 c0 0)): 13 points increase in error, 10 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (Rewrite<= metadata-eval (*.f64 -1 0)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (*.f64 -1 (Rewrite<= mul0-lft (*.f64 0 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))))): 111 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (*.f64 -1 (*.f64 (Rewrite<= metadata-eval (+.f64 -1 1)) (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (*.f64 -1 (Rewrite<= distribute-rgt1-in (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (Rewrite<= *-commutative (*.f64 (*.f64 -1 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))) c0))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (Rewrite<= associate-*r* (*.f64 -1 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) c0)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def (+.f64 (*.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0))) (*.f64 -1 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) c0)))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in c0 around 0 31.7

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    5. Simplified27.9

      \[\leadsto \color{blue}{h \cdot \left(\left(0.25 \cdot \frac{D \cdot D}{d}\right) \cdot \frac{M}{\frac{d}{M}}\right)} \]
      Proof
      (*.f64 h (*.f64 (*.f64 1/4 (/.f64 (*.f64 D D) d)) (/.f64 M (/.f64 d M)))): 0 points increase in error, 0 points decrease in error
      (*.f64 h (*.f64 (*.f64 1/4 (/.f64 (Rewrite<= unpow2 (pow.f64 D 2)) d)) (/.f64 M (/.f64 d M)))): 0 points increase in error, 0 points decrease in error
      (*.f64 h (*.f64 (Rewrite=> associate-*r/ (/.f64 (*.f64 1/4 (pow.f64 D 2)) d)) (/.f64 M (/.f64 d M)))): 1 points increase in error, 0 points decrease in error
      (*.f64 h (*.f64 (/.f64 (*.f64 1/4 (pow.f64 D 2)) d) (Rewrite<= associate-/l* (/.f64 (*.f64 M M) d)))): 21 points increase in error, 3 points decrease in error
      (*.f64 h (*.f64 (/.f64 (*.f64 1/4 (pow.f64 D 2)) d) (/.f64 (Rewrite<= unpow2 (pow.f64 M 2)) d))): 0 points increase in error, 0 points decrease in error
      (*.f64 h (Rewrite<= associate-/r/ (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 d (/.f64 (pow.f64 M 2) d))))): 10 points increase in error, 8 points decrease in error
      (*.f64 h (/.f64 (*.f64 1/4 (pow.f64 D 2)) (Rewrite<= associate-/l* (/.f64 (*.f64 d d) (pow.f64 M 2))))): 21 points increase in error, 3 points decrease in error
      (*.f64 h (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 (Rewrite<= unpow2 (pow.f64 d 2)) (pow.f64 M 2)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative (*.f64 (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 (pow.f64 d 2) (pow.f64 M 2))) h)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/ (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 (/.f64 (pow.f64 d 2) (pow.f64 M 2)) h))): 7 points increase in error, 5 points decrease in error
      (/.f64 (*.f64 1/4 (pow.f64 D 2)) (Rewrite<= associate-/r* (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 M 2) h)))): 9 points increase in error, 5 points decrease in error
      (Rewrite<= associate-*r/ (*.f64 1/4 (/.f64 (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
      (*.f64 1/4 (Rewrite<= associate-/l* (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)))): 7 points increase in error, 8 points decrease in error
      (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (Rewrite=> *-commutative (*.f64 h (pow.f64 M 2)))) (pow.f64 d 2))): 0 points increase in error, 0 points decrease in error
    6. Applied egg-rr27.0

      \[\leadsto h \cdot \left(\left(0.25 \cdot \color{blue}{\frac{D}{\frac{d}{D}}}\right) \cdot \frac{M}{\frac{d}{M}}\right) \]
    7. Applied egg-rr23.6

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

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 64.0

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Taylor expanded in c0 around -inf 63.1

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(0.5 \cdot \frac{{D}^{2} \cdot \left(w \cdot \left({M}^{2} \cdot h\right)\right)}{{d}^{2} \cdot c0} + -1 \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot c0\right)\right)} \]
    3. Simplified37.7

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w \cdot h}{\frac{c0}{M \cdot M}}, c0 \cdot 0\right)} \]
      Proof
      (fma.f64 1/2 (*.f64 (*.f64 (/.f64 D d) (/.f64 D d)) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (Rewrite<= times-frac (/.f64 (*.f64 D D) (*.f64 d d))) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 45 points increase in error, 5 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (Rewrite<= unpow2 (pow.f64 D 2)) (*.f64 d d)) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (Rewrite<= unpow2 (pow.f64 d 2))) (/.f64 (*.f64 w h) (/.f64 c0 (*.f64 M M)))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (/.f64 (*.f64 w h) (/.f64 c0 (Rewrite<= unpow2 (pow.f64 M 2))))) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (Rewrite<= associate-/l* (/.f64 (*.f64 (*.f64 w h) (pow.f64 M 2)) c0))) (*.f64 c0 0)): 5 points increase in error, 4 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (/.f64 (Rewrite<= associate-*r* (*.f64 w (*.f64 h (pow.f64 M 2)))) c0)) (*.f64 c0 0)): 6 points increase in error, 8 points decrease in error
      (fma.f64 1/2 (*.f64 (/.f64 (pow.f64 D 2) (pow.f64 d 2)) (/.f64 (*.f64 w (Rewrite=> *-commutative (*.f64 (pow.f64 M 2) h))) c0)) (*.f64 c0 0)): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (Rewrite<= times-frac (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0))) (*.f64 c0 0)): 13 points increase in error, 10 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (Rewrite<= metadata-eval (*.f64 -1 0)))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (*.f64 -1 (Rewrite<= mul0-lft (*.f64 0 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))))): 111 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (*.f64 -1 (*.f64 (Rewrite<= metadata-eval (+.f64 -1 1)) (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (*.f64 c0 (*.f64 -1 (Rewrite<= distribute-rgt1-in (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))))))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (Rewrite<= *-commutative (*.f64 (*.f64 -1 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h)))))) c0))): 0 points increase in error, 0 points decrease in error
      (fma.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0)) (Rewrite<= associate-*r* (*.f64 -1 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) c0)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def (+.f64 (*.f64 1/2 (/.f64 (*.f64 (pow.f64 D 2) (*.f64 w (*.f64 (pow.f64 M 2) h))) (*.f64 (pow.f64 d 2) c0))) (*.f64 -1 (*.f64 (+.f64 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))) (*.f64 -1 (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 D 2) (*.f64 w h))))) c0)))): 0 points increase in error, 0 points decrease in error
    4. Taylor expanded in c0 around 0 33.9

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    5. Simplified26.3

      \[\leadsto \color{blue}{h \cdot \left(\left(0.25 \cdot \frac{D \cdot D}{d}\right) \cdot \frac{M}{\frac{d}{M}}\right)} \]
      Proof
      (*.f64 h (*.f64 (*.f64 1/4 (/.f64 (*.f64 D D) d)) (/.f64 M (/.f64 d M)))): 0 points increase in error, 0 points decrease in error
      (*.f64 h (*.f64 (*.f64 1/4 (/.f64 (Rewrite<= unpow2 (pow.f64 D 2)) d)) (/.f64 M (/.f64 d M)))): 0 points increase in error, 0 points decrease in error
      (*.f64 h (*.f64 (Rewrite=> associate-*r/ (/.f64 (*.f64 1/4 (pow.f64 D 2)) d)) (/.f64 M (/.f64 d M)))): 1 points increase in error, 0 points decrease in error
      (*.f64 h (*.f64 (/.f64 (*.f64 1/4 (pow.f64 D 2)) d) (Rewrite<= associate-/l* (/.f64 (*.f64 M M) d)))): 21 points increase in error, 3 points decrease in error
      (*.f64 h (*.f64 (/.f64 (*.f64 1/4 (pow.f64 D 2)) d) (/.f64 (Rewrite<= unpow2 (pow.f64 M 2)) d))): 0 points increase in error, 0 points decrease in error
      (*.f64 h (Rewrite<= associate-/r/ (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 d (/.f64 (pow.f64 M 2) d))))): 10 points increase in error, 8 points decrease in error
      (*.f64 h (/.f64 (*.f64 1/4 (pow.f64 D 2)) (Rewrite<= associate-/l* (/.f64 (*.f64 d d) (pow.f64 M 2))))): 21 points increase in error, 3 points decrease in error
      (*.f64 h (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 (Rewrite<= unpow2 (pow.f64 d 2)) (pow.f64 M 2)))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= *-commutative (*.f64 (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 (pow.f64 d 2) (pow.f64 M 2))) h)): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-/r/ (/.f64 (*.f64 1/4 (pow.f64 D 2)) (/.f64 (/.f64 (pow.f64 d 2) (pow.f64 M 2)) h))): 7 points increase in error, 5 points decrease in error
      (/.f64 (*.f64 1/4 (pow.f64 D 2)) (Rewrite<= associate-/r* (/.f64 (pow.f64 d 2) (*.f64 (pow.f64 M 2) h)))): 9 points increase in error, 5 points decrease in error
      (Rewrite<= associate-*r/ (*.f64 1/4 (/.f64 (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
      (*.f64 1/4 (Rewrite<= associate-/l* (/.f64 (*.f64 (pow.f64 D 2) (*.f64 (pow.f64 M 2) h)) (pow.f64 d 2)))): 7 points increase in error, 8 points decrease in error
      (*.f64 1/4 (/.f64 (*.f64 (pow.f64 D 2) (Rewrite=> *-commutative (*.f64 h (pow.f64 M 2)))) (pow.f64 d 2))): 0 points increase in error, 0 points decrease in error
    6. Applied egg-rr20.4

      \[\leadsto \color{blue}{\frac{\left(0.25 \cdot \left(\left(\frac{D}{d} \cdot D\right) \cdot M\right)\right) \cdot h}{d} \cdot M} \]
    7. Applied egg-rr17.6

      \[\leadsto \color{blue}{\frac{M \cdot \left(\left(D \cdot \left(\frac{D}{d} \cdot M\right)\right) \cdot \left(0.25 \cdot h\right)\right)}{d}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification18.7

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

Alternatives

Alternative 1
Error21.3
Cost1740
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+42}:\\ \;\;\;\;M \cdot \frac{D \cdot M}{\frac{d}{D} \cdot \frac{d}{h \cdot 0.25}}\\ \mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+157}:\\ \;\;\;\;\frac{h \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M \cdot M}}\\ \mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+214}:\\ \;\;\;\;h \cdot \frac{M \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{M \cdot \left(\left(D \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot \left(h \cdot 0.25\right)\right)}{d}\\ \end{array} \]
Alternative 2
Error21.2
Cost1740
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 10^{+42}:\\ \;\;\;\;M \cdot \frac{D \cdot M}{\frac{d}{D} \cdot \frac{d}{h \cdot 0.25}}\\ \mathbf{elif}\;M \cdot M \leq 2 \cdot 10^{+189}:\\ \;\;\;\;\frac{h \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M \cdot M}}\\ \mathbf{elif}\;M \cdot M \leq 5 \cdot 10^{+250}:\\ \;\;\;\;M \cdot \left(D \cdot \frac{0.25}{\frac{d}{M} \cdot \frac{\frac{d}{D}}{h}}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{M \cdot \left(\left(D \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot \left(h \cdot 0.25\right)\right)}{d}\\ \end{array} \]
Alternative 3
Error23.4
Cost1616
\[\begin{array}{l} t_0 := h \cdot \frac{M \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M}}\\ \mathbf{if}\;D \leq -2.9 \cdot 10^{+18}:\\ \;\;\;\;M \cdot \frac{M \cdot \left(\left(h \cdot 0.25\right) \cdot \left(D \cdot \frac{D}{d}\right)\right)}{d}\\ \mathbf{elif}\;D \leq -2.35 \cdot 10^{-232}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 9.8 \cdot 10^{+51}:\\ \;\;\;\;\frac{M \cdot \left(\left(D \cdot \left(M \cdot \frac{D}{d}\right)\right) \cdot \left(h \cdot 0.25\right)\right)}{d}\\ \mathbf{elif}\;D \leq 2.1 \cdot 10^{+98}:\\ \;\;\;\;d \cdot \frac{d \cdot \frac{c0}{w \cdot h}}{\left(D \cdot D\right) \cdot \frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error21.2
Cost1224
\[\begin{array}{l} t_0 := M \cdot \frac{h \cdot \left(0.25 \cdot \left(D \cdot \frac{D \cdot M}{d}\right)\right)}{d}\\ \mathbf{if}\;h \leq -1.08 \cdot 10^{-187}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;h \leq 2.65 \cdot 10^{+76}:\\ \;\;\;\;h \cdot \frac{M \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error24.4
Cost960
\[M \cdot \left(\frac{h}{d} \cdot \left(\left(D \cdot \frac{D}{d}\right) \cdot \left(M \cdot 0.25\right)\right)\right) \]
Alternative 6
Error22.2
Cost960
\[h \cdot \frac{M \cdot \left(D \cdot 0.25\right)}{\frac{d}{D} \cdot \frac{d}{M}} \]
Alternative 7
Error31.7
Cost64
\[0 \]

Error

Reproduce

herbie shell --seed 2022296 
(FPCore (c0 w h D d M)
  :name "Henrywood and Agarwal, Equation (13)"
  :precision binary64
  (* (/ c0 (* 2.0 w)) (+ (/ (* c0 (* d d)) (* (* w h) (* D D))) (sqrt (- (* (/ (* c0 (* d d)) (* (* w h) (* D D))) (/ (* c0 (* d d)) (* (* w h) (* D D)))) (* M M))))))