?

Average Accuracy: 4.6% → 44.9%
Time: 31.3s
Precision: binary64
Cost: 8009

?

\[\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{\frac{d}{M}}{D}\\ \mathbf{if}\;c0 \leq -6.5 \cdot 10^{+84} \lor \neg \left(c0 \leq 3.5 \cdot 10^{+72}\right):\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{\left(D \cdot M\right) \cdot h}{d \cdot t_0}, \frac{0}{w}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D \cdot \left(h \cdot \frac{M}{d}\right)}{t_0}, \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\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 M) D)))
   (if (or (<= c0 -6.5e+84) (not (<= c0 3.5e+72)))
     (fma 0.25 (/ (* (* D M) h) (* d t_0)) (/ 0.0 w))
     (fma 0.25 (/ (* D (* h (/ M d))) t_0) (/ (* 0.0 (* c0 c0)) w)))))
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 / M) / D;
	double tmp;
	if ((c0 <= -6.5e+84) || !(c0 <= 3.5e+72)) {
		tmp = fma(0.25, (((D * M) * h) / (d * t_0)), (0.0 / w));
	} else {
		tmp = fma(0.25, ((D * (h * (M / d))) / t_0), ((0.0 * (c0 * c0)) / w));
	}
	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(d / M) / D)
	tmp = 0.0
	if ((c0 <= -6.5e+84) || !(c0 <= 3.5e+72))
		tmp = fma(0.25, Float64(Float64(Float64(D * M) * h) / Float64(d * t_0)), Float64(0.0 / w));
	else
		tmp = fma(0.25, Float64(Float64(D * Float64(h * Float64(M / d))) / t_0), Float64(Float64(0.0 * Float64(c0 * c0)) / w));
	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[(d / M), $MachinePrecision] / D), $MachinePrecision]}, If[Or[LessEqual[c0, -6.5e+84], N[Not[LessEqual[c0, 3.5e+72]], $MachinePrecision]], N[(0.25 * N[(N[(N[(D * M), $MachinePrecision] * h), $MachinePrecision] / N[(d * t$95$0), $MachinePrecision]), $MachinePrecision] + N[(0.0 / w), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(D * N[(h * N[(M / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $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{\frac{d}{M}}{D}\\
\mathbf{if}\;c0 \leq -6.5 \cdot 10^{+84} \lor \neg \left(c0 \leq 3.5 \cdot 10^{+72}\right):\\
\;\;\;\;\mathsf{fma}\left(0.25, \frac{\left(D \cdot M\right) \cdot h}{d \cdot t_0}, \frac{0}{w}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25, \frac{D \cdot \left(h \cdot \frac{M}{d}\right)}{t_0}, \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\right)\\


\end{array}

Error?

Derivation?

  1. Split input into 2 regimes
  2. if c0 < -6.50000000000000027e84 or 3.5000000000000001e72 < c0

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

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

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

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

      \[ \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* [=>]2.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{\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-rr4.8%

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

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

      +-commutative [=>]2.7

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

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

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

      fma-def [=>]2.7

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

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

      [Start]4.8

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

      fma-udef [=>]4.8

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

      *-lft-identity [=>]4.8

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

      associate-/r* [=>]2.7

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

      associate-/r* [=>]3.7

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

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

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

      [Start]2.5

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

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

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

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

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

      [Start]36.7

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

      associate-/l* [=>]40.5

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

      frac-times [=>]45.9

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

      *-commutative [=>]45.9

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

      associate-/r* [=>]44.9

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

    if -6.50000000000000027e84 < c0 < 3.5000000000000001e72

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

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

      associate-*l* [=>]5.3

      \[ \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 [=>]5.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{\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* [=>]5.9

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

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

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

      [Start]6.5

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

      +-commutative [=>]6.5

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

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

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

      fma-def [=>]6.5

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

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

      [Start]10.6

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

      fma-udef [=>]10.6

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

      *-lft-identity [=>]10.6

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

      associate-/r* [=>]8.8

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

      associate-/r* [=>]10.6

      \[ \frac{c0}{2 \cdot w} \cdot \left(\sqrt{{\left(\frac{c0}{w} \cdot \left(\frac{\frac{d}{h}}{D} \cdot \frac{d}{D}\right)\right)}^{2} - M \cdot M} + \frac{c0}{w} \cdot \left(\color{blue}{\frac{\frac{d}{h}}{D}} \cdot \frac{d}{D}\right)\right) \]
    5. Taylor expanded in c0 around -inf 4.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}}} \]
    6. Simplified50.3%

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

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

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

      [Start]50.3

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

      *-commutative [=>]50.3

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

      associate-/l* [=>]52.2

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

      associate-*r/ [=>]52.3

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

      *-commutative [=>]52.3

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

      associate-/r* [=>]52.3

      \[ \mathsf{fma}\left(0.25, \frac{\frac{h}{d} \cdot \left(D \cdot M\right)}{\color{blue}{\frac{\frac{d}{M}}{D}}}, \frac{\left(c0 \cdot c0\right) \cdot 0}{w}\right) \]
    8. Taylor expanded in h around 0 48.8%

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

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

      [Start]48.8

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

      *-commutative [<=]48.8

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

      associate-*r* [=>]52.3

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

      *-commutative [<=]52.3

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

      associate-*r/ [<=]53.8

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

      *-commutative [=>]53.8

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

      associate-*l* [=>]55.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c0 \leq -6.5 \cdot 10^{+84} \lor \neg \left(c0 \leq 3.5 \cdot 10^{+72}\right):\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{\left(D \cdot M\right) \cdot h}{d \cdot \frac{\frac{d}{M}}{D}}, \frac{0}{w}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{D \cdot \left(h \cdot \frac{M}{d}\right)}{\frac{\frac{d}{M}}{D}}, \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy44.8%
Cost8009
\[\begin{array}{l} \mathbf{if}\;c0 \leq -7.2 \cdot 10^{+84} \lor \neg \left(c0 \leq 2 \cdot 10^{+36}\right):\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{\left(D \cdot M\right) \cdot h}{d \cdot \frac{\frac{d}{M}}{D}}, \frac{0}{w}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.25, D \cdot \left(\frac{M}{d} \cdot \left(h \cdot \left(D \cdot \frac{M}{d}\right)\right)\right), \frac{0 \cdot \left(c0 \cdot c0\right)}{w}\right)\\ \end{array} \]
Alternative 2
Accuracy38.9%
Cost7753
\[\begin{array}{l} \mathbf{if}\;h \leq -9 \cdot 10^{+114} \lor \neg \left(h \leq 1.1 \cdot 10^{+50}\right):\\ \;\;\;\;\mathsf{fma}\left(0.25, \frac{h}{d} \cdot \left(\left(D \cdot D\right) \cdot \frac{M}{\frac{d}{M}}\right), \frac{0}{w}\right)\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)\\ \end{array} \]
Alternative 3
Accuracy44.5%
Cost7488
\[\mathsf{fma}\left(0.25, \frac{h}{d} \cdot \left(\left(D \cdot M\right) \cdot \frac{D \cdot M}{d}\right), \frac{0}{w}\right) \]
Alternative 4
Accuracy45.0%
Cost7488
\[\mathsf{fma}\left(0.25, \frac{\left(D \cdot M\right) \cdot \frac{h}{d}}{\frac{\frac{d}{M}}{D}}, \frac{0}{w}\right) \]
Alternative 5
Accuracy38.9%
Cost7168
\[0.25 \cdot \left({\left(\frac{D}{d}\right)}^{2} \cdot \left(M \cdot \left(M \cdot h\right)\right)\right) \]
Alternative 6
Accuracy35.2%
Cost2128
\[\begin{array}{l} t_0 := \frac{d}{D} \cdot \frac{d}{D}\\ \mathbf{if}\;D \leq -1.15 \cdot 10^{+214}:\\ \;\;\;\;t_0 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{h}}{w}\right)\\ \mathbf{elif}\;D \leq -2.15 \cdot 10^{-76}:\\ \;\;\;\;\frac{\left(0.25 \cdot D\right) \cdot \left(D \cdot h\right)}{d} \cdot \frac{M \cdot M}{d}\\ \mathbf{elif}\;D \leq 1.6 \cdot 10^{-169}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 4.2 \cdot 10^{+122}:\\ \;\;\;\;\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;\frac{c0}{w \cdot 2} \cdot \frac{0.5}{\frac{t_0 \cdot \frac{\frac{c0}{w}}{h}}{M \cdot M}}\\ \end{array} \]
Alternative 7
Accuracy35.2%
Cost1488
\[\begin{array}{l} \mathbf{if}\;D \leq -9.5 \cdot 10^{+217}:\\ \;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{h}}{w}\right)\\ \mathbf{elif}\;D \leq -9.8 \cdot 10^{-76}:\\ \;\;\;\;\frac{\left(0.25 \cdot D\right) \cdot \left(D \cdot h\right)}{d} \cdot \frac{M \cdot M}{d}\\ \mathbf{elif}\;D \leq 1.6 \cdot 10^{-169}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \leq 1.46 \cdot 10^{+113}:\\ \;\;\;\;\frac{0.25 \cdot \left(\left(D \cdot D\right) \cdot \left(M \cdot \left(M \cdot h\right)\right)\right)}{d \cdot d}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 8
Accuracy34.6%
Cost1480
\[\begin{array}{l} \mathbf{if}\;D \cdot D \leq 7 \cdot 10^{-224}:\\ \;\;\;\;0\\ \mathbf{elif}\;D \cdot D \leq 2.2 \cdot 10^{+112}:\\ \;\;\;\;0.25 \cdot \left(\left(M \cdot \left(M \cdot h\right)\right) \cdot \frac{D \cdot D}{d \cdot d}\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 9
Accuracy37.8%
Cost1480
\[\begin{array}{l} \mathbf{if}\;M \cdot M \leq 5 \cdot 10^{-292}:\\ \;\;\;\;0\\ \mathbf{elif}\;M \cdot M \leq 10^{+260}:\\ \;\;\;\;\frac{\left(0.25 \cdot D\right) \cdot \left(D \cdot h\right)}{d} \cdot \frac{M \cdot M}{d}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
Alternative 10
Accuracy33.2%
Cost64
\[0 \]

Error

Reproduce?

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