| Alternative 1 | |
|---|---|
| Accuracy | 45.9% |
| Cost | 8152 |

(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 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M M))))) INFINITY)
(* t_0 (* 2.0 (/ (* d (* (/ c0 w) (/ d (* h D)))) D)))
(fma 0.25 (/ (* (/ D d) (* h (* M M))) (/ d D)) 0.0))))double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * (((c0 * (d * d)) / ((w * h) * (D * D))) + sqrt(((((c0 * (d * d)) / ((w * h) * (D * D))) * ((c0 * (d * d)) / ((w * h) * (D * D)))) - (M * M))));
}
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * ((d * ((c0 / w) * (d / (h * D)))) / D));
} else {
tmp = fma(0.25, (((D / d) * (h * (M * M))) / (d / D)), 0.0);
}
return tmp;
}
function code(c0, w, h, D, d, M) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) + sqrt(Float64(Float64(Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) * Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D)))) - Float64(M * M))))) end
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M * M))))) <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(d * Float64(Float64(c0 / w) * Float64(d / Float64(h * D)))) / D))); else tmp = fma(0.25, Float64(Float64(Float64(D / d) * Float64(h * Float64(M * M))) / Float64(d / D)), 0.0); end return tmp end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Sqrt[N[(N[(N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(2.0 * N[(N[(d * N[(N[(c0 / w), $MachinePrecision] * N[(d / N[(h * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.25 * N[(N[(N[(D / d), $MachinePrecision] * N[(h * N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(d / D), $MachinePrecision]), $MachinePrecision] + 0.0), $MachinePrecision]]]]
\frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t_0 \cdot \left(t_1 + \sqrt{t_1 \cdot t_1 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_0 \cdot \left(2 \cdot \frac{d \cdot \left(\frac{c0}{w} \cdot \frac{d}{h \cdot D}\right)}{D}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.25, \frac{\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)}{\frac{d}{D}}, 0\right)\\
\end{array}
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
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))))) < +inf.0Initial program 69.5%
Taylor expanded in c0 around inf 72.3%
Simplified69.4%
[Start]72.3 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)
\] |
|---|---|
unpow2 [=>]72.3 | \[ \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* [=>]70.8 | \[ \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 [=>]70.8 | \[ \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 [=>]70.8 | \[ \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 [<=]70.8 | \[ \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/ [<=]69.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/ [=>]72.3 | \[ \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* [=>]72.3 | \[ \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/ [=>]73.4 | \[ \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* [<=]72.2 | \[ \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* [<=]74.5 | \[ \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/ [<=]71.9 | \[ \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/ [=>]71.9 | \[ \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 [=>]71.9 | \[ \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/ [<=]66.9 | \[ \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/ [<=]66.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 [=>]69.4 | \[ \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)
\] |
Applied egg-rr81.7%
[Start]69.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{c0}{w} \cdot \left(\frac{\frac{d}{D}}{h} \cdot \frac{d}{D}\right)\right)\right)
\] |
|---|---|
associate-*r* [=>]79.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\left(\left(\frac{c0}{w} \cdot \frac{\frac{d}{D}}{h}\right) \cdot \frac{d}{D}\right)}\right)
\] |
associate-*r/ [=>]79.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\frac{\left(\frac{c0}{w} \cdot \frac{\frac{d}{D}}{h}\right) \cdot d}{D}}\right)
\] |
div-inv [=>]79.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\left(\frac{c0}{w} \cdot \color{blue}{\left(\frac{d}{D} \cdot \frac{1}{h}\right)}\right) \cdot d}{D}\right)
\] |
frac-times [=>]81.7 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\left(\frac{c0}{w} \cdot \color{blue}{\frac{d \cdot 1}{D \cdot h}}\right) \cdot d}{D}\right)
\] |
*-commutative [<=]81.7 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\left(\frac{c0}{w} \cdot \frac{\color{blue}{1 \cdot d}}{D \cdot h}\right) \cdot d}{D}\right)
\] |
*-un-lft-identity [<=]81.7 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\left(\frac{c0}{w} \cdot \frac{\color{blue}{d}}{D \cdot h}\right) \cdot d}{D}\right)
\] |
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 0.0%
Applied egg-rr0.6%
[Start]0.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\] |
|---|---|
associate-*r* [=>]0.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{\color{blue}{\left(c0 \cdot d\right) \cdot d}}{\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)
\] |
*-un-lft-identity [=>]0.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{\left(c0 \cdot d\right) \cdot d}{\color{blue}{1 \cdot \left(\left(w \cdot h\right) \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)
\] |
times-frac [=>]0.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0 \cdot d}{1} \cdot \frac{d}{\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* [=>]0.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot d}{1} \cdot \frac{d}{\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)
\] |
associate-*r* [=>]0.6 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot d}{1} \cdot \frac{d}{w \cdot \color{blue}{\left(\left(h \cdot D\right) \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 0.6%
Simplified36.3%
[Start]0.6 | \[ -0.5 \cdot \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w} + 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
|---|---|
+-commutative [=>]0.6 | \[ \color{blue}{0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} + -0.5 \cdot \frac{\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot {c0}^{2}}{w}}
\] |
fma-def [=>]0.6 | \[ \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)}
\] |
associate-/l* [=>]0.6 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{{M}^{2} \cdot h}}}, -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 [<=]0.6 | \[ \mathsf{fma}\left(0.25, \frac{{D}^{2}}{\frac{{d}^{2}}{\color{blue}{h \cdot {M}^{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)
\] |
associate-/r/ [=>]0.6 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{{D}^{2}}{{d}^{2}} \cdot \left(h \cdot {M}^{2}\right)}, -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 [=>]0.6 | \[ \mathsf{fma}\left(0.25, \frac{\color{blue}{D \cdot D}}{{d}^{2}} \cdot \left(h \cdot {M}^{2}\right), -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 [=>]0.6 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\color{blue}{d \cdot d}} \cdot \left(h \cdot {M}^{2}\right), -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 [=>]0.0 | \[ \mathsf{fma}\left(0.25, \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{d}\right)} \cdot \left(h \cdot {M}^{2}\right), -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 [=>]0.0 | \[ \mathsf{fma}\left(0.25, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \color{blue}{\left(M \cdot M\right)}\right), -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/ [=>]0.0 | \[ \mathsf{fma}\left(0.25, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right), \color{blue}{\frac{-0.5 \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}^{2}\right)}{w}}\right)
\] |
Applied egg-rr37.8%
[Start]36.3 | \[ \mathsf{fma}\left(0.25, \left(\frac{D}{d} \cdot \frac{D}{d}\right) \cdot \left(h \cdot \left(M \cdot M\right)\right), \frac{0}{\frac{\frac{w}{c0}}{c0}}\right)
\] |
|---|---|
associate-*l* [=>]37.8 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{D}{d} \cdot \left(\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}, \frac{0}{\frac{\frac{w}{c0}}{c0}}\right)
\] |
clear-num [=>]37.8 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{1}{\frac{d}{D}}} \cdot \left(\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right), \frac{0}{\frac{\frac{w}{c0}}{c0}}\right)
\] |
associate-*l/ [=>]37.8 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{1 \cdot \left(\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)\right)}{\frac{d}{D}}}, \frac{0}{\frac{\frac{w}{c0}}{c0}}\right)
\] |
*-un-lft-identity [<=]37.8 | \[ \mathsf{fma}\left(0.25, \frac{\color{blue}{\frac{D}{d} \cdot \left(h \cdot \left(M \cdot M\right)\right)}}{\frac{d}{D}}, \frac{0}{\frac{\frac{w}{c0}}{c0}}\right)
\] |
Taylor expanded in w around 0 59.4%
Final simplification66.2%
| Alternative 1 | |
|---|---|
| Accuracy | 45.9% |
| Cost | 8152 |
| Alternative 2 | |
|---|---|
| Accuracy | 46.6% |
| Cost | 1476 |
| Alternative 3 | |
|---|---|
| Accuracy | 46.3% |
| Cost | 1353 |
| Alternative 4 | |
|---|---|
| Accuracy | 45.5% |
| Cost | 1352 |
| Alternative 5 | |
|---|---|
| Accuracy | 45.1% |
| Cost | 1352 |
| Alternative 6 | |
|---|---|
| Accuracy | 46.2% |
| Cost | 1352 |
| Alternative 7 | |
|---|---|
| Accuracy | 33.2% |
| Cost | 64 |
herbie shell --seed 2023161
(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))))))