?

Average Error: 59.3 → 16.5
Time: 30.7s
Precision: binary64
Cost: 43468

?

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

\mathbf{elif}\;t_2 \leq 0:\\
\;\;\;\;0.25 \cdot \left(\frac{h \cdot D}{d} \cdot \frac{M}{\frac{\frac{d}{M}}{D}}\right)\\

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;t_0 \cdot \frac{t_0}{\frac{w}{c0}}\\

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


\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))))) < -1e-276

    1. Initial program 48.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. Simplified45.6

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

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

      times-frac [=>]50.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-def [=>]50.2

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

      associate-/r* [=>]50.2

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

      \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(\frac{\frac{c0}{w}}{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.2

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

      sub-neg [=>]50.2

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

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

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

      [Start]42.5

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

      associate-/l/ [<=]42.6

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

      associate-/l* [=>]42.7

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

      unpow2 [=>]42.7

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

      *-commutative [=>]42.7

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

      associate-*l/ [<=]46.7

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

      associate-/r/ [<=]42.1

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

      unpow2 [=>]42.1

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

      associate-/r* [<=]41.9

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

      times-frac [=>]37.1

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

      associate-/r/ [=>]42.6

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

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

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

      [Start]62.4

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

      expm1-def [=>]54.4

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

      expm1-log1p [=>]38.7

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

      associate-*l* [=>]36.8

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

      associate-/r/ [=>]37.6

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

      *-commutative [=>]37.6

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

      *-lft-identity [=>]37.6

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

    if -1e-276 < (*.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 27.7

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

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

      \[ \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 [=>]38.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-neg [=>]38.0

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Simplified26.0

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

      [Start]30.7

      \[ -0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]
    5. Taylor expanded in w around 0 21.4

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

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

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

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

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

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

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

      \[ \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 [=>]49.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(\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 [=>]49.1

      \[ \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. Applied egg-rr37.5

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, \mathsf{hypot}\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}, M\right)\right)}{2 \cdot \frac{w}{c0}}} \]
    4. Simplified42.2

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

      [Start]37.5

      \[ \frac{\mathsf{fma}\left(\frac{c0}{w \cdot h}, {\left(\frac{d}{D}\right)}^{2}, \mathsf{hypot}\left(\frac{c0}{w \cdot h} \cdot {\left(\frac{d}{D}\right)}^{2}, M\right)\right)}{2 \cdot \frac{w}{c0}} \]

      associate-*l/ [=>]41.0

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

      times-frac [=>]42.2

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

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

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

      [Start]41.5

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

      times-frac [=>]43.1

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

      unpow2 [=>]43.1

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

      unpow2 [=>]43.1

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

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

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

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

      times-frac [=>]64.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-neg [=>]64.0

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

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

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    4. Simplified36.5

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

      [Start]63.4

      \[ -0.5 \cdot \frac{\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}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \]
    5. Taylor expanded in w around 0 25.1

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

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

      \[\leadsto 0 + 0.25 \cdot \frac{\color{blue}{\frac{D \cdot \left(M \cdot h\right)}{d}}}{\frac{\frac{d}{D}}{M}} \]
    8. Simplified14.4

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

      [Start]16.3

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

      *-commutative [<=]16.3

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

      associate-*l/ [<=]14.7

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

      associate-*r* [=>]14.4

      \[ 0 + 0.25 \cdot \frac{\color{blue}{\left(\frac{D}{d} \cdot h\right) \cdot M}}{\frac{\frac{d}{D}}{M}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification16.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq -1 \cdot 10^{-276}:\\ \;\;\;\;\left(\frac{d}{w \cdot h} \cdot \left(c0 \cdot d\right)\right) \cdot \left({D}^{-2} \cdot \frac{c0}{w}\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:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot D}{d} \cdot \frac{M}{\frac{\frac{d}{M}}{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 \infty:\\ \;\;\;\;\left(\sqrt{\frac{\frac{c0}{w}}{h}} \cdot \frac{d}{D}\right) \cdot \frac{\sqrt{\frac{\frac{c0}{w}}{h}} \cdot \frac{d}{D}}{\frac{w}{c0}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]

Alternatives

Alternative 1
Error17.3
Cost30412
\[\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 -1 \cdot 10^{-276}:\\ \;\;\;\;\left(\frac{d}{w \cdot h} \cdot \left(c0 \cdot d\right)\right) \cdot \left({D}^{-2} \cdot \frac{c0}{w}\right)\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot D}{d} \cdot \frac{M}{\frac{\frac{d}{M}}{D}}\right)\\ \mathbf{elif}\;t_1 \leq \infty:\\ \;\;\;\;\frac{1}{w} \cdot \left(c0 \cdot \frac{\frac{\frac{d}{D} \cdot \frac{c0 \cdot d}{h}}{w}}{D}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M \cdot \left(h \cdot \frac{D}{d}\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 2
Error19.4
Cost1864
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-87}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{elif}\;D \cdot D \leq 10^{-73}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{d}{D}}{D \cdot \frac{w \cdot h}{c0 \cdot d}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 3
Error19.4
Cost1608
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 10^{-87}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{elif}\;D \cdot D \leq 10^{-73}:\\ \;\;\;\;\frac{\frac{c0}{w} \cdot \frac{d}{\frac{w \cdot h}{c0 \cdot d}}}{D \cdot D}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \end{array} \]
Alternative 4
Error30.2
Cost1480
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 8 \cdot 10^{-183}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \cdot M \leq 10^{+288}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot D}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 5
Error29.1
Cost1480
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 0:\\ \;\;\;\;0\\ \mathbf{elif}\;d \cdot d \leq 10^{+229}:\\ \;\;\;\;0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Error18.8
Cost1225
\[\begin{array}{l} \mathbf{if}\;h \leq -2 \cdot 10^{-245} \lor \neg \left(h \leq 6.2 \cdot 10^{-296}\right):\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)\right)\\ \end{array} \]
Alternative 7
Error18.6
Cost1225
\[\begin{array}{l} \mathbf{if}\;h \leq -1.8 \cdot 10^{-244} \lor \neg \left(h \leq 2 \cdot 10^{-281}\right):\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot M\right) \cdot \frac{\frac{D}{d}}{\frac{\frac{d}{M}}{D}}\right)\\ \end{array} \]
Alternative 8
Error18.7
Cost1224
\[\begin{array}{l} t_0 := M \cdot \left(h \cdot \frac{D}{d}\right)\\ \mathbf{if}\;h \leq -4 \cdot 10^{-244}:\\ \;\;\;\;0.25 \cdot \frac{t_0}{\frac{\frac{d}{D}}{M}}\\ \mathbf{elif}\;h \leq 6 \cdot 10^{-289}:\\ \;\;\;\;0.25 \cdot \left(\left(h \cdot M\right) \cdot \frac{\frac{D}{d}}{\frac{\frac{d}{M}}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot t_0\right)\\ \end{array} \]
Alternative 9
Error18.9
Cost1092
\[\begin{array}{l} \mathbf{if}\;h \leq 8 \cdot 10^{-293}:\\ \;\;\;\;0.25 \cdot \frac{\frac{D}{d} \cdot \left(h \cdot M\right)}{\frac{\frac{d}{D}}{M}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\\ \end{array} \]
Alternative 10
Error18.6
Cost960
\[0.25 \cdot \left(\left(M \cdot \frac{D}{d}\right) \cdot \left(M \cdot \left(h \cdot \frac{D}{d}\right)\right)\right) \]
Alternative 11
Error31.7
Cost64
\[0 \]

Error

Reproduce?

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