?

Average Error: 59.6 → 15.7
Time: 34.8s
Precision: binary64
Cost: 42636

?

\[\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}{w \cdot h}\\ t_1 := {\left(\frac{d}{D}\right)}^{2}\\ t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := \frac{c0}{2 \cdot w} \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\ \mathbf{if}\;t_3 \leq -5 \cdot 10^{-297}:\\ \;\;\;\;c0 \cdot \left(\frac{0.5}{w} \cdot \mathsf{fma}\left(t_0, t_1, t_0 \cdot t_1\right)\right)\\ \mathbf{elif}\;t_3 \leq 5 \cdot 10^{-147}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \left(h \cdot M\right)\right)\\ \mathbf{elif}\;t_3 \leq \infty:\\ \;\;\;\;{\left(\frac{d}{D} \cdot \frac{c0}{w \cdot \sqrt{h}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\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 (* w h)))
        (t_1 (pow (/ d D) 2.0))
        (t_2 (/ (* c0 (* d d)) (* (* w h) (* D D))))
        (t_3 (* (/ c0 (* 2.0 w)) (+ t_2 (sqrt (- (* t_2 t_2) (* M M)))))))
   (if (<= t_3 -5e-297)
     (* c0 (* (/ 0.5 w) (fma t_0 t_1 (* t_0 t_1))))
     (if (<= t_3 5e-147)
       (* 0.25 (* (/ M (* (/ d D) (/ d D))) (* h M)))
       (if (<= t_3 INFINITY)
         (pow (* (/ d D) (/ c0 (* w (sqrt h)))) 2.0)
         (* (/ 0.25 d) (* (* D M) (* h (/ (* D M) 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 / (w * h);
	double t_1 = pow((d / D), 2.0);
	double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
	double t_3 = (c0 / (2.0 * w)) * (t_2 + sqrt(((t_2 * t_2) - (M * M))));
	double tmp;
	if (t_3 <= -5e-297) {
		tmp = c0 * ((0.5 / w) * fma(t_0, t_1, (t_0 * t_1)));
	} else if (t_3 <= 5e-147) {
		tmp = 0.25 * ((M / ((d / D) * (d / D))) * (h * M));
	} else if (t_3 <= ((double) INFINITY)) {
		tmp = pow(((d / D) * (c0 / (w * sqrt(h)))), 2.0);
	} else {
		tmp = (0.25 / d) * ((D * M) * (h * ((D * M) / 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(w * h))
	t_1 = Float64(d / D) ^ 2.0
	t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))
	t_3 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M)))))
	tmp = 0.0
	if (t_3 <= -5e-297)
		tmp = Float64(c0 * Float64(Float64(0.5 / w) * fma(t_0, t_1, Float64(t_0 * t_1))));
	elseif (t_3 <= 5e-147)
		tmp = Float64(0.25 * Float64(Float64(M / Float64(Float64(d / D) * Float64(d / D))) * Float64(h * M)));
	elseif (t_3 <= Inf)
		tmp = Float64(Float64(d / D) * Float64(c0 / Float64(w * sqrt(h)))) ^ 2.0;
	else
		tmp = Float64(Float64(0.25 / d) * Float64(Float64(D * M) * Float64(h * Float64(Float64(D * M) / d))));
	end
	return 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[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / D), $MachinePrecision], 2.0], $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[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 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, -5e-297], N[(c0 * N[(N[(0.5 / w), $MachinePrecision] * N[(t$95$0 * t$95$1 + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e-147], N[(0.25 * N[(N[(M / N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(h * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[Power[N[(N[(d / D), $MachinePrecision] * N[(c0 / N[(w * N[Sqrt[h], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(N[(0.25 / d), $MachinePrecision] * N[(N[(D * M), $MachinePrecision] * N[(h * N[(N[(D * M), $MachinePrecision] / d), $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}{w \cdot h}\\
t_1 := {\left(\frac{d}{D}\right)}^{2}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := \frac{c0}{2 \cdot w} \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\
\mathbf{if}\;t_3 \leq -5 \cdot 10^{-297}:\\
\;\;\;\;c0 \cdot \left(\frac{0.5}{w} \cdot \mathsf{fma}\left(t_0, t_1, t_0 \cdot t_1\right)\right)\\

\mathbf{elif}\;t_3 \leq 5 \cdot 10^{-147}:\\
\;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \left(h \cdot M\right)\right)\\

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

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


\end{array}

Error?

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))))) < -5e-297

    1. Initial program 49.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. Simplified46.4

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

      times-frac [=>]50.9

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

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

      associate-/r* [=>]51.0

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

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

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

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

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

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

      [Start]47.5

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

      times-frac [=>]44.7

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

      unpow2 [=>]44.7

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

      unpow2 [=>]44.7

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

      *-commutative [=>]44.7

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

      associate-/l/ [<=]43.7

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

      times-frac [<=]47.4

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

      associate-*l* [=>]46.7

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

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

    if -5e-297 < (*.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))))) < 5.00000000000000013e-147

    1. Initial program 28.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. Simplified54.8

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

      associate-*l/ [<=]35.6

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

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

      \[ \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* [=>]47.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* [=>]48.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* [=>]48.5

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

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

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

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

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

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

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

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

      [Start]27.4

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

      unpow2 [=>]27.4

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

      unpow2 [=>]27.4

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

      associate-*r* [<=]26.4

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

      *-commutative [<=]26.4

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

      unpow2 [=>]26.4

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

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

    if 5.00000000000000013e-147 < (*.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 51.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. Taylor expanded in c0 around inf 54.1

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

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

      [Start]54.1

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

      times-frac [=>]53.8

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

      unpow2 [=>]53.8

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

      unpow2 [=>]53.8

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

      associate-/r* [=>]51.7

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

      associate-*r/ [<=]51.0

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

      associate-*l/ [<=]50.7

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

      unpow2 [=>]50.7

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

      *-commutative [=>]50.7

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

      unpow2 [=>]50.7

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

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

    if +inf.0 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M)))))

    1. Initial program 64.0

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

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

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

      [Start]62.8

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

      fma-def [=>]62.8

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

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

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

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

      [Start]33.9

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

      associate-*r/ [=>]33.9

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

      *-commutative [=>]33.9

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

      unpow2 [=>]33.9

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

      times-frac [=>]30.6

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

      unpow2 [=>]30.6

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

      *-commutative [<=]30.6

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

      unpow2 [=>]30.6

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

      associate-*r* [<=]28.1

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

      associate-*l* [=>]23.9

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

      associate-*r/ [<=]21.4

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

      associate-*l/ [<=]20.8

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

      *-commutative [<=]20.8

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

      associate-*r* [<=]16.5

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

      associate-*r* [=>]16.7

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

      associate-*l* [=>]16.6

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

      associate-*r/ [=>]17.4

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

      associate-*l/ [<=]17.3

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

      *-commutative [=>]17.3

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

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

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

      [Start]16.6

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

      associate-*r* [=>]16.5

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

      associate-/l* [=>]16.5

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

      associate-*l/ [<=]14.9

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

      associate-/l* [<=]13.3

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

      *-commutative [=>]13.3

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

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

Alternatives

Alternative 1
Error15.1
Cost42636
\[\begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_2 := t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{-297}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{\frac{d}{D}}{\frac{w \cdot h}{c0} \cdot \frac{D}{d}}\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-147}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \left(h \cdot M\right)\right)\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;{\left(\frac{d}{D} \cdot \frac{c0}{w \cdot \sqrt{h}}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\right)\\ \end{array} \]
Alternative 2
Error16.0
Cost30412
\[\begin{array}{l} t_0 := \frac{c0}{2 \cdot w}\\ t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_2 := t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right)\\ \mathbf{if}\;t_2 \leq -5 \cdot 10^{-297}:\\ \;\;\;\;t_0 \cdot \left(2 \cdot \frac{\frac{d}{D}}{\frac{w \cdot h}{c0} \cdot \frac{D}{d}}\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{-147}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \left(h \cdot M\right)\right)\\ \mathbf{elif}\;t_2 \leq \infty:\\ \;\;\;\;\frac{c0}{\frac{D}{d}} \cdot \frac{-c0}{\frac{D}{d} \cdot \left(w \cdot \left(w \cdot \left(-h\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\right)\\ \end{array} \]
Alternative 3
Error19.1
Cost1737
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 2 \cdot 10^{+118} \lor \neg \left(D \cdot D \leq 10^{+162}\right):\\ \;\;\;\;\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{\frac{D}{d}} \cdot \frac{-c0}{\frac{D}{d} \cdot \left(w \cdot \left(w \cdot \left(-h\right)\right)\right)}\\ \end{array} \]
Alternative 4
Error29.0
Cost1489
\[\begin{array}{l} \mathbf{if}\;d \leq -3.2 \cdot 10^{+106}:\\ \;\;\;\;0\\ \mathbf{elif}\;d \leq -2.75 \cdot 10^{-126} \lor \neg \left(d \leq 2.5 \cdot 10^{-125}\right) \land d \leq 6 \cdot 10^{+139}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot M\right) \cdot \frac{D \cdot \left(h \cdot D\right)}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 5
Error21.6
Cost1488
\[\begin{array}{l} t_0 := \frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(M \cdot \left(D \cdot \frac{h}{d}\right)\right)\right)\\ \mathbf{if}\;M \leq -4.2 \cdot 10^{-222}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;M \leq 9 \cdot 10^{+61}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right)\\ \mathbf{elif}\;M \leq 1.1 \cdot 10^{+121}:\\ \;\;\;\;0.25 \cdot \left(\frac{M \cdot M}{d} \cdot \frac{D \cdot \left(h \cdot D\right)}{d}\right)\\ \mathbf{elif}\;M \leq 1.3 \cdot 10^{+159}:\\ \;\;\;\;0.25 \cdot \frac{D \cdot \left(M \cdot \left(h \cdot M\right)\right)}{d \cdot \frac{d}{D}}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error21.5
Cost1481
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 4 \cdot 10^{-318} \lor \neg \left(D \cdot D \leq 2 \cdot 10^{+144}\right):\\ \;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \left(h \cdot M\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \end{array} \]
Alternative 7
Error21.2
Cost1480
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 4 \cdot 10^{-318}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{\left(h \cdot M\right) \cdot \left(D \cdot M\right)}{d}\right)\\ \mathbf{elif}\;D \cdot D \leq 2 \cdot 10^{+144}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{M}{\frac{d}{D} \cdot \frac{d}{D}} \cdot \left(h \cdot M\right)\right)\\ \end{array} \]
Alternative 8
Error18.9
Cost1352
\[\begin{array}{l} \mathbf{if}\;w \leq 170000000000:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\right)\\ \mathbf{elif}\;w \leq 2.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{c0}{\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \left(\frac{h}{c0} \cdot \left(w \cdot w\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{D \cdot M}{\frac{d}{h}}}{\frac{d \cdot 4}{D \cdot M}}\\ \end{array} \]
Alternative 9
Error18.9
Cost1352
\[\begin{array}{l} \mathbf{if}\;w \leq 170000000000:\\ \;\;\;\;\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\right)\\ \mathbf{elif}\;w \leq 2.5 \cdot 10^{+36}:\\ \;\;\;\;\frac{c0 \cdot d}{\frac{D}{d} \cdot \left(D \cdot \left(\frac{h}{c0} \cdot \left(w \cdot w\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{D \cdot M}{\frac{d}{h}}}{\frac{d \cdot 4}{D \cdot M}}\\ \end{array} \]
Alternative 10
Error22.9
Cost1225
\[\begin{array}{l} \mathbf{if}\;M \leq -9.2 \cdot 10^{+69} \lor \neg \left(M \leq 3.5 \cdot 10^{+92}\right):\\ \;\;\;\;0.25 \cdot \left(\frac{M}{d} \cdot \frac{M \cdot \left(h \cdot \left(D \cdot D\right)\right)}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D}}\right)\\ \end{array} \]
Alternative 11
Error26.7
Cost1220
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq \infty:\\ \;\;\;\;0.25 \cdot \left(\frac{D}{d} \cdot \frac{h \cdot \left(M \cdot M\right)}{\frac{d}{D}}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 12
Error18.2
Cost960
\[\frac{0.25}{d} \cdot \left(\left(D \cdot M\right) \cdot \left(h \cdot \frac{D \cdot M}{d}\right)\right) \]
Alternative 13
Error31.5
Cost64
\[0 \]

Error

Reproduce?

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