| Alternative 1 | |
|---|---|
| Accuracy | 64.3% |
| Cost | 7892 |
(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}
if D < -4.4e169Initial program 2.6%
Simplified3.0%
[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)
\] |
Taylor expanded in c0 around inf 1.9%
Simplified20.3%
[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)}}
\] |
Applied egg-rr26.0%
Applied egg-rr32.0%
if -4.4e169 < D < -5.0000000000000003e-115Initial program 14.6%
Simplified6.3%
[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)
\] |
Taylor expanded in c0 around -inf 12.9%
Simplified38.6%
[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)}
\] |
Taylor expanded in c0 around 0 49.9%
Simplified48.0%
[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}
\] |
Applied egg-rr64.1%
if -5.0000000000000003e-115 < D < 6.99999999999999978e-186 or 3.84999999999999997e52 < D < 6.0000000000000004e197Initial program 2.8%
Simplified1.3%
[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)
\] |
Taylor expanded in c0 around -inf 2.6%
Simplified43.1%
[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)}
\] |
Taylor expanded in c0 around 0 46.1%
Simplified46.9%
[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}
\] |
Applied egg-rr61.0%
Simplified68.6%
[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.84999999999999997e52Initial program 11.1%
Simplified10.3%
[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)
\] |
Applied egg-rr10.2%
Simplified11.4%
[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}}}
\] |
Taylor expanded in c0 around -inf 10.2%
Simplified39.8%
[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)
\] |
Taylor expanded in w around 0 60.4%
Applied egg-rr66.2%
if 6.0000000000000004e197 < D Initial program 1.8%
Taylor expanded in c0 around inf 1.9%
Simplified27.4%
[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)
\] |
Final simplification64.0%
| Alternative 1 | |
|---|---|
| Accuracy | 64.3% |
| Cost | 7892 |
| Alternative 2 | |
|---|---|
| Accuracy | 61.8% |
| Cost | 7696 |
| Alternative 3 | |
|---|---|
| Accuracy | 62.7% |
| Cost | 7692 |
| Alternative 4 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 7628 |
| Alternative 5 | |
|---|---|
| Accuracy | 62.0% |
| Cost | 1608 |
| Alternative 6 | |
|---|---|
| Accuracy | 55.1% |
| Cost | 1488 |
| Alternative 7 | |
|---|---|
| Accuracy | 62.1% |
| Cost | 1353 |
| Alternative 8 | |
|---|---|
| Accuracy | 60.7% |
| Cost | 1352 |
| Alternative 9 | |
|---|---|
| Accuracy | 61.8% |
| Cost | 1225 |
| Alternative 10 | |
|---|---|
| Accuracy | 57.6% |
| Cost | 1224 |
| Alternative 11 | |
|---|---|
| Accuracy | 61.4% |
| Cost | 1092 |
| Alternative 12 | |
|---|---|
| Accuracy | 50.6% |
| Cost | 64 |
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))))))