?

Average Error: 59.4 → 19.3
Time: 34.2s
Precision: binary64
Cost: 30540

?

\[\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{c0}{2 \cdot w}\\ t_1 := t_0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d}{D}}{D \cdot \left(h \cdot \frac{w}{d}\right)}\right)\\ t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := t_0 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\ \mathbf{if}\;t_3 \leq -1 \cdot 10^{-250}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_3 \leq 0:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \frac{h \cdot M}{d}\right) \cdot \frac{M}{\frac{d}{D}}\right)\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{M}{\frac{\frac{d}{D}}{M \cdot \left(D \cdot \frac{h}{d}\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 (/ c0 (* 2.0 w)))
        (t_1 (* t_0 (* 2.0 (/ (* c0 (/ d D)) (* D (* h (/ w d)))))))
        (t_2 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_3 (* t_0 (+ t_2 (sqrt (- (* t_2 t_2) (* M M)))))))
   (if (<= t_3 -1e-250)
     t_1
     (if (<= t_3 0.0)
       (* 0.25 (* (* D (/ (* h M) d)) (/ M (/ d D))))
       (if (<= t_3 INFINITY)
         t_1
         (* 0.25 (/ M (/ (/ d D) (* M (* D (/ h d)))))))))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = t_0 * (2.0 * ((c0 * (d / D)) / (D * (h * (w / d)))));
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_3 = t_0 * (t_2 + sqrt(((t_2 * t_2) - (M * M))));
	double tmp;
	if (t_3 <= -1e-250) {
		tmp = t_1;
	} else if (t_3 <= 0.0) {
		tmp = 0.25 * ((D * ((h * M) / d)) * (M / (d / D)));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = 0.25 * (M / ((d / D) / (M * (D * (h / d)))));
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = c0 / (2.0 * w);
	double t_1 = t_0 * (2.0 * ((c0 * (d / D)) / (D * (h * (w / d)))));
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_3 = t_0 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))));
	double tmp;
	if (t_3 <= -1e-250) {
		tmp = t_1;
	} else if (t_3 <= 0.0) {
		tmp = 0.25 * ((D * ((h * M) / d)) * (M / (d / D)));
	} else if (t_3 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = 0.25 * (M / ((d / D) / (M * (D * (h / d)))));
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))))
def code(c0, w, h, D, d, M):
	t_0 = c0 / (2.0 * w)
	t_1 = t_0 * (2.0 * ((c0 * (d / D)) / (D * (h * (w / d)))))
	t_2 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_3 = t_0 * (t_2 + math.sqrt(((t_2 * t_2) - (M * M))))
	tmp = 0
	if t_3 <= -1e-250:
		tmp = t_1
	elif t_3 <= 0.0:
		tmp = 0.25 * ((D * ((h * M) / d)) * (M / (d / D)))
	elif t_3 <= math.inf:
		tmp = t_1
	else:
		tmp = 0.25 * (M / ((d / D) / (M * (D * (h / d)))))
	return tmp
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(c0 / Float64(2.0 * w))
	t_1 = Float64(t_0 * Float64(2.0 * Float64(Float64(c0 * Float64(d / D)) / Float64(D * Float64(h * Float64(w / d))))))
	t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_3 = Float64(t_0 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M)))))
	tmp = 0.0
	if (t_3 <= -1e-250)
		tmp = t_1;
	elseif (t_3 <= 0.0)
		tmp = Float64(0.25 * Float64(Float64(D * Float64(Float64(h * M) / d)) * Float64(M / Float64(d / D))));
	elseif (t_3 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(0.25 * Float64(M / Float64(Float64(d / D) / Float64(M * Float64(D * Float64(h / d))))));
	end
	return tmp
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = c0 / (2.0 * w);
	t_1 = t_0 * (2.0 * ((c0 * (d / D)) / (D * (h * (w / d)))));
	t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_3 = t_0 * (t_2 + sqrt(((t_2 * t_2) - (M * M))));
	tmp = 0.0;
	if (t_3 <= -1e-250)
		tmp = t_1;
	elseif (t_3 <= 0.0)
		tmp = 0.25 * ((D * ((h * M) / d)) * (M / (d / D)));
	elseif (t_3 <= Inf)
		tmp = t_1;
	else
		tmp = 0.25 * (M / ((d / D) / (M * (D * (h / d)))));
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(2.0 * N[(N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(D * N[(h * N[(w / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-250], t$95$1, If[LessEqual[t$95$3, 0.0], N[(0.25 * N[(N[(D * N[(N[(h * M), $MachinePrecision] / d), $MachinePrecision]), $MachinePrecision] * N[(M / N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], t$95$1, N[(0.25 * N[(M / N[(N[(d / D), $MachinePrecision] / N[(M * N[(D * N[(h / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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{c0}{2 \cdot w}\\
t_1 := t_0 \cdot \left(2 \cdot \frac{c0 \cdot \frac{d}{D}}{D \cdot \left(h \cdot \frac{w}{d}\right)}\right)\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := t_0 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{-250}:\\
\;\;\;\;t_1\\

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

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

\mathbf{else}:\\
\;\;\;\;0.25 \cdot \frac{M}{\frac{\frac{d}{D}}{M \cdot \left(D \cdot \frac{h}{d}\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))))) < -1.0000000000000001e-250 or 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.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 41.7

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

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

      [Start]41.7

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

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

      *-commutative [=>]41.7

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

      unpow2 [=>]41.7

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

      *-commutative [=>]41.7

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

      unpow2 [=>]41.7

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

      associate-*r* [=>]37.9

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

      associate-*r* [<=]37.7

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

      *-commutative [<=]37.7

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

      associate-*r/ [<=]37.7

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

      associate-*r/ [<=]40.3

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

      *-commutative [=>]40.3

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

      associate-*r* [=>]40.2

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

      associate-*r* [<=]43.4

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

      associate-/l/ [<=]45.4

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

      associate-/r* [<=]43.4

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

      times-frac [=>]41.6

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

      associate-/r* [=>]42.5

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

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

    if -1.0000000000000001e-250 < (*.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 28.6

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

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

      [Start]28.6

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

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

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

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

      associate-*l* [=>]45.9

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

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

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

      *-commutative [=>]47.0

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

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

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

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

      \[ \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)} \]
    5. Applied egg-rr27.6

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

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

      [Start]27.6

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

      associate-*r* [=>]30.2

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

      associate-/r* [=>]29.4

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

      *-commutative [=>]29.4

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

      associate-/l* [=>]29.4

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

      metadata-eval [=>]29.4

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

      associate-*l* [=>]28.1

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

      *-commutative [=>]28.1

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

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

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

      [Start]24.5

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

      *-commutative [<=]24.5

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

      *-commutative [=>]24.5

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

      *-commutative [=>]24.5

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

      associate-/l* [=>]24.7

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

      *-commutative [<=]24.7

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

      unpow2 [=>]24.7

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

      unpow2 [=>]24.7

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

      unpow2 [=>]24.7

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

      times-frac [=>]21.1

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

      unpow2 [<=]21.1

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

      \[\leadsto 0.25 \cdot \color{blue}{\left(\left(\frac{h \cdot M}{d} \cdot D\right) \cdot \frac{M}{\frac{d}{D}}\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.7

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

      associate-*l* [=>]64.0

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

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

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

      *-commutative [=>]64.0

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

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

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

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

      \[ \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)} \]
    5. Taylor expanded in c0 around 0 34.0

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

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

      [Start]34.0

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

      *-commutative [<=]34.0

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

      associate-/l* [=>]33.9

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

      unpow2 [=>]33.9

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

      unpow2 [=>]33.9

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

      unpow2 [=>]33.9

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

      associate-/r* [=>]33.9

      \[ 0.25 \cdot \frac{D \cdot D}{\color{blue}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}} \]
    7. Applied egg-rr32.0

      \[\leadsto 0.25 \cdot \color{blue}{\left(\frac{D \cdot D}{\frac{d}{h} \cdot \left(-d\right)} \cdot \left(M \cdot \left(-M\right)\right)\right)} \]
    8. Simplified23.5

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

      [Start]32.0

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

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

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

      distribute-rgt-neg-in [<=]32.0

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

      distribute-lft-neg-in [=>]32.0

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

      *-commutative [=>]32.0

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

      times-frac [=>]25.2

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

      distribute-lft-neg-in [=>]25.2

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

      associate-/r/ [=>]23.5

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

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

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

Alternatives

Alternative 1
Error25.0
Cost1481
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 10^{-164} \lor \neg \left(d \cdot d \leq 2 \cdot 10^{+263}\right):\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{h}{d \cdot \frac{\frac{d}{M}}{M}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{d \cdot d}{h \cdot M}}\right)\right)\\ \end{array} \]
Alternative 2
Error25.6
Cost1481
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 4 \cdot 10^{-293} \lor \neg \left(d \cdot d \leq 2 \cdot 10^{+250}\right):\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(M \cdot \frac{h}{d}\right)}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{d \cdot d}{h \cdot M}}\right)\right)\\ \end{array} \]
Alternative 3
Error29.5
Cost1480
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 5 \cdot 10^{-247}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \cdot M \leq 2.45 \cdot 10^{+256}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{d \cdot d}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 4
Error25.7
Cost1356
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \mathbf{if}\;D \leq -130000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq -6.3 \cdot 10^{-248}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(M \cdot \frac{h}{d}\right)}{d}\right)\right)\\ \mathbf{elif}\;D \leq 5 \cdot 10^{-244}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{h}{d \cdot \frac{\frac{d}{M}}{M}}\right)\right)\\ \end{array} \]
Alternative 5
Error25.9
Cost1356
\[\begin{array}{l} \mathbf{if}\;D \leq -2.8 \cdot 10^{+30}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot M\right) \cdot \frac{\frac{D}{d}}{\frac{d}{h \cdot D}}\right)\\ \mathbf{elif}\;D \leq -6.3 \cdot 10^{-248}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(M \cdot \frac{h}{d}\right)}{d}\right)\right)\\ \mathbf{elif}\;D \leq 4.35 \cdot 10^{-243}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot M\right) \cdot \frac{h}{\frac{d}{D} \cdot \frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{h}{d \cdot \frac{\frac{d}{M}}{M}}\right)\right)\\ \end{array} \]
Alternative 6
Error28.0
Cost1225
\[\begin{array}{l} \mathbf{if}\;d \leq -1.66 \cdot 10^{-71} \lor \neg \left(d \leq 2.65 \cdot 10^{-159}\right):\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{d \cdot d}{h \cdot M}}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 7
Error28.2
Cost1224
\[\begin{array}{l} \mathbf{if}\;d \leq -2.55 \cdot 10^{-71}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{\frac{d \cdot d}{h}}{M}}\right)\right)\\ \mathbf{elif}\;d \leq 2.15 \cdot 10^{-155}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M}{\frac{d \cdot d}{h \cdot M}}\right)\right)\\ \end{array} \]
Alternative 8
Error22.3
Cost1224
\[\begin{array}{l} \mathbf{if}\;D \leq -2.8 \cdot 10^{+30}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot M\right) \cdot \frac{\frac{D}{d}}{\frac{d}{h \cdot D}}\right)\\ \mathbf{elif}\;D \leq -2 \cdot 10^{-158}:\\ \;\;\;\;0.25 \cdot \left(D \cdot \left(D \cdot \frac{M \cdot \left(M \cdot \frac{h}{d}\right)}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \frac{h \cdot M}{d}\right) \cdot \frac{M}{\frac{d}{D}}\right)\\ \end{array} \]
Alternative 9
Error21.4
Cost1092
\[\begin{array}{l} \mathbf{if}\;D \leq -2 \cdot 10^{-292}:\\ \;\;\;\;0.25 \cdot \frac{M}{\frac{\frac{d}{D}}{M \cdot \left(D \cdot \frac{h}{d}\right)}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(D \cdot \frac{h \cdot M}{d}\right) \cdot \frac{M}{\frac{d}{D}}\right)\\ \end{array} \]
Alternative 10
Error32.0
Cost64
\[0 \]

Error

Reproduce?

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