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

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;\frac{M \cdot 0.25}{t_0 \cdot \frac{d}{h \cdot D}}\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;{\left(\frac{d}{D} \cdot \left(\sqrt{\frac{c0}{w \cdot h}} \cdot \sqrt{\frac{c0}{w}}\right)\right)}^{2}\\

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{t_0}\\


\end{array}

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 4 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.99999999999999991e-212

    1. Initial program 48.9

      \[\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. Simplified45.5

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

      [Start]48.9

      \[ \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 [=>]50.0

      \[ \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-def [=>]50.0

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

      times-frac [=>]50.0

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

      difference-of-squares [=>]50.0

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d}{D} \cdot \frac{d}{D}, \sqrt{\color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}}\right) \]
    3. Taylor expanded in c0 around inf 43.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)} \]
    4. Simplified43.2

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

      [Start]43.0

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

      times-frac [=>]43.2

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

      unpow2 [=>]43.2

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

      unpow2 [=>]43.2

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

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

      \[\leadsto \color{blue}{e^{\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{d \cdot d}{\left(\left(\frac{w}{c0} \cdot h\right) \cdot D\right) \cdot D}\right)\right)} - 1} \]
    7. Simplified30.4

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

      [Start]62.2

      \[ e^{\mathsf{log1p}\left(\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{d \cdot d}{\left(\left(\frac{w}{c0} \cdot h\right) \cdot D\right) \cdot D}\right)\right)} - 1 \]

      expm1-def [=>]56.3

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

      expm1-log1p [=>]38.2

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

      associate-/r/ [<=]41.9

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

      times-frac [=>]41.9

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

      metadata-eval [=>]41.9

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

      *-commutative [=>]41.9

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

      associate-/r/ [<=]41.9

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

      /-rgt-identity [=>]41.9

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

      /-rgt-identity [<=]41.9

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

      associate-/r/ [=>]38.2

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

      /-rgt-identity [=>]38.2

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

      *-commutative [=>]38.2

      \[ \frac{c0}{w} \cdot \frac{d \cdot d}{\color{blue}{D \cdot \left(\left(\frac{w}{c0} \cdot h\right) \cdot D\right)}} \]
    8. Applied egg-rr25.6

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

    if -1.99999999999999991e-212 < (*.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))))) < 0.0

    1. Initial program 30.5

      \[\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 29.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. Simplified29.2

      \[\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 \left(\frac{d}{\left(D \cdot D\right) \cdot \frac{h}{\frac{d}{w}}} \cdot 0\right)\right)} \]
      Proof

      [Start]29.3

      \[ \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 [=>]29.3

      \[ \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 [=>]28.3

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

      unpow2 [=>]28.3

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

      unpow2 [=>]28.3

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

      times-frac [=>]26.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({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 [<=]26.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(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* [=>]27.4

      \[ \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 h\right) \cdot {M}^{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 [=>]27.4

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

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{w \cdot h}{\frac{c0}{M \cdot M}}}, -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. Taylor expanded in c0 around 0 24.6

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

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

      [Start]24.6

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

      *-commutative [<=]24.6

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

      associate-/l* [=>]24.7

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

      unpow2 [=>]24.7

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

      associate-/r/ [=>]24.5

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

      unpow2 [=>]24.5

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

      times-frac [=>]22.2

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

      unpow2 [<=]22.2

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

      unpow2 [=>]22.2

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

      *-commutative [<=]22.2

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

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

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

      [Start]24.6

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

      *-commutative [=>]24.6

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

      unpow2 [=>]24.6

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

      unpow2 [=>]24.6

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

      *-commutative [<=]24.6

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

      unpow2 [=>]24.6

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

      associate-/l* [=>]24.6

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

      times-frac [=>]22.1

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

      times-frac [=>]18.2

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

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

    if 0.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))))) < +inf.0

    1. Initial program 47.2

      \[\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. Simplified45.3

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

      [Start]47.2

      \[ \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 [=>]49.7

      \[ \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-def [=>]49.7

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

      times-frac [=>]49.7

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

      difference-of-squares [=>]49.7

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

      \[\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)} \]
    4. Simplified43.2

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

      [Start]41.6

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

      times-frac [=>]43.2

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

      unpow2 [=>]43.2

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

      unpow2 [=>]43.2

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

      \[\leadsto \color{blue}{{\left(\sqrt{\frac{c0}{w}} \cdot \left(\sqrt{\frac{c0}{w \cdot h}} \cdot \frac{d}{D}\right)\right)}^{2}} \]
    6. Simplified22.9

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

      [Start]22.9

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

      associate-*r* [=>]22.9

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

      *-commutative [=>]22.9

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

      *-commutative [=>]22.9

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

    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 62.8

      \[\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. Simplified59.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 \left(\frac{d}{\left(D \cdot D\right) \cdot \frac{h}{\frac{d}{w}}} \cdot 0\right)\right)} \]
      Proof

      [Start]62.8

      \[ \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.8

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

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

      unpow2 [=>]62.7

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

      unpow2 [=>]62.7

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

      times-frac [=>]62.4

      \[ \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({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.4

      \[ \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(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* [=>]62.6

      \[ \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 h\right) \cdot {M}^{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.6

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

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \color{blue}{\frac{w \cdot h}{\frac{c0}{M \cdot M}}}, -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. Taylor expanded in c0 around 0 34.6

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

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

      [Start]34.6

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

      *-commutative [<=]34.6

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

      associate-/l* [=>]34.6

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

      unpow2 [=>]34.6

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

      associate-/r/ [=>]34.7

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

      unpow2 [=>]34.7

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

      times-frac [=>]25.7

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

      unpow2 [<=]25.7

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

      unpow2 [=>]25.7

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

      *-commutative [<=]25.7

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

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

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

      [Start]34.6

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

      *-commutative [=>]34.6

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

      unpow2 [=>]34.6

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

      unpow2 [=>]34.6

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

      *-commutative [<=]34.6

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

      unpow2 [=>]34.6

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

      associate-/l* [=>]34.7

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

      times-frac [=>]25.8

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

      times-frac [=>]22.2

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

      \[\leadsto \color{blue}{\frac{\frac{h}{\frac{d}{D}} \cdot M}{\frac{\frac{d}{D}}{M}}} \cdot 0.25 \]
  3. Recombined 4 regimes into one program.
  4. Final simplification15.4

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

Alternatives

Alternative 1
Error16.0
Cost30285
\[\begin{array}{l} t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_1 := \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\ \mathbf{if}\;t_1 \leq -2 \cdot 10^{-212} \lor \neg \left(t_1 \leq 10^{-54}\right) \land t_1 \leq \infty:\\ \;\;\;\;\frac{\left(d \cdot \frac{c0}{w}\right) \cdot \frac{d}{D}}{\frac{w}{c0} \cdot \left(h \cdot D\right)}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 2
Error20.0
Cost1353
\[\begin{array}{l} \mathbf{if}\;d \leq -3.45 \cdot 10^{-102} \lor \neg \left(d \leq -9.5 \cdot 10^{-179}\right):\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(d \cdot \left(\frac{c0}{w} \cdot \frac{\frac{d}{D}}{h \cdot D}\right)\right)\\ \end{array} \]
Alternative 3
Error20.0
Cost1353
\[\begin{array}{l} \mathbf{if}\;d \leq -6.6 \cdot 10^{-101} \lor \neg \left(d \leq -9.5 \cdot 10^{-179}\right):\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w} \cdot \left(d \cdot \frac{\frac{c0}{D} \cdot \frac{d}{h \cdot D}}{w}\right)\\ \end{array} \]
Alternative 4
Error20.2
Cost1353
\[\begin{array}{l} \mathbf{if}\;d \leq -2.3 \cdot 10^{-77} \lor \neg \left(d \leq -9.5 \cdot 10^{-179}\right):\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w} \cdot \frac{\left(d \cdot \frac{c0}{w}\right) \cdot \frac{d}{D}}{h \cdot D}\\ \end{array} \]
Alternative 5
Error18.9
Cost1289
\[\begin{array}{l} \mathbf{if}\;h \leq -6.4 \cdot 10^{-173} \lor \neg \left(h \leq -5 \cdot 10^{-275}\right):\\ \;\;\;\;0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;\left(D \cdot \frac{\frac{D}{\frac{d}{M}} \cdot \left(h \cdot M\right)}{-d}\right) \cdot -0.25\\ \end{array} \]
Alternative 6
Error27.1
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 2 \cdot 10^{+226}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Error27.1
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 2 \cdot 10^{+226}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D} \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 8
Error25.1
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 2 \cdot 10^{+303}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \frac{h}{d}\right) \cdot \frac{M \cdot M}{\frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 9
Error20.9
Cost1220
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 4 \cdot 10^{-188}:\\ \;\;\;\;0.25 \cdot \left(\frac{h}{\frac{d}{D}} \cdot \left(M \cdot \left(M \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot M}{\frac{d}{D} \cdot \frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 10
Error21.1
Cost960
\[0.25 \cdot \left(\frac{h}{\frac{d}{D}} \cdot \left(M \cdot \left(M \cdot \frac{D}{d}\right)\right)\right) \]
Alternative 11
Error18.8
Cost960
\[0.25 \cdot \frac{M \cdot \frac{h}{\frac{d}{D}}}{\frac{\frac{d}{D}}{M}} \]
Alternative 12
Error32.0
Cost64
\[0 \]

Error

Reproduce

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