Average Error: 59.6 → 17.2
Time: 30.1s
Precision: binary64
Cost: 36236
\[\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 := \frac{\frac{2}{2 \cdot \frac{w}{c0}} \cdot \left(c0 \cdot \frac{d}{D}\right)}{\frac{w \cdot h}{\frac{d}{D}}}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_2 := \frac{c0}{2 \cdot w} \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{+277}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;t_2 \leq 2 \cdot 10^{-247}:\\ \;\;\;\;\frac{\frac{D}{d}}{\frac{\frac{d}{D}}{M}} \cdot \left(M \cdot \left(h \cdot 0.25\right)\right)\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;h \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\\ \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
         (/ (* (/ 2.0 (* 2.0 (/ w c0))) (* c0 (/ d D))) (/ (* w h) (/ d D))))
        (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_2 (* (/ c0 (* 2.0 w)) (+ t_1 (sqrt (- (* t_1 t_1) (* M M)))))))
   (if (<= t_2 -5e+277)
     t_0
     (if (<= t_2 2e-247)
       (* (/ (/ D d) (/ (/ d D) M)) (* M (* h 0.25)))
       (if (<= t_2 INFINITY) t_0 (* h (* 0.25 (pow (* M (/ D d)) 2.0))))))))
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 = ((2.0 / (2.0 * (w / c0))) * (c0 * (d / D))) / ((w * h) / (d / D));
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	double tmp;
	if (t_2 <= -5e+277) {
		tmp = t_0;
	} else if (t_2 <= 2e-247) {
		tmp = ((D / d) / ((d / D) / M)) * (M * (h * 0.25));
	} else if (t_2 <= ((double) INFINITY)) {
		tmp = t_0;
	} else {
		tmp = h * (0.25 * pow((M * (D / d)), 2.0));
	}
	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 = ((2.0 / (2.0 * (w / c0))) * (c0 * (d / D))) / ((w * h) / (d / D));
	double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_2 = (c0 / (2.0 * w)) * (t_1 + Math.sqrt(((t_1 * t_1) - (M * M))));
	double tmp;
	if (t_2 <= -5e+277) {
		tmp = t_0;
	} else if (t_2 <= 2e-247) {
		tmp = ((D / d) / ((d / D) / M)) * (M * (h * 0.25));
	} else if (t_2 <= Double.POSITIVE_INFINITY) {
		tmp = t_0;
	} else {
		tmp = h * (0.25 * Math.pow((M * (D / d)), 2.0));
	}
	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 = ((2.0 / (2.0 * (w / c0))) * (c0 * (d / D))) / ((w * h) / (d / D))
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_2 = (c0 / (2.0 * w)) * (t_1 + math.sqrt(((t_1 * t_1) - (M * M))))
	tmp = 0
	if t_2 <= -5e+277:
		tmp = t_0
	elif t_2 <= 2e-247:
		tmp = ((D / d) / ((d / D) / M)) * (M * (h * 0.25))
	elif t_2 <= math.inf:
		tmp = t_0
	else:
		tmp = h * (0.25 * math.pow((M * (D / d)), 2.0))
	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(Float64(Float64(2.0 / Float64(2.0 * Float64(w / c0))) * Float64(c0 * Float64(d / D))) / Float64(Float64(w * h) / Float64(d / D)))
	t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_2 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M)))))
	tmp = 0.0
	if (t_2 <= -5e+277)
		tmp = t_0;
	elseif (t_2 <= 2e-247)
		tmp = Float64(Float64(Float64(D / d) / Float64(Float64(d / D) / M)) * Float64(M * Float64(h * 0.25)));
	elseif (t_2 <= Inf)
		tmp = t_0;
	else
		tmp = Float64(h * Float64(0.25 * (Float64(M * Float64(D / d)) ^ 2.0)));
	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 = ((2.0 / (2.0 * (w / c0))) * (c0 * (d / D))) / ((w * h) / (d / D));
	t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_2 = (c0 / (2.0 * w)) * (t_1 + sqrt(((t_1 * t_1) - (M * M))));
	tmp = 0.0;
	if (t_2 <= -5e+277)
		tmp = t_0;
	elseif (t_2 <= 2e-247)
		tmp = ((D / d) / ((d / D) / M)) * (M * (h * 0.25));
	elseif (t_2 <= Inf)
		tmp = t_0;
	else
		tmp = h * (0.25 * ((M * (D / d)) ^ 2.0));
	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[(N[(N[(2.0 / N[(2.0 * N[(w / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+277], t$95$0, If[LessEqual[t$95$2, 2e-247], N[(N[(N[(D / d), $MachinePrecision] / N[(N[(d / D), $MachinePrecision] / M), $MachinePrecision]), $MachinePrecision] * N[(M * N[(h * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$0, N[(h * N[(0.25 * N[Power[N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $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 := \frac{\frac{2}{2 \cdot \frac{w}{c0}} \cdot \left(c0 \cdot \frac{d}{D}\right)}{\frac{w \cdot h}{\frac{d}{D}}}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_2 := \frac{c0}{2 \cdot w} \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+277}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;t_2 \leq 2 \cdot 10^{-247}:\\
\;\;\;\;\frac{\frac{D}{d}}{\frac{\frac{d}{D}}{M}} \cdot \left(M \cdot \left(h \cdot 0.25\right)\right)\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;h \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\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 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))))) < -4.99999999999999982e277 or 2e-247 < (*.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 55.4

      \[\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 49.0

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

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \frac{\frac{c0}{D} \cdot \frac{d}{\frac{D}{d}}}{w \cdot h}\right)} \]
      Proof

      [Start]49.0

      \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \]

      associate-/r* [=>]49.0

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

      *-commutative [=>]49.0

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

      unpow2 [=>]49.0

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

      unpow2 [=>]49.0

      \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{D \cdot D}}}{w \cdot h}\right) \]

      times-frac [=>]45.1

      \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\color{blue}{\frac{c0}{D} \cdot \frac{d \cdot d}{D}}}{w \cdot h}\right) \]

      associate-/l* [=>]43.2

      \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{c0}{D} \cdot \color{blue}{\frac{d}{\frac{D}{d}}}}{w \cdot h}\right) \]
    4. Applied egg-rr37.0

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\color{blue}{\frac{c0 \cdot \frac{d}{D}}{\frac{D}{d}}}}{w \cdot h}\right) \]
    5. Applied egg-rr30.1

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

    if -4.99999999999999982e277 < (*.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))))) < 2e-247

    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. Simplified30.7

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, -M \cdot M\right)}\right)} \]
      Proof

      [Start]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) \]

      times-frac [=>]36.2

      \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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) \]

      fma-neg [=>]36.2

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\color{blue}{\mathsf{fma}\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, -M \cdot M\right)}}\right) \]

      times-frac [=>]33.8

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}}, \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, -M \cdot M\right)}\right) \]

      times-frac [=>]30.7

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}}, -M \cdot M\right)}\right) \]
    3. Taylor expanded in c0 around -inf 37.7

      \[\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)} \]
    4. Simplified32.8

      \[\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{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot 0\right)} \]
      Proof

      [Start]37.7

      \[ \frac{c0}{2 \cdot w} \cdot \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) \]

      fma-def [=>]37.7

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \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)} \]

      times-frac [=>]36.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      *-commutative [<=]36.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{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) \]

      unpow2 [=>]36.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \frac{w \cdot \left(h \cdot {M}^{2}\right)}{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) \]

      unpow2 [=>]36.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \frac{w \cdot \left(h \cdot {M}^{2}\right)}{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) \]

      associate-/r* [=>]35.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{\frac{D \cdot D}{d}}{d}} \cdot \frac{w \cdot \left(h \cdot {M}^{2}\right)}{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) \]

      associate-*r/ [<=]34.5

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{D \cdot \frac{D}{d}}}{d} \cdot \frac{w \cdot \left(h \cdot {M}^{2}\right)}{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) \]

      associate-*l/ [<=]34.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \frac{w \cdot \left(h \cdot {M}^{2}\right)}{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) \]

      *-commutative [=>]34.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{w \cdot \color{blue}{\left({M}^{2} \cdot h\right)}}{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) \]

      associate-*r* [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{\left(w \cdot {M}^{2}\right) \cdot h}}{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) \]

      *-commutative [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{h \cdot \left(w \cdot {M}^{2}\right)}}{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) \]

      unpow2 [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \color{blue}{\left(M \cdot M\right)}\right)}{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) \]

      associate-*r* [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, \color{blue}{\left(-1 \cdot \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)\right) \cdot c0}\right) \]

      *-commutative [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, \color{blue}{c0 \cdot \left(-1 \cdot \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)\right)}\right) \]

      distribute-rgt1-in [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot \left(-1 \cdot \color{blue}{\left(\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right)\right) \]

      metadata-eval [=>]34.2

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot \left(-1 \cdot \left(\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)\right) \]

      mul0-lft [=>]32.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot \left(-1 \cdot \color{blue}{0}\right)\right) \]

      metadata-eval [=>]32.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \frac{h \cdot \left(w \cdot \left(M \cdot M\right)\right)}{c0}, c0 \cdot \color{blue}{0}\right) \]
    5. Taylor expanded in c0 around 0 32.0

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

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

      [Start]32.0

      \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]

      associate-/l* [=>]32.7

      \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}} \]

      unpow2 [=>]32.7

      \[ 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{{M}^{2} \cdot h}} \]

      unpow2 [=>]32.7

      \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{{M}^{2} \cdot h}} \]

      unpow2 [=>]32.7

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

      associate-/r/ [=>]32.3

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

      times-frac [=>]29.5

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

      unpow2 [<=]29.5

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

      associate-*l* [=>]27.3

      \[ 0.25 \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \color{blue}{\left(M \cdot \left(M \cdot h\right)\right)}\right) \]
    7. Applied egg-rr25.5

      \[\leadsto \color{blue}{\frac{\frac{D}{d} \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot 0.25\right)}{\frac{d}{D}}} \]
    8. Applied egg-rr22.0

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

    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. Simplified63.9

      \[\leadsto \color{blue}{\frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot {\left(\frac{d}{D}\right)}^{3}\right), -M \cdot M\right)}\right)} \]
      Proof

      [Start]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) \]

      associate-*l/ [<=]64.0

      \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\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) \]

      *-commutative [=>]64.0

      \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(d \cdot d\right) \cdot \frac{c0}{\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) \]

      fma-def [=>]64.0

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(d \cdot d, \frac{c0}{\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)} \]

      times-frac [=>]64.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{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) \]

      times-frac [=>]63.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right)} - M \cdot M}\right) \]

      swap-sqr [=>]63.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{c0}{w \cdot h}\right) \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right)} - M \cdot M}\right) \]

      associate-*l* [=>]63.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\frac{c0}{w \cdot h} \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)} - M \cdot M}\right) \]

      fma-neg [=>]63.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right), -M \cdot M\right)}}\right) \]

      times-frac [=>]63.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{d \cdot d}{D \cdot D}\right), -M \cdot M\right)}\right) \]

      associate-*l* [=>]63.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)}, -M \cdot M\right)}\right) \]

      times-frac [=>]63.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)}\right)\right), -M \cdot M\right)}\right) \]

      cube-unmult [=>]63.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{3}}\right), -M \cdot M\right)}\right) \]
    3. Taylor expanded in c0 around -inf 62.9

      \[\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)} \]
    4. Simplified32.9

      \[\leadsto \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot 0\right)} \]
      Proof

      [Start]62.9

      \[ \frac{c0}{2 \cdot w} \cdot \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) \]

      fma-def [=>]62.9

      \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\mathsf{fma}\left(0.5, \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)} \]

      times-frac [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \left({M}^{2} \cdot h\right)}{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) \]

      *-commutative [<=]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{{D}^{2}}{{d}^{2}} \cdot \frac{w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{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) \]

      times-frac [<=]62.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\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) \]

      associate-/r* [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{\frac{{D}^{2} \cdot \left(w \cdot \left(h \cdot {M}^{2}\right)\right)}{{d}^{2}}}{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) \]

      *-commutative [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{\color{blue}{\left(w \cdot \left(h \cdot {M}^{2}\right)\right) \cdot {D}^{2}}}{{d}^{2}}}{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) \]

      unpow2 [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{\left(w \cdot \left(h \cdot {M}^{2}\right)\right) \cdot {D}^{2}}{\color{blue}{d \cdot d}}}{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) \]

      associate-/l* [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{\frac{w \cdot \left(h \cdot {M}^{2}\right)}{\frac{d \cdot d}{{D}^{2}}}}}{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) \]

      *-commutative [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \color{blue}{\left({M}^{2} \cdot h\right)}}{\frac{d \cdot d}{{D}^{2}}}}{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) \]

      unpow2 [=>]62.8

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(\color{blue}{\left(M \cdot M\right)} \cdot h\right)}{\frac{d \cdot d}{{D}^{2}}}}{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) \]

      associate-*l* [=>]62.7

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \color{blue}{\left(M \cdot \left(M \cdot h\right)\right)}}{\frac{d \cdot d}{{D}^{2}}}}{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) \]

      unpow2 [=>]62.7

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\frac{d \cdot d}{\color{blue}{D \cdot D}}}}{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) \]

      times-frac [=>]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\color{blue}{\frac{d}{D} \cdot \frac{d}{D}}}}{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) \]

      unpow2 [<=]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{\color{blue}{{\left(\frac{d}{D}\right)}^{2}}}}{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) \]

      mul-1-neg [=>]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, \color{blue}{-\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) \]

      *-commutative [=>]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, -\color{blue}{c0 \cdot \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)}\right) \]

      distribute-rgt-neg-in [=>]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, \color{blue}{c0 \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)\right)}\right) \]

      distribute-rgt1-in [=>]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot \left(-\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}\right)\right) \]

      metadata-eval [=>]62.4

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot \left(-\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \]

      mul0-lft [=>]32.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot \left(-\color{blue}{0}\right)\right) \]

      metadata-eval [=>]32.9

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\frac{w \cdot \left(M \cdot \left(M \cdot h\right)\right)}{{\left(\frac{d}{D}\right)}^{2}}}{c0}, c0 \cdot \color{blue}{0}\right) \]
    5. Taylor expanded in c0 around 0 34.4

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

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

      [Start]34.4

      \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]

      *-commutative [<=]34.4

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

      associate-/l* [=>]34.4

      \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}} \]

      unpow2 [=>]34.4

      \[ 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{h \cdot {M}^{2}}} \]

      unpow2 [=>]34.4

      \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{h \cdot {M}^{2}}} \]

      *-commutative [=>]34.4

      \[ 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{\color{blue}{{M}^{2} \cdot h}}} \]

      unpow2 [=>]34.4

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

      associate-*r* [<=]32.2

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

      associate-/r/ [=>]32.3

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

      associate-/r* [=>]28.8

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

      associate-*r/ [<=]24.0

      \[ 0.25 \cdot \left(\frac{\color{blue}{D \cdot \frac{D}{d}}}{d} \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \]
    7. Taylor expanded in D around 0 34.4

      \[\leadsto 0.25 \cdot \color{blue}{\frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    8. Simplified25.0

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

      [Start]34.4

      \[ 0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}} \]

      *-commutative [=>]34.4

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

      *-commutative [<=]34.4

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

      unpow2 [=>]34.4

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

      associate-*r* [<=]32.2

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

      unpow2 [=>]32.2

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

      remove-double-neg [<=]32.2

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

      distribute-rgt-neg-out [<=]32.2

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

      unpow2 [=>]32.2

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

      associate-*r/ [<=]32.3

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

      distribute-neg-frac [<=]32.3

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

      associate-*r* [=>]34.4

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

      unpow2 [<=]34.4

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

      *-commutative [=>]34.4

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

      associate-*l* [=>]33.5

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

      unpow2 [=>]33.5

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

      distribute-neg-frac [=>]33.5

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

      distribute-rgt-neg-out [=>]33.5

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

      remove-double-neg [=>]33.5

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

      times-frac [=>]25.0

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

      unpow2 [<=]25.0

      \[ 0.25 \cdot \left(h \cdot \left(\left(M \cdot M\right) \cdot \color{blue}{{\left(\frac{D}{d}\right)}^{2}}\right)\right) \]
    9. Taylor expanded in h around 0 34.4

      \[\leadsto \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}} \]
    10. Simplified15.0

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

      [Start]34.4

      \[ 0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}} \]

      associate-/l* [=>]34.4

      \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}} \]

      unpow2 [=>]34.4

      \[ 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{h \cdot {M}^{2}}} \]

      unpow2 [=>]34.4

      \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{h \cdot {M}^{2}}} \]

      unpow2 [=>]34.4

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

      *-commutative [<=]34.4

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

      associate-/l* [<=]34.4

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

      times-frac [=>]30.7

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

      associate-*r/ [<=]27.1

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

      *-commutative [=>]27.1

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

      associate-/r/ [<=]27.0

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

      associate-/r* [=>]26.0

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

      associate-/l* [<=]27.3

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

      associate-*r/ [<=]26.0

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

      associate-/l* [=>]25.1

      \[ 0.25 \cdot \color{blue}{\frac{M \cdot M}{\frac{\frac{d}{D} \cdot \frac{d}{D}}{h}}} \]

      associate-/r/ [=>]25.0

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

      times-frac [=>]15.1

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

      associate-/l* [<=]15.8

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

      associate-/l* [<=]14.7

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

      associate-*r/ [<=]15.7

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

      associate-*r/ [<=]15.0

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

      unpow2 [<=]15.0

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

      *-commutative [=>]15.0

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

      associate-*l* [<=]14.9

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

      *-commutative [<=]14.9

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

      associate-*l* [=>]15.0

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

    \[\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 -5 \cdot 10^{+277}:\\ \;\;\;\;\frac{\frac{2}{2 \cdot \frac{w}{c0}} \cdot \left(c0 \cdot \frac{d}{D}\right)}{\frac{w \cdot h}{\frac{d}{D}}}\\ \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 2 \cdot 10^{-247}:\\ \;\;\;\;\frac{\frac{D}{d}}{\frac{\frac{d}{D}}{M}} \cdot \left(M \cdot \left(h \cdot 0.25\right)\right)\\ \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{\frac{2}{2 \cdot \frac{w}{c0}} \cdot \left(c0 \cdot \frac{d}{D}\right)}{\frac{w \cdot h}{\frac{d}{D}}}\\ \mathbf{else}:\\ \;\;\;\;h \cdot \left(0.25 \cdot {\left(M \cdot \frac{D}{d}\right)}^{2}\right)\\ \end{array} \]

