
(FPCore (K m n M l) :precision binary64 (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l): return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l) return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n)))))) end
function tmp = code(K, m, n, M, l) tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n))))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (K m n M l) :precision binary64 (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l): return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l) return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n)))))) end
function tmp = code(K, m, n, M, l) tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n))))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (cbrt (* (* K 0.5) (+ m n))))
(t_1 (fabs (- m n)))
(t_2 (pow (- (/ (+ m n) 2.0) M) 2.0))
(t_3 (exp (- (- t_1 l) t_2))))
(if (<= (* (cos (- (/ (* K (+ m n)) 2.0) M)) t_3) INFINITY)
(* (cos (- (* t_0 (pow t_0 2.0)) M)) (exp (- t_1 (+ l t_2))))
(* (cos M) t_3))))
double code(double K, double m, double n, double M, double l) {
double t_0 = cbrt(((K * 0.5) * (m + n)));
double t_1 = fabs((m - n));
double t_2 = pow((((m + n) / 2.0) - M), 2.0);
double t_3 = exp(((t_1 - l) - t_2));
double tmp;
if ((cos((((K * (m + n)) / 2.0) - M)) * t_3) <= ((double) INFINITY)) {
tmp = cos(((t_0 * pow(t_0, 2.0)) - M)) * exp((t_1 - (l + t_2)));
} else {
tmp = cos(M) * t_3;
}
return tmp;
}
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.cbrt(((K * 0.5) * (m + n)));
double t_1 = Math.abs((m - n));
double t_2 = Math.pow((((m + n) / 2.0) - M), 2.0);
double t_3 = Math.exp(((t_1 - l) - t_2));
double tmp;
if ((Math.cos((((K * (m + n)) / 2.0) - M)) * t_3) <= Double.POSITIVE_INFINITY) {
tmp = Math.cos(((t_0 * Math.pow(t_0, 2.0)) - M)) * Math.exp((t_1 - (l + t_2)));
} else {
tmp = Math.cos(M) * t_3;
}
return tmp;
}
function code(K, m, n, M, l) t_0 = cbrt(Float64(Float64(K * 0.5) * Float64(m + n))) t_1 = abs(Float64(m - n)) t_2 = Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0 t_3 = exp(Float64(Float64(t_1 - l) - t_2)) tmp = 0.0 if (Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * t_3) <= Inf) tmp = Float64(cos(Float64(Float64(t_0 * (t_0 ^ 2.0)) - M)) * exp(Float64(t_1 - Float64(l + t_2)))); else tmp = Float64(cos(M) * t_3); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Power[N[(N[(K * 0.5), $MachinePrecision] * N[(m + n), $MachinePrecision]), $MachinePrecision], 1/3], $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]}, Block[{t$95$3 = N[Exp[N[(N[(t$95$1 - l), $MachinePrecision] - t$95$2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * t$95$3), $MachinePrecision], Infinity], N[(N[Cos[N[(N[(t$95$0 * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(t$95$1 - N[(l + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * t$95$3), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{\left(K \cdot 0.5\right) \cdot \left(m + n\right)}\\
t_1 := \left|m - n\right|\\
t_2 := {\left(\frac{m + n}{2} - M\right)}^{2}\\
t_3 := e^{\left(t_1 - \ell\right) - t_2}\\
\mathbf{if}\;\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot t_3 \leq \infty:\\
\;\;\;\;\cos \left(t_0 \cdot {t_0}^{2} - M\right) \cdot e^{t_1 - \left(\ell + t_2\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot t_3\\
\end{array}
\end{array}
if (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) 2) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) 2) M) 2)) (-.f64 l (fabs.f64 (-.f64 m n)))))) < +inf.0Initial program 96.3%
associate-/l*95.7%
associate--r-95.7%
Simplified95.7%
associate-/r/96.3%
*-commutative96.3%
add-cube-cbrt96.9%
pow296.9%
div-inv96.9%
metadata-eval96.9%
div-inv96.9%
metadata-eval96.9%
Applied egg-rr96.9%
if +inf.0 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) 2) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) 2) M) 2)) (-.f64 l (fabs.f64 (-.f64 m n)))))) Initial program 0.0%
*-commutative0.0%
associate-*r/0.0%
associate--r-0.0%
+-commutative0.0%
associate-+r-0.0%
unsub-neg0.0%
associate--r+0.0%
+-commutative0.0%
associate--r+0.0%
Simplified0.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Final simplification97.5%
(FPCore (K m n M l) :precision binary64 (* (cos M) (exp (- (- (fabs (- m n)) l) (pow (- (/ (+ m n) 2.0) M) 2.0)))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * exp(((fabs((m - n)) - l) - pow((((m + n) / 2.0) - M), 2.0)));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos(m_1) * exp(((abs((m - n)) - l) - ((((m + n) / 2.0d0) - m_1) ** 2.0d0)))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M) * Math.exp(((Math.abs((m - n)) - l) - Math.pow((((m + n) / 2.0) - M), 2.0)));
}
def code(K, m, n, M, l): return math.cos(M) * math.exp(((math.fabs((m - n)) - l) - math.pow((((m + n) / 2.0) - M), 2.0)))
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(Float64(abs(Float64(m - n)) - l) - (Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp(((abs((m - n)) - l) - ((((m + n) / 2.0) - M) ^ 2.0))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) - {\left(\frac{m + n}{2} - M\right)}^{2}}
\end{array}
Initial program 78.6%
*-commutative78.6%
associate-*r/78.6%
associate--r-78.6%
+-commutative78.6%
associate-+r-78.6%
unsub-neg78.6%
associate--r+78.6%
+-commutative78.6%
associate--r+78.6%
Simplified78.6%
Taylor expanded in K around 0 95.9%
cos-neg95.9%
Simplified95.9%
Final simplification95.9%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (cos M) (exp (* -0.25 (* n n)))))
(t_1 (fabs (- m n)))
(t_2 (- t_1 l)))
(if (<= m -10.5)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= m -8e-89)
(* (cos (* 0.5 (* K n))) (exp (- t_2 (* M M))))
(if (<= m -2.32e-147)
t_0
(if (<= m -1.8e-226)
(* (cos M) (exp (- (* M (- (+ m n) M)) (- l t_1))))
(if (<= m 5.7e-160)
(*
(cos (- (* (+ m n) (/ K 2.0)) M))
(exp (- t_2 (* (* n n) 0.25))))
t_0)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = cos(M) * exp((-0.25 * (n * n)));
double t_1 = fabs((m - n));
double t_2 = t_1 - l;
double tmp;
if (m <= -10.5) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (m <= -8e-89) {
tmp = cos((0.5 * (K * n))) * exp((t_2 - (M * M)));
} else if (m <= -2.32e-147) {
tmp = t_0;
} else if (m <= -1.8e-226) {
tmp = cos(M) * exp(((M * ((m + n) - M)) - (l - t_1)));
} else if (m <= 5.7e-160) {
tmp = cos((((m + n) * (K / 2.0)) - M)) * exp((t_2 - ((n * n) * 0.25)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = cos(m_1) * exp(((-0.25d0) * (n * n)))
t_1 = abs((m - n))
t_2 = t_1 - l
if (m <= (-10.5d0)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (m <= (-8d-89)) then
tmp = cos((0.5d0 * (k * n))) * exp((t_2 - (m_1 * m_1)))
else if (m <= (-2.32d-147)) then
tmp = t_0
else if (m <= (-1.8d-226)) then
tmp = cos(m_1) * exp(((m_1 * ((m + n) - m_1)) - (l - t_1)))
else if (m <= 5.7d-160) then
tmp = cos((((m + n) * (k / 2.0d0)) - m_1)) * exp((t_2 - ((n * n) * 0.25d0)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.cos(M) * Math.exp((-0.25 * (n * n)));
double t_1 = Math.abs((m - n));
double t_2 = t_1 - l;
double tmp;
if (m <= -10.5) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (m <= -8e-89) {
tmp = Math.cos((0.5 * (K * n))) * Math.exp((t_2 - (M * M)));
} else if (m <= -2.32e-147) {
tmp = t_0;
} else if (m <= -1.8e-226) {
tmp = Math.cos(M) * Math.exp(((M * ((m + n) - M)) - (l - t_1)));
} else if (m <= 5.7e-160) {
tmp = Math.cos((((m + n) * (K / 2.0)) - M)) * Math.exp((t_2 - ((n * n) * 0.25)));
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.cos(M) * math.exp((-0.25 * (n * n))) t_1 = math.fabs((m - n)) t_2 = t_1 - l tmp = 0 if m <= -10.5: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif m <= -8e-89: tmp = math.cos((0.5 * (K * n))) * math.exp((t_2 - (M * M))) elif m <= -2.32e-147: tmp = t_0 elif m <= -1.8e-226: tmp = math.cos(M) * math.exp(((M * ((m + n) - M)) - (l - t_1))) elif m <= 5.7e-160: tmp = math.cos((((m + n) * (K / 2.0)) - M)) * math.exp((t_2 - ((n * n) * 0.25))) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))) t_1 = abs(Float64(m - n)) t_2 = Float64(t_1 - l) tmp = 0.0 if (m <= -10.5) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -8e-89) tmp = Float64(cos(Float64(0.5 * Float64(K * n))) * exp(Float64(t_2 - Float64(M * M)))); elseif (m <= -2.32e-147) tmp = t_0; elseif (m <= -1.8e-226) tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(Float64(m + n) - M)) - Float64(l - t_1)))); elseif (m <= 5.7e-160) tmp = Float64(cos(Float64(Float64(Float64(m + n) * Float64(K / 2.0)) - M)) * exp(Float64(t_2 - Float64(Float64(n * n) * 0.25)))); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = cos(M) * exp((-0.25 * (n * n))); t_1 = abs((m - n)); t_2 = t_1 - l; tmp = 0.0; if (m <= -10.5) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (m <= -8e-89) tmp = cos((0.5 * (K * n))) * exp((t_2 - (M * M))); elseif (m <= -2.32e-147) tmp = t_0; elseif (m <= -1.8e-226) tmp = cos(M) * exp(((M * ((m + n) - M)) - (l - t_1))); elseif (m <= 5.7e-160) tmp = cos((((m + n) * (K / 2.0)) - M)) * exp((t_2 - ((n * n) * 0.25))); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - l), $MachinePrecision]}, If[LessEqual[m, -10.5], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -8e-89], N[(N[Cos[N[(0.5 * N[(K * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(t$95$2 - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -2.32e-147], t$95$0, If[LessEqual[m, -1.8e-226], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(N[(m + n), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision] - N[(l - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, 5.7e-160], N[(N[Cos[N[(N[(N[(m + n), $MachinePrecision] * N[(K / 2.0), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(t$95$2 - N[(N[(n * n), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
t_1 := \left|m - n\right|\\
t_2 := t_1 - \ell\\
\mathbf{if}\;m \leq -10.5:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -8 \cdot 10^{-89}:\\
\;\;\;\;\cos \left(0.5 \cdot \left(K \cdot n\right)\right) \cdot e^{t_2 - M \cdot M}\\
\mathbf{elif}\;m \leq -2.32 \cdot 10^{-147}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;m \leq -1.8 \cdot 10^{-226}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(\left(m + n\right) - M\right) - \left(\ell - t_1\right)}\\
\mathbf{elif}\;m \leq 5.7 \cdot 10^{-160}:\\
\;\;\;\;\cos \left(\left(m + n\right) \cdot \frac{K}{2} - M\right) \cdot e^{t_2 - \left(n \cdot n\right) \cdot 0.25}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if m < -10.5Initial program 72.9%
*-commutative72.9%
associate-*r/72.9%
associate--r-72.9%
+-commutative72.9%
associate-+r-72.9%
unsub-neg72.9%
associate--r+72.9%
+-commutative72.9%
associate--r+72.9%
Simplified72.9%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
Simplified98.6%
Taylor expanded in m around inf 98.6%
unpow298.6%
Simplified98.6%
if -10.5 < m < -8.00000000000000031e-89Initial program 93.3%
*-commutative93.3%
associate-*r/93.3%
associate--r-93.3%
+-commutative93.3%
associate-+r-93.3%
unsub-neg93.3%
associate--r+93.3%
+-commutative93.3%
associate--r+93.3%
Simplified93.3%
Taylor expanded in M around inf 80.2%
unpow280.2%
Simplified80.2%
Taylor expanded in n around inf 86.9%
if -8.00000000000000031e-89 < m < -2.3199999999999999e-147 or 5.70000000000000038e-160 < m Initial program 77.4%
*-commutative77.4%
associate-*r/77.4%
associate--r-77.4%
+-commutative77.4%
associate-+r-77.4%
unsub-neg77.4%
associate--r+77.4%
+-commutative77.4%
associate--r+77.4%
Simplified77.4%
Taylor expanded in K around 0 94.1%
cos-neg94.1%
Simplified94.1%
Taylor expanded in n around inf 53.2%
unpow253.2%
Simplified53.2%
if -2.3199999999999999e-147 < m < -1.79999999999999997e-226Initial program 84.2%
*-commutative84.2%
associate-*r/84.2%
associate--r-84.2%
+-commutative84.2%
associate-+r-84.2%
unsub-neg84.2%
associate--r+84.2%
+-commutative84.2%
associate--r+84.2%
Simplified84.2%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in M around inf 63.6%
+-commutative63.6%
unpow263.6%
associate-*r*63.6%
distribute-rgt-out63.7%
mul-1-neg63.7%
Simplified63.7%
if -1.79999999999999997e-226 < m < 5.70000000000000038e-160Initial program 83.6%
*-commutative83.6%
associate-*r/83.6%
associate--r-83.6%
+-commutative83.6%
associate-+r-83.6%
unsub-neg83.6%
associate--r+83.6%
+-commutative83.6%
associate--r+83.6%
Simplified83.6%
Taylor expanded in n around inf 66.6%
*-commutative66.6%
unpow266.6%
Simplified66.6%
Final simplification70.6%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (fabs (- m n))))
(if (<= m -10.5)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= m -2.4e-90)
(* (cos (* 0.5 (* K n))) (exp (- (- t_0 l) (* M M))))
(if (or (<= m -4.7e-146)
(not
(or (<= m -4.8e-222)
(and (not (<= m 7.5e-307)) (<= m 1.65e-159)))))
(* (cos M) (exp (* -0.25 (* n n))))
(* (cos M) (exp (- (* M (- (+ m n) M)) (- l t_0)))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fabs((m - n));
double tmp;
if (m <= -10.5) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (m <= -2.4e-90) {
tmp = cos((0.5 * (K * n))) * exp(((t_0 - l) - (M * M)));
} else if ((m <= -4.7e-146) || !((m <= -4.8e-222) || (!(m <= 7.5e-307) && (m <= 1.65e-159)))) {
tmp = cos(M) * exp((-0.25 * (n * n)));
} else {
tmp = cos(M) * exp(((M * ((m + n) - M)) - (l - t_0)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = abs((m - n))
if (m <= (-10.5d0)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (m <= (-2.4d-90)) then
tmp = cos((0.5d0 * (k * n))) * exp(((t_0 - l) - (m_1 * m_1)))
else if ((m <= (-4.7d-146)) .or. (.not. (m <= (-4.8d-222)) .or. (.not. (m <= 7.5d-307)) .and. (m <= 1.65d-159))) then
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
else
tmp = cos(m_1) * exp(((m_1 * ((m + n) - m_1)) - (l - t_0)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.abs((m - n));
double tmp;
if (m <= -10.5) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (m <= -2.4e-90) {
tmp = Math.cos((0.5 * (K * n))) * Math.exp(((t_0 - l) - (M * M)));
} else if ((m <= -4.7e-146) || !((m <= -4.8e-222) || (!(m <= 7.5e-307) && (m <= 1.65e-159)))) {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
} else {
tmp = Math.cos(M) * Math.exp(((M * ((m + n) - M)) - (l - t_0)));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.fabs((m - n)) tmp = 0 if m <= -10.5: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif m <= -2.4e-90: tmp = math.cos((0.5 * (K * n))) * math.exp(((t_0 - l) - (M * M))) elif (m <= -4.7e-146) or not ((m <= -4.8e-222) or (not (m <= 7.5e-307) and (m <= 1.65e-159))): tmp = math.cos(M) * math.exp((-0.25 * (n * n))) else: tmp = math.cos(M) * math.exp(((M * ((m + n) - M)) - (l - t_0))) return tmp
function code(K, m, n, M, l) t_0 = abs(Float64(m - n)) tmp = 0.0 if (m <= -10.5) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -2.4e-90) tmp = Float64(cos(Float64(0.5 * Float64(K * n))) * exp(Float64(Float64(t_0 - l) - Float64(M * M)))); elseif ((m <= -4.7e-146) || !((m <= -4.8e-222) || (!(m <= 7.5e-307) && (m <= 1.65e-159)))) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); else tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(Float64(m + n) - M)) - Float64(l - t_0)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = abs((m - n)); tmp = 0.0; if (m <= -10.5) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (m <= -2.4e-90) tmp = cos((0.5 * (K * n))) * exp(((t_0 - l) - (M * M))); elseif ((m <= -4.7e-146) || ~(((m <= -4.8e-222) || (~((m <= 7.5e-307)) && (m <= 1.65e-159))))) tmp = cos(M) * exp((-0.25 * (n * n))); else tmp = cos(M) * exp(((M * ((m + n) - M)) - (l - t_0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[m, -10.5], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -2.4e-90], N[(N[Cos[N[(0.5 * N[(K * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(t$95$0 - l), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[m, -4.7e-146], N[Not[Or[LessEqual[m, -4.8e-222], And[N[Not[LessEqual[m, 7.5e-307]], $MachinePrecision], LessEqual[m, 1.65e-159]]]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(N[(m + n), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision] - N[(l - t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|m - n\right|\\
\mathbf{if}\;m \leq -10.5:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -2.4 \cdot 10^{-90}:\\
\;\;\;\;\cos \left(0.5 \cdot \left(K \cdot n\right)\right) \cdot e^{\left(t_0 - \ell\right) - M \cdot M}\\
\mathbf{elif}\;m \leq -4.7 \cdot 10^{-146} \lor \neg \left(m \leq -4.8 \cdot 10^{-222} \lor \neg \left(m \leq 7.5 \cdot 10^{-307}\right) \land m \leq 1.65 \cdot 10^{-159}\right):\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(\left(m + n\right) - M\right) - \left(\ell - t_0\right)}\\
\end{array}
\end{array}
if m < -10.5Initial program 72.9%
*-commutative72.9%
associate-*r/72.9%
associate--r-72.9%
+-commutative72.9%
associate-+r-72.9%
unsub-neg72.9%
associate--r+72.9%
+-commutative72.9%
associate--r+72.9%
Simplified72.9%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
Simplified98.6%
Taylor expanded in m around inf 98.6%
unpow298.6%
Simplified98.6%
if -10.5 < m < -2.4000000000000002e-90Initial program 93.3%
*-commutative93.3%
associate-*r/93.3%
associate--r-93.3%
+-commutative93.3%
associate-+r-93.3%
unsub-neg93.3%
associate--r+93.3%
+-commutative93.3%
associate--r+93.3%
Simplified93.3%
Taylor expanded in M around inf 80.2%
unpow280.2%
Simplified80.2%
Taylor expanded in n around inf 86.9%
if -2.4000000000000002e-90 < m < -4.7e-146 or -4.79999999999999986e-222 < m < 7.5000000000000006e-307 or 1.6500000000000001e-159 < m Initial program 78.1%
*-commutative78.1%
associate-*r/78.1%
associate--r-78.1%
+-commutative78.1%
associate-+r-78.1%
unsub-neg78.1%
associate--r+78.1%
+-commutative78.1%
associate--r+78.1%
Simplified78.1%
Taylor expanded in K around 0 93.2%
cos-neg93.2%
Simplified93.2%
Taylor expanded in n around inf 54.3%
unpow254.3%
Simplified54.3%
if -4.7e-146 < m < -4.79999999999999986e-222 or 7.5000000000000006e-307 < m < 1.6500000000000001e-159Initial program 84.3%
*-commutative84.3%
associate-*r/84.3%
associate--r-84.3%
+-commutative84.3%
associate-+r-84.3%
unsub-neg84.3%
associate--r+84.3%
+-commutative84.3%
associate--r+84.3%
Simplified84.3%
Taylor expanded in K around 0 99.9%
cos-neg99.9%
Simplified99.9%
Taylor expanded in M around inf 71.3%
+-commutative71.3%
unpow271.3%
associate-*r*71.3%
distribute-rgt-out71.4%
mul-1-neg71.4%
Simplified71.4%
Final simplification71.3%
(FPCore (K m n M l)
:precision binary64
(if (<= n 1.3e-298)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= n 0.000365)
(* (cos (* 0.5 (* K n))) (exp (- (- (fabs (- m n)) l) (* M M))))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.3e-298) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (n <= 0.000365) {
tmp = cos((0.5 * (K * n))) * exp(((fabs((m - n)) - l) - (M * M)));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (n <= 1.3d-298) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (n <= 0.000365d0) then
tmp = cos((0.5d0 * (k * n))) * exp(((abs((m - n)) - l) - (m_1 * m_1)))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.3e-298) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (n <= 0.000365) {
tmp = Math.cos((0.5 * (K * n))) * Math.exp(((Math.abs((m - n)) - l) - (M * M)));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 1.3e-298: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif n <= 0.000365: tmp = math.cos((0.5 * (K * n))) * math.exp(((math.fabs((m - n)) - l) - (M * M))) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 1.3e-298) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (n <= 0.000365) tmp = Float64(cos(Float64(0.5 * Float64(K * n))) * exp(Float64(Float64(abs(Float64(m - n)) - l) - Float64(M * M)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 1.3e-298) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (n <= 0.000365) tmp = cos((0.5 * (K * n))) * exp(((abs((m - n)) - l) - (M * M))); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 1.3e-298], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.000365], N[(N[Cos[N[(0.5 * N[(K * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 1.3 \cdot 10^{-298}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;n \leq 0.000365:\\
\;\;\;\;\cos \left(0.5 \cdot \left(K \cdot n\right)\right) \cdot e^{\left(\left|m - n\right| - \ell\right) - M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < 1.2999999999999999e-298Initial program 76.2%
*-commutative76.2%
associate-*r/76.2%
associate--r-76.2%
+-commutative76.2%
associate-+r-76.2%
unsub-neg76.2%
associate--r+76.2%
+-commutative76.2%
associate--r+76.2%
Simplified76.2%
Taylor expanded in K around 0 96.4%
cos-neg96.4%
Simplified96.4%
Taylor expanded in m around inf 59.1%
unpow259.1%
Simplified59.1%
if 1.2999999999999999e-298 < n < 3.6499999999999998e-4Initial program 80.7%
*-commutative80.7%
associate-*r/80.7%
associate--r-80.7%
+-commutative80.7%
associate-+r-80.7%
unsub-neg80.7%
associate--r+80.7%
+-commutative80.7%
associate--r+80.7%
Simplified80.7%
Taylor expanded in M around inf 65.9%
unpow265.9%
Simplified65.9%
Taylor expanded in n around inf 76.2%
if 3.6499999999999998e-4 < n Initial program 82.5%
*-commutative82.5%
associate-*r/82.5%
associate--r-82.5%
+-commutative82.5%
associate-+r-82.5%
unsub-neg82.5%
associate--r+82.5%
+-commutative82.5%
associate--r+82.5%
Simplified82.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in n around inf 94.9%
unpow294.9%
Simplified94.9%
Final simplification71.1%
(FPCore (K m n M l)
:precision binary64
(if (<= n 1.25e-293)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= n 0.000365)
(* (cos M) (exp (- (- (fabs (- m n)) l) (* M M))))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.25e-293) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (n <= 0.000365) {
tmp = cos(M) * exp(((fabs((m - n)) - l) - (M * M)));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (n <= 1.25d-293) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (n <= 0.000365d0) then
tmp = cos(m_1) * exp(((abs((m - n)) - l) - (m_1 * m_1)))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.25e-293) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (n <= 0.000365) {
tmp = Math.cos(M) * Math.exp(((Math.abs((m - n)) - l) - (M * M)));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 1.25e-293: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif n <= 0.000365: tmp = math.cos(M) * math.exp(((math.fabs((m - n)) - l) - (M * M))) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 1.25e-293) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (n <= 0.000365) tmp = Float64(cos(M) * exp(Float64(Float64(abs(Float64(m - n)) - l) - Float64(M * M)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 1.25e-293) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (n <= 0.000365) tmp = cos(M) * exp(((abs((m - n)) - l) - (M * M))); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 1.25e-293], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.000365], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 1.25 \cdot 10^{-293}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;n \leq 0.000365:\\
\;\;\;\;\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) - M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < 1.2500000000000001e-293Initial program 76.2%
*-commutative76.2%
associate-*r/76.2%
associate--r-76.2%
+-commutative76.2%
associate-+r-76.2%
unsub-neg76.2%
associate--r+76.2%
+-commutative76.2%
associate--r+76.2%
Simplified76.2%
Taylor expanded in K around 0 96.4%
cos-neg96.4%
Simplified96.4%
Taylor expanded in m around inf 59.1%
unpow259.1%
Simplified59.1%
if 1.2500000000000001e-293 < n < 3.6499999999999998e-4Initial program 80.7%
*-commutative80.7%
associate-*r/80.7%
associate--r-80.7%
+-commutative80.7%
associate-+r-80.7%
unsub-neg80.7%
associate--r+80.7%
+-commutative80.7%
associate--r+80.7%
Simplified80.7%
Taylor expanded in K around 0 90.6%
cos-neg90.6%
Simplified90.6%
Taylor expanded in M around inf 74.2%
unpow265.9%
Simplified74.2%
if 3.6499999999999998e-4 < n Initial program 82.5%
*-commutative82.5%
associate-*r/82.5%
associate--r-82.5%
+-commutative82.5%
associate-+r-82.5%
unsub-neg82.5%
associate--r+82.5%
+-commutative82.5%
associate--r+82.5%
Simplified82.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in n around inf 94.9%
unpow294.9%
Simplified94.9%
Final simplification70.6%
(FPCore (K m n M l)
:precision binary64
(if (<= m -4.6e-7)
(* (cos M) (exp (* -0.25 (* m m))))
(if (or (<= m -2.7e-90) (and (not (<= m -3e-147)) (<= m -4.8e-222)))
(* (cos M) (exp (* M (- M))))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -4.6e-7) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if ((m <= -2.7e-90) || (!(m <= -3e-147) && (m <= -4.8e-222))) {
tmp = cos(M) * exp((M * -M));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-4.6d-7)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if ((m <= (-2.7d-90)) .or. (.not. (m <= (-3d-147))) .and. (m <= (-4.8d-222))) then
tmp = cos(m_1) * exp((m_1 * -m_1))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -4.6e-7) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if ((m <= -2.7e-90) || (!(m <= -3e-147) && (m <= -4.8e-222))) {
tmp = Math.cos(M) * Math.exp((M * -M));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -4.6e-7: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif (m <= -2.7e-90) or (not (m <= -3e-147) and (m <= -4.8e-222)): tmp = math.cos(M) * math.exp((M * -M)) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -4.6e-7) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif ((m <= -2.7e-90) || (!(m <= -3e-147) && (m <= -4.8e-222))) tmp = Float64(cos(M) * exp(Float64(M * Float64(-M)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -4.6e-7) tmp = cos(M) * exp((-0.25 * (m * m))); elseif ((m <= -2.7e-90) || (~((m <= -3e-147)) && (m <= -4.8e-222))) tmp = cos(M) * exp((M * -M)); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -4.6e-7], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[m, -2.7e-90], And[N[Not[LessEqual[m, -3e-147]], $MachinePrecision], LessEqual[m, -4.8e-222]]], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(M * (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.6 \cdot 10^{-7}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -2.7 \cdot 10^{-90} \lor \neg \left(m \leq -3 \cdot 10^{-147}\right) \land m \leq -4.8 \cdot 10^{-222}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(-M\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if m < -4.5999999999999999e-7Initial program 73.2%
*-commutative73.2%
associate-*r/73.2%
associate--r-73.2%
+-commutative73.2%
associate-+r-73.2%
unsub-neg73.2%
associate--r+73.2%
+-commutative73.2%
associate--r+73.2%
Simplified73.2%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
Simplified98.6%
Taylor expanded in m around inf 97.2%
unpow297.2%
Simplified97.2%
if -4.5999999999999999e-7 < m < -2.69999999999999996e-90 or -3.0000000000000002e-147 < m < -4.79999999999999986e-222Initial program 87.1%
*-commutative87.1%
associate-*r/87.1%
associate--r-87.1%
+-commutative87.1%
associate-+r-87.1%
unsub-neg87.1%
associate--r+87.1%
+-commutative87.1%
associate--r+87.1%
Simplified87.1%
Taylor expanded in K around 0 96.8%
cos-neg96.8%
Simplified96.8%
Taylor expanded in M around inf 62.3%
mul-1-neg62.3%
unpow262.3%
Simplified62.3%
if -2.69999999999999996e-90 < m < -3.0000000000000002e-147 or -4.79999999999999986e-222 < m Initial program 79.4%
*-commutative79.4%
associate-*r/79.4%
associate--r-79.4%
+-commutative79.4%
associate-+r-79.4%
unsub-neg79.4%
associate--r+79.4%
+-commutative79.4%
associate--r+79.4%
Simplified79.4%
Taylor expanded in K around 0 94.4%
cos-neg94.4%
Simplified94.4%
Taylor expanded in n around inf 55.1%
unpow255.1%
Simplified55.1%
Final simplification67.7%
(FPCore (K m n M l)
:precision binary64
(if (<= n 1.25e-296)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= n 0.000365)
(exp (- (- (fabs (- m n)) l) (* M M)))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.25e-296) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (n <= 0.000365) {
tmp = exp(((fabs((m - n)) - l) - (M * M)));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (n <= 1.25d-296) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (n <= 0.000365d0) then
tmp = exp(((abs((m - n)) - l) - (m_1 * m_1)))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.25e-296) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (n <= 0.000365) {
tmp = Math.exp(((Math.abs((m - n)) - l) - (M * M)));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 1.25e-296: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif n <= 0.000365: tmp = math.exp(((math.fabs((m - n)) - l) - (M * M))) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 1.25e-296) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (n <= 0.000365) tmp = exp(Float64(Float64(abs(Float64(m - n)) - l) - Float64(M * M))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 1.25e-296) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (n <= 0.000365) tmp = exp(((abs((m - n)) - l) - (M * M))); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 1.25e-296], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.000365], N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 1.25 \cdot 10^{-296}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;n \leq 0.000365:\\
\;\;\;\;e^{\left(\left|m - n\right| - \ell\right) - M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < 1.25000000000000008e-296Initial program 76.2%
*-commutative76.2%
associate-*r/76.2%
associate--r-76.2%
+-commutative76.2%
associate-+r-76.2%
unsub-neg76.2%
associate--r+76.2%
+-commutative76.2%
associate--r+76.2%
Simplified76.2%
Taylor expanded in K around 0 96.4%
cos-neg96.4%
Simplified96.4%
Taylor expanded in m around inf 59.1%
unpow259.1%
Simplified59.1%
if 1.25000000000000008e-296 < n < 3.6499999999999998e-4Initial program 80.7%
*-commutative80.7%
associate-*r/80.7%
associate--r-80.7%
+-commutative80.7%
associate-+r-80.7%
unsub-neg80.7%
associate--r+80.7%
+-commutative80.7%
associate--r+80.7%
Simplified80.7%
Taylor expanded in M around inf 65.9%
unpow265.9%
Simplified65.9%
add-cube-cbrt66.3%
pow366.2%
div-inv66.2%
metadata-eval66.2%
Applied egg-rr66.2%
Taylor expanded in m around inf 74.2%
if 3.6499999999999998e-4 < n Initial program 82.5%
*-commutative82.5%
associate-*r/82.5%
associate--r-82.5%
+-commutative82.5%
associate-+r-82.5%
unsub-neg82.5%
associate--r+82.5%
+-commutative82.5%
associate--r+82.5%
Simplified82.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in n around inf 94.9%
unpow294.9%
Simplified94.9%
Final simplification70.6%
(FPCore (K m n M l) :precision binary64 (if (or (<= m -4.6e-7) (not (<= m 55.0))) (* (cos M) (exp (* -0.25 (* m m)))) (* (cos M) (exp (* M (- M))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((m <= -4.6e-7) || !(m <= 55.0)) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else {
tmp = cos(M) * exp((M * -M));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if ((m <= (-4.6d-7)) .or. (.not. (m <= 55.0d0))) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else
tmp = cos(m_1) * exp((m_1 * -m_1))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if ((m <= -4.6e-7) || !(m <= 55.0)) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else {
tmp = Math.cos(M) * Math.exp((M * -M));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (m <= -4.6e-7) or not (m <= 55.0): tmp = math.cos(M) * math.exp((-0.25 * (m * m))) else: tmp = math.cos(M) * math.exp((M * -M)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((m <= -4.6e-7) || !(m <= 55.0)) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); else tmp = Float64(cos(M) * exp(Float64(M * Float64(-M)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((m <= -4.6e-7) || ~((m <= 55.0))) tmp = cos(M) * exp((-0.25 * (m * m))); else tmp = cos(M) * exp((M * -M)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[m, -4.6e-7], N[Not[LessEqual[m, 55.0]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(M * (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -4.6 \cdot 10^{-7} \lor \neg \left(m \leq 55\right):\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(-M\right)}\\
\end{array}
\end{array}
if m < -4.5999999999999999e-7 or 55 < m Initial program 73.9%
*-commutative73.9%
associate-*r/73.9%
associate--r-73.9%
+-commutative73.9%
associate-+r-73.9%
unsub-neg73.9%
associate--r+73.9%
+-commutative73.9%
associate--r+73.9%
Simplified73.9%
Taylor expanded in K around 0 98.5%
cos-neg98.5%
Simplified98.5%
Taylor expanded in m around inf 97.1%
unpow297.1%
Simplified97.1%
if -4.5999999999999999e-7 < m < 55Initial program 83.9%
*-commutative83.9%
associate-*r/83.9%
associate--r-83.9%
+-commutative83.9%
associate-+r-83.9%
unsub-neg83.9%
associate--r+83.9%
+-commutative83.9%
associate--r+83.9%
Simplified83.9%
Taylor expanded in K around 0 93.0%
cos-neg93.0%
Simplified93.0%
Taylor expanded in M around inf 59.4%
mul-1-neg59.4%
unpow259.4%
Simplified59.4%
Final simplification79.1%
(FPCore (K m n M l) :precision binary64 (if (<= l -720.0) (* (cos M) (exp l)) (if (<= l 720.0) (* (cos M) (exp (* M (- M)))) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -720.0) {
tmp = cos(M) * exp(l);
} else if (l <= 720.0) {
tmp = cos(M) * exp((M * -M));
} else {
tmp = exp(-l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-720.0d0)) then
tmp = cos(m_1) * exp(l)
else if (l <= 720.0d0) then
tmp = cos(m_1) * exp((m_1 * -m_1))
else
tmp = exp(-l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -720.0) {
tmp = Math.cos(M) * Math.exp(l);
} else if (l <= 720.0) {
tmp = Math.cos(M) * Math.exp((M * -M));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -720.0: tmp = math.cos(M) * math.exp(l) elif l <= 720.0: tmp = math.cos(M) * math.exp((M * -M)) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -720.0) tmp = Float64(cos(M) * exp(l)); elseif (l <= 720.0) tmp = Float64(cos(M) * exp(Float64(M * Float64(-M)))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -720.0) tmp = cos(M) * exp(l); elseif (l <= 720.0) tmp = cos(M) * exp((M * -M)); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -720.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 720.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(M * (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -720:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{elif}\;\ell \leq 720:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(-M\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < -720Initial program 72.2%
*-commutative72.2%
associate-*r/72.2%
associate--r-72.2%
+-commutative72.2%
associate-+r-72.2%
unsub-neg72.2%
associate--r+72.2%
+-commutative72.2%
associate--r+72.2%
Simplified72.2%
Taylor expanded in K around 0 92.6%
cos-neg92.6%
Simplified92.6%
Taylor expanded in l around inf 17.9%
mul-1-neg17.9%
Simplified17.9%
expm1-log1p-u15.8%
expm1-udef15.8%
add-sqr-sqrt15.8%
sqrt-unprod15.8%
sqr-neg15.8%
sqrt-unprod0.0%
add-sqr-sqrt76.3%
Applied egg-rr76.3%
expm1-def76.3%
expm1-log1p76.3%
Simplified76.3%
if -720 < l < 720Initial program 77.9%
*-commutative77.9%
associate-*r/77.9%
associate--r-77.9%
+-commutative77.9%
associate-+r-77.9%
unsub-neg77.9%
associate--r+77.9%
+-commutative77.9%
associate--r+77.9%
Simplified77.9%
Taylor expanded in K around 0 95.3%
cos-neg95.3%
Simplified95.3%
Taylor expanded in M around inf 61.6%
mul-1-neg61.6%
unpow261.6%
Simplified61.6%
if 720 < l Initial program 85.7%
*-commutative85.7%
associate-*r/85.7%
associate--r-85.7%
+-commutative85.7%
associate-+r-85.7%
unsub-neg85.7%
associate--r+85.7%
+-commutative85.7%
associate--r+85.7%
Simplified85.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in M around 0 100.0%
Final simplification74.2%
(FPCore (K m n M l) :precision binary64 (if (<= l -5.5e-15) (* (cos M) (exp l)) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -5.5e-15) {
tmp = cos(M) * exp(l);
} else {
tmp = exp(-l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-5.5d-15)) then
tmp = cos(m_1) * exp(l)
else
tmp = exp(-l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -5.5e-15) {
tmp = Math.cos(M) * Math.exp(l);
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -5.5e-15: tmp = math.cos(M) * math.exp(l) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -5.5e-15) tmp = Float64(cos(M) * exp(l)); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -5.5e-15) tmp = cos(M) * exp(l); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -5.5e-15], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -5.5 \cdot 10^{-15}:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < -5.5000000000000002e-15Initial program 72.4%
*-commutative72.4%
associate-*r/72.4%
associate--r-72.4%
+-commutative72.4%
associate-+r-72.4%
unsub-neg72.4%
associate--r+72.4%
+-commutative72.4%
associate--r+72.4%
Simplified72.4%
Taylor expanded in K around 0 93.1%
cos-neg93.1%
Simplified93.1%
Taylor expanded in l around inf 16.8%
mul-1-neg16.8%
Simplified16.8%
expm1-log1p-u15.0%
expm1-udef15.0%
add-sqr-sqrt15.0%
sqrt-unprod15.0%
sqr-neg15.0%
sqrt-unprod0.0%
add-sqr-sqrt71.3%
Applied egg-rr71.3%
expm1-def71.3%
expm1-log1p71.3%
Simplified71.3%
if -5.5000000000000002e-15 < l Initial program 80.5%
*-commutative80.5%
associate-*r/80.5%
associate--r-80.5%
+-commutative80.5%
associate-+r-80.5%
unsub-neg80.5%
associate--r+80.5%
+-commutative80.5%
associate--r+80.5%
Simplified80.5%
Taylor expanded in K around 0 96.7%
cos-neg96.7%
Simplified96.7%
Taylor expanded in l around inf 37.2%
mul-1-neg37.2%
Simplified37.2%
Taylor expanded in M around 0 37.2%
Final simplification44.9%
(FPCore (K m n M l) :precision binary64 (if (<= l -1.6e-9) (* (cos M) (exp l)) (/ (cos M) (exp l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -1.6e-9) {
tmp = cos(M) * exp(l);
} else {
tmp = cos(M) / exp(l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-1.6d-9)) then
tmp = cos(m_1) * exp(l)
else
tmp = cos(m_1) / exp(l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -1.6e-9) {
tmp = Math.cos(M) * Math.exp(l);
} else {
tmp = Math.cos(M) / Math.exp(l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -1.6e-9: tmp = math.cos(M) * math.exp(l) else: tmp = math.cos(M) / math.exp(l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -1.6e-9) tmp = Float64(cos(M) * exp(l)); else tmp = Float64(cos(M) / exp(l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -1.6e-9) tmp = cos(M) * exp(l); else tmp = cos(M) / exp(l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -1.6e-9], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.6 \cdot 10^{-9}:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\end{array}
\end{array}
if l < -1.60000000000000006e-9Initial program 72.7%
*-commutative72.7%
associate-*r/72.7%
associate--r-72.7%
+-commutative72.7%
associate-+r-72.7%
unsub-neg72.7%
associate--r+72.7%
+-commutative72.7%
associate--r+72.7%
Simplified72.7%
Taylor expanded in K around 0 92.7%
cos-neg92.7%
Simplified92.7%
Taylor expanded in l around inf 17.6%
mul-1-neg17.6%
Simplified17.6%
expm1-log1p-u15.6%
expm1-udef15.6%
add-sqr-sqrt15.6%
sqrt-unprod15.6%
sqr-neg15.6%
sqrt-unprod0.0%
add-sqr-sqrt75.0%
Applied egg-rr75.0%
expm1-def75.0%
expm1-log1p75.0%
Simplified75.0%
if -1.60000000000000006e-9 < l Initial program 80.3%
*-commutative80.3%
associate-*r/80.3%
associate--r-80.3%
+-commutative80.3%
associate-+r-80.3%
unsub-neg80.3%
associate--r+80.3%
+-commutative80.3%
associate--r+80.3%
Simplified80.3%
Taylor expanded in K around 0 96.7%
cos-neg96.7%
Simplified96.7%
Taylor expanded in l around inf 36.7%
mul-1-neg36.7%
Simplified36.7%
exp-neg36.7%
un-div-inv36.7%
Applied egg-rr36.7%
Final simplification44.9%
(FPCore (K m n M l) :precision binary64 (exp (- l)))
double code(double K, double m, double n, double M, double l) {
return exp(-l);
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = exp(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(-l);
}
def code(K, m, n, M, l): return math.exp(-l)
function code(K, m, n, M, l) return exp(Float64(-l)) end
function tmp = code(K, m, n, M, l) tmp = exp(-l); end
code[K_, m_, n_, M_, l_] := N[Exp[(-l)], $MachinePrecision]
\begin{array}{l}
\\
e^{-\ell}
\end{array}
Initial program 78.6%
*-commutative78.6%
associate-*r/78.6%
associate--r-78.6%
+-commutative78.6%
associate-+r-78.6%
unsub-neg78.6%
associate--r+78.6%
+-commutative78.6%
associate--r+78.6%
Simplified78.6%
Taylor expanded in K around 0 95.9%
cos-neg95.9%
Simplified95.9%
Taylor expanded in l around inf 32.6%
mul-1-neg32.6%
Simplified32.6%
Taylor expanded in M around 0 32.2%
Final simplification32.2%
herbie shell --seed 2023176
(FPCore (K m n M l)
:name "Maksimov and Kolovsky, Equation (32)"
:precision binary64
(* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))