| Alternative 1 | |
|---|---|
| Accuracy | 67.2% |
| Cost | 8264 |
(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 (/ (* M D) d)))
(if (<= h 1.5e-292)
(* h (* (* t_0 t_0) 0.25))
(pow (* (sqrt h) (* t_0 0.5)) 2.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 = (M * D) / d;
double tmp;
if (h <= 1.5e-292) {
tmp = h * ((t_0 * t_0) * 0.25);
} else {
tmp = pow((sqrt(h) * (t_0 * 0.5)), 2.0);
}
return tmp;
}
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
code = (c0 / (2.0d0 * w)) * (((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) + sqrt(((((c0 * (d_1 * d_1)) / ((w * h) * (d * d))) * ((c0 * (d_1 * d_1)) / ((w * h) * (d * d)))) - (m * m))))
end function
real(8) function code(c0, w, h, d, d_1, m)
real(8), intent (in) :: c0
real(8), intent (in) :: w
real(8), intent (in) :: h
real(8), intent (in) :: d
real(8), intent (in) :: d_1
real(8), intent (in) :: m
real(8) :: t_0
real(8) :: tmp
t_0 = (m * d) / d_1
if (h <= 1.5d-292) then
tmp = h * ((t_0 * t_0) * 0.25d0)
else
tmp = (sqrt(h) * (t_0 * 0.5d0)) ** 2.0d0
end if
code = tmp
end function
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 = (M * D) / d;
double tmp;
if (h <= 1.5e-292) {
tmp = h * ((t_0 * t_0) * 0.25);
} else {
tmp = Math.pow((Math.sqrt(h) * (t_0 * 0.5)), 2.0);
}
return tmp;
}
def code(c0, w, h, D, d, 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))))
def code(c0, w, h, D, d, M): t_0 = (M * D) / d tmp = 0 if h <= 1.5e-292: tmp = h * ((t_0 * t_0) * 0.25) else: tmp = math.pow((math.sqrt(h) * (t_0 * 0.5)), 2.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(M * D) / d) tmp = 0.0 if (h <= 1.5e-292) tmp = Float64(h * Float64(Float64(t_0 * t_0) * 0.25)); else tmp = Float64(sqrt(h) * Float64(t_0 * 0.5)) ^ 2.0; end return tmp end
function tmp = code(c0, w, h, D, d, M) tmp = (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)))); end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (M * D) / d; tmp = 0.0; if (h <= 1.5e-292) tmp = h * ((t_0 * t_0) * 0.25); else tmp = (sqrt(h) * (t_0 * 0.5)) ^ 2.0; end tmp_2 = 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[(M * D), $MachinePrecision] / d), $MachinePrecision]}, If[LessEqual[h, 1.5e-292], N[(h * N[(N[(t$95$0 * t$95$0), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[h], $MachinePrecision] * N[(t$95$0 * 0.5), $MachinePrecision]), $MachinePrecision], 2.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{M \cdot D}{d}\\
\mathbf{if}\;h \leq 1.5 \cdot 10^{-292}:\\
\;\;\;\;h \cdot \left(\left(t_0 \cdot t_0\right) \cdot 0.25\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{h} \cdot \left(t_0 \cdot 0.5\right)\right)}^{2}\\
\end{array}
Results
if h < 1.50000000000000008e-292Initial program 7.1%
Simplified7.1%
[Start]7.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* [=>]5.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 [=>]5.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* [=>]5.9 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right)
\] |
associate-*l* [=>]7.1 | \[ \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-rr11.5%
[Start]7.1 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right)
\] |
|---|---|
*-commutative [=>]7.1 | \[ \color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right) \cdot \frac{c0}{2 \cdot w}}
\] |
clear-num [=>]7.1 | \[ \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right) \cdot \color{blue}{\frac{1}{\frac{2 \cdot w}{c0}}}
\] |
un-div-inv [=>]7.1 | \[ \color{blue}{\frac{\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}}{\frac{2 \cdot w}{c0}}}
\] |
Taylor expanded in c0 around -inf 5.6%
Simplified43.4%
[Start]5.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 [=>]5.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 [=>]5.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)}
\] |
unpow2 [=>]5.6 | \[ \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)
\] |
associate-/l* [=>]5.5 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{{D}^{2}}{\frac{d \cdot d}{{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)
\] |
unpow2 [=>]5.5 | \[ \mathsf{fma}\left(0.25, \frac{\color{blue}{D \cdot D}}{\frac{d \cdot d}{{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 [<=]5.5 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\frac{d \cdot d}{\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)
\] |
unpow2 [=>]5.5 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \color{blue}{\left(M \cdot M\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-/l* [=>]5.1 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}, -0.5 \cdot \color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}{\frac{w}{{c0}^{2}}}}\right)
\] |
Taylor expanded in D around 0 43.3%
Simplified43.8%
[Start]43.3 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
|---|---|
*-commutative [=>]43.3 | \[ \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \cdot 0.25}
\] |
unpow2 [=>]43.3 | \[ \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \cdot 0.25
\] |
unpow2 [=>]43.3 | \[ \frac{\left(D \cdot D\right) \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{d \cdot d}} \cdot 0.25
\] |
*-commutative [=>]43.3 | \[ \frac{\color{blue}{\left({M}^{2} \cdot h\right) \cdot \left(D \cdot D\right)}}{d \cdot d} \cdot 0.25
\] |
unpow2 [=>]43.3 | \[ \frac{\left(\color{blue}{\left(M \cdot M\right)} \cdot h\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25
\] |
*-commutative [<=]43.3 | \[ \frac{\color{blue}{\left(h \cdot \left(M \cdot M\right)\right)} \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25
\] |
associate-*r/ [<=]43.4 | \[ \color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot D}{d \cdot d}\right)} \cdot 0.25
\] |
associate-*l* [=>]44.1 | \[ \color{blue}{\left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{d \cdot d}\right)\right)} \cdot 0.25
\] |
*-commutative [<=]44.1 | \[ \left(h \cdot \color{blue}{\left(\frac{D \cdot D}{d \cdot d} \cdot \left(M \cdot M\right)\right)}\right) \cdot 0.25
\] |
associate-*l* [=>]44.1 | \[ \color{blue}{h \cdot \left(\left(\frac{D \cdot D}{d \cdot d} \cdot \left(M \cdot M\right)\right) \cdot 0.25\right)}
\] |
*-commutative [=>]44.1 | \[ h \cdot \left(\color{blue}{\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{d \cdot d}\right)} \cdot 0.25\right)
\] |
associate-*r/ [=>]43.8 | \[ h \cdot \left(\color{blue}{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}} \cdot 0.25\right)
\] |
Applied egg-rr68.1%
[Start]43.8 | \[ h \cdot \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right)
\] |
|---|---|
add-sqr-sqrt [=>]43.8 | \[ h \cdot \left(\color{blue}{\left(\sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right)} \cdot 0.25\right)
\] |
sqrt-div [=>]43.8 | \[ h \cdot \left(\left(\color{blue}{\frac{\sqrt{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}}{\sqrt{d \cdot d}}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]43.8 | \[ h \cdot \left(\left(\frac{\color{blue}{\sqrt{M \cdot M} \cdot \sqrt{D \cdot D}}}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]21.8 | \[ h \cdot \left(\left(\frac{\color{blue}{\left(\sqrt{M} \cdot \sqrt{M}\right)} \cdot \sqrt{D \cdot D}}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
add-sqr-sqrt [<=]41.7 | \[ h \cdot \left(\left(\frac{\color{blue}{M} \cdot \sqrt{D \cdot D}}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]20.4 | \[ h \cdot \left(\left(\frac{M \cdot \color{blue}{\left(\sqrt{D} \cdot \sqrt{D}\right)}}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
add-sqr-sqrt [<=]42.0 | \[ h \cdot \left(\left(\frac{M \cdot \color{blue}{D}}{\sqrt{d \cdot d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]21.1 | \[ h \cdot \left(\left(\frac{M \cdot D}{\color{blue}{\sqrt{d} \cdot \sqrt{d}}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
add-sqr-sqrt [<=]41.8 | \[ h \cdot \left(\left(\frac{M \cdot D}{\color{blue}{d}} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-div [=>]41.8 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \color{blue}{\frac{\sqrt{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}}{\sqrt{d \cdot d}}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]42.4 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{\color{blue}{\sqrt{M \cdot M} \cdot \sqrt{D \cdot D}}}{\sqrt{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]23.6 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{\color{blue}{\left(\sqrt{M} \cdot \sqrt{M}\right)} \cdot \sqrt{D \cdot D}}{\sqrt{d \cdot d}}\right) \cdot 0.25\right)
\] |
add-sqr-sqrt [<=]47.1 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{\color{blue}{M} \cdot \sqrt{D \cdot D}}{\sqrt{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]26.5 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot \color{blue}{\left(\sqrt{D} \cdot \sqrt{D}\right)}}{\sqrt{d \cdot d}}\right) \cdot 0.25\right)
\] |
add-sqr-sqrt [<=]52.6 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot \color{blue}{D}}{\sqrt{d \cdot d}}\right) \cdot 0.25\right)
\] |
sqrt-prod [=>]34.3 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}\right) \cdot 0.25\right)
\] |
add-sqr-sqrt [<=]68.1 | \[ h \cdot \left(\left(\frac{M \cdot D}{d} \cdot \frac{M \cdot D}{\color{blue}{d}}\right) \cdot 0.25\right)
\] |
if 1.50000000000000008e-292 < h Initial program 8.3%
Simplified8.0%
[Start]8.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* [=>]6.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 [=>]6.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* [=>]6.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{\color{blue}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M\right)}\right)
\] |
associate-*l* [=>]8.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)
\] |
Applied egg-rr12.0%
[Start]8.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)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right)
\] |
|---|---|
*-commutative [=>]8.0 | \[ \color{blue}{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right) \cdot \frac{c0}{2 \cdot w}}
\] |
clear-num [=>]8.0 | \[ \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}\right) \cdot \color{blue}{\frac{1}{\frac{2 \cdot w}{c0}}}
\] |
un-div-inv [=>]8.0 | \[ \color{blue}{\frac{\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + \sqrt{\left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} + M\right) \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)} - M\right)}}{\frac{2 \cdot w}{c0}}}
\] |
Taylor expanded in c0 around -inf 6.1%
Simplified45.5%
[Start]6.1 | \[ -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 [=>]6.1 | \[ \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 [=>]6.1 | \[ \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 [=>]6.1 | \[ \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)
\] |
associate-/l* [=>]6.0 | \[ \mathsf{fma}\left(0.25, \color{blue}{\frac{{D}^{2}}{\frac{d \cdot d}{{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)
\] |
unpow2 [=>]6.0 | \[ \mathsf{fma}\left(0.25, \frac{\color{blue}{D \cdot D}}{\frac{d \cdot d}{{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 [<=]6.0 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\frac{d \cdot d}{\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)
\] |
unpow2 [=>]6.0 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \color{blue}{\left(M \cdot M\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-/l* [=>]5.7 | \[ \mathsf{fma}\left(0.25, \frac{D \cdot D}{\frac{d \cdot d}{h \cdot \left(M \cdot M\right)}}, -0.5 \cdot \color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + -1 \cdot \frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}{\frac{w}{{c0}^{2}}}}\right)
\] |
Taylor expanded in D around 0 45.3%
Simplified45.7%
[Start]45.3 | \[ 0.25 \cdot \frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}}
\] |
|---|---|
*-commutative [=>]45.3 | \[ \color{blue}{\frac{{D}^{2} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \cdot 0.25}
\] |
unpow2 [=>]45.3 | \[ \frac{\color{blue}{\left(D \cdot D\right)} \cdot \left({M}^{2} \cdot h\right)}{{d}^{2}} \cdot 0.25
\] |
unpow2 [=>]45.3 | \[ \frac{\left(D \cdot D\right) \cdot \left({M}^{2} \cdot h\right)}{\color{blue}{d \cdot d}} \cdot 0.25
\] |
*-commutative [=>]45.3 | \[ \frac{\color{blue}{\left({M}^{2} \cdot h\right) \cdot \left(D \cdot D\right)}}{d \cdot d} \cdot 0.25
\] |
unpow2 [=>]45.3 | \[ \frac{\left(\color{blue}{\left(M \cdot M\right)} \cdot h\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25
\] |
*-commutative [<=]45.3 | \[ \frac{\color{blue}{\left(h \cdot \left(M \cdot M\right)\right)} \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25
\] |
associate-*r/ [<=]45.2 | \[ \color{blue}{\left(\left(h \cdot \left(M \cdot M\right)\right) \cdot \frac{D \cdot D}{d \cdot d}\right)} \cdot 0.25
\] |
associate-*l* [=>]45.8 | \[ \color{blue}{\left(h \cdot \left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{d \cdot d}\right)\right)} \cdot 0.25
\] |
*-commutative [<=]45.8 | \[ \left(h \cdot \color{blue}{\left(\frac{D \cdot D}{d \cdot d} \cdot \left(M \cdot M\right)\right)}\right) \cdot 0.25
\] |
associate-*l* [=>]45.8 | \[ \color{blue}{h \cdot \left(\left(\frac{D \cdot D}{d \cdot d} \cdot \left(M \cdot M\right)\right) \cdot 0.25\right)}
\] |
*-commutative [=>]45.8 | \[ h \cdot \left(\color{blue}{\left(\left(M \cdot M\right) \cdot \frac{D \cdot D}{d \cdot d}\right)} \cdot 0.25\right)
\] |
associate-*r/ [=>]45.7 | \[ h \cdot \left(\color{blue}{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}} \cdot 0.25\right)
\] |
Applied egg-rr73.3%
[Start]45.7 | \[ h \cdot \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right)
\] |
|---|---|
add-sqr-sqrt [=>]45.7 | \[ \color{blue}{\sqrt{h \cdot \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right)} \cdot \sqrt{h \cdot \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right)}}
\] |
pow2 [=>]45.7 | \[ \color{blue}{{\left(\sqrt{h \cdot \left(\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25\right)}\right)}^{2}}
\] |
sqrt-prod [=>]45.7 | \[ {\color{blue}{\left(\sqrt{h} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d} \cdot 0.25}\right)}}^{2}
\] |
*-commutative [=>]45.7 | \[ {\left(\sqrt{h} \cdot \sqrt{\color{blue}{0.25 \cdot \frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}}\right)}^{2}
\] |
sqrt-prod [=>]45.7 | \[ {\left(\sqrt{h} \cdot \color{blue}{\left(\sqrt{0.25} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right)}\right)}^{2}
\] |
metadata-eval [=>]45.7 | \[ {\left(\sqrt{h} \cdot \left(\color{blue}{0.5} \cdot \sqrt{\frac{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}{d \cdot d}}\right)\right)}^{2}
\] |
sqrt-div [=>]46.3 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \color{blue}{\frac{\sqrt{\left(M \cdot M\right) \cdot \left(D \cdot D\right)}}{\sqrt{d \cdot d}}}\right)\right)}^{2}
\] |
sqrt-prod [=>]47.3 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{\color{blue}{\sqrt{M \cdot M} \cdot \sqrt{D \cdot D}}}{\sqrt{d \cdot d}}\right)\right)}^{2}
\] |
sqrt-prod [=>]27.1 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{\color{blue}{\left(\sqrt{M} \cdot \sqrt{M}\right)} \cdot \sqrt{D \cdot D}}{\sqrt{d \cdot d}}\right)\right)}^{2}
\] |
add-sqr-sqrt [<=]53.5 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{\color{blue}{M} \cdot \sqrt{D \cdot D}}{\sqrt{d \cdot d}}\right)\right)}^{2}
\] |
sqrt-prod [=>]29.5 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{M \cdot \color{blue}{\left(\sqrt{D} \cdot \sqrt{D}\right)}}{\sqrt{d \cdot d}}\right)\right)}^{2}
\] |
add-sqr-sqrt [<=]61.9 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{M \cdot \color{blue}{D}}{\sqrt{d \cdot d}}\right)\right)}^{2}
\] |
sqrt-prod [=>]35.6 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{M \cdot D}{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}\right)\right)}^{2}
\] |
add-sqr-sqrt [<=]73.3 | \[ {\left(\sqrt{h} \cdot \left(0.5 \cdot \frac{M \cdot D}{\color{blue}{d}}\right)\right)}^{2}
\] |
Final simplification70.6%
| Alternative 1 | |
|---|---|
| Accuracy | 67.2% |
| Cost | 8264 |
| Alternative 2 | |
|---|---|
| Accuracy | 68.6% |
| Cost | 8264 |
| Alternative 3 | |
|---|---|
| Accuracy | 68.2% |
| Cost | 7752 |
| Alternative 4 | |
|---|---|
| Accuracy | 68.3% |
| Cost | 7688 |
| Alternative 5 | |
|---|---|
| Accuracy | 68.2% |
| Cost | 7432 |
| Alternative 6 | |
|---|---|
| Accuracy | 52.3% |
| Cost | 1489 |
| Alternative 7 | |
|---|---|
| Accuracy | 52.3% |
| Cost | 1488 |
| Alternative 8 | |
|---|---|
| Accuracy | 61.4% |
| Cost | 960 |
| Alternative 9 | |
|---|---|
| Accuracy | 68.5% |
| Cost | 960 |
| Alternative 10 | |
|---|---|
| Accuracy | 49.8% |
| Cost | 64 |
herbie shell --seed 2023151
(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))))))