Alternatives

Alternative 1
Error21.2
Cost1608
\[\begin{array}{l} \mathbf{if}\;h \leq -5 \cdot 10^{+165}:\\ \;\;\;\;\frac{D \cdot \left(0.25 \cdot \left(M \cdot \left(h \cdot M\right)\right)\right)}{d \cdot \frac{d}{D}}\\ \mathbf{elif}\;h \leq -7.2 \cdot 10^{+127}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0 \cdot \frac{d}{D}}{h} \cdot \frac{\frac{d}{D}}{w}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{\frac{d}{D}}\\ \end{array} \]
Alternative 2
Error21.6
Cost1608
\[\begin{array}{l} \mathbf{if}\;c0 \leq -2.85 \cdot 10^{+29}:\\ \;\;\;\;\frac{\frac{D}{d}}{\frac{\frac{d}{D}}{M}} \cdot \left(M \cdot \left(h \cdot 0.25\right)\right)\\ \mathbf{elif}\;c0 \leq -3 \cdot 10^{-30}:\\ \;\;\;\;\frac{\frac{2}{2 \cdot \frac{w}{c0}} \cdot \left(c0 \cdot \frac{d}{D}\right)}{\frac{w \cdot h}{\frac{d}{D}}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{\frac{d}{D}}\\ \end{array} \]
Alternative 3
Error24.6
Cost1225
\[\begin{array}{l} \mathbf{if}\;M \leq 2.75 \cdot 10^{-163} \lor \neg \left(M \leq 1.35 \cdot 10^{+154}\right):\\ \;\;\;\;0.25 \cdot \frac{\frac{D \cdot \left(M \cdot \left(h \cdot M\right)\right)}{d}}{\frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \frac{\left(M \cdot M\right) \cdot \frac{D}{d}}{\frac{d}{D}}\right)\\ \end{array} \]
Alternative 4
Error24.8
Cost1224
\[\begin{array}{l} \mathbf{if}\;M \leq -1.15 \cdot 10^{+131}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \leq 1.45 \cdot 10^{+150}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \frac{\left(M \cdot M\right) \cdot \frac{D}{d}}{\frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \left(h \cdot M\right)\right) \cdot \frac{D}{d \cdot \frac{d}{D}}\right)\\ \end{array} \]
Alternative 5
Error26.1
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 5.8 \cdot 10^{+288}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \frac{M \cdot M}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Error24.5
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 3.1 \cdot 10^{+289}:\\ \;\;\;\;0.25 \cdot \left(h \cdot \frac{\left(M \cdot M\right) \cdot \frac{D}{d}}{\frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Error21.9
Cost960
\[\frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{d} \cdot \left(D \cdot 0.25\right) \]
Alternative 8
Error20.1
Cost960
\[0.25 \cdot \frac{\left(M \cdot \frac{D}{d}\right) \cdot \left(h \cdot M\right)}{\frac{d}{D}} \]
Alternative 9
Error31.8
Cost64
\[0 \]

Error

Reproduce

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