| Alternative 1 | |
|---|---|
| Error | 29.3 |
| Cost | 42700 |
(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 (pow (* d c0) 2.0))
(t_1 (pow (* D w) 2.0))
(t_2 (/ c0 (* 2.0 w)))
(t_3 (* d (/ c0 (* D (* h (* D w))))))
(t_4 (* d t_3))
(t_5 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_6 (* t_2 (+ t_5 (sqrt (- (* t_5 t_5) (* M M)))))))
(if (<= t_6 (- INFINITY))
(/ t_0 (* h t_1))
(if (<= t_6 1e+151)
(* t_2 (+ t_4 (sqrt (- (* d (* t_3 t_4)) (* M M)))))
(if (<= t_6 INFINITY) (/ (/ t_0 h) t_1) 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 = pow((d * c0), 2.0);
double t_1 = pow((D * w), 2.0);
double t_2 = c0 / (2.0 * w);
double t_3 = d * (c0 / (D * (h * (D * w))));
double t_4 = d * t_3;
double t_5 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_6 = t_2 * (t_5 + sqrt(((t_5 * t_5) - (M * M))));
double tmp;
if (t_6 <= -((double) INFINITY)) {
tmp = t_0 / (h * t_1);
} else if (t_6 <= 1e+151) {
tmp = t_2 * (t_4 + sqrt(((d * (t_3 * t_4)) - (M * M))));
} else if (t_6 <= ((double) INFINITY)) {
tmp = (t_0 / h) / t_1;
} else {
tmp = 0.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 = Math.pow((d * c0), 2.0);
double t_1 = Math.pow((D * w), 2.0);
double t_2 = c0 / (2.0 * w);
double t_3 = d * (c0 / (D * (h * (D * w))));
double t_4 = d * t_3;
double t_5 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_6 = t_2 * (t_5 + Math.sqrt(((t_5 * t_5) - (M * M))));
double tmp;
if (t_6 <= -Double.POSITIVE_INFINITY) {
tmp = t_0 / (h * t_1);
} else if (t_6 <= 1e+151) {
tmp = t_2 * (t_4 + Math.sqrt(((d * (t_3 * t_4)) - (M * M))));
} else if (t_6 <= Double.POSITIVE_INFINITY) {
tmp = (t_0 / h) / t_1;
} else {
tmp = 0.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 = math.pow((d * c0), 2.0) t_1 = math.pow((D * w), 2.0) t_2 = c0 / (2.0 * w) t_3 = d * (c0 / (D * (h * (D * w)))) t_4 = d * t_3 t_5 = (c0 * (d * d)) / ((w * h) * (D * D)) t_6 = t_2 * (t_5 + math.sqrt(((t_5 * t_5) - (M * M)))) tmp = 0 if t_6 <= -math.inf: tmp = t_0 / (h * t_1) elif t_6 <= 1e+151: tmp = t_2 * (t_4 + math.sqrt(((d * (t_3 * t_4)) - (M * M)))) elif t_6 <= math.inf: tmp = (t_0 / h) / t_1 else: tmp = 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(d * c0) ^ 2.0 t_1 = Float64(D * w) ^ 2.0 t_2 = Float64(c0 / Float64(2.0 * w)) t_3 = Float64(d * Float64(c0 / Float64(D * Float64(h * Float64(D * w))))) t_4 = Float64(d * t_3) t_5 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_6 = Float64(t_2 * Float64(t_5 + sqrt(Float64(Float64(t_5 * t_5) - Float64(M * M))))) tmp = 0.0 if (t_6 <= Float64(-Inf)) tmp = Float64(t_0 / Float64(h * t_1)); elseif (t_6 <= 1e+151) tmp = Float64(t_2 * Float64(t_4 + sqrt(Float64(Float64(d * Float64(t_3 * t_4)) - Float64(M * M))))); elseif (t_6 <= Inf) tmp = Float64(Float64(t_0 / h) / t_1); else tmp = 0.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 = (d * c0) ^ 2.0; t_1 = (D * w) ^ 2.0; t_2 = c0 / (2.0 * w); t_3 = d * (c0 / (D * (h * (D * w)))); t_4 = d * t_3; t_5 = (c0 * (d * d)) / ((w * h) * (D * D)); t_6 = t_2 * (t_5 + sqrt(((t_5 * t_5) - (M * M)))); tmp = 0.0; if (t_6 <= -Inf) tmp = t_0 / (h * t_1); elseif (t_6 <= 1e+151) tmp = t_2 * (t_4 + sqrt(((d * (t_3 * t_4)) - (M * M)))); elseif (t_6 <= Inf) tmp = (t_0 / h) / t_1; else tmp = 0.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[Power[N[(d * c0), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(D * w), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(d * N[(c0 / N[(D * N[(h * N[(D * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(d * t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(t$95$2 * N[(t$95$5 + N[Sqrt[N[(N[(t$95$5 * t$95$5), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, (-Infinity)], N[(t$95$0 / N[(h * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, 1e+151], N[(t$95$2 * N[(t$95$4 + N[Sqrt[N[(N[(d * N[(t$95$3 * t$95$4), $MachinePrecision]), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, Infinity], N[(N[(t$95$0 / h), $MachinePrecision] / t$95$1), $MachinePrecision], 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)
\begin{array}{l}
t_0 := {\left(d \cdot c0\right)}^{2}\\
t_1 := {\left(D \cdot w\right)}^{2}\\
t_2 := \frac{c0}{2 \cdot w}\\
t_3 := d \cdot \frac{c0}{D \cdot \left(h \cdot \left(D \cdot w\right)\right)}\\
t_4 := d \cdot t_3\\
t_5 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_6 := t_2 \cdot \left(t_5 + \sqrt{t_5 \cdot t_5 - M \cdot M}\right)\\
\mathbf{if}\;t_6 \leq -\infty:\\
\;\;\;\;\frac{t_0}{h \cdot t_1}\\
\mathbf{elif}\;t_6 \leq 10^{+151}:\\
\;\;\;\;t_2 \cdot \left(t_4 + \sqrt{d \cdot \left(t_3 \cdot t_4\right) - M \cdot M}\right)\\
\mathbf{elif}\;t_6 \leq \infty:\\
\;\;\;\;\frac{\frac{t_0}{h}}{t_1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\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))))) < -inf.0Initial program 64.0
Simplified62.9
[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)
\] |
|---|---|
rational.json-simplify-49 [=>]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)
\] |
rational.json-simplify-2 [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\color{blue}{\left(D \cdot D\right) \cdot \left(w \cdot h\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)
\] |
rational.json-simplify-2 [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot w\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)
\] |
rational.json-simplify-43 [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\color{blue}{h \cdot \left(w \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)
\] |
Taylor expanded in c0 around inf 58.2
Simplified38.9
[Start]58.2 | \[ \frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}
\] |
|---|---|
exponential.json-simplify-27 [=>]49.0 | \[ \frac{\color{blue}{{\left(d \cdot c0\right)}^{2}}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}
\] |
rational.json-simplify-43 [=>]50.2 | \[ \frac{{\left(d \cdot c0\right)}^{2}}{\color{blue}{{w}^{2} \cdot \left(h \cdot {D}^{2}\right)}}
\] |
rational.json-simplify-43 [=>]48.0 | \[ \frac{{\left(d \cdot c0\right)}^{2}}{\color{blue}{h \cdot \left({D}^{2} \cdot {w}^{2}\right)}}
\] |
exponential.json-simplify-27 [=>]38.9 | \[ \frac{{\left(d \cdot c0\right)}^{2}}{h \cdot \color{blue}{{\left(D \cdot w\right)}^{2}}}
\] |
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))))) < 1.00000000000000002e151Initial program 24.3
Simplified28.4
[Start]24.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)
\] |
|---|---|
rational.json-simplify-49 [=>]29.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)
\] |
rational.json-simplify-2 [=>]29.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\color{blue}{\left(D \cdot D\right) \cdot \left(w \cdot h\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)
\] |
rational.json-simplify-2 [=>]29.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot w\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)
\] |
rational.json-simplify-43 [=>]33.3 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\color{blue}{h \cdot \left(w \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)
\] |
Applied egg-rr37.0
Applied egg-rr26.7
Simplified25.8
[Start]26.7 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right) + \sqrt{d \cdot \left(\left(d \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) - M \cdot M}\right) - 0\right)
\] |
|---|---|
rational.json-simplify-5 [=>]26.7 | \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\left(d \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right) + \sqrt{d \cdot \left(\left(d \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) - M \cdot M}\right)}
\] |
rational.json-simplify-43 [=>]29.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(d \cdot \left(d \cdot \frac{c0}{\color{blue}{D \cdot \left(h \cdot \left(w \cdot D\right)\right)}}\right) + \sqrt{d \cdot \left(\left(d \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) - M \cdot M}\right)
\] |
rational.json-simplify-2 [=>]29.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(d \cdot \left(d \cdot \frac{c0}{D \cdot \left(h \cdot \color{blue}{\left(D \cdot w\right)}\right)}\right) + \sqrt{d \cdot \left(\left(d \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) \cdot \left(d \cdot \frac{c0}{\left(w \cdot D\right) \cdot \left(D \cdot h\right)}\right)\right) - M \cdot M}\right)
\] |
if 1.00000000000000002e151 < (*.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 59.8
Simplified58.8
[Start]59.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)
\] |
|---|---|
rational.json-simplify-46 [=>]60.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{\frac{c0 \cdot \left(d \cdot d\right)}{w \cdot h}}{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)
\] |
rational.json-simplify-2 [=>]60.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{\frac{\color{blue}{\left(d \cdot d\right) \cdot c0}}{w \cdot h}}{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)
\] |
rational.json-simplify-49 [=>]60.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(\frac{\color{blue}{c0 \cdot \frac{d \cdot d}{w \cdot h}}}{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)
\] |
rational.json-simplify-49 [=>]60.6 | \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{d \cdot d}{w \cdot h} \cdot \frac{c0}{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)
\] |
rational.json-simplify-46 [=>]60.9 | \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\frac{\frac{d \cdot d}{w}}{h}} \cdot \frac{c0}{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)
\] |
Taylor expanded in d around inf 53.4
Simplified50.7
[Start]53.4 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{{d}^{2} \cdot c0}{{D}^{2} \cdot \left(w \cdot h\right)}\right)
\] |
|---|---|
rational.json-simplify-46 [=>]52.6 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\frac{\frac{{d}^{2} \cdot c0}{{D}^{2}}}{w \cdot h}}\right)
\] |
rational.json-simplify-44 [=>]52.1 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \color{blue}{\frac{\frac{{d}^{2} \cdot c0}{w \cdot h}}{{D}^{2}}}\right)
\] |
rational.json-simplify-2 [=>]52.1 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\frac{\color{blue}{c0 \cdot {d}^{2}}}{w \cdot h}}{{D}^{2}}\right)
\] |
rational.json-simplify-49 [=>]51.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{\color{blue}{{d}^{2} \cdot \frac{c0}{w \cdot h}}}{{D}^{2}}\right)
\] |
rational.json-simplify-46 [=>]50.7 | \[ \frac{c0}{2 \cdot w} \cdot \left(2 \cdot \frac{{d}^{2} \cdot \color{blue}{\frac{\frac{c0}{w}}{h}}}{{D}^{2}}\right)
\] |
Taylor expanded in c0 around 0 57.3
Simplified43.2
[Start]57.3 | \[ \frac{{d}^{2} \cdot {c0}^{2}}{{D}^{2} \cdot \left({w}^{2} \cdot h\right)}
\] |
|---|---|
rational.json-simplify-43 [=>]58.9 | \[ \frac{{d}^{2} \cdot {c0}^{2}}{\color{blue}{{w}^{2} \cdot \left(h \cdot {D}^{2}\right)}}
\] |
rational.json-simplify-43 [=>]57.0 | \[ \frac{{d}^{2} \cdot {c0}^{2}}{\color{blue}{h \cdot \left({D}^{2} \cdot {w}^{2}\right)}}
\] |
rational.json-simplify-46 [=>]57.7 | \[ \color{blue}{\frac{\frac{{d}^{2} \cdot {c0}^{2}}{h}}{{D}^{2} \cdot {w}^{2}}}
\] |
exponential.json-simplify-27 [=>]51.4 | \[ \frac{\frac{\color{blue}{{\left(d \cdot c0\right)}^{2}}}{h}}{{D}^{2} \cdot {w}^{2}}
\] |
exponential.json-simplify-27 [=>]43.2 | \[ \frac{\frac{{\left(d \cdot c0\right)}^{2}}{h}}{\color{blue}{{\left(D \cdot w\right)}^{2}}}
\] |
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.3
[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)
\] |
|---|---|
rational.json-simplify-49 [=>]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)
\] |
rational.json-simplify-2 [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\color{blue}{\left(D \cdot D\right) \cdot \left(w \cdot h\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)
\] |
rational.json-simplify-2 [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\left(D \cdot D\right) \cdot \color{blue}{\left(h \cdot w\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)
\] |
rational.json-simplify-43 [=>]64.0 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(d \cdot d\right) \cdot \frac{c0}{\color{blue}{h \cdot \left(w \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)
\] |
Taylor expanded in c0 around -inf 62.8
Simplified62.8
[Start]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(-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)
\] |
|---|---|
rational.json-simplify-43 [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \color{blue}{\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 \left(c0 \cdot -1\right)\right)}
\] |
rational.json-simplify-2 [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + \color{blue}{\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} \cdot -1}\right) \cdot \left(c0 \cdot -1\right)\right)
\] |
rational.json-simplify-9 [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + \color{blue}{\left(-\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot \left(c0 \cdot -1\right)\right)
\] |
rational.json-simplify-10 [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)} + \color{blue}{\frac{\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}{-1}}\right) \cdot \left(c0 \cdot -1\right)\right)
\] |
rational.json-simplify-31 [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\color{blue}{\left(\left(-1 + 1\right) \cdot \frac{\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}{-1}\right)} \cdot \left(c0 \cdot -1\right)\right)
\] |
metadata-eval [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(\color{blue}{0} \cdot \frac{\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}}{-1}\right) \cdot \left(c0 \cdot -1\right)\right)
\] |
rational.json-simplify-10 [<=]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(0 \cdot \color{blue}{\left(-\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)}\right) \cdot \left(c0 \cdot -1\right)\right)
\] |
rational.json-simplify-9 [=>]62.8 | \[ \frac{c0}{2 \cdot w} \cdot \left(\left(0 \cdot \left(-\frac{{d}^{2}}{{D}^{2} \cdot \left(w \cdot h\right)}\right)\right) \cdot \color{blue}{\left(-c0\right)}\right)
\] |
Taylor expanded in d around 0 33.1
Taylor expanded in c0 around 0 28.2
Final simplification29.2
| Alternative 1 | |
|---|---|
| Error | 29.3 |
| Cost | 42700 |
| Alternative 2 | |
|---|---|
| Error | 31.2 |
| Cost | 19396 |
| Alternative 3 | |
|---|---|
| Error | 31.9 |
| Cost | 64 |
herbie shell --seed 2023073
(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))))))