?

Average Accuracy: 7.2% → 64.0%
Time: 42.6s
Precision: binary64
Cost: 7892

?

\[\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 := \left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \frac{h}{-d}\right) \cdot -0.25\\ t_1 := \frac{d}{D} \cdot c0\\ \mathbf{if}\;D \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t_1}{w} \cdot \frac{t_1}{w \cdot h}\\ \mathbf{elif}\;D \leq -5 \cdot 10^{-115}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{elif}\;D \leq 7 \cdot 10^{-186}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 3.85 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(0.25, D \cdot \left(\frac{D}{d} \cdot \frac{h \cdot M}{\frac{d}{M}}\right), 0\right)\\ \mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{D}}{h}\right)\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 (* (* (/ (pow (* D M) 2.0) d) (/ h (- d))) -0.25))
        (t_1 (* (/ d D) c0)))
   (if (<= D -4.4e+169)
     (* (/ t_1 w) (/ t_1 (* w h)))
     (if (<= D -5e-115)
       (* 0.25 (* (/ (* (* D (* D h)) M) d) (/ M d)))
       (if (<= D 7e-186)
         t_0
         (if (<= D 3.85e+52)
           (fma 0.25 (* D (* (/ D d) (/ (* h M) (/ d M)))) 0.0)
           (if (<= D 6e+197)
             t_0
             (*
              (/ c0 (* w 2.0))
              (* 2.0 (* (/ c0 w) (* (/ d D) (/ (/ d D) h))))))))))))
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 = ((pow((D * M), 2.0) / d) * (h / -d)) * -0.25;
	double t_1 = (d / D) * c0;
	double tmp;
	if (D <= -4.4e+169) {
		tmp = (t_1 / w) * (t_1 / (w * h));
	} else if (D <= -5e-115) {
		tmp = 0.25 * ((((D * (D * h)) * M) / d) * (M / d));
	} else if (D <= 7e-186) {
		tmp = t_0;
	} else if (D <= 3.85e+52) {
		tmp = fma(0.25, (D * ((D / d) * ((h * M) / (d / M)))), 0.0);
	} else if (D <= 6e+197) {
		tmp = t_0;
	} else {
		tmp = (c0 / (w * 2.0)) * (2.0 * ((c0 / w) * ((d / D) * ((d / D) / h))));
	}
	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(Float64((Float64(D * M) ^ 2.0) / d) * Float64(h / Float64(-d))) * -0.25)
	t_1 = Float64(Float64(d / D) * c0)
	tmp = 0.0
	if (D <= -4.4e+169)
		tmp = Float64(Float64(t_1 / w) * Float64(t_1 / Float64(w * h)));
	elseif (D <= -5e-115)
		tmp = Float64(0.25 * Float64(Float64(Float64(Float64(D * Float64(D * h)) * M) / d) * Float64(M / d)));
	elseif (D <= 7e-186)
		tmp = t_0;
	elseif (D <= 3.85e+52)
		tmp = fma(0.25, Float64(D * Float64(Float64(D / d) * Float64(Float64(h * M) / Float64(d / M)))), 0.0);
	elseif (D <= 6e+197)
		tmp = t_0;
	else
		tmp = Float64(Float64(c0 / Float64(w * 2.0)) * Float64(2.0 * Float64(Float64(c0 / w) * Float64(Float64(d / D) * Float64(Float64(d / D) / h)))));
	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[(N[(N[(N[Power[N[(D * M), $MachinePrecision], 2.0], $MachinePrecision] / d), $MachinePrecision] * N[(h / (-d)), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]}, Block[{t$95$1 = N[(N[(d / D), $MachinePrecision] * c0), $MachinePrecision]}, If[LessEqual[D, -4.4e+169], N[(N[(t$95$1 / w), $MachinePrecision] * N[(t$95$1 / N[(w * h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, -5e-115], N[(0.25 * N[(N[(N[(N[(D * N[(D * h), $MachinePrecision]), $MachinePrecision] * M), $MachinePrecision] / d), $MachinePrecision] * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[D, 7e-186], t$95$0, If[LessEqual[D, 3.85e+52], N[(0.25 * N[(D * N[(N[(D / d), $MachinePrecision] * N[(N[(h * M), $MachinePrecision] / N[(d / M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision], If[LessEqual[D, 6e+197], t$95$0, N[(N[(c0 / N[(w * 2.0), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] / h), $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 := \left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \frac{h}{-d}\right) \cdot -0.25\\
t_1 := \frac{d}{D} \cdot c0\\
\mathbf{if}\;D \leq -4.4 \cdot 10^{+169}:\\
\;\;\;\;\frac{t_1}{w} \cdot \frac{t_1}{w \cdot h}\\

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

\mathbf{elif}\;D \leq 7 \cdot 10^{-186}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;D \leq 3.85 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(0.25, D \cdot \left(\frac{D}{d} \cdot \frac{h \cdot M}{\frac{d}{M}}\right), 0\right)\\

\mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\
\;\;\;\;t_0\\

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


\end{array}

Error?

Derivation?

  1. Split input into 5 regimes
  2. if D < -4.4e169

    1. Initial program 2.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. Simplified3.0%

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

      [Start]2.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* [=>]2.6

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

      difference-of-squares [=>]2.6

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

      associate-*l* [=>]2.6

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

      associate-*l* [=>]3.0

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

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

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

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

      times-frac [=>]2.8

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

      unpow2 [=>]2.8

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

      unpow2 [=>]2.8

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

      times-frac [=>]20.3

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

      unpow2 [=>]20.3

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

      *-commutative [=>]20.3

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

      unpow2 [=>]20.3

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

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

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

    if -4.4e169 < D < -5.0000000000000003e-115

    1. Initial program 14.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. Simplified6.3%

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

      [Start]14.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/ [<=]13.3

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

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

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

      *-commutative [=>]10.5

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

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

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

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

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

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

      [Start]12.9

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

      \[ \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 49.9%

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

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

      [Start]49.9

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

      associate-/l* [=>]49.3

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

      unpow2 [=>]49.3

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

      *-commutative [=>]49.3

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

      associate-/l* [<=]49.9

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

      associate-*r* [=>]48.0

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

      unpow2 [=>]48.0

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

      unpow2 [=>]48.0

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

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

    if -5.0000000000000003e-115 < D < 6.99999999999999978e-186 or 3.84999999999999997e52 < D < 6.0000000000000004e197

    1. Initial program 2.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. Simplified1.3%

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

      [Start]2.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/ [<=]2.5

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

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

      *-commutative [=>]2.0

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

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

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

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

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

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

      [Start]2.6

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

      \[ \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 46.1%

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

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

      [Start]46.1

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

      associate-/l* [=>]46.0

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

      unpow2 [=>]46.0

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

      *-commutative [=>]46.0

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

      associate-/l* [<=]46.1

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

      associate-*r* [=>]46.9

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

      unpow2 [=>]46.9

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

      unpow2 [=>]46.9

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

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

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

      [Start]61.0

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

      associate-*r/ [=>]61.5

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

      *-rgt-identity [=>]61.5

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

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

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

      times-frac [=>]68.6

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

      *-commutative [=>]68.6

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

    if 6.99999999999999978e-186 < D < 3.84999999999999997e52

    1. Initial program 11.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. Simplified10.3%

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

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

      associate-*l* [=>]8.7

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

      difference-of-squares [=>]8.7

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

      associate-*l* [=>]9.0

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

      associate-*l* [=>]10.3

      \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}} - M\right)}\right) \]
    3. Applied egg-rr10.2%

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

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

      [Start]10.2

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

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

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

      *-commutative [<=]10.2

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

      associate-/l* [=>]10.7

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

      \[\leadsto \color{blue}{-0.5 \cdot \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}} \]
    6. Simplified39.8%

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

      [Start]10.2

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

      +-commutative [=>]10.2

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

      fma-def [=>]10.2

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

      unpow2 [=>]10.2

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

      *-commutative [<=]10.2

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

      times-frac [=>]10.6

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

      unpow2 [=>]10.6

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

      associate-*r/ [<=]10.6

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

      *-commutative [=>]10.6

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

      unpow2 [=>]10.6

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

      associate-*l* [=>]11.4

      \[ \mathsf{fma}\left(0.25, \left(D \cdot \frac{D}{d}\right) \cdot \frac{\color{blue}{M \cdot \left(M \cdot h\right)}}{d}, -0.5 \cdot \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w}\right) \]
    7. Taylor expanded in w around 0 60.4%

      \[\leadsto \mathsf{fma}\left(0.25, \left(D \cdot \frac{D}{d}\right) \cdot \frac{M \cdot \left(M \cdot h\right)}{d}, \color{blue}{0}\right) \]
    8. Applied egg-rr66.2%

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

    if 6.0000000000000004e197 < D

    1. Initial program 1.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. Taylor expanded in c0 around inf 1.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. Simplified27.4%

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

      [Start]1.9

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

      unpow2 [=>]1.9

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

      associate-/r* [=>]1.9

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

      unpow2 [=>]1.9

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

      *-commutative [=>]1.9

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

      *-lft-identity [<=]1.9

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

      associate-*l/ [<=]1.9

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

      associate-*r/ [=>]1.1

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

      associate-/r* [=>]1.1

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

      associate-*l/ [=>]1.1

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

      associate-/r* [<=]2.3

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

      associate-*l* [<=]3.3

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

      associate-*r/ [<=]3.4

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

      associate-*l/ [=>]3.4

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

      *-lft-identity [=>]3.4

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

      associate-*r/ [<=]4.6

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

      associate-*l/ [<=]4.9

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

      times-frac [=>]24.5

      \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \color{blue}{\left(\frac{d}{h \cdot D} \cdot \frac{d}{D}\right)}\right)\right) \]
  3. Recombined 5 regimes into one program.
  4. Final simplification64.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;D \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{\frac{d}{D} \cdot c0}{w} \cdot \frac{\frac{d}{D} \cdot c0}{w \cdot h}\\ \mathbf{elif}\;D \leq -5 \cdot 10^{-115}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{elif}\;D \leq 7 \cdot 10^{-186}:\\ \;\;\;\;\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \frac{h}{-d}\right) \cdot -0.25\\ \mathbf{elif}\;D \leq 3.85 \cdot 10^{+52}:\\ \;\;\;\;\mathsf{fma}\left(0.25, D \cdot \left(\frac{D}{d} \cdot \frac{h \cdot M}{\frac{d}{M}}\right), 0\right)\\ \mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\ \;\;\;\;\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \frac{h}{-d}\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{D}}{h}\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy64.3%
Cost7892
\[\begin{array}{l} t_0 := \left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \frac{h}{-d}\right) \cdot -0.25\\ t_1 := \frac{d}{D} \cdot c0\\ \mathbf{if}\;D \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t_1}{w} \cdot \frac{t_1}{w \cdot h}\\ \mathbf{elif}\;D \leq -1.8 \cdot 10^{-115}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{elif}\;D \leq 2.8 \cdot 10^{-115}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 6.7 \cdot 10^{+53}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{\frac{h \cdot M}{\frac{d}{M}} \cdot \left(D \cdot D\right)}{d}, 0\right)\\ \mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{D}}{h}\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy61.8%
Cost7696
\[\begin{array}{l} t_0 := 0.25 \cdot \frac{h \cdot {\left(D \cdot M\right)}^{2}}{d \cdot d}\\ t_1 := D \cdot \left(D \cdot h\right)\\ \mathbf{if}\;d \leq -1.25 \cdot 10^{+161}:\\ \;\;\;\;0.25 \cdot \left(t_1 \cdot \frac{1}{\frac{d}{M} \cdot \frac{d}{M}}\right)\\ \mathbf{elif}\;d \leq -4.8 \cdot 10^{-101}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 1.45 \cdot 10^{-124}:\\ \;\;\;\;\frac{0.25}{\frac{d}{D \cdot \left(D \cdot \left(M \cdot M\right)\right)} \cdot \frac{d}{h}}\\ \mathbf{elif}\;d \leq 8.2 \cdot 10^{+21}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;d \leq 5 \cdot 10^{+203}:\\ \;\;\;\;0.25 \cdot \left(\frac{t_1 \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 3
Accuracy62.7%
Cost7692
\[\begin{array}{l} t_0 := \frac{d}{D} \cdot c0\\ \mathbf{if}\;D \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t_0}{w} \cdot \frac{t_0}{w \cdot h}\\ \mathbf{elif}\;D \leq -2.1 \cdot 10^{-199}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\ \;\;\;\;0.25 \cdot \left(\frac{h \cdot {\left(D \cdot M\right)}^{2}}{d} \cdot \frac{1}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{D}}{h}\right)\right)\right)\\ \end{array} \]
Alternative 4
Accuracy63.7%
Cost7628
\[\begin{array}{l} t_0 := \frac{d}{D} \cdot c0\\ \mathbf{if}\;D \leq -3.9 \cdot 10^{+169}:\\ \;\;\;\;\frac{t_0}{w} \cdot \frac{t_0}{w \cdot h}\\ \mathbf{elif}\;D \leq -9 \cdot 10^{-116}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\ \;\;\;\;\left(\frac{{\left(D \cdot M\right)}^{2}}{d} \cdot \frac{h}{-d}\right) \cdot -0.25\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{D}}{h}\right)\right)\right)\\ \end{array} \]
Alternative 5
Accuracy62.0%
Cost1608
\[\begin{array}{l} t_0 := \frac{d}{D} \cdot c0\\ \mathbf{if}\;D \leq -4.4 \cdot 10^{+169}:\\ \;\;\;\;\frac{t_0}{w} \cdot \frac{t_0}{w \cdot h}\\ \mathbf{elif}\;D \leq 6 \cdot 10^{+197}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{d}{D} \cdot \frac{\frac{d}{D}}{h}\right)\right)\right)\\ \end{array} \]
Alternative 6
Accuracy55.1%
Cost1488
\[\begin{array}{l} t_0 := 0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(\frac{h}{d} \cdot \frac{M \cdot M}{d}\right)\right)\\ \mathbf{if}\;D \leq -6.6 \cdot 10^{+152}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq -7.2 \cdot 10^{-128}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 7.5 \cdot 10^{-89}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 9.5 \cdot 10^{+108}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;0 \cdot \frac{c0}{w \cdot 2}\\ \end{array} \]
Alternative 7
Accuracy62.1%
Cost1353
\[\begin{array}{l} t_0 := \frac{d}{D} \cdot c0\\ \mathbf{if}\;D \leq -4.4 \cdot 10^{+169} \lor \neg \left(D \leq 5.7 \cdot 10^{+197}\right):\\ \;\;\;\;\frac{t_0}{w} \cdot \frac{t_0}{w \cdot h}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \end{array} \]
Alternative 8
Accuracy60.7%
Cost1352
\[\begin{array}{l} t_0 := D \cdot \left(D \cdot h\right)\\ \mathbf{if}\;h \leq 0.098:\\ \;\;\;\;0.25 \cdot \left(\frac{t_0 \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{elif}\;h \leq 4.8 \cdot 10^{+183}:\\ \;\;\;\;\frac{0.25}{\frac{d}{D \cdot \left(D \cdot \left(M \cdot M\right)\right)} \cdot \frac{d}{h}}\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(t_0 \cdot \frac{1}{\frac{d}{M} \cdot \frac{d}{M}}\right)\\ \end{array} \]
Alternative 9
Accuracy61.8%
Cost1225
\[\begin{array}{l} \mathbf{if}\;M \leq -1.6 \cdot 10^{-248} \lor \neg \left(M \leq 1.25 \cdot 10^{+152}\right):\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{\frac{d}{D \cdot \left(D \cdot \left(M \cdot M\right)\right)} \cdot \frac{d}{h}}\\ \end{array} \]
Alternative 10
Accuracy57.6%
Cost1224
\[\begin{array}{l} \mathbf{if}\;D \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 3.5 \cdot 10^{+120}:\\ \;\;\;\;0.25 \cdot \left(\frac{D \cdot D}{\frac{d}{h}} \cdot \frac{M}{\frac{d}{M}}\right)\\ \mathbf{else}:\\ \;\;\;\;0 \cdot \frac{c0}{w \cdot 2}\\ \end{array} \]
Alternative 11
Accuracy61.4%
Cost1092
\[\begin{array}{l} \mathbf{if}\;d \leq 1.45 \cdot 10^{+204}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot \left(D \cdot h\right)\right) \cdot M}{d} \cdot \frac{M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 12
Accuracy50.6%
Cost64
\[0 \]

Error

Reproduce?

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