?

Average Error: 59.7 → 16.5
Time: 34.7s
Precision: binary64
Cost: 42637

?

\[\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 \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^{-99}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} \cdot \frac{c0 \cdot d}{w}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-145} \lor \neg \left(t_1 \leq \infty\right):\\ \;\;\;\;\left(\frac{w}{w} \cdot \frac{h}{{\left(\frac{d}{D \cdot M}\right)}^{2}}\right) \cdot \frac{c0 \cdot 0.25}{c0}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{c0 \cdot \frac{d}{D}}{w \cdot \sqrt{h}}\right)}^{2}\\ \end{array} \]
(FPCore (c0 w h D d M)
 :precision binary64
 (*
  (/ c0 (* 2.0 w))
  (+
   (/ (* c0 (* d d)) (* (* w h) (* D D)))
   (sqrt
    (-
     (*
      (/ (* c0 (* d d)) (* (* w h) (* D D)))
      (/ (* c0 (* d d)) (* (* w h) (* D D))))
     (* M M))))))
(FPCore (c0 w h D d M)
 :precision binary64
 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
   (if (<= t_1 -1e-99)
     (* (/ (* c0 d) (* w (* h (* D D)))) (/ (* c0 d) w))
     (if (or (<= t_1 4e-145) (not (<= t_1 INFINITY)))
       (* (* (/ w w) (/ h (pow (/ d (* D M)) 2.0))) (/ (* c0 0.25) c0))
       (pow (/ (* c0 (/ d D)) (* w (sqrt h))) 2.0)))))
double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	double tmp;
	if (t_1 <= -1e-99) {
		tmp = ((c0 * d) / (w * (h * (D * D)))) * ((c0 * d) / w);
	} else if ((t_1 <= 4e-145) || !(t_1 <= ((double) INFINITY))) {
		tmp = ((w / w) * (h / pow((d / (D * M)), 2.0))) * ((c0 * 0.25) / c0);
	} else {
		tmp = pow(((c0 * (d / D)) / (w * sqrt(h))), 2.0);
	}
	return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
	double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
	double tmp;
	if (t_1 <= -1e-99) {
		tmp = ((c0 * d) / (w * (h * (D * D)))) * ((c0 * d) / w);
	} else if ((t_1 <= 4e-145) || !(t_1 <= Double.POSITIVE_INFINITY)) {
		tmp = ((w / w) * (h / Math.pow((d / (D * M)), 2.0))) * ((c0 * 0.25) / c0);
	} else {
		tmp = Math.pow(((c0 * (d / D)) / (w * Math.sqrt(h))), 2.0);
	}
	return tmp;
}
def code(c0, w, h, D, d, M):
	return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))))
def code(c0, w, h, D, d, M):
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D))
	t_1 = (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
	tmp = 0
	if t_1 <= -1e-99:
		tmp = ((c0 * d) / (w * (h * (D * D)))) * ((c0 * d) / w)
	elif (t_1 <= 4e-145) or not (t_1 <= math.inf):
		tmp = ((w / w) * (h / math.pow((d / (D * M)), 2.0))) * ((c0 * 0.25) / c0)
	else:
		tmp = math.pow(((c0 * (d / D)) / (w * math.sqrt(h))), 2.0)
	return tmp
function code(c0, w, h, D, d, M)
	return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M)))))
end
function code(c0, w, h, D, d, M)
	t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M)))))
	tmp = 0.0
	if (t_1 <= -1e-99)
		tmp = Float64(Float64(Float64(c0 * d) / Float64(w * Float64(h * Float64(D * D)))) * Float64(Float64(c0 * d) / w));
	elseif ((t_1 <= 4e-145) || !(t_1 <= Inf))
		tmp = Float64(Float64(Float64(w / w) * Float64(h / (Float64(d / Float64(D * M)) ^ 2.0))) * Float64(Float64(c0 * 0.25) / c0));
	else
		tmp = Float64(Float64(c0 * Float64(d / D)) / Float64(w * sqrt(h))) ^ 2.0;
	end
	return tmp
