?

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25, t_0 \cdot \left(h \cdot \left(D \cdot \frac{M}{d}\right)\right), 0\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))))) < -4.99999999999999963e-208

    1. Initial program 24.2%

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

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

      [Start]24.2

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

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

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

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

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

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

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

      [Start]12.8

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

      times-frac [=>]11.6

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

      unpow2 [=>]11.6

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

      unpow2 [=>]11.6

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

      unpow2 [=>]11.6

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

      *-commutative [=>]11.6

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

      unpow2 [=>]11.6

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

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

      [Start]11.6

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

      frac-2neg [=>]11.6

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

      frac-2neg [=>]11.6

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

      frac-times [=>]12.8

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

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

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

      associate-*r* [=>]15.3

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

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

      \[ \frac{\left(-d \cdot d\right) \cdot \left(-c0 \cdot c0\right)}{\left(D \cdot \left(-D\right)\right) \cdot \color{blue}{\left(\left(-h \cdot w\right) \cdot w\right)}} \]
    6. Simplified39.8%

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

      [Start]15.3

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

      distribute-lft-neg-out [=>]15.3

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

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

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

      remove-double-neg [=>]15.3

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

      associate-*l* [=>]18.5

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

      associate-/r* [=>]19.9

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

      swap-sqr [<=]35.6

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

      unpow2 [<=]35.6

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

      *-commutative [=>]35.6

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

      associate-*r* [=>]39.8

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

      *-commutative [=>]39.8

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

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

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

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

      [Start]39.8

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

      associate-/l/ [=>]41.6

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

      unpow2 [=>]41.6

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

      times-frac [=>]57.3

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

      *-commutative [=>]57.3

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

      associate-*l* [=>]58.3

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

      add-sqr-sqrt [=>]29.2

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

      sqrt-unprod [=>]24.8

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

      sqr-neg [=>]24.8

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

      sqrt-unprod [<=]0.9

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

      add-sqr-sqrt [<=]1.4

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

      add-sqr-sqrt [=>]0.9

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

      sqrt-unprod [=>]2.1

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

      sqr-neg [=>]2.1

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

      sqrt-unprod [<=]0.6

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

      add-sqr-sqrt [<=]58.3

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

    if -4.99999999999999963e-208 < (*.f64 (/.f64 c0 (*.f64 2 w)) (+.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (sqrt.f64 (-.f64 (*.f64 (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D))) (/.f64 (*.f64 c0 (*.f64 d d)) (*.f64 (*.f64 w h) (*.f64 D D)))) (*.f64 M M))))) < -0.0

    1. Initial program 54.9%

      \[\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 49.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}}} \]
    3. Simplified51.7%

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

      [Start]49.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 [=>]49.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 [=>]49.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)} \]
    4. Applied egg-rr65.1%

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

      [Start]51.7

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

      associate-*l* [=>]53.9

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

      add-sqr-sqrt [=>]53.9

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

      times-frac [=>]55.8

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

      times-frac [=>]55.8

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

      sqrt-prod [=>]26.5

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

      add-sqr-sqrt [<=]50.2

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

      times-frac [=>]53.2

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

      sqrt-prod [=>]31.9

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

      add-sqr-sqrt [<=]65.1

      \[ \mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \frac{D \cdot h}{\color{blue}{\frac{d}{M}}}, \frac{c0 \cdot c0}{\frac{w}{0}}\right) \]
    5. Applied egg-rr82.4%

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

      [Start]65.1

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

      associate-/r/ [=>]63.6

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

      mul0-rgt [=>]82.4

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

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

    1. Initial program 24.2%

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

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

      [Start]24.2

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

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

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

      associate-/r* [=>]20.1

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

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

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

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

      [Start]13.9

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

      times-frac [=>]13.7

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

      unpow2 [=>]13.7

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

      unpow2 [=>]13.7

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

      unpow2 [=>]13.7

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

      *-commutative [=>]13.7

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

      unpow2 [=>]13.7

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

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

      [Start]13.7

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

      add-log-exp [=>]2.5

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

      *-un-lft-identity [=>]2.5

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

      log-prod [=>]2.5

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

      metadata-eval [=>]2.5

      \[ \color{blue}{0} + \log \left(e^{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}}\right) \]

      add-log-exp [<=]13.7

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

      add-sqr-sqrt [=>]13.5

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

      pow2 [=>]13.5

      \[ 0 + \color{blue}{{\left(\sqrt{\frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{h \cdot \left(w \cdot w\right)}}\right)}^{2}} \]
    6. Simplified71.2%

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

      [Start]70.7

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

      +-lft-identity [=>]70.7

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

      associate-/r* [=>]71.2

      \[ {\left(\color{blue}{\frac{\frac{c0}{w}}{\sqrt{h}}} \cdot \frac{d}{D}\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 0.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. Taylor expanded in c0 around -inf 0.9%

      \[\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}}} \]
    3. Simplified34.5%

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

      [Start]0.9

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

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

      \[ \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)} \]
    4. Applied egg-rr54.0%

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

      [Start]34.5

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

      associate-*l* [=>]36.7

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

      add-sqr-sqrt [=>]36.7

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

      times-frac [=>]38.5

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

      times-frac [=>]38.6

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

      sqrt-prod [=>]19.2

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

      add-sqr-sqrt [<=]36.7

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

      times-frac [=>]44.8

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

      sqrt-prod [=>]26.8

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

      add-sqr-sqrt [<=]54.0

      \[ \mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \frac{D \cdot h}{\color{blue}{\frac{d}{M}}}, \frac{c0 \cdot c0}{\frac{w}{0}}\right) \]
    5. Applied egg-rr77.6%

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

      [Start]54.0

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

      associate-/r/ [=>]47.5

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

      mul0-rgt [=>]77.6

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

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

      [Start]77.6

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

      associate-/l* [=>]78.5

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

      associate-/r/ [=>]82.0

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

      div-inv [=>]81.9

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

      clear-num [<=]82.0

      \[ \mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(\left(D \cdot \color{blue}{\frac{M}{d}}\right) \cdot h\right), 0\right) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification79.8%

    \[\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^{-208}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(\left(w \cdot h\right) \cdot D\right)} \cdot \frac{c0 \cdot d}{D}\\ \mathbf{elif}\;\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right) \leq 0:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \frac{h \cdot D}{\frac{d}{M}}, 0\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{\frac{c0}{w}}{\sqrt{h}} \cdot \frac{d}{D}\right)}^{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(h \cdot \left(D \cdot \frac{M}{d}\right)\right), 0\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy76.5%
Cost36556
\[\begin{array}{l} t_0 := c0 \cdot \left(d \cdot d\right)\\ t_1 := \frac{c0 \cdot d}{w \cdot \left(\left(w \cdot h\right) \cdot D\right)} \cdot \frac{c0 \cdot d}{D}\\ t_2 := \frac{t_0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\ t_3 := \frac{c0}{2 \cdot w}\\ t_4 := t_3 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\ t_5 := \frac{t_0}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\\ \mathbf{if}\;t_4 \leq -4 \cdot 10^{+248}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t_4 \leq 2 \cdot 10^{-280}:\\ \;\;\;\;t_3 \cdot \left(t_5 + \sqrt{\left(M + t_5\right) \cdot \left(t_5 - M\right)}\right)\\ \mathbf{elif}\;t_4 \leq \infty:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(h \cdot \left(D \cdot \frac{M}{d}\right)\right), 0\right)\\ \end{array} \]
Alternative 2
Accuracy73.6%
Cost7625
\[\begin{array}{l} \mathbf{if}\;c0 \leq 3.6 \cdot 10^{-215} \lor \neg \left(c0 \leq 4.6 \cdot 10^{-167}\right):\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D}{\frac{d}{M}} \cdot \left(h \cdot \left(D \cdot \frac{M}{d}\right)\right), 0\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(\left(w \cdot h\right) \cdot D\right)} \cdot \frac{c0 \cdot d}{D}\\ \end{array} \]
Alternative 3
Accuracy64.2%
Cost7564
\[\begin{array}{l} t_0 := M \cdot \left(h \cdot \left(0.25 \cdot \frac{M}{{\left(\frac{d}{D}\right)}^{2}}\right)\right)\\ \mathbf{if}\;D \leq -1.12 \cdot 10^{+91}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq -9 \cdot 10^{+37}:\\ \;\;\;\;\left(d \cdot \frac{\frac{d}{D}}{D}\right) \cdot \left(c0 \cdot \frac{c0}{w \cdot \left(w \cdot h\right)}\right)\\ \mathbf{elif}\;D \leq -9.8 \cdot 10^{-210}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;D \leq 6.7 \cdot 10^{-184}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \frac{h}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(M \cdot \frac{D}{\frac{d}{h}}\right)\right)}{\frac{d}{M}}\\ \end{array} \]
Alternative 4
Accuracy64.2%
Cost7564
\[\begin{array}{l} t_0 := {\left(\frac{d}{D}\right)}^{2}\\ \mathbf{if}\;D \leq -1.12 \cdot 10^{+91}:\\ \;\;\;\;\frac{M \cdot 0.25}{\frac{t_0}{h \cdot M}}\\ \mathbf{elif}\;D \leq -9 \cdot 10^{+37}:\\ \;\;\;\;\left(d \cdot \frac{\frac{d}{D}}{D}\right) \cdot \left(c0 \cdot \frac{c0}{w \cdot \left(w \cdot h\right)}\right)\\ \mathbf{elif}\;D \leq -3.7 \cdot 10^{-209}:\\ \;\;\;\;M \cdot \left(h \cdot \left(0.25 \cdot \frac{M}{t_0}\right)\right)\\ \mathbf{elif}\;D \leq 2 \cdot 10^{-184}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \frac{h}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot \left(M \cdot \frac{D}{\frac{d}{h}}\right)\right)}{\frac{d}{M}}\\ \end{array} \]
Alternative 5
Accuracy68.4%
Cost1353
\[\begin{array}{l} \mathbf{if}\;c0 \leq 3.6 \cdot 10^{-215} \lor \neg \left(c0 \leq 4.6 \cdot 10^{-167}\right):\\ \;\;\;\;\left(M \cdot \frac{D}{\frac{d}{h}}\right) \cdot \left(0.25 \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{c0 \cdot d}{w \cdot \left(\left(w \cdot h\right) \cdot D\right)} \cdot \frac{c0 \cdot d}{D}\\ \end{array} \]
Alternative 6
Accuracy68.2%
Cost1352
\[\begin{array}{l} \mathbf{if}\;h \leq -4 \cdot 10^{+161}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \frac{h}{d}\right)\\ \mathbf{elif}\;h \leq -1.12 \cdot 10^{+142}:\\ \;\;\;\;\left(\frac{d}{w} \cdot \left(\frac{d}{h} \cdot \frac{c0}{D}\right)\right) \cdot \frac{\frac{c0}{w}}{D}\\ \mathbf{else}:\\ \;\;\;\;\left(M \cdot \frac{D}{\frac{d}{h}}\right) \cdot \left(0.25 \cdot \frac{D \cdot M}{d}\right)\\ \end{array} \]
Alternative 7
Accuracy68.1%
Cost1225
\[\begin{array}{l} \mathbf{if}\;D \leq -2 \cdot 10^{-167} \lor \neg \left(D \leq 5 \cdot 10^{-98}\right):\\ \;\;\;\;\left(M \cdot \frac{D}{\frac{d}{h}}\right) \cdot \left(0.25 \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \frac{h}{d}\right)\\ \end{array} \]
Alternative 8
Accuracy67.8%
Cost1224
\[\begin{array}{l} t_0 := M \cdot \frac{D}{\frac{d}{h}}\\ \mathbf{if}\;D \leq -1.4 \cdot 10^{-167}:\\ \;\;\;\;t_0 \cdot \left(0.25 \cdot \frac{D \cdot M}{d}\right)\\ \mathbf{elif}\;D \leq 3 \cdot 10^{-183}:\\ \;\;\;\;0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \frac{h}{d}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25 \cdot \left(D \cdot t_0\right)}{\frac{d}{M}}\\ \end{array} \]
Alternative 9
Accuracy63.6%
Cost960
\[0.25 \cdot \left(\frac{\left(D \cdot M\right) \cdot \left(D \cdot M\right)}{d} \cdot \frac{h}{d}\right) \]
Alternative 10
Accuracy50.8%
Cost64
\[0 \]

Error

Reproduce?

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