| Alternative 1 | |
|---|---|
| Accuracy | 44.8% |
| Cost | 8009 |
(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}
if c0 < -6.50000000000000027e84 or 3.5000000000000001e72 < c0 Initial program 2.7%
Simplified2.7%
[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)
\] |
Applied egg-rr4.8%
[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)}
\] |
Simplified3.7%
[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)
\] |
Taylor expanded in c0 around -inf 2.5%
Simplified13.9%
[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)}
\] |
Taylor expanded in c0 around 0 36.7%
Applied egg-rr44.9%
[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.5000000000000001e72Initial program 5.2%
Simplified6.5%
[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)
\] |
Applied egg-rr10.6%
[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)}
\] |
Simplified10.6%
[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)
\] |
Taylor expanded in c0 around -inf 4.9%
Simplified50.3%
[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)}
\] |
Applied egg-rr52.3%
[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)
\] |
Taylor expanded in h around 0 48.8%
Simplified55.0%
[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)
\] |
Final simplification50.9%
| Alternative 1 | |
|---|---|
| Accuracy | 44.8% |
| Cost | 8009 |
| Alternative 2 | |
|---|---|
| Accuracy | 38.9% |
| Cost | 7753 |
| Alternative 3 | |
|---|---|
| Accuracy | 44.5% |
| Cost | 7488 |
| Alternative 4 | |
|---|---|
| Accuracy | 45.0% |
| Cost | 7488 |
| Alternative 5 | |
|---|---|
| Accuracy | 38.9% |
| Cost | 7168 |
| Alternative 6 | |
|---|---|
| Accuracy | 35.2% |
| Cost | 2128 |
| Alternative 7 | |
|---|---|
| Accuracy | 35.2% |
| Cost | 1488 |
| Alternative 8 | |
|---|---|
| Accuracy | 34.6% |
| Cost | 1480 |
| Alternative 9 | |
|---|---|
| Accuracy | 37.8% |
| Cost | 1480 |
| Alternative 10 | |
|---|---|
| Accuracy | 33.2% |
| Cost | 64 |
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))))))