
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
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
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (c0 w h D d M) :precision binary64 (let* ((t_0 (/ (* c0 (* d d)) (* (* w h) (* D D))))) (* (/ c0 (* 2.0 w)) (+ t_0 (sqrt (- (* t_0 t_0) (* M M)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M))));
}
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
t_0 = (c0 * (d_1 * d_1)) / ((w * h) * (d * d))
code = (c0 / (2.0d0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (m * m))))
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 * (d * d)) / ((w * h) * (D * D));
return (c0 / (2.0 * w)) * (t_0 + Math.sqrt(((t_0 * t_0) - (M * M))));
}
def code(c0, w, h, D, d, M): t_0 = (c0 * (d * d)) / ((w * h) * (D * D)) return (c0 / (2.0 * w)) * (t_0 + math.sqrt(((t_0 * t_0) - (M * M))))
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) return Float64(Float64(c0 / Float64(2.0 * w)) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M * M))))) end
function tmp = code(c0, w, h, D, d, M) t_0 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = (c0 / (2.0 * w)) * (t_0 + sqrt(((t_0 * t_0) - (M * M)))); end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\frac{c0}{2 \cdot w} \cdot \left(t_0 + \sqrt{t_0 \cdot t_0 - M \cdot M}\right)
\end{array}
\end{array}
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (* c0 (* d d)))
(t_2 (/ t_1 (* (* w h) (* D D))))
(t_3 (/ t_1 (* w (* h (* D D))))))
(if (<= (* t_0 (+ t_2 (sqrt (- (* t_2 t_2) (* M M))))) INFINITY)
(* t_0 (+ t_3 (sqrt (* (+ M t_3) (- t_3 M)))))
(* -0.5 (/ (cbrt 0.0) w)))))
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);
double t_2 = t_1 / ((w * h) * (D * D));
double t_3 = t_1 / (w * (h * (D * D)));
double tmp;
if ((t_0 * (t_2 + sqrt(((t_2 * t_2) - (M * M))))) <= ((double) INFINITY)) {
tmp = t_0 * (t_3 + sqrt(((M + t_3) * (t_3 - M))));
} else {
tmp = -0.5 * (cbrt(0.0) / w);
}
return tmp;
}
public static 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);
double t_2 = t_1 / ((w * h) * (D * D));
double t_3 = t_1 / (w * (h * (D * D)));
double tmp;
if ((t_0 * (t_2 + Math.sqrt(((t_2 * t_2) - (M * M))))) <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (t_3 + Math.sqrt(((M + t_3) * (t_3 - M))));
} else {
tmp = -0.5 * (Math.cbrt(0.0) / w);
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(c0 * Float64(d * d)) t_2 = Float64(t_1 / Float64(Float64(w * h) * Float64(D * D))) t_3 = Float64(t_1 / Float64(w * Float64(h * Float64(D * D)))) tmp = 0.0 if (Float64(t_0 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M * M))))) <= Inf) tmp = Float64(t_0 * Float64(t_3 + sqrt(Float64(Float64(M + t_3) * Float64(t_3 - M))))); else tmp = Float64(-0.5 * Float64(cbrt(0.0) / w)); end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 / N[(w * N[(h * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(t$95$3 + N[Sqrt[N[(N[(M + t$95$3), $MachinePrecision] * N[(t$95$3 - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := c0 \cdot \left(d \cdot d\right)\\
t_2 := \frac{t_1}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := \frac{t_1}{w \cdot \left(h \cdot \left(D \cdot D\right)\right)}\\
\mathbf{if}\;t_0 \cdot \left(t_2 + \sqrt{t_2 \cdot t_2 - M \cdot M}\right) \leq \infty:\\
\;\;\;\;t_0 \cdot \left(t_3 + \sqrt{\left(M + t_3\right) \cdot \left(t_3 - M\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\
\end{array}
\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))))) < +inf.0Initial program 78.5%
associate-*l*75.8%
difference-of-squares75.8%
associate-*l*77.1%
associate-*l*78.5%
Simplified78.5%
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%
associate-*l*0.0%
difference-of-squares10.4%
associate-*l*10.4%
associate-*l*11.5%
Simplified11.5%
Taylor expanded in c0 around -inf 0.1%
Taylor expanded in w around 0 1.8%
distribute-rgt1-in1.8%
metadata-eval1.8%
mul0-lft34.9%
Simplified34.9%
add-cbrt-cube34.9%
pow234.9%
div034.9%
*-commutative34.9%
pow234.9%
div034.9%
*-commutative34.9%
pow234.9%
div034.9%
*-commutative34.9%
Applied egg-rr34.9%
unpow234.9%
mul0-rgt34.9%
unpow234.9%
mul0-rgt34.9%
metadata-eval34.9%
unpow234.9%
mul0-rgt44.8%
metadata-eval44.8%
Simplified44.8%
Final simplification54.3%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w)))
(t_1 (pow (/ d D) 2.0))
(t_2 (* (* (/ c0 w) (/ c0 w)) (/ t_1 h))))
(if (<= c0 -2.8e-90)
t_2
(if (<= c0 180.0)
(* t_0 0.0)
(if (<= c0 3.9e+93)
(* t_0 (* t_1 (* 2.0 (/ (/ c0 w) h))))
(if (<= c0 4.5e+217) (* -0.5 (/ (cbrt 0.0) w)) t_2))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = pow((d / D), 2.0);
double t_2 = ((c0 / w) * (c0 / w)) * (t_1 / h);
double tmp;
if (c0 <= -2.8e-90) {
tmp = t_2;
} else if (c0 <= 180.0) {
tmp = t_0 * 0.0;
} else if (c0 <= 3.9e+93) {
tmp = t_0 * (t_1 * (2.0 * ((c0 / w) / h)));
} else if (c0 <= 4.5e+217) {
tmp = -0.5 * (cbrt(0.0) / w);
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = c0 / (2.0 * w);
double t_1 = Math.pow((d / D), 2.0);
double t_2 = ((c0 / w) * (c0 / w)) * (t_1 / h);
double tmp;
if (c0 <= -2.8e-90) {
tmp = t_2;
} else if (c0 <= 180.0) {
tmp = t_0 * 0.0;
} else if (c0 <= 3.9e+93) {
tmp = t_0 * (t_1 * (2.0 * ((c0 / w) / h)));
} else if (c0 <= 4.5e+217) {
tmp = -0.5 * (Math.cbrt(0.0) / w);
} else {
tmp = t_2;
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(d / D) ^ 2.0 t_2 = Float64(Float64(Float64(c0 / w) * Float64(c0 / w)) * Float64(t_1 / h)) tmp = 0.0 if (c0 <= -2.8e-90) tmp = t_2; elseif (c0 <= 180.0) tmp = Float64(t_0 * 0.0); elseif (c0 <= 3.9e+93) tmp = Float64(t_0 * Float64(t_1 * Float64(2.0 * Float64(Float64(c0 / w) / h)))); elseif (c0 <= 4.5e+217) tmp = Float64(-0.5 * Float64(cbrt(0.0) / w)); else tmp = t_2; end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(c0 / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -2.8e-90], t$95$2, If[LessEqual[c0, 180.0], N[(t$95$0 * 0.0), $MachinePrecision], If[LessEqual[c0, 3.9e+93], N[(t$95$0 * N[(t$95$1 * N[(2.0 * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 4.5e+217], N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := {\left(\frac{d}{D}\right)}^{2}\\
t_2 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{t_1}{h}\\
\mathbf{if}\;c0 \leq -2.8 \cdot 10^{-90}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;c0 \leq 180:\\
\;\;\;\;t_0 \cdot 0\\
\mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\
\;\;\;\;t_0 \cdot \left(t_1 \cdot \left(2 \cdot \frac{\frac{c0}{w}}{h}\right)\right)\\
\mathbf{elif}\;c0 \leq 4.5 \cdot 10^{+217}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if c0 < -2.7999999999999999e-90 or 4.49999999999999988e217 < c0 Initial program 24.5%
associate-*l*23.7%
difference-of-squares32.9%
associate-*l*32.9%
associate-*l*35.5%
Simplified35.5%
Taylor expanded in c0 around inf 31.1%
times-frac30.2%
unpow230.2%
unpow230.2%
unpow230.2%
*-commutative30.2%
unpow230.2%
Simplified30.2%
times-frac41.3%
Applied egg-rr41.3%
pow241.3%
associate-*r/41.4%
Applied egg-rr41.4%
unpow241.4%
*-commutative41.4%
unpow241.4%
*-commutative41.4%
times-frac42.9%
unpow242.9%
unpow242.9%
times-frac48.1%
Simplified48.1%
if -2.7999999999999999e-90 < c0 < 180Initial program 17.3%
times-frac13.7%
fma-def13.7%
associate-/r*13.7%
difference-of-squares16.2%
Simplified18.8%
associate-*r/18.8%
associate-/l*17.7%
div-inv17.7%
clear-num17.7%
Applied egg-rr17.7%
fma-udef17.7%
associate-/r*17.5%
times-frac17.8%
unpow217.8%
associate-/r*17.5%
times-frac20.5%
unpow220.5%
associate-*r/19.0%
associate-/l*19.0%
associate-*r/20.0%
Applied egg-rr20.0%
Taylor expanded in c0 around -inf 8.6%
*-commutative8.6%
distribute-rgt1-in8.6%
metadata-eval8.6%
mul0-lft54.0%
mul0-rgt54.0%
metadata-eval54.0%
Simplified54.0%
if 180 < c0 < 3.9000000000000002e93Initial program 26.4%
times-frac26.2%
fma-def26.2%
associate-/r*26.2%
difference-of-squares41.0%
Simplified41.1%
associate-*r/41.1%
associate-/l*41.1%
div-inv41.1%
clear-num41.1%
Applied egg-rr41.1%
fma-udef41.3%
associate-/r*41.2%
times-frac41.1%
unpow241.1%
associate-/r*41.0%
times-frac48.7%
unpow248.7%
associate-*r/45.7%
associate-/l*45.7%
associate-*r/48.7%
Applied egg-rr48.7%
Taylor expanded in c0 around inf 45.2%
times-frac45.2%
unpow245.2%
unpow245.2%
times-frac56.1%
unpow256.1%
*-commutative56.1%
associate-*r*56.1%
associate-/r*56.2%
Simplified56.2%
if 3.9000000000000002e93 < c0 < 4.49999999999999988e217Initial program 21.5%
associate-*l*21.5%
difference-of-squares28.6%
associate-*l*28.6%
associate-*l*28.6%
Simplified28.6%
Taylor expanded in c0 around -inf 3.6%
Taylor expanded in w around 0 3.6%
distribute-rgt1-in3.6%
metadata-eval3.6%
mul0-lft25.0%
Simplified25.0%
add-cbrt-cube25.0%
pow225.0%
div025.0%
*-commutative25.0%
pow225.0%
div025.0%
*-commutative25.0%
pow225.0%
div025.0%
*-commutative25.0%
Applied egg-rr25.0%
unpow225.0%
mul0-rgt25.0%
unpow225.0%
mul0-rgt25.0%
metadata-eval25.0%
unpow225.0%
mul0-rgt47.9%
metadata-eval47.9%
Simplified47.9%
Final simplification50.8%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (* (/ c0 w) (/ c0 w)) (/ (pow (/ d D) 2.0) h))))
(if (<= c0 -7.5e-86)
t_0
(if (<= c0 3.05e+43)
(* -0.5 (/ (/ (* 0.0 (* c0 c0)) w) w))
(if (or (<= c0 2.05e+93) (not (<= c0 4.2e+217)))
t_0
(* -0.5 (/ (cbrt 0.0) w)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 / w) * (c0 / w)) * (pow((d / D), 2.0) / h);
double tmp;
if (c0 <= -7.5e-86) {
tmp = t_0;
} else if (c0 <= 3.05e+43) {
tmp = -0.5 * (((0.0 * (c0 * c0)) / w) / w);
} else if ((c0 <= 2.05e+93) || !(c0 <= 4.2e+217)) {
tmp = t_0;
} else {
tmp = -0.5 * (cbrt(0.0) / w);
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = ((c0 / w) * (c0 / w)) * (Math.pow((d / D), 2.0) / h);
double tmp;
if (c0 <= -7.5e-86) {
tmp = t_0;
} else if (c0 <= 3.05e+43) {
tmp = -0.5 * (((0.0 * (c0 * c0)) / w) / w);
} else if ((c0 <= 2.05e+93) || !(c0 <= 4.2e+217)) {
tmp = t_0;
} else {
tmp = -0.5 * (Math.cbrt(0.0) / w);
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(Float64(c0 / w) * Float64(c0 / w)) * Float64((Float64(d / D) ^ 2.0) / h)) tmp = 0.0 if (c0 <= -7.5e-86) tmp = t_0; elseif (c0 <= 3.05e+43) tmp = Float64(-0.5 * Float64(Float64(Float64(0.0 * Float64(c0 * c0)) / w) / w)); elseif ((c0 <= 2.05e+93) || !(c0 <= 4.2e+217)) tmp = t_0; else tmp = Float64(-0.5 * Float64(cbrt(0.0) / w)); end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(N[(c0 / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -7.5e-86], t$95$0, If[LessEqual[c0, 3.05e+43], N[(-0.5 * N[(N[(N[(0.0 * N[(c0 * c0), $MachinePrecision]), $MachinePrecision] / w), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[c0, 2.05e+93], N[Not[LessEqual[c0, 4.2e+217]], $MachinePrecision]], t$95$0, N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{{\left(\frac{d}{D}\right)}^{2}}{h}\\
\mathbf{if}\;c0 \leq -7.5 \cdot 10^{-86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;c0 \leq 3.05 \cdot 10^{+43}:\\
\;\;\;\;-0.5 \cdot \frac{\frac{0 \cdot \left(c0 \cdot c0\right)}{w}}{w}\\
\mathbf{elif}\;c0 \leq 2.05 \cdot 10^{+93} \lor \neg \left(c0 \leq 4.2 \cdot 10^{+217}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\
\end{array}
\end{array}
if c0 < -7.50000000000000055e-86 or 3.0499999999999999e43 < c0 < 2.0500000000000001e93 or 4.2000000000000002e217 < c0 Initial program 26.7%
associate-*l*25.9%
difference-of-squares35.8%
associate-*l*35.8%
associate-*l*38.0%
Simplified38.0%
Taylor expanded in c0 around inf 33.4%
times-frac32.6%
unpow232.6%
unpow232.6%
unpow232.6%
*-commutative32.6%
unpow232.6%
Simplified32.6%
times-frac43.4%
Applied egg-rr43.4%
pow243.4%
associate-*r/43.4%
Applied egg-rr43.4%
unpow243.4%
*-commutative43.4%
unpow243.4%
*-commutative43.4%
times-frac44.8%
unpow244.8%
unpow244.8%
times-frac50.2%
Simplified50.2%
if -7.50000000000000055e-86 < c0 < 3.0499999999999999e43Initial program 15.9%
associate-*l*14.9%
difference-of-squares19.2%
associate-*l*20.2%
associate-*l*20.2%
Simplified20.2%
Taylor expanded in c0 around -inf 7.5%
Taylor expanded in w around 0 9.6%
distribute-rgt1-in9.6%
metadata-eval9.6%
mul0-lft50.7%
Simplified50.7%
pow250.7%
associate-*l/50.7%
*-commutative50.7%
Applied egg-rr50.7%
if 2.0500000000000001e93 < c0 < 4.2000000000000002e217Initial program 21.5%
associate-*l*21.5%
difference-of-squares28.6%
associate-*l*28.6%
associate-*l*28.6%
Simplified28.6%
Taylor expanded in c0 around -inf 3.6%
Taylor expanded in w around 0 3.6%
distribute-rgt1-in3.6%
metadata-eval3.6%
mul0-lft25.0%
Simplified25.0%
add-cbrt-cube25.0%
pow225.0%
div025.0%
*-commutative25.0%
pow225.0%
div025.0%
*-commutative25.0%
pow225.0%
div025.0%
*-commutative25.0%
Applied egg-rr25.0%
unpow225.0%
mul0-rgt25.0%
unpow225.0%
mul0-rgt25.0%
metadata-eval25.0%
unpow225.0%
mul0-rgt47.9%
metadata-eval47.9%
Simplified47.9%
Final simplification50.1%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (pow (/ d D) 2.0)) (t_1 (* (* (/ c0 w) (/ c0 w)) (/ t_0 h))))
(if (<= c0 -5.6e-83)
t_1
(if (<= c0 0.125)
(* (/ c0 (* 2.0 w)) 0.0)
(if (<= c0 3.9e+93)
(* t_0 (* (/ c0 w) (/ (/ c0 w) h)))
(if (<= c0 6.2e+217) (* -0.5 (/ (cbrt 0.0) w)) t_1))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = pow((d / D), 2.0);
double t_1 = ((c0 / w) * (c0 / w)) * (t_0 / h);
double tmp;
if (c0 <= -5.6e-83) {
tmp = t_1;
} else if (c0 <= 0.125) {
tmp = (c0 / (2.0 * w)) * 0.0;
} else if (c0 <= 3.9e+93) {
tmp = t_0 * ((c0 / w) * ((c0 / w) / h));
} else if (c0 <= 6.2e+217) {
tmp = -0.5 * (cbrt(0.0) / w);
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = Math.pow((d / D), 2.0);
double t_1 = ((c0 / w) * (c0 / w)) * (t_0 / h);
double tmp;
if (c0 <= -5.6e-83) {
tmp = t_1;
} else if (c0 <= 0.125) {
tmp = (c0 / (2.0 * w)) * 0.0;
} else if (c0 <= 3.9e+93) {
tmp = t_0 * ((c0 / w) * ((c0 / w) / h));
} else if (c0 <= 6.2e+217) {
tmp = -0.5 * (Math.cbrt(0.0) / w);
} else {
tmp = t_1;
}
return tmp;
}
function code(c0, w, h, D, d, M) t_0 = Float64(d / D) ^ 2.0 t_1 = Float64(Float64(Float64(c0 / w) * Float64(c0 / w)) * Float64(t_0 / h)) tmp = 0.0 if (c0 <= -5.6e-83) tmp = t_1; elseif (c0 <= 0.125) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0); elseif (c0 <= 3.9e+93) tmp = Float64(t_0 * Float64(Float64(c0 / w) * Float64(Float64(c0 / w) / h))); elseif (c0 <= 6.2e+217) tmp = Float64(-0.5 * Float64(cbrt(0.0) / w)); else tmp = t_1; end return tmp end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(c0 / w), $MachinePrecision] * N[(c0 / w), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 / h), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c0, -5.6e-83], t$95$1, If[LessEqual[c0, 0.125], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision], If[LessEqual[c0, 3.9e+93], N[(t$95$0 * N[(N[(c0 / w), $MachinePrecision] * N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c0, 6.2e+217], N[(-0.5 * N[(N[Power[0.0, 1/3], $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\frac{d}{D}\right)}^{2}\\
t_1 := \left(\frac{c0}{w} \cdot \frac{c0}{w}\right) \cdot \frac{t_0}{h}\\
\mathbf{if}\;c0 \leq -5.6 \cdot 10^{-83}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;c0 \leq 0.125:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\
\mathbf{elif}\;c0 \leq 3.9 \cdot 10^{+93}:\\
\;\;\;\;t_0 \cdot \left(\frac{c0}{w} \cdot \frac{\frac{c0}{w}}{h}\right)\\
\mathbf{elif}\;c0 \leq 6.2 \cdot 10^{+217}:\\
\;\;\;\;-0.5 \cdot \frac{\sqrt[3]{0}}{w}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if c0 < -5.6000000000000002e-83 or 6.2000000000000003e217 < c0 Initial program 24.5%
associate-*l*23.7%
difference-of-squares32.9%
associate-*l*32.9%
associate-*l*35.5%
Simplified35.5%
Taylor expanded in c0 around inf 31.1%
times-frac30.2%
unpow230.2%
unpow230.2%
unpow230.2%
*-commutative30.2%
unpow230.2%
Simplified30.2%
times-frac41.3%
Applied egg-rr41.3%
pow241.3%
associate-*r/41.4%
Applied egg-rr41.4%
unpow241.4%
*-commutative41.4%
unpow241.4%
*-commutative41.4%
times-frac42.9%
unpow242.9%
unpow242.9%
times-frac48.1%
Simplified48.1%
if -5.6000000000000002e-83 < c0 < 0.125Initial program 17.3%
times-frac13.7%
fma-def13.7%
associate-/r*13.7%
difference-of-squares16.2%
Simplified18.8%
associate-*r/18.8%
associate-/l*17.7%
div-inv17.7%
clear-num17.7%
Applied egg-rr17.7%
fma-udef17.7%
associate-/r*17.5%
times-frac17.8%
unpow217.8%
associate-/r*17.5%
times-frac20.5%
unpow220.5%
associate-*r/19.0%
associate-/l*19.0%
associate-*r/20.0%
Applied egg-rr20.0%
Taylor expanded in c0 around -inf 8.6%
*-commutative8.6%
distribute-rgt1-in8.6%
metadata-eval8.6%
mul0-lft54.0%
mul0-rgt54.0%
metadata-eval54.0%
Simplified54.0%
if 0.125 < c0 < 3.9000000000000002e93Initial program 26.4%
associate-*l*26.2%
difference-of-squares41.0%
associate-*l*41.2%
associate-*l*41.2%
Simplified41.2%
Taylor expanded in c0 around inf 37.7%
times-frac37.7%
unpow237.7%
unpow237.7%
unpow237.7%
*-commutative37.7%
unpow237.7%
Simplified37.7%
times-frac41.7%
Applied egg-rr41.7%
Taylor expanded in d around 0 37.7%
times-frac37.7%
unpow237.7%
unpow237.7%
times-frac41.7%
unpow241.7%
unpow241.7%
*-commutative41.7%
unpow241.7%
associate-*r*49.0%
*-commutative49.0%
times-frac56.2%
associate-/r*56.2%
Simplified56.2%
if 3.9000000000000002e93 < c0 < 6.2000000000000003e217Initial program 21.5%
associate-*l*21.5%
difference-of-squares28.6%
associate-*l*28.6%
associate-*l*28.6%
Simplified28.6%
Taylor expanded in c0 around -inf 3.6%
Taylor expanded in w around 0 3.6%
distribute-rgt1-in3.6%
metadata-eval3.6%
mul0-lft25.0%
Simplified25.0%
add-cbrt-cube25.0%
pow225.0%
div025.0%
*-commutative25.0%
pow225.0%
div025.0%
*-commutative25.0%
pow225.0%
div025.0%
*-commutative25.0%
Applied egg-rr25.0%
unpow225.0%
mul0-rgt25.0%
unpow225.0%
mul0-rgt25.0%
metadata-eval25.0%
unpow225.0%
mul0-rgt47.9%
metadata-eval47.9%
Simplified47.9%
Final simplification50.8%
(FPCore (c0 w h D d M)
:precision binary64
(let* ((t_0 (* (/ c0 h) (/ c0 (* w w)))) (t_1 (* (/ c0 (* 2.0 w)) 0.0)))
(if (<= w -2.2e+24)
t_1
(if (<= w 3.2e-23)
(* (* (/ d D) (/ d D)) t_0)
(if (or (<= w 8.5e+50) (not (<= w 6.4e+94)))
t_1
(* (/ (* d d) D) (/ t_0 D)))))))
double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / h) * (c0 / (w * w));
double t_1 = (c0 / (2.0 * w)) * 0.0;
double tmp;
if (w <= -2.2e+24) {
tmp = t_1;
} else if (w <= 3.2e-23) {
tmp = ((d / D) * (d / D)) * t_0;
} else if ((w <= 8.5e+50) || !(w <= 6.4e+94)) {
tmp = t_1;
} else {
tmp = ((d * d) / D) * (t_0 / D);
}
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
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (c0 / h) * (c0 / (w * w))
t_1 = (c0 / (2.0d0 * w)) * 0.0d0
if (w <= (-2.2d+24)) then
tmp = t_1
else if (w <= 3.2d-23) then
tmp = ((d_1 / d) * (d_1 / d)) * t_0
else if ((w <= 8.5d+50) .or. (.not. (w <= 6.4d+94))) then
tmp = t_1
else
tmp = ((d_1 * d_1) / d) * (t_0 / d)
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double t_0 = (c0 / h) * (c0 / (w * w));
double t_1 = (c0 / (2.0 * w)) * 0.0;
double tmp;
if (w <= -2.2e+24) {
tmp = t_1;
} else if (w <= 3.2e-23) {
tmp = ((d / D) * (d / D)) * t_0;
} else if ((w <= 8.5e+50) || !(w <= 6.4e+94)) {
tmp = t_1;
} else {
tmp = ((d * d) / D) * (t_0 / D);
}
return tmp;
}
def code(c0, w, h, D, d, M): t_0 = (c0 / h) * (c0 / (w * w)) t_1 = (c0 / (2.0 * w)) * 0.0 tmp = 0 if w <= -2.2e+24: tmp = t_1 elif w <= 3.2e-23: tmp = ((d / D) * (d / D)) * t_0 elif (w <= 8.5e+50) or not (w <= 6.4e+94): tmp = t_1 else: tmp = ((d * d) / D) * (t_0 / D) return tmp
function code(c0, w, h, D, d, M) t_0 = Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w))) t_1 = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0) tmp = 0.0 if (w <= -2.2e+24) tmp = t_1; elseif (w <= 3.2e-23) tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * t_0); elseif ((w <= 8.5e+50) || !(w <= 6.4e+94)) tmp = t_1; else tmp = Float64(Float64(Float64(d * d) / D) * Float64(t_0 / D)); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) t_0 = (c0 / h) * (c0 / (w * w)); t_1 = (c0 / (2.0 * w)) * 0.0; tmp = 0.0; if (w <= -2.2e+24) tmp = t_1; elseif (w <= 3.2e-23) tmp = ((d / D) * (d / D)) * t_0; elseif ((w <= 8.5e+50) || ~((w <= 6.4e+94))) tmp = t_1; else tmp = ((d * d) / D) * (t_0 / D); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := Block[{t$95$0 = N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]}, If[LessEqual[w, -2.2e+24], t$95$1, If[LessEqual[w, 3.2e-23], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[Or[LessEqual[w, 8.5e+50], N[Not[LessEqual[w, 6.4e+94]], $MachinePrecision]], t$95$1, N[(N[(N[(d * d), $MachinePrecision] / D), $MachinePrecision] * N[(t$95$0 / D), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{c0}{h} \cdot \frac{c0}{w \cdot w}\\
t_1 := \frac{c0}{2 \cdot w} \cdot 0\\
\mathbf{if}\;w \leq -2.2 \cdot 10^{+24}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq 3.2 \cdot 10^{-23}:\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot t_0\\
\mathbf{elif}\;w \leq 8.5 \cdot 10^{+50} \lor \neg \left(w \leq 6.4 \cdot 10^{+94}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{d \cdot d}{D} \cdot \frac{t_0}{D}\\
\end{array}
\end{array}
if w < -2.20000000000000002e24 or 3.19999999999999976e-23 < w < 8.49999999999999961e50 or 6.40000000000000028e94 < w Initial program 12.2%
times-frac11.1%
fma-def11.1%
associate-/r*11.1%
difference-of-squares15.5%
Simplified19.9%
associate-*r/19.9%
associate-/l*17.8%
div-inv17.8%
clear-num17.8%
Applied egg-rr17.8%
fma-udef17.7%
associate-/r*16.6%
times-frac17.9%
unpow217.9%
associate-/r*16.6%
times-frac21.1%
unpow221.1%
associate-*r/18.0%
associate-/l*18.0%
associate-*r/20.0%
Applied egg-rr20.0%
Taylor expanded in c0 around -inf 5.5%
*-commutative5.5%
distribute-rgt1-in5.5%
metadata-eval5.5%
mul0-lft55.7%
mul0-rgt55.7%
metadata-eval55.7%
Simplified55.7%
if -2.20000000000000002e24 < w < 3.19999999999999976e-23Initial program 27.6%
associate-*l*26.9%
difference-of-squares35.2%
associate-*l*35.3%
associate-*l*35.9%
Simplified35.9%
Taylor expanded in c0 around inf 32.0%
times-frac32.1%
unpow232.1%
unpow232.1%
unpow232.1%
*-commutative32.1%
unpow232.1%
Simplified32.1%
times-frac39.3%
Applied egg-rr39.3%
*-un-lft-identity39.3%
times-frac42.1%
Applied egg-rr42.1%
*-lft-identity42.1%
Simplified42.1%
if 8.49999999999999961e50 < w < 6.40000000000000028e94Initial program 29.3%
associate-*l*29.3%
difference-of-squares57.8%
associate-*l*57.8%
associate-*l*57.8%
Simplified57.8%
Taylor expanded in c0 around inf 57.8%
times-frac43.5%
unpow243.5%
unpow243.5%
unpow243.5%
*-commutative43.5%
unpow243.5%
Simplified43.5%
associate-*l/57.1%
times-frac71.4%
Applied egg-rr71.4%
unpow271.4%
times-frac86.0%
unpow286.0%
Simplified86.0%
Final simplification48.2%
(FPCore (c0 w h D d M) :precision binary64 (if (or (<= w -2.3e+24) (not (<= w 1.75e-23))) (* (/ c0 (* 2.0 w)) 0.0) (* (* (/ d D) (/ d D)) (* (/ c0 h) (/ c0 (* w w))))))
double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -2.3e+24) || !(w <= 1.75e-23)) {
tmp = (c0 / (2.0 * w)) * 0.0;
} else {
tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w)));
}
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
real(8) :: tmp
if ((w <= (-2.3d+24)) .or. (.not. (w <= 1.75d-23))) then
tmp = (c0 / (2.0d0 * w)) * 0.0d0
else
tmp = ((d_1 / d) * (d_1 / d)) * ((c0 / h) * (c0 / (w * w)))
end if
code = tmp
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
double tmp;
if ((w <= -2.3e+24) || !(w <= 1.75e-23)) {
tmp = (c0 / (2.0 * w)) * 0.0;
} else {
tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w)));
}
return tmp;
}
def code(c0, w, h, D, d, M): tmp = 0 if (w <= -2.3e+24) or not (w <= 1.75e-23): tmp = (c0 / (2.0 * w)) * 0.0 else: tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w))) return tmp
function code(c0, w, h, D, d, M) tmp = 0.0 if ((w <= -2.3e+24) || !(w <= 1.75e-23)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * 0.0); else tmp = Float64(Float64(Float64(d / D) * Float64(d / D)) * Float64(Float64(c0 / h) * Float64(c0 / Float64(w * w)))); end return tmp end
function tmp_2 = code(c0, w, h, D, d, M) tmp = 0.0; if ((w <= -2.3e+24) || ~((w <= 1.75e-23))) tmp = (c0 / (2.0 * w)) * 0.0; else tmp = ((d / D) * (d / D)) * ((c0 / h) * (c0 / (w * w))); end tmp_2 = tmp; end
code[c0_, w_, h_, D_, d_, M_] := If[Or[LessEqual[w, -2.3e+24], N[Not[LessEqual[w, 1.75e-23]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision], N[(N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision] * N[(N[(c0 / h), $MachinePrecision] * N[(c0 / N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.3 \cdot 10^{+24} \lor \neg \left(w \leq 1.75 \cdot 10^{-23}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot 0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{d}{D} \cdot \frac{d}{D}\right) \cdot \left(\frac{c0}{h} \cdot \frac{c0}{w \cdot w}\right)\\
\end{array}
\end{array}
if w < -2.2999999999999999e24 or 1.74999999999999997e-23 < w Initial program 13.4%
times-frac11.3%
fma-def11.4%
associate-/r*11.4%
difference-of-squares17.5%
Simplified21.6%
associate-*r/21.6%
associate-/l*19.6%
div-inv19.6%
clear-num19.6%
Applied egg-rr19.6%
fma-udef19.6%
associate-/r*18.5%
times-frac19.7%
unpow219.7%
associate-/r*18.5%
times-frac22.7%
unpow222.7%
associate-*r/19.8%
associate-/l*19.8%
associate-*r/21.7%
Applied egg-rr21.7%
Taylor expanded in c0 around -inf 6.1%
*-commutative6.1%
distribute-rgt1-in6.1%
metadata-eval6.1%
mul0-lft52.9%
mul0-rgt52.9%
metadata-eval52.9%
Simplified52.9%
if -2.2999999999999999e24 < w < 1.74999999999999997e-23Initial program 27.6%
associate-*l*26.9%
difference-of-squares35.2%
associate-*l*35.3%
associate-*l*35.9%
Simplified35.9%
Taylor expanded in c0 around inf 32.0%
times-frac32.1%
unpow232.1%
unpow232.1%
unpow232.1%
*-commutative32.1%
unpow232.1%
Simplified32.1%
times-frac39.3%
Applied egg-rr39.3%
*-un-lft-identity39.3%
times-frac42.1%
Applied egg-rr42.1%
*-lft-identity42.1%
Simplified42.1%
Final simplification46.3%
(FPCore (c0 w h D d M) :precision binary64 (* (/ c0 (* 2.0 w)) 0.0))
double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * 0.0;
}
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)) * 0.0d0
end function
public static double code(double c0, double w, double h, double D, double d, double M) {
return (c0 / (2.0 * w)) * 0.0;
}
def code(c0, w, h, D, d, M): return (c0 / (2.0 * w)) * 0.0
function code(c0, w, h, D, d, M) return Float64(Float64(c0 / Float64(2.0 * w)) * 0.0) end
function tmp = code(c0, w, h, D, d, M) tmp = (c0 / (2.0 * w)) * 0.0; end
code[c0_, w_, h_, D_, d_, M_] := N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * 0.0), $MachinePrecision]
\begin{array}{l}
\\
\frac{c0}{2 \cdot w} \cdot 0
\end{array}
Initial program 22.1%
times-frac20.5%
fma-def20.1%
associate-/r*20.2%
difference-of-squares27.6%
Simplified30.1%
associate-*r/30.0%
associate-/l*29.3%
div-inv29.3%
clear-num29.3%
Applied egg-rr29.3%
fma-udef29.7%
associate-/r*28.1%
times-frac29.5%
unpow229.5%
associate-/r*28.5%
times-frac33.0%
unpow233.0%
associate-*r/31.0%
associate-/l*31.0%
associate-*r/32.8%
Applied egg-rr32.8%
Taylor expanded in c0 around -inf 4.1%
*-commutative4.1%
distribute-rgt1-in4.1%
metadata-eval4.1%
mul0-lft33.8%
mul0-rgt33.8%
metadata-eval33.8%
Simplified33.8%
Final simplification33.8%
herbie shell --seed 2023257
(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))))))