
(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 13 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}
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* w h)))
(t_1 (* t_0 (/ (* d d) (* D D))))
(t_2 (/ c0 (* 2.0 w)))
(t_3 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_4 (* t_2 (+ t_3 (sqrt (- (* t_3 t_3) (* M_m M_m)))))))
(if (<= t_4 2e+307)
(* (/ 1.0 (* w (/ 2.0 c0))) (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m)))))
(if (<= t_4 INFINITY)
(pow (* (sqrt (* 2.0 t_2)) (* (/ d D) (sqrt t_0))) 2.0)
(* c0 (/ (log (exp M_m)) (* 2.0 w)))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d * d) / (D * D));
double t_2 = c0 / (2.0 * w);
double t_3 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_4 = t_2 * (t_3 + sqrt(((t_3 * t_3) - (M_m * M_m))));
double tmp;
if (t_4 <= 2e+307) {
tmp = (1.0 / (w * (2.0 / c0))) * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))));
} else if (t_4 <= ((double) INFINITY)) {
tmp = pow((sqrt((2.0 * t_2)) * ((d / D) * sqrt(t_0))), 2.0);
} else {
tmp = c0 * (log(exp(M_m)) / (2.0 * w));
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (w * h);
double t_1 = t_0 * ((d * d) / (D * D));
double t_2 = c0 / (2.0 * w);
double t_3 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_4 = t_2 * (t_3 + Math.sqrt(((t_3 * t_3) - (M_m * M_m))));
double tmp;
if (t_4 <= 2e+307) {
tmp = (1.0 / (w * (2.0 / c0))) * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))));
} else if (t_4 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow((Math.sqrt((2.0 * t_2)) * ((d / D) * Math.sqrt(t_0))), 2.0);
} else {
tmp = c0 * (Math.log(Math.exp(M_m)) / (2.0 * w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = c0 / (w * h) t_1 = t_0 * ((d * d) / (D * D)) t_2 = c0 / (2.0 * w) t_3 = (c0 * (d * d)) / ((w * h) * (D * D)) t_4 = t_2 * (t_3 + math.sqrt(((t_3 * t_3) - (M_m * M_m)))) tmp = 0 if t_4 <= 2e+307: tmp = (1.0 / (w * (2.0 / c0))) * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m)))) elif t_4 <= math.inf: tmp = math.pow((math.sqrt((2.0 * t_2)) * ((d / D) * math.sqrt(t_0))), 2.0) else: tmp = c0 * (math.log(math.exp(M_m)) / (2.0 * w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(w * h)) t_1 = Float64(t_0 * Float64(Float64(d * d) / Float64(D * D))) t_2 = Float64(c0 / Float64(2.0 * w)) t_3 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_4 = Float64(t_2 * Float64(t_3 + sqrt(Float64(Float64(t_3 * t_3) - Float64(M_m * M_m))))) tmp = 0.0 if (t_4 <= 2e+307) tmp = Float64(Float64(1.0 / Float64(w * Float64(2.0 / c0))) * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))); elseif (t_4 <= Inf) tmp = Float64(sqrt(Float64(2.0 * t_2)) * Float64(Float64(d / D) * sqrt(t_0))) ^ 2.0; else tmp = Float64(c0 * Float64(log(exp(M_m)) / Float64(2.0 * w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = c0 / (w * h); t_1 = t_0 * ((d * d) / (D * D)); t_2 = c0 / (2.0 * w); t_3 = (c0 * (d * d)) / ((w * h) * (D * D)); t_4 = t_2 * (t_3 + sqrt(((t_3 * t_3) - (M_m * M_m)))); tmp = 0.0; if (t_4 <= 2e+307) tmp = (1.0 / (w * (2.0 / c0))) * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m)))); elseif (t_4 <= Inf) tmp = (sqrt((2.0 * t_2)) * ((d / D) * sqrt(t_0))) ^ 2.0; else tmp = c0 * (log(exp(M_m)) / (2.0 * w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * N[(t$95$3 + N[Sqrt[N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, 2e+307], N[(N[(1.0 / N[(w * N[(2.0 / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[Power[N[(N[Sqrt[N[(2.0 * t$95$2), $MachinePrecision]], $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision], N[(c0 * N[(N[Log[N[Exp[M$95$m], $MachinePrecision]], $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h}\\
t_1 := t\_0 \cdot \frac{d \cdot d}{D \cdot D}\\
t_2 := \frac{c0}{2 \cdot w}\\
t_3 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_4 := t\_2 \cdot \left(t\_3 + \sqrt{t\_3 \cdot t\_3 - M\_m \cdot M\_m}\right)\\
\mathbf{if}\;t\_4 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;\frac{1}{w \cdot \frac{2}{c0}} \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right)\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;{\left(\sqrt{2 \cdot t\_2} \cdot \left(\frac{d}{D} \cdot \sqrt{t\_0}\right)\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\log \left(e^{M\_m}\right)}{2 \cdot w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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.99999999999999997e307Initial program 82.8%
Simplified86.3%
clear-num86.3%
inv-pow86.3%
*-commutative86.3%
Applied egg-rr86.3%
unpow-186.3%
associate-/l*86.3%
Simplified86.3%
if 1.99999999999999997e307 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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 83.7%
Simplified83.5%
frac-times81.2%
pow281.2%
associate-*l*81.2%
pow281.2%
Applied egg-rr81.2%
associate-*r/81.2%
Simplified81.2%
Taylor expanded in c0 around inf 83.7%
*-commutative83.7%
times-frac83.5%
unpow283.5%
unpow283.5%
times-frac88.1%
unpow288.1%
*-commutative88.1%
associate-/r*88.1%
Simplified88.1%
add-sqr-sqrt88.1%
pow288.1%
associate-*r*88.1%
sqrt-prod88.1%
*-commutative88.1%
sqrt-prod88.1%
sqrt-pow197.3%
metadata-eval97.3%
pow197.3%
associate-/l/97.4%
Applied egg-rr97.4%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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%
Simplified17.0%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr42.2%
Final simplification59.9%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (* (/ c0 (* w h)) (/ (* d d) (* D D))))
(t_1 (/ c0 (* 2.0 w)))
(t_2 (/ (* c0 (* d d)) (* (* w h) (* D D))))
(t_3 (* t_1 (+ t_2 (sqrt (- (* t_2 t_2) (* M_m M_m)))))))
(if (<= t_3 2e+307)
(* (/ 1.0 (* w (/ 2.0 c0))) (+ t_0 (sqrt (- (* t_0 t_0) (* M_m M_m)))))
(if (<= t_3 INFINITY)
(* t_1 (pow (* (/ d D) (sqrt (* 2.0 (/ (/ c0 h) w)))) 2.0))
(* c0 (/ (log (exp M_m)) (* 2.0 w)))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 / (w * h)) * ((d * d) / (D * D));
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_3 = t_1 * (t_2 + sqrt(((t_2 * t_2) - (M_m * M_m))));
double tmp;
if (t_3 <= 2e+307) {
tmp = (1.0 / (w * (2.0 / c0))) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m))));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_1 * pow(((d / D) * sqrt((2.0 * ((c0 / h) / w)))), 2.0);
} else {
tmp = c0 * (log(exp(M_m)) / (2.0 * w));
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 / (w * h)) * ((d * d) / (D * D));
double t_1 = c0 / (2.0 * w);
double t_2 = (c0 * (d * d)) / ((w * h) * (D * D));
double t_3 = t_1 * (t_2 + Math.sqrt(((t_2 * t_2) - (M_m * M_m))));
double tmp;
if (t_3 <= 2e+307) {
tmp = (1.0 / (w * (2.0 / c0))) * (t_0 + Math.sqrt(((t_0 * t_0) - (M_m * M_m))));
} else if (t_3 <= Double.POSITIVE_INFINITY) {
tmp = t_1 * Math.pow(((d / D) * Math.sqrt((2.0 * ((c0 / h) / w)))), 2.0);
} else {
tmp = c0 * (Math.log(Math.exp(M_m)) / (2.0 * w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = (c0 / (w * h)) * ((d * d) / (D * D)) t_1 = c0 / (2.0 * w) t_2 = (c0 * (d * d)) / ((w * h) * (D * D)) t_3 = t_1 * (t_2 + math.sqrt(((t_2 * t_2) - (M_m * M_m)))) tmp = 0 if t_3 <= 2e+307: tmp = (1.0 / (w * (2.0 / c0))) * (t_0 + math.sqrt(((t_0 * t_0) - (M_m * M_m)))) elif t_3 <= math.inf: tmp = t_1 * math.pow(((d / D) * math.sqrt((2.0 * ((c0 / h) / w)))), 2.0) else: tmp = c0 * (math.log(math.exp(M_m)) / (2.0 * w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(c0 / Float64(w * h)) * Float64(Float64(d * d) / Float64(D * D))) t_1 = Float64(c0 / Float64(2.0 * w)) t_2 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) t_3 = Float64(t_1 * Float64(t_2 + sqrt(Float64(Float64(t_2 * t_2) - Float64(M_m * M_m))))) tmp = 0.0 if (t_3 <= 2e+307) tmp = Float64(Float64(1.0 / Float64(w * Float64(2.0 / c0))) * Float64(t_0 + sqrt(Float64(Float64(t_0 * t_0) - Float64(M_m * M_m))))); elseif (t_3 <= Inf) tmp = Float64(t_1 * (Float64(Float64(d / D) * sqrt(Float64(2.0 * Float64(Float64(c0 / h) / w)))) ^ 2.0)); else tmp = Float64(c0 * Float64(log(exp(M_m)) / Float64(2.0 * w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = (c0 / (w * h)) * ((d * d) / (D * D)); t_1 = c0 / (2.0 * w); t_2 = (c0 * (d * d)) / ((w * h) * (D * D)); t_3 = t_1 * (t_2 + sqrt(((t_2 * t_2) - (M_m * M_m)))); tmp = 0.0; if (t_3 <= 2e+307) tmp = (1.0 / (w * (2.0 / c0))) * (t_0 + sqrt(((t_0 * t_0) - (M_m * M_m)))); elseif (t_3 <= Inf) tmp = t_1 * (((d / D) * sqrt((2.0 * ((c0 / h) / w)))) ^ 2.0); else tmp = c0 * (log(exp(M_m)) / (2.0 * w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(c0 / N[(w * h), $MachinePrecision]), $MachinePrecision] * N[(N[(d * d), $MachinePrecision] / N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 * N[(t$95$2 + N[Sqrt[N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 2e+307], N[(N[(1.0 / N[(w * N[(2.0 / c0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[Sqrt[N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t$95$1 * N[Power[N[(N[(d / D), $MachinePrecision] * N[Sqrt[N[(2.0 * N[(N[(c0 / h), $MachinePrecision] / w), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Log[N[Exp[M$95$m], $MachinePrecision]], $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{w \cdot h} \cdot \frac{d \cdot d}{D \cdot D}\\
t_1 := \frac{c0}{2 \cdot w}\\
t_2 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
t_3 := t\_1 \cdot \left(t\_2 + \sqrt{t\_2 \cdot t\_2 - M\_m \cdot M\_m}\right)\\
\mathbf{if}\;t\_3 \leq 2 \cdot 10^{+307}:\\
\;\;\;\;\frac{1}{w \cdot \frac{2}{c0}} \cdot \left(t\_0 + \sqrt{t\_0 \cdot t\_0 - M\_m \cdot M\_m}\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_1 \cdot {\left(\frac{d}{D} \cdot \sqrt{2 \cdot \frac{\frac{c0}{h}}{w}}\right)}^{2}\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\log \left(e^{M\_m}\right)}{2 \cdot w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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.99999999999999997e307Initial program 82.8%
Simplified86.3%
clear-num86.3%
inv-pow86.3%
*-commutative86.3%
Applied egg-rr86.3%
unpow-186.3%
associate-/l*86.3%
Simplified86.3%
if 1.99999999999999997e307 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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 83.7%
Simplified83.5%
frac-times81.2%
pow281.2%
associate-*l*81.2%
pow281.2%
Applied egg-rr81.2%
associate-*r/81.2%
Simplified81.2%
Taylor expanded in c0 around inf 83.7%
*-commutative83.7%
times-frac83.5%
unpow283.5%
unpow283.5%
times-frac88.1%
unpow288.1%
*-commutative88.1%
associate-/r*88.1%
Simplified88.1%
add-sqr-sqrt88.1%
pow288.1%
associate-*r*88.1%
sqrt-prod88.1%
associate-/l/88.1%
sqrt-pow195.0%
metadata-eval95.0%
pow195.0%
Applied egg-rr95.0%
*-commutative95.0%
associate-/r*95.1%
Simplified95.1%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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%
Simplified17.0%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr42.2%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m))))) INFINITY)
(* t_0 (* 2.0 (/ (* (/ c0 w) (pow (/ d D) 2.0)) h)))
(* c0 (/ (log (exp M_m)) (* 2.0 w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * (((c0 / w) * pow((d / D), 2.0)) / h));
} else {
tmp = c0 * (log(exp(M_m)) / (2.0 * w));
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (2.0 * (((c0 / w) * Math.pow((d / D), 2.0)) / h));
} else {
tmp = c0 * (Math.log(Math.exp(M_m)) / (2.0 * w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= math.inf: tmp = t_0 * (2.0 * (((c0 / w) * math.pow((d / D), 2.0)) / h)) else: tmp = c0 * (math.log(math.exp(M_m)) / (2.0 * w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))) <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)) / h))); else tmp = Float64(c0 * Float64(log(exp(M_m)) / Float64(2.0 * w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Inf) tmp = t_0 * (2.0 * (((c0 / w) * ((d / D) ^ 2.0)) / h)); else tmp = c0 * (log(exp(M_m)) / (2.0 * w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[Log[N[Exp[M$95$m], $MachinePrecision]], $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \frac{\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}}{h}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\log \left(e^{M\_m}\right)}{2 \cdot w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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 83.2%
Simplified85.0%
frac-times80.1%
pow280.1%
associate-*l*75.9%
pow275.9%
Applied egg-rr75.9%
associate-*r/78.0%
Simplified78.0%
Taylor expanded in c0 around inf 81.2%
*-commutative81.2%
times-frac83.0%
unpow283.0%
unpow283.0%
times-frac85.1%
unpow285.1%
*-commutative85.1%
associate-/r*85.1%
Simplified85.1%
associate-*l/85.3%
Applied egg-rr85.3%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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%
Simplified17.0%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr42.2%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ c0 (* 2.0 w))) (t_1 (/ (* c0 (* d d)) (* (* w h) (* D D)))))
(if (<= (* t_0 (+ t_1 (sqrt (- (* t_1 t_1) (* M_m M_m))))) INFINITY)
(* t_0 (* 2.0 (/ (* (/ c0 w) (pow (/ d D) 2.0)) h)))
(* c0 (/ (+ (+ M_m 1.0) -1.0) (* 2.0 w))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= ((double) INFINITY)) {
tmp = t_0 * (2.0 * (((c0 / w) * pow((d / D), 2.0)) / h));
} else {
tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w));
}
return tmp;
}
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = c0 / (2.0 * w);
double t_1 = (c0 * (d * d)) / ((w * h) * (D * D));
double tmp;
if ((t_0 * (t_1 + Math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Double.POSITIVE_INFINITY) {
tmp = t_0 * (2.0 * (((c0 / w) * Math.pow((d / D), 2.0)) / h));
} else {
tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = c0 / (2.0 * w) t_1 = (c0 * (d * d)) / ((w * h) * (D * D)) tmp = 0 if (t_0 * (t_1 + math.sqrt(((t_1 * t_1) - (M_m * M_m))))) <= math.inf: tmp = t_0 * (2.0 * (((c0 / w) * math.pow((d / D), 2.0)) / h)) else: tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(c0 / Float64(2.0 * w)) t_1 = Float64(Float64(c0 * Float64(d * d)) / Float64(Float64(w * h) * Float64(D * D))) tmp = 0.0 if (Float64(t_0 * Float64(t_1 + sqrt(Float64(Float64(t_1 * t_1) - Float64(M_m * M_m))))) <= Inf) tmp = Float64(t_0 * Float64(2.0 * Float64(Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)) / h))); else tmp = Float64(c0 * Float64(Float64(Float64(M_m + 1.0) + -1.0) / Float64(2.0 * w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = c0 / (2.0 * w); t_1 = (c0 * (d * d)) / ((w * h) * (D * D)); tmp = 0.0; if ((t_0 * (t_1 + sqrt(((t_1 * t_1) - (M_m * M_m))))) <= Inf) tmp = t_0 * (2.0 * (((c0 / w) * ((d / D) ^ 2.0)) / h)); else tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(c0 * N[(d * d), $MachinePrecision]), $MachinePrecision] / N[(N[(w * h), $MachinePrecision] * N[(D * D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(t$95$1 + N[Sqrt[N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(M$95$m * M$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$0 * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] / h), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c0 * N[(N[(N[(M$95$m + 1.0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{c0}{2 \cdot w}\\
t_1 := \frac{c0 \cdot \left(d \cdot d\right)}{\left(w \cdot h\right) \cdot \left(D \cdot D\right)}\\
\mathbf{if}\;t\_0 \cdot \left(t\_1 + \sqrt{t\_1 \cdot t\_1 - M\_m \cdot M\_m}\right) \leq \infty:\\
\;\;\;\;t\_0 \cdot \left(2 \cdot \frac{\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}}{h}\right)\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\left(M\_m + 1\right) + -1}{2 \cdot w}\\
\end{array}
\end{array}
if (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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 83.2%
Simplified85.0%
frac-times80.1%
pow280.1%
associate-*l*75.9%
pow275.9%
Applied egg-rr75.9%
associate-*r/78.0%
Simplified78.0%
Taylor expanded in c0 around inf 81.2%
*-commutative81.2%
times-frac83.0%
unpow283.0%
unpow283.0%
times-frac85.1%
unpow285.1%
*-commutative85.1%
associate-/r*85.1%
Simplified85.1%
associate-*l/85.3%
Applied egg-rr85.3%
if +inf.0 < (*.f64 (/.f64 c0 (*.f64 #s(literal 2 binary64) 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%
Simplified17.0%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr42.2%
expm1-log1p-u40.6%
rem-log-exp22.1%
log1p-define41.9%
expm1-define41.9%
add-exp-log44.2%
+-commutative44.2%
Applied egg-rr44.2%
Final simplification59.0%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (/ c0 w) h)))
(if (<= M_m 2.25e-274)
(* (/ c0 (* 2.0 w)) (* 2.0 (* t_0 (/ d (* D (/ D d))))))
(if (<= M_m 3.5e-105) 0.0 (* (* (/ c0 w) (pow (/ d D) 2.0)) t_0)))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 / w) / h;
double tmp;
if (M_m <= 2.25e-274) {
tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (d / (D * (D / d)))));
} else if (M_m <= 3.5e-105) {
tmp = 0.0;
} else {
tmp = ((c0 / w) * pow((d / D), 2.0)) * t_0;
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: t_0
real(8) :: tmp
t_0 = (c0 / w) / h
if (m_m <= 2.25d-274) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (t_0 * (d_1 / (d * (d / d_1)))))
else if (m_m <= 3.5d-105) then
tmp = 0.0d0
else
tmp = ((c0 / w) * ((d_1 / d) ** 2.0d0)) * t_0
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 / w) / h;
double tmp;
if (M_m <= 2.25e-274) {
tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (d / (D * (D / d)))));
} else if (M_m <= 3.5e-105) {
tmp = 0.0;
} else {
tmp = ((c0 / w) * Math.pow((d / D), 2.0)) * t_0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = (c0 / w) / h tmp = 0 if M_m <= 2.25e-274: tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (d / (D * (D / d))))) elif M_m <= 3.5e-105: tmp = 0.0 else: tmp = ((c0 / w) * math.pow((d / D), 2.0)) * t_0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(c0 / w) / h) tmp = 0.0 if (M_m <= 2.25e-274) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(t_0 * Float64(d / Float64(D * Float64(D / d)))))); elseif (M_m <= 3.5e-105) tmp = 0.0; else tmp = Float64(Float64(Float64(c0 / w) * (Float64(d / D) ^ 2.0)) * t_0); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = (c0 / w) / h; tmp = 0.0; if (M_m <= 2.25e-274) tmp = (c0 / (2.0 * w)) * (2.0 * (t_0 * (d / (D * (D / d))))); elseif (M_m <= 3.5e-105) tmp = 0.0; else tmp = ((c0 / w) * ((d / D) ^ 2.0)) * t_0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]}, If[LessEqual[M$95$m, 2.25e-274], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(t$95$0 * N[(d / N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 3.5e-105], 0.0, N[(N[(N[(c0 / w), $MachinePrecision] * N[Power[N[(d / D), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{c0}{w}}{h}\\
\mathbf{if}\;M\_m \leq 2.25 \cdot 10^{-274}:\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(t\_0 \cdot \frac{d}{D \cdot \frac{D}{d}}\right)\right)\\
\mathbf{elif}\;M\_m \leq 3.5 \cdot 10^{-105}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{c0}{w} \cdot {\left(\frac{d}{D}\right)}^{2}\right) \cdot t\_0\\
\end{array}
\end{array}
if M < 2.24999999999999996e-274Initial program 31.0%
Simplified31.0%
frac-times30.2%
pow230.2%
associate-*l*28.7%
pow228.7%
Applied egg-rr28.7%
associate-*r/29.5%
Simplified29.5%
Taylor expanded in c0 around inf 37.8%
*-commutative37.8%
times-frac37.0%
unpow237.0%
unpow237.0%
times-frac44.0%
unpow244.0%
*-commutative44.0%
associate-/r*45.5%
Simplified45.5%
unpow245.5%
clear-num45.5%
frac-times44.0%
*-un-lft-identity44.0%
Applied egg-rr44.0%
if 2.24999999999999996e-274 < M < 3.5e-105Initial program 27.2%
Simplified32.3%
frac-times25.0%
pow225.0%
associate-*l*17.4%
pow217.4%
Applied egg-rr17.4%
associate-*r/20.1%
Simplified20.1%
Taylor expanded in c0 around -inf 16.5%
associate-*r*16.5%
mul-1-neg16.5%
distribute-lft1-in16.5%
metadata-eval16.5%
mul0-lft62.7%
distribute-lft-neg-in62.7%
distribute-rgt-neg-in62.7%
metadata-eval62.7%
Simplified62.7%
Taylor expanded in c0 around 0 68.2%
if 3.5e-105 < M Initial program 29.3%
Simplified29.3%
frac-times28.2%
pow228.2%
associate-*l*29.3%
pow229.3%
Applied egg-rr29.3%
associate-*r/29.3%
Simplified29.3%
Taylor expanded in c0 around inf 42.0%
*-commutative42.0%
times-frac42.1%
unpow242.1%
unpow242.1%
times-frac51.5%
unpow251.5%
*-commutative51.5%
associate-/r*53.7%
Simplified53.7%
associate-*l/52.6%
associate-/l/51.5%
Applied egg-rr51.5%
associate-*r*51.5%
associate-*l/51.5%
*-commutative51.5%
times-frac51.5%
metadata-eval51.5%
*-rgt-identity51.5%
rem-square-sqrt30.9%
*-rgt-identity30.9%
metadata-eval30.9%
times-frac30.9%
*-commutative30.9%
associate-*l/30.9%
*-rgt-identity30.9%
metadata-eval30.9%
times-frac30.9%
*-commutative30.9%
associate-*l/30.9%
*-commutative30.9%
unpow230.9%
rem-square-sqrt26.9%
Simplified54.8%
Final simplification51.1%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (or (<= M_m 2.02e-274) (not (<= M_m 4.4e-106))) (* (/ c0 (* 2.0 w)) (* 2.0 (* (/ (/ c0 w) h) (* (/ d D) (/ d D))))) 0.0))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if ((M_m <= 2.02e-274) || !(M_m <= 4.4e-106)) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D))));
} else {
tmp = 0.0;
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if ((m_m <= 2.02d-274) .or. (.not. (m_m <= 4.4d-106))) then
tmp = (c0 / (2.0d0 * w)) * (2.0d0 * (((c0 / w) / h) * ((d_1 / d) * (d_1 / d))))
else
tmp = 0.0d0
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if ((M_m <= 2.02e-274) || !(M_m <= 4.4e-106)) {
tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D))));
} else {
tmp = 0.0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if (M_m <= 2.02e-274) or not (M_m <= 4.4e-106): tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D)))) else: tmp = 0.0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if ((M_m <= 2.02e-274) || !(M_m <= 4.4e-106)) tmp = Float64(Float64(c0 / Float64(2.0 * w)) * Float64(2.0 * Float64(Float64(Float64(c0 / w) / h) * Float64(Float64(d / D) * Float64(d / D))))); else tmp = 0.0; end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if ((M_m <= 2.02e-274) || ~((M_m <= 4.4e-106))) tmp = (c0 / (2.0 * w)) * (2.0 * (((c0 / w) / h) * ((d / D) * (d / D)))); else tmp = 0.0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[Or[LessEqual[M$95$m, 2.02e-274], N[Not[LessEqual[M$95$m, 4.4e-106]], $MachinePrecision]], N[(N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision] * N[(2.0 * N[(N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision] * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 2.02 \cdot 10^{-274} \lor \neg \left(M\_m \leq 4.4 \cdot 10^{-106}\right):\\
\;\;\;\;\frac{c0}{2 \cdot w} \cdot \left(2 \cdot \left(\frac{\frac{c0}{w}}{h} \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if M < 2.01999999999999993e-274 or 4.39999999999999989e-106 < M Initial program 30.4%
Simplified30.3%
frac-times29.4%
pow229.4%
associate-*l*28.9%
pow228.9%
Applied egg-rr28.9%
associate-*r/29.4%
Simplified29.4%
Taylor expanded in c0 around inf 39.5%
*-commutative39.5%
times-frac39.0%
unpow239.0%
unpow239.0%
times-frac46.9%
unpow246.9%
*-commutative46.9%
associate-/r*48.7%
Simplified48.7%
unpow248.7%
Applied egg-rr48.7%
if 2.01999999999999993e-274 < M < 4.39999999999999989e-106Initial program 27.2%
Simplified32.3%
frac-times25.0%
pow225.0%
associate-*l*17.4%
pow217.4%
Applied egg-rr17.4%
associate-*r/20.1%
Simplified20.1%
Taylor expanded in c0 around -inf 16.5%
associate-*r*16.5%
mul-1-neg16.5%
distribute-lft1-in16.5%
metadata-eval16.5%
mul0-lft62.7%
distribute-lft-neg-in62.7%
distribute-rgt-neg-in62.7%
metadata-eval62.7%
Simplified62.7%
Taylor expanded in c0 around 0 68.2%
Final simplification51.6%
M_m = (fabs.f64 M)
(FPCore (c0 w h D d M_m)
:precision binary64
(let* ((t_0 (/ (/ c0 w) h)) (t_1 (/ c0 (* 2.0 w))))
(if (<= M_m 2.4e-274)
(* t_1 (* 2.0 (* t_0 (/ d (* D (/ D d))))))
(if (<= M_m 9.6e-107) 0.0 (* t_1 (* 2.0 (* t_0 (* (/ d D) (/ d D)))))))))M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 / w) / h;
double t_1 = c0 / (2.0 * w);
double tmp;
if (M_m <= 2.4e-274) {
tmp = t_1 * (2.0 * (t_0 * (d / (D * (D / d)))));
} else if (M_m <= 9.6e-107) {
tmp = 0.0;
} else {
tmp = t_1 * (2.0 * (t_0 * ((d / D) * (d / D))));
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (c0 / w) / h
t_1 = c0 / (2.0d0 * w)
if (m_m <= 2.4d-274) then
tmp = t_1 * (2.0d0 * (t_0 * (d_1 / (d * (d / d_1)))))
else if (m_m <= 9.6d-107) then
tmp = 0.0d0
else
tmp = t_1 * (2.0d0 * (t_0 * ((d_1 / d) * (d_1 / d))))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double t_0 = (c0 / w) / h;
double t_1 = c0 / (2.0 * w);
double tmp;
if (M_m <= 2.4e-274) {
tmp = t_1 * (2.0 * (t_0 * (d / (D * (D / d)))));
} else if (M_m <= 9.6e-107) {
tmp = 0.0;
} else {
tmp = t_1 * (2.0 * (t_0 * ((d / D) * (d / D))));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): t_0 = (c0 / w) / h t_1 = c0 / (2.0 * w) tmp = 0 if M_m <= 2.4e-274: tmp = t_1 * (2.0 * (t_0 * (d / (D * (D / d))))) elif M_m <= 9.6e-107: tmp = 0.0 else: tmp = t_1 * (2.0 * (t_0 * ((d / D) * (d / D)))) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) t_0 = Float64(Float64(c0 / w) / h) t_1 = Float64(c0 / Float64(2.0 * w)) tmp = 0.0 if (M_m <= 2.4e-274) tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(d / Float64(D * Float64(D / d)))))); elseif (M_m <= 9.6e-107) tmp = 0.0; else tmp = Float64(t_1 * Float64(2.0 * Float64(t_0 * Float64(Float64(d / D) * Float64(d / D))))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) t_0 = (c0 / w) / h; t_1 = c0 / (2.0 * w); tmp = 0.0; if (M_m <= 2.4e-274) tmp = t_1 * (2.0 * (t_0 * (d / (D * (D / d))))); elseif (M_m <= 9.6e-107) tmp = 0.0; else tmp = t_1 * (2.0 * (t_0 * ((d / D) * (d / D)))); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision]
code[c0_, w_, h_, D_, d_, M$95$m_] := Block[{t$95$0 = N[(N[(c0 / w), $MachinePrecision] / h), $MachinePrecision]}, Block[{t$95$1 = N[(c0 / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M$95$m, 2.4e-274], N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(d / N[(D * N[(D / d), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[M$95$m, 9.6e-107], 0.0, N[(t$95$1 * N[(2.0 * N[(t$95$0 * N[(N[(d / D), $MachinePrecision] * N[(d / D), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
t_0 := \frac{\frac{c0}{w}}{h}\\
t_1 := \frac{c0}{2 \cdot w}\\
\mathbf{if}\;M\_m \leq 2.4 \cdot 10^{-274}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_0 \cdot \frac{d}{D \cdot \frac{D}{d}}\right)\right)\\
\mathbf{elif}\;M\_m \leq 9.6 \cdot 10^{-107}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(2 \cdot \left(t\_0 \cdot \left(\frac{d}{D} \cdot \frac{d}{D}\right)\right)\right)\\
\end{array}
\end{array}
if M < 2.4e-274Initial program 31.0%
Simplified31.0%
frac-times30.2%
pow230.2%
associate-*l*28.7%
pow228.7%
Applied egg-rr28.7%
associate-*r/29.5%
Simplified29.5%
Taylor expanded in c0 around inf 37.8%
*-commutative37.8%
times-frac37.0%
unpow237.0%
unpow237.0%
times-frac44.0%
unpow244.0%
*-commutative44.0%
associate-/r*45.5%
Simplified45.5%
unpow245.5%
clear-num45.5%
frac-times44.0%
*-un-lft-identity44.0%
Applied egg-rr44.0%
if 2.4e-274 < M < 9.59999999999999977e-107Initial program 27.2%
Simplified32.3%
frac-times25.0%
pow225.0%
associate-*l*17.4%
pow217.4%
Applied egg-rr17.4%
associate-*r/20.1%
Simplified20.1%
Taylor expanded in c0 around -inf 16.5%
associate-*r*16.5%
mul-1-neg16.5%
distribute-lft1-in16.5%
metadata-eval16.5%
mul0-lft62.7%
distribute-lft-neg-in62.7%
distribute-rgt-neg-in62.7%
metadata-eval62.7%
Simplified62.7%
Taylor expanded in c0 around 0 68.2%
if 9.59999999999999977e-107 < M Initial program 29.3%
Simplified29.3%
frac-times28.2%
pow228.2%
associate-*l*29.3%
pow229.3%
Applied egg-rr29.3%
associate-*r/29.3%
Simplified29.3%
Taylor expanded in c0 around inf 42.0%
*-commutative42.0%
times-frac42.1%
unpow242.1%
unpow242.1%
times-frac51.5%
unpow251.5%
*-commutative51.5%
associate-/r*53.7%
Simplified53.7%
unpow253.7%
Applied egg-rr53.7%
Final simplification50.8%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= M_m 4.1e-25) 0.0 (* c0 (/ (/ (* M_m (+ 2.0 M_m)) M_m) (* 2.0 w)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 4.1e-25) {
tmp = 0.0;
} else {
tmp = c0 * (((M_m * (2.0 + M_m)) / M_m) / (2.0 * w));
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (m_m <= 4.1d-25) then
tmp = 0.0d0
else
tmp = c0 * (((m_m * (2.0d0 + m_m)) / m_m) / (2.0d0 * w))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 4.1e-25) {
tmp = 0.0;
} else {
tmp = c0 * (((M_m * (2.0 + M_m)) / M_m) / (2.0 * w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if M_m <= 4.1e-25: tmp = 0.0 else: tmp = c0 * (((M_m * (2.0 + M_m)) / M_m) / (2.0 * w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 4.1e-25) tmp = 0.0; else tmp = Float64(c0 * Float64(Float64(Float64(M_m * Float64(2.0 + M_m)) / M_m) / Float64(2.0 * w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (M_m <= 4.1e-25) tmp = 0.0; else tmp = c0 * (((M_m * (2.0 + M_m)) / M_m) / (2.0 * w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 4.1e-25], 0.0, N[(c0 * N[(N[(N[(M$95$m * N[(2.0 + M$95$m), $MachinePrecision]), $MachinePrecision] / M$95$m), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 4.1 \cdot 10^{-25}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\frac{M\_m \cdot \left(2 + M\_m\right)}{M\_m}}{2 \cdot w}\\
\end{array}
\end{array}
if M < 4.09999999999999987e-25Initial program 30.8%
Simplified31.7%
frac-times29.3%
pow229.3%
associate-*l*27.3%
pow227.3%
Applied egg-rr27.3%
associate-*r/28.3%
Simplified28.3%
Taylor expanded in c0 around -inf 5.4%
associate-*r*5.4%
mul-1-neg5.4%
distribute-lft1-in5.4%
metadata-eval5.4%
mul0-lft34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-in34.4%
metadata-eval34.4%
Simplified34.4%
Taylor expanded in c0 around 0 39.8%
if 4.09999999999999987e-25 < M Initial program 27.2%
Simplified43.3%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr36.9%
sub-neg36.9%
log1p-undefine36.9%
rem-exp-log36.9%
metadata-eval36.9%
Simplified36.9%
flip-+35.2%
pow235.2%
+-commutative35.2%
metadata-eval35.2%
add-exp-log35.2%
expm1-define35.2%
log1p-define35.3%
expm1-log1p-u35.3%
Applied egg-rr35.3%
unpow235.3%
difference-of-sqr-135.3%
associate-+l+35.3%
metadata-eval35.3%
associate--l+36.9%
metadata-eval36.9%
+-rgt-identity36.9%
Simplified36.9%
Final simplification39.1%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= w -1.08e+60) 0.0 (* c0 (/ (+ (+ M_m 1.0) -1.0) (* 2.0 w)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (w <= -1.08e+60) {
tmp = 0.0;
} else {
tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w));
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (w <= (-1.08d+60)) then
tmp = 0.0d0
else
tmp = c0 * (((m_m + 1.0d0) + (-1.0d0)) / (2.0d0 * w))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (w <= -1.08e+60) {
tmp = 0.0;
} else {
tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if w <= -1.08e+60: tmp = 0.0 else: tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (w <= -1.08e+60) tmp = 0.0; else tmp = Float64(c0 * Float64(Float64(Float64(M_m + 1.0) + -1.0) / Float64(2.0 * w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (w <= -1.08e+60) tmp = 0.0; else tmp = c0 * (((M_m + 1.0) + -1.0) / (2.0 * w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[w, -1.08e+60], 0.0, N[(c0 * N[(N[(N[(M$95$m + 1.0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(2.0 * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.08 \cdot 10^{+60}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \frac{\left(M\_m + 1\right) + -1}{2 \cdot w}\\
\end{array}
\end{array}
if w < -1.08e60Initial program 23.5%
Simplified25.8%
frac-times21.3%
pow221.3%
associate-*l*21.2%
pow221.2%
Applied egg-rr21.2%
associate-*r/23.5%
Simplified23.5%
Taylor expanded in c0 around -inf 11.9%
associate-*r*11.9%
mul-1-neg11.9%
distribute-lft1-in11.9%
metadata-eval11.9%
mul0-lft50.5%
distribute-lft-neg-in50.5%
distribute-rgt-neg-in50.5%
metadata-eval50.5%
Simplified50.5%
Taylor expanded in c0 around 0 50.5%
if -1.08e60 < w Initial program 31.2%
Simplified40.9%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr36.4%
expm1-log1p-u35.2%
rem-log-exp18.3%
log1p-define33.6%
expm1-define33.6%
add-exp-log34.9%
+-commutative34.9%
Applied egg-rr34.9%
Final simplification37.5%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= M_m 9.5e-24) 0.0 (* c0 (* (/ M_m w) 0.5))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 9.5e-24) {
tmp = 0.0;
} else {
tmp = c0 * ((M_m / w) * 0.5);
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (m_m <= 9.5d-24) then
tmp = 0.0d0
else
tmp = c0 * ((m_m / w) * 0.5d0)
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 9.5e-24) {
tmp = 0.0;
} else {
tmp = c0 * ((M_m / w) * 0.5);
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if M_m <= 9.5e-24: tmp = 0.0 else: tmp = c0 * ((M_m / w) * 0.5) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 9.5e-24) tmp = 0.0; else tmp = Float64(c0 * Float64(Float64(M_m / w) * 0.5)); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (M_m <= 9.5e-24) tmp = 0.0; else tmp = c0 * ((M_m / w) * 0.5); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 9.5e-24], 0.0, N[(c0 * N[(N[(M$95$m / w), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 9.5 \cdot 10^{-24}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(\frac{M\_m}{w} \cdot 0.5\right)\\
\end{array}
\end{array}
if M < 9.50000000000000029e-24Initial program 30.8%
Simplified31.7%
frac-times29.3%
pow229.3%
associate-*l*27.3%
pow227.3%
Applied egg-rr27.3%
associate-*r/28.3%
Simplified28.3%
Taylor expanded in c0 around -inf 5.4%
associate-*r*5.4%
mul-1-neg5.4%
distribute-lft1-in5.4%
metadata-eval5.4%
mul0-lft34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-in34.4%
metadata-eval34.4%
Simplified34.4%
Taylor expanded in c0 around 0 39.8%
if 9.50000000000000029e-24 < M Initial program 27.2%
Simplified43.3%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr36.9%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= M_m 9.5e-24) 0.0 (* c0 (* M_m (/ 0.5 w)))))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 9.5e-24) {
tmp = 0.0;
} else {
tmp = c0 * (M_m * (0.5 / w));
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (m_m <= 9.5d-24) then
tmp = 0.0d0
else
tmp = c0 * (m_m * (0.5d0 / w))
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (M_m <= 9.5e-24) {
tmp = 0.0;
} else {
tmp = c0 * (M_m * (0.5 / w));
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if M_m <= 9.5e-24: tmp = 0.0 else: tmp = c0 * (M_m * (0.5 / w)) return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (M_m <= 9.5e-24) tmp = 0.0; else tmp = Float64(c0 * Float64(M_m * Float64(0.5 / w))); end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (M_m <= 9.5e-24) tmp = 0.0; else tmp = c0 * (M_m * (0.5 / w)); end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[M$95$m, 9.5e-24], 0.0, N[(c0 * N[(M$95$m * N[(0.5 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;M\_m \leq 9.5 \cdot 10^{-24}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;c0 \cdot \left(M\_m \cdot \frac{0.5}{w}\right)\\
\end{array}
\end{array}
if M < 9.50000000000000029e-24Initial program 30.8%
Simplified31.7%
frac-times29.3%
pow229.3%
associate-*l*27.3%
pow227.3%
Applied egg-rr27.3%
associate-*r/28.3%
Simplified28.3%
Taylor expanded in c0 around -inf 5.4%
associate-*r*5.4%
mul-1-neg5.4%
distribute-lft1-in5.4%
metadata-eval5.4%
mul0-lft34.4%
distribute-lft-neg-in34.4%
distribute-rgt-neg-in34.4%
metadata-eval34.4%
Simplified34.4%
Taylor expanded in c0 around 0 39.8%
if 9.50000000000000029e-24 < M Initial program 27.2%
Simplified43.3%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr40.7%
Taylor expanded in M around 0 36.9%
associate-*r/36.9%
*-commutative36.9%
associate-*r/36.9%
Simplified36.9%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 (if (<= c0 -6.4e+168) (/ c0 w) 0.0))
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (c0 <= -6.4e+168) {
tmp = c0 / w;
} else {
tmp = 0.0;
}
return tmp;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
real(8) :: tmp
if (c0 <= (-6.4d+168)) then
tmp = c0 / w
else
tmp = 0.0d0
end if
code = tmp
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
double tmp;
if (c0 <= -6.4e+168) {
tmp = c0 / w;
} else {
tmp = 0.0;
}
return tmp;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): tmp = 0 if c0 <= -6.4e+168: tmp = c0 / w else: tmp = 0.0 return tmp
M_m = abs(M) function code(c0, w, h, D, d, M_m) tmp = 0.0 if (c0 <= -6.4e+168) tmp = Float64(c0 / w); else tmp = 0.0; end return tmp end
M_m = abs(M); function tmp_2 = code(c0, w, h, D, d, M_m) tmp = 0.0; if (c0 <= -6.4e+168) tmp = c0 / w; else tmp = 0.0; end tmp_2 = tmp; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := If[LessEqual[c0, -6.4e+168], N[(c0 / w), $MachinePrecision], 0.0]
\begin{array}{l}
M_m = \left|M\right|
\\
\begin{array}{l}
\mathbf{if}\;c0 \leq -6.4 \cdot 10^{+168}:\\
\;\;\;\;\frac{c0}{w}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if c0 < -6.4000000000000002e168Initial program 41.3%
Simplified53.1%
Taylor expanded in c0 around 0 0.0%
Applied egg-rr28.3%
sub-neg28.3%
log1p-undefine28.3%
rem-exp-log29.2%
metadata-eval29.2%
Simplified29.2%
Taylor expanded in M around 0 31.6%
if -6.4000000000000002e168 < c0 Initial program 28.2%
Simplified28.6%
frac-times26.8%
pow226.8%
associate-*l*26.0%
pow226.0%
Applied egg-rr26.0%
associate-*r/26.9%
Simplified26.9%
Taylor expanded in c0 around -inf 4.7%
associate-*r*4.7%
mul-1-neg4.7%
distribute-lft1-in4.7%
metadata-eval4.7%
mul0-lft32.9%
distribute-lft-neg-in32.9%
distribute-rgt-neg-in32.9%
metadata-eval32.9%
Simplified32.9%
Taylor expanded in c0 around 0 37.2%
M_m = (fabs.f64 M) (FPCore (c0 w h D d M_m) :precision binary64 0.0)
M_m = fabs(M);
double code(double c0, double w, double h, double D, double d, double M_m) {
return 0.0;
}
M_m = abs(m)
real(8) function code(c0, w, h, d, d_1, m_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_m
code = 0.0d0
end function
M_m = Math.abs(M);
public static double code(double c0, double w, double h, double D, double d, double M_m) {
return 0.0;
}
M_m = math.fabs(M) def code(c0, w, h, D, d, M_m): return 0.0
M_m = abs(M) function code(c0, w, h, D, d, M_m) return 0.0 end
M_m = abs(M); function tmp = code(c0, w, h, D, d, M_m) tmp = 0.0; end
M_m = N[Abs[M], $MachinePrecision] code[c0_, w_, h_, D_, d_, M$95$m_] := 0.0
\begin{array}{l}
M_m = \left|M\right|
\\
0
\end{array}
Initial program 29.9%
Simplified30.6%
frac-times28.8%
pow228.8%
associate-*l*27.3%
pow227.3%
Applied egg-rr27.3%
associate-*r/28.1%
Simplified28.1%
Taylor expanded in c0 around -inf 4.1%
associate-*r*4.1%
mul-1-neg4.1%
distribute-lft1-in4.1%
metadata-eval4.1%
mul0-lft29.9%
distribute-lft-neg-in29.9%
distribute-rgt-neg-in29.9%
metadata-eval29.9%
Simplified29.9%
Taylor expanded in c0 around 0 34.1%
herbie shell --seed 2024150
(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))))))