
(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 17 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 (* (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 82.4%
Taylor expanded in K around 0 96.3%
cos-neg96.3%
Simplified96.3%
Final simplification96.3%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (+ -1.0 (- 1.0 (* l (cos (fma (* n 0.5) K (- M)))))))
(t_1 (* (cos M) (exp (- (* M (- n M)) n)))))
(if (<= l -3e-76)
t_1
(if (<= l -1.45e-172)
t_0
(if (<= l -1e-187)
t_1
(if (<= l -6.6e-295)
t_0
(if (<= l 1.5) t_1 (* (cos M) (exp (- l))))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = -1.0 + (1.0 - (l * cos(fma((n * 0.5), K, -M))));
double t_1 = cos(M) * exp(((M * (n - M)) - n));
double tmp;
if (l <= -3e-76) {
tmp = t_1;
} else if (l <= -1.45e-172) {
tmp = t_0;
} else if (l <= -1e-187) {
tmp = t_1;
} else if (l <= -6.6e-295) {
tmp = t_0;
} else if (l <= 1.5) {
tmp = t_1;
} else {
tmp = cos(M) * exp(-l);
}
return tmp;
}
function code(K, m, n, M, l) t_0 = Float64(-1.0 + Float64(1.0 - Float64(l * cos(fma(Float64(n * 0.5), K, Float64(-M)))))) t_1 = Float64(cos(M) * exp(Float64(Float64(M * Float64(n - M)) - n))) tmp = 0.0 if (l <= -3e-76) tmp = t_1; elseif (l <= -1.45e-172) tmp = t_0; elseif (l <= -1e-187) tmp = t_1; elseif (l <= -6.6e-295) tmp = t_0; elseif (l <= 1.5) tmp = t_1; else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(-1.0 + N[(1.0 - N[(l * N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K + (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3e-76], t$95$1, If[LessEqual[l, -1.45e-172], t$95$0, If[LessEqual[l, -1e-187], t$95$1, If[LessEqual[l, -6.6e-295], t$95$0, If[LessEqual[l, 1.5], t$95$1, N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 + \left(1 - \ell \cdot \cos \left(\mathsf{fma}\left(n \cdot 0.5, K, -M\right)\right)\right)\\
t_1 := \cos M \cdot e^{M \cdot \left(n - M\right) - n}\\
\mathbf{if}\;\ell \leq -3 \cdot 10^{-76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -1.45 \cdot 10^{-172}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -1 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -6.6 \cdot 10^{-295}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq 1.5:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < -3.00000000000000024e-76 or -1.44999999999999999e-172 < l < -1e-187 or -6.5999999999999997e-295 < l < 1.5Initial program 78.8%
Taylor expanded in K around 0 95.1%
cos-neg95.1%
Simplified95.1%
sub-neg95.1%
distribute-neg-out95.1%
div-inv95.1%
metadata-eval95.1%
add-sqr-sqrt54.1%
fabs-sqr54.1%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
unpow294.5%
Applied egg-rr94.5%
Taylor expanded in n around inf 91.1%
Taylor expanded in n around 0 69.8%
+-commutative69.8%
unpow269.8%
distribute-rgt-out74.7%
Simplified74.7%
Taylor expanded in m around 0 62.6%
neg-sub062.6%
+-commutative62.6%
associate--r+62.6%
neg-sub062.6%
mul-1-neg62.6%
remove-double-neg62.6%
Simplified62.6%
if -3.00000000000000024e-76 < l < -1.44999999999999999e-172 or -1e-187 < l < -6.5999999999999997e-295Initial program 92.7%
Taylor expanded in l around inf 13.9%
mul-1-neg13.9%
Simplified13.9%
Taylor expanded in l around 0 13.9%
associate-*r*13.9%
neg-mul-113.9%
distribute-rgt1-in13.9%
fma-neg13.9%
Simplified13.9%
Taylor expanded in m around 0 14.3%
Taylor expanded in l around inf 5.6%
associate-*r*5.6%
mul-1-neg5.6%
*-commutative5.6%
associate-*r*5.6%
*-commutative5.6%
Simplified5.6%
expm1-log1p-u5.6%
expm1-undefine80.6%
*-commutative80.6%
fma-neg80.6%
*-commutative80.6%
Applied egg-rr80.6%
sub-neg80.6%
metadata-eval80.6%
+-commutative80.6%
log1p-undefine80.6%
rem-exp-log80.6%
*-commutative80.6%
distribute-lft-neg-in80.6%
unsub-neg80.6%
Simplified80.6%
if 1.5 < l Initial program 82.3%
Taylor expanded in l around inf 79.2%
mul-1-neg79.2%
Simplified79.2%
Taylor expanded in K around 0 96.9%
cos-neg96.9%
Simplified96.9%
Final simplification74.4%
(FPCore (K m n M l)
:precision binary64
(if (<= m -7.5e+162)
(* (cos M) (exp (- (* (- (* m 0.5) M) (- (- M (* m 0.5)) n)) n)))
(if (<= m -2.8e+88)
(* (cos M) (exp (- (* M (- n M)) n)))
(if (<= m -4e+48)
(* (cos M) (exp (- (- n) (* 0.5 (* m (+ n (* m 0.5)))))))
(* (cos M) (exp (- (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) l)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -7.5e+162) {
tmp = cos(M) * exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n));
} else if (m <= -2.8e+88) {
tmp = cos(M) * exp(((M * (n - M)) - n));
} else if (m <= -4e+48) {
tmp = cos(M) * exp((-n - (0.5 * (m * (n + (m * 0.5))))));
} else {
tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - 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 (m <= (-7.5d+162)) then
tmp = cos(m_1) * exp(((((m * 0.5d0) - m_1) * ((m_1 - (m * 0.5d0)) - n)) - n))
else if (m <= (-2.8d+88)) then
tmp = cos(m_1) * exp(((m_1 * (n - m_1)) - n))
else if (m <= (-4d+48)) then
tmp = cos(m_1) * exp((-n - (0.5d0 * (m * (n + (m * 0.5d0))))))
else
tmp = cos(m_1) * exp(((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) - l))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -7.5e+162) {
tmp = Math.cos(M) * Math.exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n));
} else if (m <= -2.8e+88) {
tmp = Math.cos(M) * Math.exp(((M * (n - M)) - n));
} else if (m <= -4e+48) {
tmp = Math.cos(M) * Math.exp((-n - (0.5 * (m * (n + (m * 0.5))))));
} else {
tmp = Math.cos(M) * Math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -7.5e+162: tmp = math.cos(M) * math.exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n)) elif m <= -2.8e+88: tmp = math.cos(M) * math.exp(((M * (n - M)) - n)) elif m <= -4e+48: tmp = math.cos(M) * math.exp((-n - (0.5 * (m * (n + (m * 0.5)))))) else: tmp = math.cos(M) * math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -7.5e+162) tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(m * 0.5) - M) * Float64(Float64(M - Float64(m * 0.5)) - n)) - n))); elseif (m <= -2.8e+88) tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(n - M)) - n))); elseif (m <= -4e+48) tmp = Float64(cos(M) * exp(Float64(Float64(-n) - Float64(0.5 * Float64(m * Float64(n + Float64(m * 0.5))))))); else tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) - l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -7.5e+162) tmp = cos(M) * exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n)); elseif (m <= -2.8e+88) tmp = cos(M) * exp(((M * (n - M)) - n)); elseif (m <= -4e+48) tmp = cos(M) * exp((-n - (0.5 * (m * (n + (m * 0.5)))))); else tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -7.5e+162], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -2.8e+88], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -4e+48], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[((-n) - N[(0.5 * N[(m * N[(n + N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7.5 \cdot 10^{+162}:\\
\;\;\;\;\cos M \cdot e^{\left(m \cdot 0.5 - M\right) \cdot \left(\left(M - m \cdot 0.5\right) - n\right) - n}\\
\mathbf{elif}\;m \leq -2.8 \cdot 10^{+88}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(n - M\right) - n}\\
\mathbf{elif}\;m \leq -4 \cdot 10^{+48}:\\
\;\;\;\;\cos M \cdot e^{\left(-n\right) - 0.5 \cdot \left(m \cdot \left(n + m \cdot 0.5\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) - \ell}\\
\end{array}
\end{array}
if m < -7.50000000000000033e162Initial program 75.9%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-neg-out100.0%
div-inv100.0%
metadata-eval100.0%
add-sqr-sqrt3.4%
fabs-sqr3.4%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow2100.0%
Applied egg-rr100.0%
Taylor expanded in n around inf 100.0%
Taylor expanded in n around 0 82.8%
+-commutative82.8%
unpow282.8%
distribute-rgt-out96.6%
Simplified96.6%
if -7.50000000000000033e162 < m < -2.79999999999999989e88Initial program 81.3%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-neg-out100.0%
div-inv100.0%
metadata-eval100.0%
add-sqr-sqrt18.8%
fabs-sqr18.8%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow2100.0%
Applied egg-rr100.0%
Taylor expanded in n around inf 100.0%
Taylor expanded in n around 0 63.0%
+-commutative63.0%
unpow263.0%
distribute-rgt-out63.1%
Simplified63.1%
Taylor expanded in m around 0 81.7%
neg-sub081.7%
+-commutative81.7%
associate--r+81.7%
neg-sub081.7%
mul-1-neg81.7%
remove-double-neg81.7%
Simplified81.7%
if -2.79999999999999989e88 < m < -4.00000000000000018e48Initial program 91.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-neg-out100.0%
div-inv100.0%
metadata-eval100.0%
add-sqr-sqrt16.7%
fabs-sqr16.7%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow2100.0%
Applied egg-rr100.0%
Taylor expanded in n around inf 100.0%
Taylor expanded in n around 0 91.8%
+-commutative91.8%
unpow291.8%
distribute-rgt-out91.8%
Simplified91.8%
Taylor expanded in M around 0 91.8%
*-commutative91.8%
Simplified91.8%
if -4.00000000000000018e48 < m Initial program 82.8%
Taylor expanded in K around 0 95.2%
cos-neg95.2%
Simplified95.2%
Taylor expanded in m around 0 75.4%
+-commutative75.4%
unpow275.4%
distribute-rgt-out79.5%
*-commutative79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in l around inf 80.2%
Final simplification82.7%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (cos M) (exp (- (- n) (* 0.5 (* m (+ n (* m 0.5)))))))))
(if (<= l -5.4e-136)
t_0
(if (<= l -6.8e-279)
(+ -1.0 (- 1.0 (* l (cos (fma (* n 0.5) K (- M))))))
(if (<= l 1.5) t_0 (* (cos M) (exp (- l))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = cos(M) * exp((-n - (0.5 * (m * (n + (m * 0.5))))));
double tmp;
if (l <= -5.4e-136) {
tmp = t_0;
} else if (l <= -6.8e-279) {
tmp = -1.0 + (1.0 - (l * cos(fma((n * 0.5), K, -M))));
} else if (l <= 1.5) {
tmp = t_0;
} else {
tmp = cos(M) * exp(-l);
}
return tmp;
}
function code(K, m, n, M, l) t_0 = Float64(cos(M) * exp(Float64(Float64(-n) - Float64(0.5 * Float64(m * Float64(n + Float64(m * 0.5))))))) tmp = 0.0 if (l <= -5.4e-136) tmp = t_0; elseif (l <= -6.8e-279) tmp = Float64(-1.0 + Float64(1.0 - Float64(l * cos(fma(Float64(n * 0.5), K, Float64(-M)))))); elseif (l <= 1.5) tmp = t_0; else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Cos[M], $MachinePrecision] * N[Exp[N[((-n) - N[(0.5 * N[(m * N[(n + N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.4e-136], t$95$0, If[LessEqual[l, -6.8e-279], N[(-1.0 + N[(1.0 - N[(l * N[Cos[N[(N[(n * 0.5), $MachinePrecision] * K + (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.5], t$95$0, N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos M \cdot e^{\left(-n\right) - 0.5 \cdot \left(m \cdot \left(n + m \cdot 0.5\right)\right)}\\
\mathbf{if}\;\ell \leq -5.4 \cdot 10^{-136}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -6.8 \cdot 10^{-279}:\\
\;\;\;\;-1 + \left(1 - \ell \cdot \cos \left(\mathsf{fma}\left(n \cdot 0.5, K, -M\right)\right)\right)\\
\mathbf{elif}\;\ell \leq 1.5:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < -5.3999999999999997e-136 or -6.8000000000000003e-279 < l < 1.5Initial program 80.4%
Taylor expanded in K around 0 95.0%
cos-neg95.0%
Simplified95.0%
sub-neg95.0%
distribute-neg-out95.0%
div-inv95.0%
metadata-eval95.0%
add-sqr-sqrt54.4%
fabs-sqr54.4%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
unpow294.5%
Applied egg-rr94.5%
Taylor expanded in n around inf 91.4%
Taylor expanded in n around 0 69.3%
+-commutative69.3%
unpow269.3%
distribute-rgt-out74.3%
Simplified74.3%
Taylor expanded in M around 0 61.0%
*-commutative61.0%
Simplified61.0%
if -5.3999999999999997e-136 < l < -6.8000000000000003e-279Initial program 91.9%
Taylor expanded in l around inf 12.6%
mul-1-neg12.6%
Simplified12.6%
Taylor expanded in l around 0 12.6%
associate-*r*12.6%
neg-mul-112.6%
distribute-rgt1-in12.6%
fma-neg12.6%
Simplified12.6%
Taylor expanded in m around 0 13.3%
Taylor expanded in l around inf 5.6%
associate-*r*5.6%
mul-1-neg5.6%
*-commutative5.6%
associate-*r*5.6%
*-commutative5.6%
Simplified5.6%
expm1-log1p-u5.6%
expm1-undefine82.9%
*-commutative82.9%
fma-neg82.9%
*-commutative82.9%
Applied egg-rr82.9%
sub-neg82.9%
metadata-eval82.9%
+-commutative82.9%
log1p-undefine82.9%
rem-exp-log82.9%
*-commutative82.9%
distribute-lft-neg-in82.9%
unsub-neg82.9%
Simplified82.9%
if 1.5 < l Initial program 82.3%
Taylor expanded in l around inf 79.2%
mul-1-neg79.2%
Simplified79.2%
Taylor expanded in K around 0 96.9%
cos-neg96.9%
Simplified96.9%
Final simplification72.6%
(FPCore (K m n M l)
:precision binary64
(if (<= l -1.4e-103)
(* (cos M) (exp (- (- n) (* 0.5 (* m (+ n (* m 0.5)))))))
(if (<= l 720.0)
(* (cos M) (exp (- (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) n)))
(* (cos M) (exp (- l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -1.4e-103) {
tmp = cos(M) * exp((-n - (0.5 * (m * (n + (m * 0.5))))));
} else if (l <= 720.0) {
tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n));
} 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.4d-103)) then
tmp = cos(m_1) * exp((-n - (0.5d0 * (m * (n + (m * 0.5d0))))))
else if (l <= 720.0d0) then
tmp = cos(m_1) * exp(((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) - n))
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.4e-103) {
tmp = Math.cos(M) * Math.exp((-n - (0.5 * (m * (n + (m * 0.5))))));
} else if (l <= 720.0) {
tmp = Math.cos(M) * Math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -1.4e-103: tmp = math.cos(M) * math.exp((-n - (0.5 * (m * (n + (m * 0.5)))))) elif l <= 720.0: tmp = math.cos(M) * math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n)) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -1.4e-103) tmp = Float64(cos(M) * exp(Float64(Float64(-n) - Float64(0.5 * Float64(m * Float64(n + Float64(m * 0.5))))))); elseif (l <= 720.0) tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) - n))); else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -1.4e-103) tmp = cos(M) * exp((-n - (0.5 * (m * (n + (m * 0.5)))))); elseif (l <= 720.0) tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n)); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -1.4e-103], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[((-n) - N[(0.5 * N[(m * N[(n + N[(m * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 720.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.4 \cdot 10^{-103}:\\
\;\;\;\;\cos M \cdot e^{\left(-n\right) - 0.5 \cdot \left(m \cdot \left(n + m \cdot 0.5\right)\right)}\\
\mathbf{elif}\;\ell \leq 720:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) - n}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < -1.40000000000000011e-103Initial program 82.2%
Taylor expanded in K around 0 95.1%
cos-neg95.1%
Simplified95.1%
sub-neg95.1%
distribute-neg-out95.1%
div-inv95.1%
metadata-eval95.1%
add-sqr-sqrt52.3%
fabs-sqr52.3%
add-sqr-sqrt94.0%
Applied egg-rr94.0%
unpow294.0%
Applied egg-rr94.0%
Taylor expanded in n around inf 87.8%
Taylor expanded in n around 0 59.5%
+-commutative59.5%
unpow259.5%
distribute-rgt-out67.3%
Simplified67.3%
Taylor expanded in M around 0 61.1%
*-commutative61.1%
Simplified61.1%
if -1.40000000000000011e-103 < l < 720Initial program 82.8%
Taylor expanded in K around 0 95.1%
cos-neg95.1%
Simplified95.1%
sub-neg95.1%
distribute-neg-out95.1%
div-inv95.1%
metadata-eval95.1%
add-sqr-sqrt49.5%
fabs-sqr49.5%
add-sqr-sqrt94.4%
Applied egg-rr94.4%
unpow294.4%
Applied egg-rr94.4%
Taylor expanded in n around inf 94.4%
Taylor expanded in m around 0 71.2%
+-commutative71.2%
unpow271.2%
distribute-rgt-out78.0%
*-commutative78.0%
*-commutative78.0%
Simplified78.0%
if 720 < l Initial program 81.7%
Taylor expanded in l around inf 81.7%
mul-1-neg81.7%
Simplified81.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Final simplification78.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (+ m n) 0.5)))
(if (<= m -11200.0)
(* (cos M) (exp (- (* (- t_0 M) (- M t_0)) n)))
(* (cos M) (exp (- (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) l))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = (m + n) * 0.5;
double tmp;
if (m <= -11200.0) {
tmp = cos(M) * exp((((t_0 - M) * (M - t_0)) - n));
} else {
tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - 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) :: t_0
real(8) :: tmp
t_0 = (m + n) * 0.5d0
if (m <= (-11200.0d0)) then
tmp = cos(m_1) * exp((((t_0 - m_1) * (m_1 - t_0)) - n))
else
tmp = cos(m_1) * exp(((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) - l))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (m + n) * 0.5;
double tmp;
if (m <= -11200.0) {
tmp = Math.cos(M) * Math.exp((((t_0 - M) * (M - t_0)) - n));
} else {
tmp = Math.cos(M) * Math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = (m + n) * 0.5 tmp = 0 if m <= -11200.0: tmp = math.cos(M) * math.exp((((t_0 - M) * (M - t_0)) - n)) else: tmp = math.cos(M) * math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)) return tmp
function code(K, m, n, M, l) t_0 = Float64(Float64(m + n) * 0.5) tmp = 0.0 if (m <= -11200.0) tmp = Float64(cos(M) * exp(Float64(Float64(Float64(t_0 - M) * Float64(M - t_0)) - n))); else tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) - l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (m + n) * 0.5; tmp = 0.0; if (m <= -11200.0) tmp = cos(M) * exp((((t_0 - M) * (M - t_0)) - n)); else tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[m, -11200.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(t$95$0 - M), $MachinePrecision] * N[(M - t$95$0), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(m + n\right) \cdot 0.5\\
\mathbf{if}\;m \leq -11200:\\
\;\;\;\;\cos M \cdot e^{\left(t\_0 - M\right) \cdot \left(M - t\_0\right) - n}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) - \ell}\\
\end{array}
\end{array}
if m < -11200Initial program 82.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-neg-out100.0%
div-inv100.0%
metadata-eval100.0%
add-sqr-sqrt11.5%
fabs-sqr11.5%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow2100.0%
Applied egg-rr100.0%
Taylor expanded in n around inf 100.0%
if -11200 < m Initial program 82.5%
Taylor expanded in K around 0 95.1%
cos-neg95.1%
Simplified95.1%
Taylor expanded in m around 0 75.9%
+-commutative75.9%
unpow275.9%
distribute-rgt-out80.0%
*-commutative80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in l around inf 80.8%
Final simplification85.3%
(FPCore (K m n M l) :precision binary64 (let* ((t_0 (* (+ m n) 0.5))) (* (cos M) (exp (+ (* (- t_0 M) (- M t_0)) (- (- m n) l))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = (m + n) * 0.5;
return cos(M) * exp((((t_0 - M) * (M - t_0)) + ((m - n) - 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
real(8) :: t_0
t_0 = (m + n) * 0.5d0
code = cos(m_1) * exp((((t_0 - m_1) * (m_1 - t_0)) + ((m - n) - l)))
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (m + n) * 0.5;
return Math.cos(M) * Math.exp((((t_0 - M) * (M - t_0)) + ((m - n) - l)));
}
def code(K, m, n, M, l): t_0 = (m + n) * 0.5 return math.cos(M) * math.exp((((t_0 - M) * (M - t_0)) + ((m - n) - l)))
function code(K, m, n, M, l) t_0 = Float64(Float64(m + n) * 0.5) return Float64(cos(M) * exp(Float64(Float64(Float64(t_0 - M) * Float64(M - t_0)) + Float64(Float64(m - n) - l)))) end
function tmp = code(K, m, n, M, l) t_0 = (m + n) * 0.5; tmp = cos(M) * exp((((t_0 - M) * (M - t_0)) + ((m - n) - l))); end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision]}, N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(t$95$0 - M), $MachinePrecision] * N[(M - t$95$0), $MachinePrecision]), $MachinePrecision] + N[(N[(m - n), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(m + n\right) \cdot 0.5\\
\cos M \cdot e^{\left(t\_0 - M\right) \cdot \left(M - t\_0\right) + \left(\left(m - n\right) - \ell\right)}
\end{array}
\end{array}
Initial program 82.4%
Taylor expanded in K around 0 96.3%
cos-neg96.3%
Simplified96.3%
sub-neg96.3%
distribute-neg-out96.3%
div-inv96.3%
metadata-eval96.3%
add-sqr-sqrt50.1%
fabs-sqr50.1%
add-sqr-sqrt95.6%
Applied egg-rr95.6%
unpow295.6%
Applied egg-rr95.6%
Final simplification95.6%
(FPCore (K m n M l)
:precision binary64
(if (<= n -1.75e-177)
(exp (* -0.5 (* m n)))
(if (<= n -3.8e-288)
(* (cos M) (exp (* m (- M (* n 0.5)))))
(if (<= n 3.3e-43)
(* (cos M) (exp (- l)))
(* (cos M) (exp (- (* M n) n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -1.75e-177) {
tmp = exp((-0.5 * (m * n)));
} else if (n <= -3.8e-288) {
tmp = cos(M) * exp((m * (M - (n * 0.5))));
} else if (n <= 3.3e-43) {
tmp = cos(M) * exp(-l);
} else {
tmp = cos(M) * exp(((M * 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.75d-177)) then
tmp = exp(((-0.5d0) * (m * n)))
else if (n <= (-3.8d-288)) then
tmp = cos(m_1) * exp((m * (m_1 - (n * 0.5d0))))
else if (n <= 3.3d-43) then
tmp = cos(m_1) * exp(-l)
else
tmp = cos(m_1) * exp(((m_1 * 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.75e-177) {
tmp = Math.exp((-0.5 * (m * n)));
} else if (n <= -3.8e-288) {
tmp = Math.cos(M) * Math.exp((m * (M - (n * 0.5))));
} else if (n <= 3.3e-43) {
tmp = Math.cos(M) * Math.exp(-l);
} else {
tmp = Math.cos(M) * Math.exp(((M * n) - n));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= -1.75e-177: tmp = math.exp((-0.5 * (m * n))) elif n <= -3.8e-288: tmp = math.cos(M) * math.exp((m * (M - (n * 0.5)))) elif n <= 3.3e-43: tmp = math.cos(M) * math.exp(-l) else: tmp = math.cos(M) * math.exp(((M * n) - n)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= -1.75e-177) tmp = exp(Float64(-0.5 * Float64(m * n))); elseif (n <= -3.8e-288) tmp = Float64(cos(M) * exp(Float64(m * Float64(M - Float64(n * 0.5))))); elseif (n <= 3.3e-43) tmp = Float64(cos(M) * exp(Float64(-l))); else tmp = Float64(cos(M) * exp(Float64(Float64(M * n) - n))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= -1.75e-177) tmp = exp((-0.5 * (m * n))); elseif (n <= -3.8e-288) tmp = cos(M) * exp((m * (M - (n * 0.5)))); elseif (n <= 3.3e-43) tmp = cos(M) * exp(-l); else tmp = cos(M) * exp(((M * n) - n)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -1.75e-177], N[Exp[N[(-0.5 * N[(m * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, -3.8e-288], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.3e-43], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * n), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.75 \cdot 10^{-177}:\\
\;\;\;\;e^{-0.5 \cdot \left(m \cdot n\right)}\\
\mathbf{elif}\;n \leq -3.8 \cdot 10^{-288}:\\
\;\;\;\;\cos M \cdot e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{elif}\;n \leq 3.3 \cdot 10^{-43}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{M \cdot n - n}\\
\end{array}
\end{array}
if n < -1.7500000000000001e-177Initial program 84.6%
Taylor expanded in m around 0 62.0%
+-commutative67.2%
unpow267.2%
distribute-rgt-out75.2%
*-commutative75.2%
*-commutative75.2%
Simplified66.1%
Taylor expanded in m around inf 31.5%
*-commutative31.5%
Simplified31.5%
Taylor expanded in K around 0 38.6%
cos-neg95.7%
Simplified38.6%
Taylor expanded in M around 0 34.9%
if -1.7500000000000001e-177 < n < -3.7999999999999998e-288Initial program 84.1%
Taylor expanded in m around 0 68.2%
+-commutative69.2%
unpow269.2%
distribute-rgt-out73.3%
*-commutative73.3%
*-commutative73.3%
Simplified72.3%
Taylor expanded in m around inf 33.4%
*-commutative33.4%
Simplified33.4%
Taylor expanded in K around 0 34.4%
cos-neg96.9%
Simplified34.4%
if -3.7999999999999998e-288 < n < 3.30000000000000016e-43Initial program 86.5%
Taylor expanded in l around inf 43.9%
mul-1-neg43.9%
Simplified43.9%
Taylor expanded in K around 0 51.3%
cos-neg51.3%
Simplified51.3%
if 3.30000000000000016e-43 < n Initial program 75.2%
Taylor expanded in K around 0 97.6%
cos-neg97.6%
Simplified97.6%
sub-neg97.6%
distribute-neg-out97.6%
div-inv97.6%
metadata-eval97.6%
add-sqr-sqrt14.1%
fabs-sqr14.1%
add-sqr-sqrt96.4%
Applied egg-rr96.4%
unpow296.4%
Applied egg-rr96.4%
Taylor expanded in n around inf 93.6%
Taylor expanded in n around 0 63.0%
+-commutative63.0%
unpow263.0%
distribute-rgt-out74.3%
Simplified74.3%
Taylor expanded in m around 0 79.9%
neg-sub079.9%
+-commutative79.9%
associate--r+79.9%
neg-sub079.9%
mul-1-neg79.9%
remove-double-neg79.9%
Simplified79.9%
Taylor expanded in M around 0 56.3%
(FPCore (K m n M l) :precision binary64 (if (<= n 2.9e+47) (* (cos M) (exp (- (* (- (* m 0.5) M) (- (- M (* m 0.5)) n)) n))) (* (cos M) (exp (- (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) n)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 2.9e+47) {
tmp = cos(M) * exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n));
} else {
tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - 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 <= 2.9d+47) then
tmp = cos(m_1) * exp(((((m * 0.5d0) - m_1) * ((m_1 - (m * 0.5d0)) - n)) - n))
else
tmp = cos(m_1) * exp(((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) - 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 <= 2.9e+47) {
tmp = Math.cos(M) * Math.exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n));
} else {
tmp = Math.cos(M) * Math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 2.9e+47: tmp = math.cos(M) * math.exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n)) else: tmp = math.cos(M) * math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 2.9e+47) tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(m * 0.5) - M) * Float64(Float64(M - Float64(m * 0.5)) - n)) - n))); else tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) - n))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 2.9e+47) tmp = cos(M) * exp(((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - n)); else tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - n)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 2.9e+47], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 2.9 \cdot 10^{+47}:\\
\;\;\;\;\cos M \cdot e^{\left(m \cdot 0.5 - M\right) \cdot \left(\left(M - m \cdot 0.5\right) - n\right) - n}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) - n}\\
\end{array}
\end{array}
if n < 2.8999999999999998e47Initial program 84.1%
Taylor expanded in K around 0 95.3%
cos-neg95.3%
Simplified95.3%
sub-neg95.3%
distribute-neg-out95.3%
div-inv95.3%
metadata-eval95.3%
add-sqr-sqrt61.0%
fabs-sqr61.0%
add-sqr-sqrt94.4%
Applied egg-rr94.4%
unpow294.4%
Applied egg-rr94.4%
Taylor expanded in n around inf 87.3%
Taylor expanded in n around 0 71.2%
+-commutative71.2%
unpow271.2%
distribute-rgt-out75.2%
Simplified75.2%
if 2.8999999999999998e47 < n Initial program 75.9%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
sub-neg100.0%
distribute-neg-out100.0%
div-inv100.0%
metadata-eval100.0%
add-sqr-sqrt9.3%
fabs-sqr9.3%
add-sqr-sqrt100.0%
Applied egg-rr100.0%
unpow2100.0%
Applied egg-rr100.0%
Taylor expanded in n around inf 100.0%
Taylor expanded in m around 0 83.4%
+-commutative83.4%
unpow283.4%
distribute-rgt-out92.7%
*-commutative92.7%
*-commutative92.7%
Simplified92.7%
Final simplification78.9%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (* -0.5 (* m n)))))
(if (<= l -1.15e+234)
t_0
(if (<= l -1.05e+154)
(* 0.5 (* K (* m (sin M))))
(if (<= l 1.5) t_0 (* (cos M) (exp (- l))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp((-0.5 * (m * n)));
double tmp;
if (l <= -1.15e+234) {
tmp = t_0;
} else if (l <= -1.05e+154) {
tmp = 0.5 * (K * (m * sin(M)));
} else if (l <= 1.5) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = exp(((-0.5d0) * (m * n)))
if (l <= (-1.15d+234)) then
tmp = t_0
else if (l <= (-1.05d+154)) then
tmp = 0.5d0 * (k * (m * sin(m_1)))
else if (l <= 1.5d0) then
tmp = t_0
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 t_0 = Math.exp((-0.5 * (m * n)));
double tmp;
if (l <= -1.15e+234) {
tmp = t_0;
} else if (l <= -1.05e+154) {
tmp = 0.5 * (K * (m * Math.sin(M)));
} else if (l <= 1.5) {
tmp = t_0;
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp((-0.5 * (m * n))) tmp = 0 if l <= -1.15e+234: tmp = t_0 elif l <= -1.05e+154: tmp = 0.5 * (K * (m * math.sin(M))) elif l <= 1.5: tmp = t_0 else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) t_0 = exp(Float64(-0.5 * Float64(m * n))) tmp = 0.0 if (l <= -1.15e+234) tmp = t_0; elseif (l <= -1.05e+154) tmp = Float64(0.5 * Float64(K * Float64(m * sin(M)))); elseif (l <= 1.5) tmp = t_0; else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp((-0.5 * (m * n))); tmp = 0.0; if (l <= -1.15e+234) tmp = t_0; elseif (l <= -1.05e+154) tmp = 0.5 * (K * (m * sin(M))); elseif (l <= 1.5) tmp = t_0; else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(-0.5 * N[(m * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[l, -1.15e+234], t$95$0, If[LessEqual[l, -1.05e+154], N[(0.5 * N[(K * N[(m * N[Sin[M], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.5], t$95$0, N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-0.5 \cdot \left(m \cdot n\right)}\\
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{+234}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -1.05 \cdot 10^{+154}:\\
\;\;\;\;0.5 \cdot \left(K \cdot \left(m \cdot \sin M\right)\right)\\
\mathbf{elif}\;\ell \leq 1.5:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < -1.15e234 or -1.04999999999999997e154 < l < 1.5Initial program 81.9%
Taylor expanded in m around 0 58.7%
+-commutative67.3%
unpow267.3%
distribute-rgt-out73.4%
*-commutative73.4%
*-commutative73.4%
Simplified62.1%
Taylor expanded in m around inf 38.9%
*-commutative38.9%
Simplified38.9%
Taylor expanded in K around 0 44.8%
cos-neg95.3%
Simplified44.8%
Taylor expanded in M around 0 38.0%
if -1.15e234 < l < -1.04999999999999997e154Initial program 90.9%
Taylor expanded in n around inf 46.9%
Taylor expanded in n around 0 2.8%
*-commutative2.8%
*-commutative2.8%
Simplified2.8%
Taylor expanded in m around 0 2.7%
cos-neg2.7%
associate-*r*2.7%
*-commutative2.7%
sin-neg2.7%
Simplified2.7%
Taylor expanded in m around inf 30.3%
if 1.5 < l Initial program 82.3%
Taylor expanded in l around inf 79.2%
mul-1-neg79.2%
Simplified79.2%
Taylor expanded in K around 0 96.9%
cos-neg96.9%
Simplified96.9%
(FPCore (K m n M l) :precision binary64 (if (<= l -1.15e-222) (exp (* -0.5 (* m n))) (if (<= l 450.0) (* (cos M) (exp (* M m))) (* (cos M) (exp (- l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -1.15e-222) {
tmp = exp((-0.5 * (m * n)));
} else if (l <= 450.0) {
tmp = cos(M) * exp((M * m));
} 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.15d-222)) then
tmp = exp(((-0.5d0) * (m * n)))
else if (l <= 450.0d0) then
tmp = cos(m_1) * exp((m_1 * m))
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.15e-222) {
tmp = Math.exp((-0.5 * (m * n)));
} else if (l <= 450.0) {
tmp = Math.cos(M) * Math.exp((M * m));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -1.15e-222: tmp = math.exp((-0.5 * (m * n))) elif l <= 450.0: tmp = math.cos(M) * math.exp((M * m)) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -1.15e-222) tmp = exp(Float64(-0.5 * Float64(m * n))); elseif (l <= 450.0) tmp = Float64(cos(M) * exp(Float64(M * m))); else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -1.15e-222) tmp = exp((-0.5 * (m * n))); elseif (l <= 450.0) tmp = cos(M) * exp((M * m)); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -1.15e-222], N[Exp[N[(-0.5 * N[(m * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 450.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(M * m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.15 \cdot 10^{-222}:\\
\;\;\;\;e^{-0.5 \cdot \left(m \cdot n\right)}\\
\mathbf{elif}\;\ell \leq 450:\\
\;\;\;\;\cos M \cdot e^{M \cdot m}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < -1.1500000000000001e-222Initial program 85.4%
Taylor expanded in m around 0 63.8%
+-commutative68.6%
unpow268.6%
distribute-rgt-out72.5%
*-commutative72.5%
*-commutative72.5%
Simplified65.8%
Taylor expanded in m around inf 37.2%
*-commutative37.2%
Simplified37.2%
Taylor expanded in K around 0 41.1%
cos-neg95.0%
Simplified41.1%
Taylor expanded in M around 0 40.4%
if -1.1500000000000001e-222 < l < 450Initial program 79.3%
Taylor expanded in m around 0 55.5%
+-commutative66.2%
unpow266.2%
distribute-rgt-out73.9%
*-commutative73.9%
*-commutative73.9%
Simplified59.9%
Taylor expanded in m around inf 37.7%
*-commutative37.7%
Simplified37.7%
Taylor expanded in K around 0 45.1%
cos-neg95.3%
Simplified45.1%
Taylor expanded in n around 0 42.0%
if 450 < l Initial program 81.7%
Taylor expanded in l around inf 81.7%
mul-1-neg81.7%
Simplified81.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
(FPCore (K m n M l) :precision binary64 (if (<= l 1.5) (* (cos M) (exp (- (* M (- n M)) n))) (* (cos M) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 1.5) {
tmp = cos(M) * exp(((M * (n - M)) - n));
} 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.5d0) then
tmp = cos(m_1) * exp(((m_1 * (n - m_1)) - n))
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.5) {
tmp = Math.cos(M) * Math.exp(((M * (n - M)) - n));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 1.5: tmp = math.cos(M) * math.exp(((M * (n - M)) - n)) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 1.5) tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(n - M)) - n))); else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 1.5) tmp = cos(M) * exp(((M * (n - M)) - n)); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 1.5], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(n - M), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 1.5:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(n - M\right) - n}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < 1.5Initial program 82.4%
Taylor expanded in K around 0 95.1%
cos-neg95.1%
Simplified95.1%
sub-neg95.1%
distribute-neg-out95.1%
div-inv95.1%
metadata-eval95.1%
add-sqr-sqrt50.6%
fabs-sqr50.6%
add-sqr-sqrt94.2%
Applied egg-rr94.2%
unpow294.2%
Applied egg-rr94.2%
Taylor expanded in n around inf 91.7%
Taylor expanded in n around 0 71.9%
+-commutative71.9%
unpow271.9%
distribute-rgt-out76.1%
Simplified76.1%
Taylor expanded in m around 0 62.1%
neg-sub062.1%
+-commutative62.1%
associate--r+62.1%
neg-sub062.1%
mul-1-neg62.1%
remove-double-neg62.1%
Simplified62.1%
if 1.5 < l Initial program 82.3%
Taylor expanded in l around inf 79.2%
mul-1-neg79.2%
Simplified79.2%
Taylor expanded in K around 0 96.9%
cos-neg96.9%
Simplified96.9%
(FPCore (K m n M l) :precision binary64 (if (<= l 9.6e-18) (* (cos M) (exp (- (* M n) n))) (* (cos M) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 9.6e-18) {
tmp = cos(M) * exp(((M * n) - n));
} 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 <= 9.6d-18) then
tmp = cos(m_1) * exp(((m_1 * n) - n))
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 <= 9.6e-18) {
tmp = Math.cos(M) * Math.exp(((M * n) - n));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 9.6e-18: tmp = math.cos(M) * math.exp(((M * n) - n)) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 9.6e-18) tmp = Float64(cos(M) * exp(Float64(Float64(M * n) - n))); else tmp = Float64(cos(M) * exp(Float64(-l))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 9.6e-18) tmp = cos(M) * exp(((M * n) - n)); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 9.6e-18], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * n), $MachinePrecision] - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 9.6 \cdot 10^{-18}:\\
\;\;\;\;\cos M \cdot e^{M \cdot n - n}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if l < 9.59999999999999976e-18Initial program 83.0%
Taylor expanded in K around 0 95.4%
cos-neg95.4%
Simplified95.4%
sub-neg95.4%
distribute-neg-out95.4%
div-inv95.4%
metadata-eval95.4%
add-sqr-sqrt50.8%
fabs-sqr50.8%
add-sqr-sqrt94.5%
Applied egg-rr94.5%
unpow294.5%
Applied egg-rr94.5%
Taylor expanded in n around inf 91.9%
Taylor expanded in n around 0 71.6%
+-commutative71.6%
unpow271.6%
distribute-rgt-out75.9%
Simplified75.9%
Taylor expanded in m around 0 62.0%
neg-sub062.0%
+-commutative62.0%
associate--r+62.0%
neg-sub062.0%
mul-1-neg62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in M around 0 37.2%
if 9.59999999999999976e-18 < l Initial program 80.6%
Taylor expanded in l around inf 73.4%
mul-1-neg73.4%
Simplified73.4%
Taylor expanded in K around 0 90.2%
cos-neg90.2%
Simplified90.2%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* 0.5 (* K (* m (sin M))))) (t_1 (exp (* -0.5 (* m n)))))
(if (<= m -6.8e-127)
t_1
(if (<= m -1e-240)
t_0
(if (<= m -9e-247) 1.0 (if (<= m 1.8e-235) t_0 t_1))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = 0.5 * (K * (m * sin(M)));
double t_1 = exp((-0.5 * (m * n)));
double tmp;
if (m <= -6.8e-127) {
tmp = t_1;
} else if (m <= -1e-240) {
tmp = t_0;
} else if (m <= -9e-247) {
tmp = 1.0;
} else if (m <= 1.8e-235) {
tmp = t_0;
} else {
tmp = t_1;
}
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) :: tmp
t_0 = 0.5d0 * (k * (m * sin(m_1)))
t_1 = exp(((-0.5d0) * (m * n)))
if (m <= (-6.8d-127)) then
tmp = t_1
else if (m <= (-1d-240)) then
tmp = t_0
else if (m <= (-9d-247)) then
tmp = 1.0d0
else if (m <= 1.8d-235) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = 0.5 * (K * (m * Math.sin(M)));
double t_1 = Math.exp((-0.5 * (m * n)));
double tmp;
if (m <= -6.8e-127) {
tmp = t_1;
} else if (m <= -1e-240) {
tmp = t_0;
} else if (m <= -9e-247) {
tmp = 1.0;
} else if (m <= 1.8e-235) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = 0.5 * (K * (m * math.sin(M))) t_1 = math.exp((-0.5 * (m * n))) tmp = 0 if m <= -6.8e-127: tmp = t_1 elif m <= -1e-240: tmp = t_0 elif m <= -9e-247: tmp = 1.0 elif m <= 1.8e-235: tmp = t_0 else: tmp = t_1 return tmp
function code(K, m, n, M, l) t_0 = Float64(0.5 * Float64(K * Float64(m * sin(M)))) t_1 = exp(Float64(-0.5 * Float64(m * n))) tmp = 0.0 if (m <= -6.8e-127) tmp = t_1; elseif (m <= -1e-240) tmp = t_0; elseif (m <= -9e-247) tmp = 1.0; elseif (m <= 1.8e-235) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = 0.5 * (K * (m * sin(M))); t_1 = exp((-0.5 * (m * n))); tmp = 0.0; if (m <= -6.8e-127) tmp = t_1; elseif (m <= -1e-240) tmp = t_0; elseif (m <= -9e-247) tmp = 1.0; elseif (m <= 1.8e-235) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(0.5 * N[(K * N[(m * N[Sin[M], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(-0.5 * N[(m * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[m, -6.8e-127], t$95$1, If[LessEqual[m, -1e-240], t$95$0, If[LessEqual[m, -9e-247], 1.0, If[LessEqual[m, 1.8e-235], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(K \cdot \left(m \cdot \sin M\right)\right)\\
t_1 := e^{-0.5 \cdot \left(m \cdot n\right)}\\
\mathbf{if}\;m \leq -6.8 \cdot 10^{-127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;m \leq -1 \cdot 10^{-240}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq -9 \cdot 10^{-247}:\\
\;\;\;\;1\\
\mathbf{elif}\;m \leq 1.8 \cdot 10^{-235}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if m < -6.7999999999999997e-127 or 1.79999999999999999e-235 < m Initial program 79.2%
Taylor expanded in m around 0 53.6%
+-commutative62.7%
unpow262.7%
distribute-rgt-out69.9%
*-commutative69.9%
*-commutative69.9%
Simplified58.0%
Taylor expanded in m around inf 33.8%
*-commutative33.8%
Simplified33.8%
Taylor expanded in K around 0 41.0%
cos-neg95.9%
Simplified41.0%
Taylor expanded in M around 0 36.5%
if -6.7999999999999997e-127 < m < -9.9999999999999997e-241 or -9.0000000000000005e-247 < m < 1.79999999999999999e-235Initial program 95.7%
Taylor expanded in n around inf 54.5%
Taylor expanded in n around 0 15.4%
*-commutative15.4%
*-commutative15.4%
Simplified15.4%
Taylor expanded in m around 0 15.4%
cos-neg15.4%
associate-*r*15.4%
*-commutative15.4%
sin-neg15.4%
Simplified15.4%
Taylor expanded in m around inf 55.1%
if -9.9999999999999997e-241 < m < -9.0000000000000005e-247Initial program 100.0%
Taylor expanded in n around inf 100.0%
Taylor expanded in n around 0 100.0%
*-commutative100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in m around 0 100.0%
(FPCore (K m n M l) :precision binary64 (exp (* -0.5 (* m n))))
double code(double K, double m, double n, double M, double l) {
return exp((-0.5 * (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 = exp(((-0.5d0) * (m * n)))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp((-0.5 * (m * n)));
}
def code(K, m, n, M, l): return math.exp((-0.5 * (m * n)))
function code(K, m, n, M, l) return exp(Float64(-0.5 * Float64(m * n))) end
function tmp = code(K, m, n, M, l) tmp = exp((-0.5 * (m * n))); end
code[K_, m_, n_, M_, l_] := N[Exp[N[(-0.5 * N[(m * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{-0.5 \cdot \left(m \cdot n\right)}
\end{array}
Initial program 82.4%
Taylor expanded in m around 0 61.6%
+-commutative69.3%
unpow269.3%
distribute-rgt-out75.2%
*-commutative75.2%
*-commutative75.2%
Simplified65.1%
Taylor expanded in m around inf 33.3%
*-commutative33.3%
Simplified33.3%
Taylor expanded in K around 0 39.2%
cos-neg96.3%
Simplified39.2%
Taylor expanded in M around 0 33.3%
(FPCore (K m n M l) :precision binary64 (cos M))
double code(double K, double m, double n, double M, double l) {
return cos(M);
}
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)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M);
}
def code(K, m, n, M, l): return math.cos(M)
function code(K, m, n, M, l) return cos(M) end
function tmp = code(K, m, n, M, l) tmp = cos(M); end
code[K_, m_, n_, M_, l_] := N[Cos[M], $MachinePrecision]
\begin{array}{l}
\\
\cos M
\end{array}
Initial program 82.4%
Taylor expanded in n around inf 45.5%
Taylor expanded in n around 0 9.2%
*-commutative9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in m around 0 9.8%
cos-neg9.8%
Simplified9.8%
(FPCore (K m n M l) :precision binary64 1.0)
double code(double K, double m, double n, double M, double l) {
return 1.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 = 1.0d0
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0;
}
def code(K, m, n, M, l): return 1.0
function code(K, m, n, M, l) return 1.0 end
function tmp = code(K, m, n, M, l) tmp = 1.0; end
code[K_, m_, n_, M_, l_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 82.4%
Taylor expanded in n around inf 45.5%
Taylor expanded in n around 0 9.2%
*-commutative9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in M around 0 9.2%
*-commutative9.2%
Simplified9.2%
Taylor expanded in m around 0 9.8%
herbie shell --seed 2024105
(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)))))))