| Alternative 1 | |
|---|---|
| Accuracy | 69.9% |
| Cost | 42636 |
(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 (if (<= h -5e-309) (* M (* (/ (* (* h M) (/ D d)) d) (* 0.25 D))) (pow (/ (* D 0.5) (/ (/ d (sqrt h)) M)) 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 tmp;
if (h <= -5e-309) {
tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D));
} else {
tmp = pow(((D * 0.5) / ((d / sqrt(h)) / M)), 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) :: tmp
if (h <= (-5d-309)) then
tmp = m * ((((h * m) * (d / d_1)) / d_1) * (0.25d0 * d))
else
tmp = ((d * 0.5d0) / ((d_1 / sqrt(h)) / m)) ** 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 tmp;
if (h <= -5e-309) {
tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D));
} else {
tmp = Math.pow(((D * 0.5) / ((d / Math.sqrt(h)) / M)), 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): tmp = 0 if h <= -5e-309: tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D)) else: tmp = math.pow(((D * 0.5) / ((d / math.sqrt(h)) / M)), 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) tmp = 0.0 if (h <= -5e-309) tmp = Float64(M * Float64(Float64(Float64(Float64(h * M) * Float64(D / d)) / d) * Float64(0.25 * D))); else tmp = Float64(Float64(D * 0.5) / Float64(Float64(d / sqrt(h)) / M)) ^ 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) tmp = 0.0; if (h <= -5e-309) tmp = M * ((((h * M) * (D / d)) / d) * (0.25 * D)); else tmp = ((D * 0.5) / ((d / sqrt(h)) / M)) ^ 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_] := If[LessEqual[h, -5e-309], N[(M * N[(N[(N[(N[(h * M), $MachinePrecision] * N[(D / d), $MachinePrecision]), $MachinePrecision] / d), $MachinePrecision] * N[(0.25 * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(D * 0.5), $MachinePrecision] / N[(N[(d / N[Sqrt[h], $MachinePrecision]), $MachinePrecision] / M), $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}
\mathbf{if}\;h \leq -5 \cdot 10^{-309}:\\
\;\;\;\;M \cdot \left(\frac{\left(h \cdot M\right) \cdot \frac{D}{d}}{d} \cdot \left(0.25 \cdot D\right)\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{D \cdot 0.5}{\frac{\frac{d}{\sqrt{h}}}{M}}\right)}^{2}\\
\end{array}
Results
if h < -4.9999999999999995e-309Initial program 6.8%
Simplified7.4%
[Start]6.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} + \sqrt{\frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} \cdot \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)} - M \cdot M}\right)
\] |
|---|---|
times-frac [=>]5.4 | \[ \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 [=>]5.4 | \[ \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 [=>]5.6 | \[ \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 [=>]7.4 | \[ \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)
\] |
Taylor expanded in c0 around -inf 5.1%
Simplified31.5%
[Start]5.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}}
\] |
|---|
Taylor expanded in w around 0 44.3%
Applied egg-rr56.1%
[Start]44.3 | \[ 0 + \frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}
\] |
|---|---|
associate-/r* [=>]48.6 | \[ 0 + \frac{0.25 \cdot \left(D \cdot D\right)}{\color{blue}{\frac{\frac{\frac{d \cdot d}{h}}{M}}{M}}}
\] |
associate-/r/ [=>]49.9 | \[ 0 + \color{blue}{\frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d \cdot d}{h}}{M}} \cdot M}
\] |
associate-*r* [=>]49.9 | \[ 0 + \frac{\color{blue}{\left(0.25 \cdot D\right) \cdot D}}{\frac{\frac{d \cdot d}{h}}{M}} \cdot M
\] |
*-commutative [=>]49.9 | \[ 0 + \frac{\color{blue}{D \cdot \left(0.25 \cdot D\right)}}{\frac{\frac{d \cdot d}{h}}{M}} \cdot M
\] |
associate-/l* [=>]53.3 | \[ 0 + \frac{D \cdot \left(0.25 \cdot D\right)}{\frac{\color{blue}{\frac{d}{\frac{h}{d}}}}{M}} \cdot M
\] |
associate-/l/ [=>]56.1 | \[ 0 + \frac{D \cdot \left(0.25 \cdot D\right)}{\color{blue}{\frac{d}{M \cdot \frac{h}{d}}}} \cdot M
\] |
Taylor expanded in D around 0 50.6%
Simplified66.1%
[Start]50.6 | \[ 0 + \left(0.25 \cdot \frac{{D}^{2} \cdot \left(M \cdot h\right)}{{d}^{2}}\right) \cdot M
\] |
|---|---|
associate-*r/ [=>]50.6 | \[ 0 + \color{blue}{\frac{0.25 \cdot \left({D}^{2} \cdot \left(M \cdot h\right)\right)}{{d}^{2}}} \cdot M
\] |
associate-*r* [=>]50.6 | \[ 0 + \frac{\color{blue}{\left(0.25 \cdot {D}^{2}\right) \cdot \left(M \cdot h\right)}}{{d}^{2}} \cdot M
\] |
*-commutative [<=]50.6 | \[ 0 + \frac{\color{blue}{\left({D}^{2} \cdot 0.25\right)} \cdot \left(M \cdot h\right)}{{d}^{2}} \cdot M
\] |
unpow2 [=>]50.6 | \[ 0 + \frac{\left(\color{blue}{\left(D \cdot D\right)} \cdot 0.25\right) \cdot \left(M \cdot h\right)}{{d}^{2}} \cdot M
\] |
associate-*r* [<=]50.6 | \[ 0 + \frac{\color{blue}{\left(D \cdot \left(D \cdot 0.25\right)\right)} \cdot \left(M \cdot h\right)}{{d}^{2}} \cdot M
\] |
*-commutative [=>]50.6 | \[ 0 + \frac{\color{blue}{\left(\left(D \cdot 0.25\right) \cdot D\right)} \cdot \left(M \cdot h\right)}{{d}^{2}} \cdot M
\] |
associate-*l* [=>]54.9 | \[ 0 + \frac{\color{blue}{\left(D \cdot 0.25\right) \cdot \left(D \cdot \left(M \cdot h\right)\right)}}{{d}^{2}} \cdot M
\] |
associate-*r/ [<=]57.3 | \[ 0 + \color{blue}{\left(\left(D \cdot 0.25\right) \cdot \frac{D \cdot \left(M \cdot h\right)}{{d}^{2}}\right)} \cdot M
\] |
*-commutative [=>]57.3 | \[ 0 + \left(\color{blue}{\left(0.25 \cdot D\right)} \cdot \frac{D \cdot \left(M \cdot h\right)}{{d}^{2}}\right) \cdot M
\] |
unpow2 [=>]57.3 | \[ 0 + \left(\left(0.25 \cdot D\right) \cdot \frac{D \cdot \left(M \cdot h\right)}{\color{blue}{d \cdot d}}\right) \cdot M
\] |
associate-/r* [=>]64.0 | \[ 0 + \left(\left(0.25 \cdot D\right) \cdot \color{blue}{\frac{\frac{D \cdot \left(M \cdot h\right)}{d}}{d}}\right) \cdot M
\] |
associate-*l/ [<=]66.1 | \[ 0 + \left(\left(0.25 \cdot D\right) \cdot \frac{\color{blue}{\frac{D}{d} \cdot \left(M \cdot h\right)}}{d}\right) \cdot M
\] |
*-commutative [=>]66.1 | \[ 0 + \left(\left(0.25 \cdot D\right) \cdot \frac{\color{blue}{\left(M \cdot h\right) \cdot \frac{D}{d}}}{d}\right) \cdot M
\] |
if -4.9999999999999995e-309 < h Initial program 7.1%
Simplified7.6%
[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)
\] |
|---|---|
times-frac [=>]5.4 | \[ \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 [=>]5.4 | \[ \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 [=>]5.8 | \[ \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 [=>]7.6 | \[ \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)
\] |
Taylor expanded in c0 around -inf 5.5%
Simplified31.6%
[Start]5.5 | \[ -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}}
\] |
|---|
Taylor expanded in w around 0 43.4%
Applied egg-rr71.8%
[Start]43.4 | \[ 0 + \frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}
\] |
|---|---|
add-sqr-sqrt [=>]43.4 | \[ 0 + \color{blue}{\sqrt{\frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}} \cdot \sqrt{\frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}}
\] |
pow2 [=>]43.4 | \[ 0 + \color{blue}{{\left(\sqrt{\frac{0.25 \cdot \left(D \cdot D\right)}{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2}}
\] |
sqrt-div [=>]43.4 | \[ 0 + {\color{blue}{\left(\frac{\sqrt{0.25 \cdot \left(D \cdot D\right)}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}}^{2}
\] |
*-commutative [=>]43.4 | \[ 0 + {\left(\frac{\sqrt{\color{blue}{\left(D \cdot D\right) \cdot 0.25}}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2}
\] |
sqrt-prod [=>]43.4 | \[ 0 + {\left(\frac{\color{blue}{\sqrt{D \cdot D} \cdot \sqrt{0.25}}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2}
\] |
sqrt-prod [=>]24.2 | \[ 0 + {\left(\frac{\color{blue}{\left(\sqrt{D} \cdot \sqrt{D}\right)} \cdot \sqrt{0.25}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2}
\] |
add-sqr-sqrt [<=]47.8 | \[ 0 + {\left(\frac{\color{blue}{D} \cdot \sqrt{0.25}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2}
\] |
metadata-eval [=>]47.8 | \[ 0 + {\left(\frac{D \cdot \color{blue}{0.5}}{\sqrt{\frac{\frac{d \cdot d}{h}}{M \cdot M}}}\right)}^{2}
\] |
sqrt-div [=>]49.2 | \[ 0 + {\left(\frac{D \cdot 0.5}{\color{blue}{\frac{\sqrt{\frac{d \cdot d}{h}}}{\sqrt{M \cdot M}}}}\right)}^{2}
\] |
sqrt-prod [=>]29.4 | \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\sqrt{\frac{d \cdot d}{h}}}{\color{blue}{\sqrt{M} \cdot \sqrt{M}}}}\right)}^{2}
\] |
add-sqr-sqrt [<=]57.3 | \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\sqrt{\frac{d \cdot d}{h}}}{\color{blue}{M}}}\right)}^{2}
\] |
sqrt-div [=>]60.9 | \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\color{blue}{\frac{\sqrt{d \cdot d}}{\sqrt{h}}}}{M}}\right)}^{2}
\] |
sqrt-prod [=>]35.9 | \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\frac{\color{blue}{\sqrt{d} \cdot \sqrt{d}}}{\sqrt{h}}}{M}}\right)}^{2}
\] |
add-sqr-sqrt [<=]71.8 | \[ 0 + {\left(\frac{D \cdot 0.5}{\frac{\frac{\color{blue}{d}}{\sqrt{h}}}{M}}\right)}^{2}
\] |
Final simplification68.9%
| Alternative 1 | |
|---|---|
| Accuracy | 69.9% |
| Cost | 42636 |
| Alternative 2 | |
|---|---|
| Accuracy | 69.0% |
| Cost | 13572 |
| Alternative 3 | |
|---|---|
| Accuracy | 64.0% |
| Cost | 2000 |
| Alternative 4 | |
|---|---|
| Accuracy | 63.9% |
| Cost | 1868 |
| Alternative 5 | |
|---|---|
| Accuracy | 63.5% |
| Cost | 1353 |
| Alternative 6 | |
|---|---|
| Accuracy | 48.2% |
| Cost | 1352 |
| Alternative 7 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 1352 |
| Alternative 8 | |
|---|---|
| Accuracy | 63.7% |
| Cost | 1352 |
| Alternative 9 | |
|---|---|
| Accuracy | 64.1% |
| Cost | 1352 |
| Alternative 10 | |
|---|---|
| Accuracy | 58.8% |
| Cost | 1220 |
| Alternative 11 | |
|---|---|
| Accuracy | 49.5% |
| Cost | 64 |
herbie shell --seed 2023137
(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))))))