| Alternative 1 | |
|---|---|
| Error | 17.9 |
| Cost | 30284 |
(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 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_1 (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M))))))
(t_2 (* (/ (/ d D) (/ w c0)) (/ d (* D (* h (/ w c0))))))
(t_3 (* M (/ D d))))
(if (<= t_1 -2e-212)
t_2
(if (<= t_1 0.0)
(* 0.25 (* h (/ M (/ d (* D t_3)))))
(if (<= t_1 INFINITY)
t_2
(* 0.25 (* h (* (/ D d) (pow (cbrt (* M t_3)) 3.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 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_1 = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
double t_2 = ((d / D) / (w / c0)) * (d / (D * (h * (w / c0))));
double t_3 = M * (D / d);
double tmp;
if (t_1 <= -2e-212) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = 0.25 * (h * (M / (d / (D * t_3))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = 0.25 * (h * ((D / d) * pow(cbrt((M * t_3)), 3.0)));
}
return tmp;
}
public static 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))) + Math.sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_1 = (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
double t_2 = ((d / D) / (w / c0)) * (d / (D * (h * (w / c0))));
double t_3 = M * (D / d);
double tmp;
if (t_1 <= -2e-212) {
tmp = t_2;
} else if (t_1 <= 0.0) {
tmp = 0.25 * (h * (M / (d / (D * t_3))));
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_2;
} else {
tmp = 0.25 * (h * ((D / d) * Math.pow(Math.cbrt((M * t_3)), 3.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(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) t_2 = Float64(Float64(Float64(d / D) / Float64(w / c0)) * Float64(d / Float64(D * Float64(h * Float64(w / c0))))) t_3 = Float64(M * Float64(D / d)) tmp = 0.0 if (t_1 <= -2e-212) tmp = t_2; elseif (t_1 <= 0.0) tmp = Float64(0.25 * Float64(h * Float64(M / Float64(d / Float64(D * t_3))))); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(0.25 * Float64(h * Float64(Float64(D / d) * (cbrt(Float64(M * t_3)) ^ 3.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[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(d / D), $MachinePrecision] / N[(w / c0), $MachinePrecision]), $MachinePrecision] * N[(d / N[(D * N[(h * N[(w / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(M * N[(D / d), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-212], t$95$2, If[LessEqual[t$95$1, 0.0], N[(0.25 * N[(h * N[(M / N[(d / N[(D * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(0.25 * N[(h * N[(N[(D / d), $MachinePrecision] * N[Power[N[Power[N[(M * t$95$3), $MachinePrecision], 1/3], $MachinePrecision], 3.0], $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 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_1 := \frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)\\
t_2 := \frac{\frac{d}{D}}{\frac{w}{c0}} \cdot \frac{d}{D \cdot \left(h \cdot \frac{w}{c0}\right)}\\
t_3 := M \cdot \frac{D}{d}\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{-212}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 0:\\
\;\;\;\;0.25 \cdot \left(h \cdot \frac{M}{\frac{d}{D \cdot t_3}}\right)\\
\mathbf{elif}\;t_1 \leq \infty:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;0.25 \cdot \left(h \cdot \left(\frac{D}{d} \cdot {\left(\sqrt[3]{M \cdot t_3}\right)}^{3}\right)\right)\\
\end{array}
Results
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))))) < -1.99999999999999991e-212 or 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.0Initial program 48.0
Taylor expanded in c0 around inf 42.3
Simplified42.4
[Start]42.3 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)
\] |
|---|---|
associate-*r/ [=>]42.3 | \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{2} \cdot \left(w \cdot h\right)}}
\] |
*-commutative [=>]42.3 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\color{blue}{\left(w \cdot h\right) \cdot {D}^{2}}}
\] |
unpow2 [=>]42.3 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left({d}^{2} \cdot c0\right)}{\left(w \cdot h\right) \cdot \color{blue}{\left(D \cdot D\right)}}
\] |
*-commutative [=>]42.3 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \color{blue}{\left(c0 \cdot {d}^{2}\right)}}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}
\] |
unpow2 [=>]42.3 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \color{blue}{\left(d \cdot d\right)}\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}
\] |
associate-*r* [=>]38.4 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\color{blue}{\left(\left(w \cdot h\right) \cdot D\right) \cdot D}}
\] |
associate-*r* [<=]38.6 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\color{blue}{\left(w \cdot \left(h \cdot D\right)\right)} \cdot D}
\] |
*-commutative [<=]38.6 | \[ \frac{c0}{2 \cdot w} \cdot \frac{2 \cdot \left(c0 \cdot \left(d \cdot d\right)\right)}{\color{blue}{D \cdot \left(w \cdot \left(h \cdot D\right)\right)}}
\] |
associate-*r/ [<=]38.6 | \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(2 \cdot \frac{c0 \cdot \left(d \cdot d\right)}{D \cdot \left(w \cdot \left(h \cdot D\right)\right)}\right)}
\] |
associate-*r/ [<=]41.2 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\left(c0 \cdot \frac{d \cdot d}{D \cdot \left(w \cdot \left(h \cdot D\right)\right)}\right)}\right)
\] |
*-commutative [=>]41.2 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \frac{d \cdot d}{\color{blue}{\left(w \cdot \left(h \cdot D\right)\right) \cdot D}}\right)\right)
\] |
associate-*r* [=>]40.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \frac{d \cdot d}{\color{blue}{\left(\left(w \cdot h\right) \cdot D\right)} \cdot D}\right)\right)
\] |
associate-*r* [<=]43.9 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \frac{d \cdot d}{\color{blue}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}}\right)\right)
\] |
associate-/l/ [<=]45.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \color{blue}{\frac{\frac{d \cdot d}{D \cdot D}}{w \cdot h}}\right)\right)
\] |
associate-/r* [<=]43.9 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \color{blue}{\frac{d \cdot d}{\left(D \cdot D\right) \cdot \left(w \cdot h\right)}}\right)\right)
\] |
times-frac [=>]40.6 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \color{blue}{\left(\frac{d}{D \cdot D} \cdot \frac{d}{w \cdot h}\right)}\right)\right)
\] |
associate-/r* [=>]42.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(c0 \cdot \left(\frac{d}{D \cdot D} \cdot \color{blue}{\frac{\frac{d}{w}}{h}}\right)\right)\right)
\] |
Taylor expanded in c0 around 0 54.8
Simplified53.3
[Start]54.8 | \[ \frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}
\] |
|---|---|
times-frac [=>]55.1 | \[ \color{blue}{\frac{{d}^{2}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}}
\] |
unpow2 [=>]55.1 | \[ \frac{\color{blue}{d \cdot d}}{{D}^{2}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}
\] |
unpow2 [=>]55.1 | \[ \frac{d \cdot d}{\color{blue}{D \cdot D}} \cdot \frac{{c0}^{2}}{{w}^{2} \cdot h}
\] |
unpow2 [=>]55.1 | \[ \frac{d \cdot d}{D \cdot D} \cdot \frac{\color{blue}{c0 \cdot c0}}{{w}^{2} \cdot h}
\] |
unpow2 [=>]55.1 | \[ \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{\left(w \cdot w\right)} \cdot h}
\] |
associate-*l* [=>]53.3 | \[ \frac{d \cdot d}{D \cdot D} \cdot \frac{c0 \cdot c0}{\color{blue}{w \cdot \left(w \cdot h\right)}}
\] |
Applied egg-rr38.5
Applied egg-rr22.7
if -1.99999999999999991e-212 < (*.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.0Initial program 30.5
Simplified53.3
[Start]30.5 | \[ \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/ [<=]37.4 | \[ \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 [=>]37.4 | \[ \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 [=>]44.5 | \[ \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)}
\] |
times-frac [=>]48.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{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 [=>]48.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right)} - M \cdot M}\right)
\] |
swap-sqr [=>]55.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{c0}{w \cdot h}\right) \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right)} - M \cdot M}\right)
\] |
associate-*l* [=>]53.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\frac{c0}{w \cdot h} \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)} - M \cdot M}\right)
\] |
fma-neg [=>]53.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right), -M \cdot M\right)}}\right)
\] |
times-frac [=>]53.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{d \cdot d}{D \cdot D}\right), -M \cdot M\right)}\right)
\] |
associate-*l* [=>]53.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)}, -M \cdot M\right)}\right)
\] |
times-frac [=>]53.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)}\right)\right), -M \cdot M\right)}\right)
\] |
cube-unmult [=>]53.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{3}}\right), -M \cdot M\right)}\right)
\] |
Taylor expanded in c0 around -inf 29.3
Simplified24.9
[Start]29.3 | \[ \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 [=>]29.3 | \[ \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)}
\] |
*-commutative [=>]29.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{\left(w \cdot \left({M}^{2} \cdot h\right)\right) \cdot {D}^{2}}}{{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)
\] |
*-commutative [<=]29.3 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\left(w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right) \cdot {D}^{2}}{{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)
\] |
associate-/l* [=>]29.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{w \cdot \left(h \cdot {M}^{2}\right)}{\frac{{d}^{2} \cdot c0}{{D}^{2}}}}, -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)
\] |
unpow2 [=>]29.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}{\frac{{d}^{2} \cdot c0}{{D}^{2}}}, -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)
\] |
associate-/l* [=>]32.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{\frac{{d}^{2}}{\frac{{D}^{2}}{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)
\] |
associate-/r/ [=>]28.6 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{\frac{{d}^{2}}{{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)
\] |
unpow2 [=>]28.6 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{\color{blue}{d \cdot d}}{{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)
\] |
unpow2 [=>]28.6 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d \cdot d}{\color{blue}{D \cdot D}} \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)
\] |
times-frac [=>]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \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)
\] |
unpow2 [<=]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{{\left(\frac{d}{D}\right)}^{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)
\] |
mul-1-neg [=>]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, \color{blue}{-\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)
\] |
*-commutative [=>]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, -\color{blue}{c0 \cdot \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)}\right)
\] |
distribute-rgt-neg-in [=>]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, \color{blue}{c0 \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)\right)}\right)
\] |
distribute-rgt1-in [=>]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \left(-\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}\right)\right)
\] |
metadata-eval [=>]26.5 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \left(-\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)
\] |
mul0-lft [=>]24.9 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \left(-\color{blue}{0}\right)\right)
\] |
metadata-eval [=>]24.9 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \color{blue}{0}\right)
\] |
Taylor expanded in c0 around 0 24.6
Simplified19.6
[Start]24.6 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
|---|---|
*-commutative [<=]24.6 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{{d}^{2}}
\] |
associate-/l* [=>]24.7 | \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}}
\] |
unpow2 [=>]24.7 | \[ 0.25 \cdot \frac{{D}^{2}}{\frac{\color{blue}{d \cdot d}}{h \cdot {M}^{2}}}
\] |
unpow2 [=>]24.7 | \[ 0.25 \cdot \frac{{D}^{2}}{\frac{d \cdot d}{h \cdot \color{blue}{\left(M \cdot M\right)}}}
\] |
associate-/r/ [=>]24.5 | \[ 0.25 \cdot \color{blue}{\left(\frac{{D}^{2}}{d \cdot d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}
\] |
unpow2 [=>]24.5 | \[ 0.25 \cdot \left(\frac{\color{blue}{D \cdot D}}{d \cdot d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)
\] |
times-frac [=>]22.2 | \[ 0.25 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)
\] |
*-commutative [=>]22.2 | \[ 0.25 \cdot \color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)}
\] |
associate-*l* [=>]22.1 | \[ 0.25 \cdot \color{blue}{\left(h \cdot \left(\left(M \cdot M\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)}
\] |
associate-*r* [=>]19.6 | \[ 0.25 \cdot \left(h \cdot \color{blue}{\left(\left(\left(M \cdot M\right) \cdot \frac{D}{d}\right) \cdot \frac{D}{d}\right)}\right)
\] |
Applied egg-rr14.5
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))))) Initial program 64.0
Simplified63.8
[Start]64.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)
\] |
|---|---|
associate-*l/ [<=]64.0 | \[ \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 [=>]64.0 | \[ \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 [=>]64.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)}
\] |
times-frac [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{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 [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right) \cdot \color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\right)} - M \cdot M}\right)
\] |
swap-sqr [=>]63.9 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\left(\frac{c0}{w \cdot h} \cdot \frac{c0}{w \cdot h}\right) \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right)} - M \cdot M}\right)
\] |
associate-*l* [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\frac{c0}{w \cdot h} \cdot \left(\frac{c0}{w \cdot h} \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)} - M \cdot M}\right)
\] |
fma-neg [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d \cdot d}{D \cdot D} \cdot \frac{d \cdot d}{D \cdot D}\right), -M \cdot M\right)}}\right)
\] |
times-frac [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \cdot \frac{d \cdot d}{D \cdot D}\right), -M \cdot M\right)}\right)
\] |
associate-*l* [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \color{blue}{\left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \frac{d \cdot d}{D \cdot D}\right)\right)}, -M \cdot M\right)}\right)
\] |
times-frac [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \left(\frac{d}{D} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)}\right)\right), -M \cdot M\right)}\right)
\] |
cube-unmult [=>]63.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{c0}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{c0}{w \cdot h} \cdot \left(\frac{d}{D} \cdot \color{blue}{{\left(\frac{d}{D}\right)}^{3}}\right), -M \cdot M\right)}\right)
\] |
Taylor expanded in c0 around -inf 62.8
Simplified34.4
[Start]62.8 | \[ \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 [=>]62.8 | \[ \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)}
\] |
*-commutative [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\color{blue}{\left(w \cdot \left({M}^{2} \cdot h\right)\right) \cdot {D}^{2}}}{{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)
\] |
*-commutative [<=]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{\left(w \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}\right) \cdot {D}^{2}}{{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)
\] |
associate-/l* [=>]62.9 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \color{blue}{\frac{w \cdot \left(h \cdot {M}^{2}\right)}{\frac{{d}^{2} \cdot c0}{{D}^{2}}}}, -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)
\] |
unpow2 [=>]62.9 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right)}{\frac{{d}^{2} \cdot c0}{{D}^{2}}}, -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)
\] |
associate-/l* [=>]62.7 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{\frac{{d}^{2}}{\frac{{D}^{2}}{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)
\] |
associate-/r/ [=>]62.7 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{\frac{{d}^{2}}{{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)
\] |
unpow2 [=>]62.7 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{\color{blue}{d \cdot d}}{{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)
\] |
unpow2 [=>]62.7 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d \cdot d}{\color{blue}{D \cdot D}} \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)
\] |
times-frac [=>]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{\left(\frac{d}{D} \cdot \frac{d}{D}\right)} \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)
\] |
unpow2 [<=]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\color{blue}{{\left(\frac{d}{D}\right)}^{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)
\] |
mul-1-neg [=>]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, \color{blue}{-\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)
\] |
*-commutative [=>]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, -\color{blue}{c0 \cdot \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)}\right)
\] |
distribute-rgt-neg-in [=>]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, \color{blue}{c0 \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)\right)}\right)
\] |
distribute-rgt1-in [=>]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \left(-\color{blue}{\left(-1 + 1\right) \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}\right)\right)
\] |
metadata-eval [=>]62.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \left(-\color{blue}{0} \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right)
\] |
mul0-lft [=>]34.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \left(-\color{blue}{0}\right)\right)
\] |
metadata-eval [=>]34.4 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(0.5, \frac{w \cdot \left(h \cdot \left(M \cdot M\right)\right)}{{\left(\frac{d}{D}\right)}^{2} \cdot c0}, c0 \cdot \color{blue}{0}\right)
\] |
Taylor expanded in c0 around 0 34.6
Simplified23.2
[Start]34.6 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
|---|---|
*-commutative [<=]34.6 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{{d}^{2}}
\] |
associate-/l* [=>]34.6 | \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}}
\] |
unpow2 [=>]34.6 | \[ 0.25 \cdot \frac{{D}^{2}}{\frac{\color{blue}{d \cdot d}}{h \cdot {M}^{2}}}
\] |
unpow2 [=>]34.6 | \[ 0.25 \cdot \frac{{D}^{2}}{\frac{d \cdot d}{h \cdot \color{blue}{\left(M \cdot M\right)}}}
\] |
associate-/r/ [=>]34.7 | \[ 0.25 \cdot \color{blue}{\left(\frac{{D}^{2}}{d \cdot d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}
\] |
unpow2 [=>]34.7 | \[ 0.25 \cdot \left(\frac{\color{blue}{D \cdot D}}{d \cdot d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)
\] |
times-frac [=>]25.7 | \[ 0.25 \cdot \left(\color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)
\] |
*-commutative [=>]25.7 | \[ 0.25 \cdot \color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)}
\] |
associate-*l* [=>]24.9 | \[ 0.25 \cdot \color{blue}{\left(h \cdot \left(\left(M \cdot M\right) \cdot \left(\frac{D}{d} \cdot \frac{D}{d}\right)\right)\right)}
\] |
associate-*r* [=>]23.2 | \[ 0.25 \cdot \left(h \cdot \color{blue}{\left(\left(\left(M \cdot M\right) \cdot \frac{D}{d}\right) \cdot \frac{D}{d}\right)}\right)
\] |
Applied egg-rr16.9
Final simplification17.5
| Alternative 1 | |
|---|---|
| Error | 17.9 |
| Cost | 30284 |
| Alternative 2 | |
|---|---|
| Error | 23.7 |
| Cost | 1620 |
| Alternative 3 | |
|---|---|
| Error | 21.1 |
| Cost | 1480 |
| Alternative 4 | |
|---|---|
| Error | 20.6 |
| Cost | 1480 |
| Alternative 5 | |
|---|---|
| Error | 28.5 |
| Cost | 1225 |
| Alternative 6 | |
|---|---|
| Error | 21.3 |
| Cost | 1225 |
| Alternative 7 | |
|---|---|
| Error | 21.0 |
| Cost | 1224 |
| Alternative 8 | |
|---|---|
| Error | 20.7 |
| Cost | 1224 |
| Alternative 9 | |
|---|---|
| Error | 22.9 |
| Cost | 1224 |
| Alternative 10 | |
|---|---|
| Error | 26.7 |
| Cost | 1220 |
| Alternative 11 | |
|---|---|
| Error | 21.5 |
| Cost | 1220 |
| Alternative 12 | |
|---|---|
| Error | 21.8 |
| Cost | 960 |
| Alternative 13 | |
|---|---|
| Error | 32.0 |
| Cost | 64 |
herbie shell --seed 2023011
(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))))))