| Alternative 1 | |
|---|---|
| Accuracy | 68.3% |
| Cost | 43341 |
(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 (* w h)))
(t_1 (pow (/ d D) 2.0))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_3 (* (/ c0 (* 2.0 w)) (+ t_2 (sqrt (- (* t_2 t_2) (* M M)))))))
(if (<= t_3 -1e-212)
(/ 1.0 (/ (* 2.0 w) (* c0 (fma t_0 t_1 (hypot (* t_0 t_1) M)))))
(if (or (<= t_3 0.0) (not (<= t_3 INFINITY)))
(* 0.25 (* M (* M (* (/ D d) (* h (/ D d))))))
(exp
(log
(*
(/ (* 2.0 (* d (* c0 d))) (* D (* (* w h) D)))
(/ (* c0 0.5) 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 = c0 / (w * h);
double t_1 = pow((d / D), 2.0);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_3 = (c0 / (2.0 * w)) * (t_2 + sqrt(((t_2 * t_2) - (M * M))));
double tmp;
if (t_3 <= -1e-212) {
tmp = 1.0 / ((2.0 * w) / (c0 * fma(t_0, t_1, hypot((t_0 * t_1), M))));
} else if ((t_3 <= 0.0) || !(t_3 <= ((double) INFINITY))) {
tmp = 0.25 * (M * (M * ((D / d) * (h * (D / d)))));
} else {
tmp = exp(log((((2.0 * (d * (c0 * d))) / (D * ((w * h) * D))) * ((c0 * 0.5) / 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(c0 / Float64(w * h)) t_1 = Float64(d / D) ^ 2.0 t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_3 = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) tmp = 0.0 if (t_3 <= -1e-212) tmp = Float64(1.0 / Float64(Float64(2.0 * w) / Float64(c0 * fma(t_0, t_1, hypot(Float64(t_0 * t_1), M))))); elseif ((t_3 <= 0.0) || !(t_3 <= Inf)) tmp = Float64(0.25 * Float64(M * Float64(M * Float64(Float64(D / d) * Float64(h * Float64(D / d)))))); else tmp = exp(log(Float64(Float64(Float64(2.0 * Float64(d * Float64(c0 * d))) / Float64(D * Float64(Float64(w * h) * D))) * Float64(Float64(c0 * 0.5) / 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[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-212], N[(1.0 / N[(N[(2.0 * w), $MachinePrecision] / N[(c0 * N[(t$95$0 * t$95$1 + N[Sqrt[N[(t$95$0 * t$95$1), $MachinePrecision] ^ 2 + M ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$3, 0.0], N[Not[LessEqual[t$95$3, Infinity]], $MachinePrecision]], N[(0.25 * N[(M * N[(M * N[(N[(D / d), $MachinePrecision] * N[(h * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[Log[N[(N[(N[(2.0 * N[(d * N[(c0 * d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(D * N[(N[(w * h), $MachinePrecision] * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 * 0.5), $MachinePrecision] / w), $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}{w \cdot h}\\
t_1 := {\left(\frac{d}{D}\right)}^{2}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := \frac{c0}{2 \cdot w} \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{-212}:\\
\;\;\;\;\frac{1}{\frac{2 \cdot w}{c0 \cdot \mathsf{fma}\left(t_0, t_1, \mathsf{hypot}\left(t_0 \cdot t_1, M\right)\right)}}\\
\mathbf{elif}\;t_3 \leq 0 \lor \neg \left(t_3 \leq \infty\right):\\
\;\;\;\;0.25 \cdot \left(M \cdot \left(M \cdot \left(\frac{D}{d} \cdot \left(h \cdot \frac{D}{d}\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\log \left(\frac{2 \cdot \left(d \cdot \left(c0 \cdot d\right)\right)}{D \cdot \left(\left(w \cdot h\right) \cdot D\right)} \cdot \frac{c0 \cdot 0.5}{w}\right)}\\
\end{array}
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))))) < -9.99999999999999954e-213Initial program 21.9%
Simplified19.5%
[Start]21.9 | \[ \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)
\] |
|---|---|
times-frac [=>]18.1 | \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}} + \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-neg [=>]18.1 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\color{blue}{\mathsf{fma}\left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, -M \cdot M\right)}}\right)
\] |
times-frac [=>]18.1 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}}, \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}, -M \cdot M\right)}\right)
\] |
times-frac [=>]19.5 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \color{blue}{\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}}, -M \cdot M\right)}\right)
\] |
Applied egg-rr31.9%
[Start]19.5 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, -M \cdot M\right)}\right)
\] |
|---|---|
associate-*l/ [=>]18.8 | \[ \color{blue}{\frac{c0 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, -M \cdot M\right)}\right)}{2 \cdot w}}
\] |
clear-num [=>]18.8 | \[ \color{blue}{\frac{1}{\frac{2 \cdot w}{c0 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, -M \cdot M\right)}\right)}}}
\] |
*-commutative [=>]18.8 | \[ \frac{1}{\frac{\color{blue}{w \cdot 2}}{c0 \cdot \left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D} + \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, -M \cdot M\right)}\right)}}
\] |
fma-def [=>]18.8 | \[ \frac{1}{\frac{w \cdot 2}{c0 \cdot \color{blue}{\mathsf{fma}\left(\frac{c0}{w \cdot h}, \frac{d \cdot d}{D \cdot D}, \sqrt{\mathsf{fma}\left(\frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}, -M \cdot M\right)}\right)}}}
\] |
if -9.99999999999999954e-213 < (*.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.0 or +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 4.3%
Simplified1.8%
[Start]4.3 | \[ \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/ [<=]3.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 [=>]3.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 [=>]2.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)}
\] |
associate-*l* [=>]2.1 | \[ \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)
\] |
associate-/r* [=>]2.1 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \color{blue}{\frac{\frac{c0}{w}}{h \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* [=>]2.0 | \[ \frac{c0}{2 \cdot w} \cdot \mathsf{fma}\left(d \cdot d, \frac{\frac{c0}{w}}{\color{blue}{\left(h \cdot D\right) \cdot D}}, \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{\frac{c0}{w}}{\color{blue}{D \cdot \left(h \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 5.9%
Simplified50.2%
[Start]5.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 [=>]5.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 48.0%
Simplified48.0%
[Start]48.0 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
|---|---|
*-commutative [<=]48.0 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \color{blue}{\left(h \cdot {M}^{2}\right)}}{{d}^{2}}
\] |
associate-/l* [=>]48.0 | \[ 0.25 \cdot \color{blue}{\frac{{D}^{2}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}}
\] |
unpow2 [=>]48.0 | \[ 0.25 \cdot \frac{\color{blue}{D \cdot D}}{\frac{{d}^{2}}{h \cdot {M}^{2}}}
\] |
unpow2 [=>]48.0 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{d \cdot d}}{h \cdot {M}^{2}}}
\] |
unpow2 [=>]48.0 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \color{blue}{\left(M \cdot M\right)}}}
\] |
associate-/r* [=>]48.0 | \[ 0.25 \cdot \frac{D \cdot D}{\color{blue}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}
\] |
Applied egg-rr56.4%
[Start]48.0 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}
\] |
|---|---|
add-cube-cbrt [=>]47.9 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{\left(\sqrt[3]{\frac{d \cdot d}{h}} \cdot \sqrt[3]{\frac{d \cdot d}{h}}\right) \cdot \sqrt[3]{\frac{d \cdot d}{h}}}}{M \cdot M}}
\] |
times-frac [=>]52.7 | \[ 0.25 \cdot \frac{D \cdot D}{\color{blue}{\frac{\sqrt[3]{\frac{d \cdot d}{h}} \cdot \sqrt[3]{\frac{d \cdot d}{h}}}{M} \cdot \frac{\sqrt[3]{\frac{d \cdot d}{h}}}{M}}}
\] |
pow2 [=>]52.7 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{\color{blue}{{\left(\sqrt[3]{\frac{d \cdot d}{h}}\right)}^{2}}}{M} \cdot \frac{\sqrt[3]{\frac{d \cdot d}{h}}}{M}}
\] |
associate-/l* [=>]52.7 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{{\left(\sqrt[3]{\color{blue}{\frac{d}{\frac{h}{d}}}}\right)}^{2}}{M} \cdot \frac{\sqrt[3]{\frac{d \cdot d}{h}}}{M}}
\] |
associate-/r/ [=>]52.7 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{{\left(\sqrt[3]{\color{blue}{\frac{d}{h} \cdot d}}\right)}^{2}}{M} \cdot \frac{\sqrt[3]{\frac{d \cdot d}{h}}}{M}}
\] |
associate-/l* [=>]56.4 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{{\left(\sqrt[3]{\frac{d}{h} \cdot d}\right)}^{2}}{M} \cdot \frac{\sqrt[3]{\color{blue}{\frac{d}{\frac{h}{d}}}}}{M}}
\] |
associate-/r/ [=>]56.4 | \[ 0.25 \cdot \frac{D \cdot D}{\frac{{\left(\sqrt[3]{\frac{d}{h} \cdot d}\right)}^{2}}{M} \cdot \frac{\sqrt[3]{\color{blue}{\frac{d}{h} \cdot d}}}{M}}
\] |
Taylor expanded in D around 0 48.0%
Simplified72.5%
[Start]48.0 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \left(h \cdot {M}^{2}\right)}{{d}^{2}}
\] |
|---|---|
*-commutative [<=]48.0 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \color{blue}{\left({M}^{2} \cdot h\right)}}{{d}^{2}}
\] |
unpow2 [=>]48.0 | \[ 0.25 \cdot \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
unpow2 [=>]48.0 | \[ 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(\color{blue}{\left(M \cdot M\right)} \cdot h\right)}{{d}^{2}}
\] |
associate-*r* [=>]48.9 | \[ 0.25 \cdot \frac{\color{blue}{\left(\left(D \cdot D\right) \cdot \left(M \cdot M\right)\right) \cdot h}}{{d}^{2}}
\] |
associate-/l* [=>]48.1 | \[ 0.25 \cdot \color{blue}{\frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{{d}^{2}}{h}}}
\] |
unpow2 [=>]48.1 | \[ 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\frac{\color{blue}{d \cdot d}}{h}}
\] |
associate-*r/ [<=]51.2 | \[ 0.25 \cdot \frac{\left(D \cdot D\right) \cdot \left(M \cdot M\right)}{\color{blue}{d \cdot \frac{d}{h}}}
\] |
*-commutative [=>]51.2 | \[ 0.25 \cdot \frac{\color{blue}{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}}{d \cdot \frac{d}{h}}
\] |
associate-*r/ [<=]51.3 | \[ 0.25 \cdot \color{blue}{\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{d \cdot \frac{d}{h}}\right)}
\] |
associate-*l* [=>]56.7 | \[ 0.25 \cdot \color{blue}{\left(M \cdot \left(M \cdot \frac{D \cdot D}{d \cdot \frac{d}{h}}\right)\right)}
\] |
times-frac [=>]69.5 | \[ 0.25 \cdot \left(M \cdot \left(M \cdot \color{blue}{\left(\frac{D}{d} \cdot \frac{D}{\frac{d}{h}}\right)}\right)\right)
\] |
associate-/r/ [=>]72.5 | \[ 0.25 \cdot \left(M \cdot \left(M \cdot \left(\frac{D}{d} \cdot \color{blue}{\left(\frac{D}{d} \cdot h\right)}\right)\right)\right)
\] |
if -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 23.7%
Applied egg-rr23.9%
[Start]23.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)
\] |
|---|---|
add-exp-log [=>]22.1 | \[ \color{blue}{e^{\log \left(\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)\right)}}
\] |
*-commutative [=>]22.1 | \[ e^{\log \color{blue}{\left(\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) \cdot \frac{c0}{2 \cdot w}\right)}}
\] |
Taylor expanded in c0 around inf 32.0%
Simplified44.2%
[Start]32.0 | \[ e^{\log \left(\left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right) \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
|---|---|
associate-*r/ [=>]32.0 | \[ e^{\log \left(\color{blue}{\frac{2 \cdot \left({d}^{2} \cdot c0\right)}{{D}^{2} \cdot \left(w \cdot h\right)}} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
unpow2 [=>]32.0 | \[ e^{\log \left(\frac{2 \cdot \left(\color{blue}{\left(d \cdot d\right)} \cdot c0\right)}{{D}^{2} \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
associate-*l* [=>]39.3 | \[ e^{\log \left(\frac{2 \cdot \color{blue}{\left(d \cdot \left(d \cdot c0\right)\right)}}{{D}^{2} \cdot \left(w \cdot h\right)} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
*-commutative [<=]39.3 | \[ e^{\log \left(\frac{2 \cdot \left(d \cdot \left(d \cdot c0\right)\right)}{{D}^{2} \cdot \color{blue}{\left(h \cdot w\right)}} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
unpow2 [=>]39.3 | \[ e^{\log \left(\frac{2 \cdot \left(d \cdot \left(d \cdot c0\right)\right)}{\color{blue}{\left(D \cdot D\right)} \cdot \left(h \cdot w\right)} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
associate-*l* [=>]44.2 | \[ e^{\log \left(\frac{2 \cdot \left(d \cdot \left(d \cdot c0\right)\right)}{\color{blue}{D \cdot \left(D \cdot \left(h \cdot w\right)\right)}} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
*-commutative [=>]44.2 | \[ e^{\log \left(\frac{2 \cdot \left(d \cdot \left(d \cdot c0\right)\right)}{D \cdot \left(D \cdot \color{blue}{\left(w \cdot h\right)}\right)} \cdot \frac{c0 \cdot 0.5}{w}\right)}
\] |
Final simplification68.2%
| Alternative 1 | |
|---|---|
| Accuracy | 68.3% |
| Cost | 43341 |
| Alternative 2 | |
|---|---|
| Accuracy | 68.6% |
| Cost | 43341 |
| Alternative 3 | |
|---|---|
| Accuracy | 68.6% |
| Cost | 43341 |
| Alternative 4 | |
|---|---|
| Accuracy | 68.2% |
| Cost | 43341 |
| Alternative 5 | |
|---|---|
| Accuracy | 67.7% |
| Cost | 30541 |
| Alternative 6 | |
|---|---|
| Accuracy | 62.2% |
| Cost | 1481 |
| Alternative 7 | |
|---|---|
| Accuracy | 66.1% |
| Cost | 1481 |
| Alternative 8 | |
|---|---|
| Accuracy | 53.6% |
| Cost | 1480 |
| Alternative 9 | |
|---|---|
| Accuracy | 55.9% |
| Cost | 1480 |
| Alternative 10 | |
|---|---|
| Accuracy | 59.8% |
| Cost | 1224 |
| Alternative 11 | |
|---|---|
| Accuracy | 59.8% |
| Cost | 960 |
| Alternative 12 | |
|---|---|
| Accuracy | 49.8% |
| Cost | 64 |
herbie shell --seed 2023131
(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))))))