end
function tmp = code(c0, w, h, D, d, M)
	tmp = (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
end
function tmp_2 = code(c0, w, h, D, d, M)
	t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
	t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
	tmp = 0.0;
	if (t_1 <= -1e-99)
		tmp = ((c0 * d) / (w * (h * (D * D)))) * ((c0 * d) / w);
	elseif ((t_1 <= 4e-145) || ~((t_1 <= Inf)))
		tmp = ((w / w) * (h / ((d / (D * M)) ^ 2.0))) * ((c0 * 0.25) / c0);
	else
		tmp = ((c0 * (d / D)) / (w * sqrt(h))) ^ 2.0;
	end
	tmp_2 = tmp;
end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-99], N[(N[(N[(c0 * d), $MachinePrecision] / N[(w * N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * d), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, 4e-145], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(N[(w / w), $MachinePrecision] * N[(h / N[Power[N[(d / N[(D * M), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * 0.25), $MachinePrecision] / c0), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(c0 * N[(d / D), $MachinePrecision]), $MachinePrecision] / N[(w * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $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 \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^{-99}:\\
\;\;\;\;\frac{c0 \cdot d}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} \cdot \frac{c0 \cdot d}{w}\\

\mathbf{elif}\;t_1 \leq 4 \cdot 10^{-145} \lor \neg \left(t_1 \leq \infty\right):\\
\;\;\;\;\left(\frac{w}{w} \cdot \frac{h}{{\left(\frac{d}{D \cdot M}\right)}^{2}}\right) \cdot \frac{c0 \cdot 0.25}{c0}\\

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


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

    1. Initial program 52.1

      \[\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 45.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)} \]
    3. Simplified44.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]45.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-*r/ [=>]45.5

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

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

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

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

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

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

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

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

      \[ \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/ [<=]43.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 [=>]43.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* [=>]43.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* [<=]46.5

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

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

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

      \[ \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* [=>]44.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. Taylor expanded in c0 around 0 54.8

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

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

      [Start]54.8

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

      times-frac [=>]55.9

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

      unpow2 [=>]55.9

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

      unpow2 [=>]55.9

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

      unpow2 [=>]55.9

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

      unpow2 [=>]55.9

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

      associate-*l* [=>]54.3

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

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

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

      [Start]53.0

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

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

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

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

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

      distribute-lft-neg-out [<=]53.0

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

      remove-double-neg [=>]53.0

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

      *-commutative [=>]53.0

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

      swap-sqr [<=]44.7

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

      unpow2 [<=]44.7

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

      *-commutative [=>]44.7

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

      associate-*l* [=>]43.1

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

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

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

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

    if -1e-99 < (*.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))))) < 3.99999999999999966e-145 or +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 60.8

      \[\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \]
    2. Simplified62.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]60.8

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

      associate-*l/ [<=]61.1

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

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

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

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

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

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

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

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

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

      [Start]60.4

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

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

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

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

      [Start]41.7

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

      times-frac [=>]42.1

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

      *-commutative [=>]42.1

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

      associate-/l* [=>]41.9

      \[ \frac{{\color{blue}{\left(\frac{\sqrt{w \cdot h}}{\frac{\frac{d}{D}}{M}}\right)}}^{2} \cdot \frac{0.5}{c0}}{w} \cdot \frac{-c0}{-2} \]
    7. Applied egg-rr29.4

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

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

      [Start]29.4

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

      associate-/r/ [=>]25.6

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

      associate-*l/ [<=]24.7

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

      associate-*l* [=>]22.8

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

      associate-/l/ [=>]22.9

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

      times-frac [=>]15.4

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

      associate-*l/ [=>]15.4

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

      *-commutative [=>]15.4

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

      associate-*r* [=>]15.4

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

      metadata-eval [=>]15.4

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

    if 3.99999999999999966e-145 < (*.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 49.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. Taylor expanded in c0 around inf 43.9

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[ \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* [<=]45.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/ [<=]46.6

      \[ \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* [<=]45.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.7

      \[ \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* [=>]43.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. Taylor expanded in c0 around 0 54.7

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

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

      [Start]54.7

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

      times-frac [=>]55.4

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

      unpow2 [=>]55.4

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

      unpow2 [=>]55.4

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

      unpow2 [=>]55.4

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

      unpow2 [=>]55.4

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

      associate-*l* [=>]53.4

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

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

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

      [Start]29.4

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

      expm1-def [=>]18.9

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

      expm1-log1p [=>]16.2

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

      associate-*l/ [=>]17.6

      \[ {\color{blue}{\left(\frac{c0 \cdot \frac{d}{D}}{w \cdot \sqrt{h}}\right)}}^{2} \]
  3. Recombined 3 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^{-99}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} \cdot \frac{c0 \cdot d}{w}\\ \mathbf{elif}\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq 4 \cdot 10^{-145} \lor \neg \left(\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\right):\\ \;\;\;\;\left(\frac{w}{w} \cdot \frac{h}{{\left(\frac{d}{D \cdot M}\right)}^{2}}\right) \cdot \frac{c0 \cdot 0.25}{c0}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{c0 \cdot \frac{d}{D}}{w \cdot \sqrt{h}}\right)}^{2}\\ \end{array} \]

Alternatives

Alternative 1
Error17.8
Cost37261
\[\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^{-99}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} \cdot \frac{c0 \cdot d}{w}\\ \mathbf{elif}\;t_1 \leq 4 \cdot 10^{-145} \lor \neg \left(t_1 \leq \infty\right):\\ \;\;\;\;\left(\frac{w}{w} \cdot \frac{h}{{\left(\frac{d}{D \cdot M}\right)}^{2}}\right) \cdot \frac{c0 \cdot 0.25}{c0}\\ \mathbf{else}:\\ \;\;\;\;{\left(\frac{d}{D}\right)}^{2} \cdot \left(\left(\frac{c0}{w} \cdot \frac{2}{h}\right) \cdot \left(c0 \cdot \frac{0.5}{w}\right)\right) + c0 \cdot \left(M \cdot \frac{0.5}{w}\right)\\ \end{array} \]
Alternative 2
Error25.6
Cost8224
\[\begin{array}{l} t_0 := \left(c0 \cdot 2\right) \cdot \frac{1}{\frac{D \cdot \left(2 \cdot \frac{w}{c0}\right)}{\frac{d}{h}} \cdot \frac{D}{\frac{d}{w}}}\\ t_1 := 0.25 \cdot \frac{h \cdot \left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)}{d \cdot d}\\ t_2 := 0.25 \cdot \frac{M \cdot \left(h \cdot M\right)}{{\left(\frac{d}{D}\right)}^{2}}\\ \mathbf{if}\;d \leq -4.2 \cdot 10^{+159}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq -2.3 \cdot 10^{-39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq -5 \cdot 10^{-108}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 5 \cdot 10^{-125}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;d \leq 8 \cdot 10^{+52}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 1.85 \cdot 10^{+77}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 2 \cdot 10^{+137}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;d \leq 8 \cdot 10^{+300}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 3
Error20.3
Cost8073
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 5 \cdot 10^{+31} \lor \neg \left(D \cdot D \leq 2 \cdot 10^{+70}\right):\\ \;\;\;\;\left(\frac{w}{w} \cdot \frac{h}{{\left(\frac{d}{D \cdot M}\right)}^{2}}\right) \cdot \frac{c0 \cdot 0.25}{c0}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{d \cdot \left(d \cdot \frac{c0}{w}\right)}{D \cdot \left(h \cdot D\right)}\right)\\ \end{array} \]
Alternative 4
Error28.2
Cost1881
\[\begin{array}{l} t_0 := 0.25 \cdot \frac{h \cdot \left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)}{d \cdot d}\\ \mathbf{if}\;D \leq -1.28 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq -2 \cdot 10^{-91}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{d}\\ \mathbf{elif}\;D \leq -1 \cdot 10^{-216}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 10^{-249}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 2100000000 \lor \neg \left(D \leq 4.5 \cdot 10^{+116}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} \cdot \frac{c0 \cdot d}{w}\\ \end{array} \]
Alternative 5
Error27.4
Cost1489
\[\begin{array}{l} t_0 := 0.25 \cdot \frac{h \cdot \left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)}{d \cdot d}\\ \mathbf{if}\;D \leq -1.25 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq -5.2 \cdot 10^{-90}:\\ \;\;\;\;\frac{0.25}{d} \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot \left(h \cdot M\right)\right)}{d}\\ \mathbf{elif}\;D \leq -5 \cdot 10^{-220} \lor \neg \left(D \leq 8.8 \cdot 10^{-249}\right):\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 6
Error26.5
Cost1220
\[\begin{array}{l} \mathbf{if}\;d \cdot d \leq 0:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \frac{h \cdot \left(\left(D \cdot M\right) \cdot \left(D \cdot M\right)\right)}{d \cdot d}\\ \end{array} \]
Alternative 7
Error31.9
Cost64
\[0 \]

Error

Reproduce?

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