
(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 15 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 (- n m)) 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((n - m)) - 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((n - m)) - 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((n - m)) - 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((n - m)) - 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(n - m)) - 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((n - m)) - 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[(n - m), $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|n - m\right| - \ell\right) - {\left(\frac{m + n}{2} - M\right)}^{2}}
\end{array}
Initial program 75.9%
associate-/l*76.6%
+-commutative76.6%
fabs-sub76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in K around 0 97.5%
cos-neg97.5%
Simplified97.5%
Final simplification97.5%
(FPCore (K m n M l)
:precision binary64
(if (<= m -3e+30)
(* (cos M) (exp (* -0.25 (pow m 2.0))))
(*
(cos M)
(exp (+ (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) (- (fabs (- n m)) l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -3e+30) {
tmp = cos(M) * exp((-0.25 * pow(m, 2.0)));
} else {
tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) + (fabs((n - 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 <= (-3d+30)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m ** 2.0d0)))
else
tmp = cos(m_1) * exp(((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) + (abs((n - 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 <= -3e+30) {
tmp = Math.cos(M) * Math.exp((-0.25 * Math.pow(m, 2.0)));
} else {
tmp = Math.cos(M) * Math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) + (Math.abs((n - m)) - l)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -3e+30: tmp = math.cos(M) * math.exp((-0.25 * math.pow(m, 2.0))) else: tmp = math.cos(M) * math.exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) + (math.fabs((n - m)) - l))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -3e+30) tmp = Float64(cos(M) * exp(Float64(-0.25 * (m ^ 2.0)))); else tmp = Float64(cos(M) * exp(Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) + Float64(abs(Float64(n - m)) - l)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -3e+30) tmp = cos(M) * exp((-0.25 * (m ^ 2.0))); else tmp = cos(M) * exp(((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) + (abs((n - m)) - l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -3e+30], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[Power[m, 2.0], $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] + N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3 \cdot 10^{+30}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot {m}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) + \left(\left|n - m\right| - \ell\right)}\\
\end{array}
\end{array}
if m < -2.99999999999999978e30Initial program 61.1%
associate-/l*61.1%
+-commutative61.1%
fabs-sub61.1%
+-commutative61.1%
Simplified61.1%
Taylor expanded in K around 0 98.1%
cos-neg98.1%
Simplified98.1%
Taylor expanded in m around inf 96.4%
if -2.99999999999999978e30 < m Initial program 79.8%
associate-/l*80.8%
+-commutative80.8%
fabs-sub80.8%
+-commutative80.8%
Simplified80.8%
Taylor expanded in K around 0 97.4%
cos-neg97.4%
Simplified97.4%
Taylor expanded in m around 0 78.2%
+-commutative78.2%
unpow278.2%
distribute-rgt-out82.7%
*-commutative82.7%
*-commutative82.7%
Simplified82.7%
Final simplification85.6%
(FPCore (K m n M l) :precision binary64 (if (or (<= M -27.0) (not (<= M 30.0))) (* (cos M) (exp (- (pow M 2.0)))) (* (cos M) (exp (+ (- m n) (- (* M (+ M m)) l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -27.0) || !(M <= 30.0)) {
tmp = cos(M) * exp(-pow(M, 2.0));
} else {
tmp = cos(M) * exp(((m - n) + ((M * (M + 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_1 <= (-27.0d0)) .or. (.not. (m_1 <= 30.0d0))) then
tmp = cos(m_1) * exp(-(m_1 ** 2.0d0))
else
tmp = cos(m_1) * exp(((m - n) + ((m_1 * (m_1 + 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 <= -27.0) || !(M <= 30.0)) {
tmp = Math.cos(M) * Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.cos(M) * Math.exp(((m - n) + ((M * (M + m)) - l)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (M <= -27.0) or not (M <= 30.0): tmp = math.cos(M) * math.exp(-math.pow(M, 2.0)) else: tmp = math.cos(M) * math.exp(((m - n) + ((M * (M + m)) - l))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((M <= -27.0) || !(M <= 30.0)) tmp = Float64(cos(M) * exp(Float64(-(M ^ 2.0)))); else tmp = Float64(cos(M) * exp(Float64(Float64(m - n) + Float64(Float64(M * Float64(M + m)) - l)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((M <= -27.0) || ~((M <= 30.0))) tmp = cos(M) * exp(-(M ^ 2.0)); else tmp = cos(M) * exp(((m - n) + ((M * (M + m)) - l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[M, -27.0], N[Not[LessEqual[M, 30.0]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(m - n), $MachinePrecision] + N[(N[(M * N[(M + m), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -27 \lor \neg \left(M \leq 30\right):\\
\;\;\;\;\cos M \cdot e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(m - n\right) + \left(M \cdot \left(M + m\right) - \ell\right)}\\
\end{array}
\end{array}
if M < -27 or 30 < M Initial program 82.2%
associate-/l*83.0%
+-commutative83.0%
fabs-sub83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in K around 0 99.3%
cos-neg99.3%
Simplified99.3%
Taylor expanded in M around inf 97.8%
mul-1-neg97.8%
Simplified97.8%
if -27 < M < 30Initial program 68.7%
associate-/l*69.6%
+-commutative69.6%
fabs-sub69.6%
+-commutative69.6%
Simplified69.6%
Taylor expanded in K around 0 95.6%
cos-neg95.6%
Simplified95.6%
Taylor expanded in m around 0 66.2%
+-commutative66.2%
unpow266.2%
distribute-rgt-out68.7%
*-commutative68.7%
*-commutative68.7%
Simplified68.7%
Taylor expanded in n around 0 32.9%
associate--r+32.9%
sub-neg32.9%
neg-mul-132.9%
associate-*r*32.9%
neg-mul-132.9%
cancel-sign-sub32.9%
neg-mul-132.9%
sub-neg32.9%
unpow132.9%
sqr-pow18.8%
fabs-sqr18.8%
sqr-pow68.7%
unpow168.7%
Simplified68.7%
associate-+l-68.7%
add-sqr-sqrt18.8%
fabs-sqr18.8%
add-sqr-sqrt32.9%
fabs-sub32.9%
add-sqr-sqrt14.1%
fabs-sqr14.1%
add-sqr-sqrt56.5%
sub-neg56.5%
add-sqr-sqrt26.0%
sqrt-unprod56.5%
sqr-neg56.5%
sqrt-unprod30.5%
add-sqr-sqrt56.5%
Applied egg-rr56.5%
Final simplification78.3%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (- l))) (t_1 (* (cos M) (exp l))))
(if (<= l -1.36e+202)
t_1
(if (<= l -2.1e+177)
(* (+ (* (pow M 2.0) -0.5) 1.0) t_0)
(if (<= l -2.2)
t_1
(if (<= l 3.6) (* (cos M) (exp (* m (- M (* n 0.5))))) t_0))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(-l);
double t_1 = cos(M) * exp(l);
double tmp;
if (l <= -1.36e+202) {
tmp = t_1;
} else if (l <= -2.1e+177) {
tmp = ((pow(M, 2.0) * -0.5) + 1.0) * t_0;
} else if (l <= -2.2) {
tmp = t_1;
} else if (l <= 3.6) {
tmp = cos(M) * exp((m * (M - (n * 0.5))));
} 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) :: tmp
t_0 = exp(-l)
t_1 = cos(m_1) * exp(l)
if (l <= (-1.36d+202)) then
tmp = t_1
else if (l <= (-2.1d+177)) then
tmp = (((m_1 ** 2.0d0) * (-0.5d0)) + 1.0d0) * t_0
else if (l <= (-2.2d0)) then
tmp = t_1
else if (l <= 3.6d0) then
tmp = cos(m_1) * exp((m * (m_1 - (n * 0.5d0))))
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.exp(-l);
double t_1 = Math.cos(M) * Math.exp(l);
double tmp;
if (l <= -1.36e+202) {
tmp = t_1;
} else if (l <= -2.1e+177) {
tmp = ((Math.pow(M, 2.0) * -0.5) + 1.0) * t_0;
} else if (l <= -2.2) {
tmp = t_1;
} else if (l <= 3.6) {
tmp = Math.cos(M) * Math.exp((m * (M - (n * 0.5))));
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp(-l) t_1 = math.cos(M) * math.exp(l) tmp = 0 if l <= -1.36e+202: tmp = t_1 elif l <= -2.1e+177: tmp = ((math.pow(M, 2.0) * -0.5) + 1.0) * t_0 elif l <= -2.2: tmp = t_1 elif l <= 3.6: tmp = math.cos(M) * math.exp((m * (M - (n * 0.5)))) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = exp(Float64(-l)) t_1 = Float64(cos(M) * exp(l)) tmp = 0.0 if (l <= -1.36e+202) tmp = t_1; elseif (l <= -2.1e+177) tmp = Float64(Float64(Float64((M ^ 2.0) * -0.5) + 1.0) * t_0); elseif (l <= -2.2) tmp = t_1; elseif (l <= 3.6) tmp = Float64(cos(M) * exp(Float64(m * Float64(M - Float64(n * 0.5))))); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(-l); t_1 = cos(M) * exp(l); tmp = 0.0; if (l <= -1.36e+202) tmp = t_1; elseif (l <= -2.1e+177) tmp = (((M ^ 2.0) * -0.5) + 1.0) * t_0; elseif (l <= -2.2) tmp = t_1; elseif (l <= 3.6) tmp = cos(M) * exp((m * (M - (n * 0.5)))); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[(-l)], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.36e+202], t$95$1, If[LessEqual[l, -2.1e+177], N[(N[(N[(N[Power[M, 2.0], $MachinePrecision] * -0.5), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[l, -2.2], t$95$1, If[LessEqual[l, 3.6], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-\ell}\\
t_1 := \cos M \cdot e^{\ell}\\
\mathbf{if}\;\ell \leq -1.36 \cdot 10^{+202}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq -2.1 \cdot 10^{+177}:\\
\;\;\;\;\left({M}^{2} \cdot -0.5 + 1\right) \cdot t\_0\\
\mathbf{elif}\;\ell \leq -2.2:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 3.6:\\
\;\;\;\;\cos M \cdot e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -1.36e202 or -2.10000000000000013e177 < l < -2.2000000000000002Initial program 83.1%
associate-/l*84.6%
+-commutative84.6%
fabs-sub84.6%
+-commutative84.6%
Simplified84.6%
Taylor expanded in K around 0 96.9%
cos-neg96.9%
Simplified96.9%
Taylor expanded in l around inf 21.2%
mul-1-neg21.2%
Simplified21.2%
expm1-log1p-u20.8%
expm1-udef20.8%
add-sqr-sqrt20.8%
sqrt-unprod20.8%
sqr-neg20.8%
sqrt-unprod0.0%
add-sqr-sqrt75.8%
Applied egg-rr75.8%
expm1-def75.8%
expm1-log1p75.8%
Simplified75.8%
if -1.36e202 < l < -2.10000000000000013e177Initial program 50.0%
associate-/l*66.7%
+-commutative66.7%
fabs-sub66.7%
+-commutative66.7%
Simplified66.7%
Taylor expanded in K around 0 66.7%
cos-neg66.7%
Simplified66.7%
Taylor expanded in l around inf 66.7%
mul-1-neg66.7%
Simplified66.7%
Taylor expanded in M around 0 0.0%
associate-*r*0.0%
distribute-rgt1-in83.3%
Simplified83.3%
if -2.2000000000000002 < l < 3.60000000000000009Initial program 71.3%
associate-/l*71.4%
+-commutative71.4%
fabs-sub71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in K around 0 98.0%
cos-neg98.0%
Simplified98.0%
Taylor expanded in m around 0 71.1%
+-commutative71.1%
unpow271.1%
distribute-rgt-out78.8%
*-commutative78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around inf 43.8%
*-commutative43.8%
Simplified43.8%
if 3.60000000000000009 < l Initial program 79.1%
associate-/l*79.1%
+-commutative79.1%
fabs-sub79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 97.1%
mul-1-neg97.1%
Simplified97.1%
Taylor expanded in M around 0 97.1%
Final simplification66.8%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* M (+ M m))))
(if (<= M -9e+108)
(* (cos M) (exp (- (- n (+ m l)) t_0)))
(if (<= M -0.26)
(* (cos (- (/ (* n K) 2.0) M)) (exp (- m (+ n l))))
(if (<= M 0.0095)
(* (cos M) (exp (+ (- m n) (- t_0 l))))
(* (cos M) (exp (- (* M (- m M)) (+ m l)))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = M * (M + m);
double tmp;
if (M <= -9e+108) {
tmp = cos(M) * exp(((n - (m + l)) - t_0));
} else if (M <= -0.26) {
tmp = cos((((n * K) / 2.0) - M)) * exp((m - (n + l)));
} else if (M <= 0.0095) {
tmp = cos(M) * exp(((m - n) + (t_0 - l)));
} else {
tmp = cos(M) * exp(((M * (m - M)) - (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_1 * (m_1 + m)
if (m_1 <= (-9d+108)) then
tmp = cos(m_1) * exp(((n - (m + l)) - t_0))
else if (m_1 <= (-0.26d0)) then
tmp = cos((((n * k) / 2.0d0) - m_1)) * exp((m - (n + l)))
else if (m_1 <= 0.0095d0) then
tmp = cos(m_1) * exp(((m - n) + (t_0 - l)))
else
tmp = cos(m_1) * exp(((m_1 * (m - m_1)) - (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 * (M + m);
double tmp;
if (M <= -9e+108) {
tmp = Math.cos(M) * Math.exp(((n - (m + l)) - t_0));
} else if (M <= -0.26) {
tmp = Math.cos((((n * K) / 2.0) - M)) * Math.exp((m - (n + l)));
} else if (M <= 0.0095) {
tmp = Math.cos(M) * Math.exp(((m - n) + (t_0 - l)));
} else {
tmp = Math.cos(M) * Math.exp(((M * (m - M)) - (m + l)));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = M * (M + m) tmp = 0 if M <= -9e+108: tmp = math.cos(M) * math.exp(((n - (m + l)) - t_0)) elif M <= -0.26: tmp = math.cos((((n * K) / 2.0) - M)) * math.exp((m - (n + l))) elif M <= 0.0095: tmp = math.cos(M) * math.exp(((m - n) + (t_0 - l))) else: tmp = math.cos(M) * math.exp(((M * (m - M)) - (m + l))) return tmp
function code(K, m, n, M, l) t_0 = Float64(M * Float64(M + m)) tmp = 0.0 if (M <= -9e+108) tmp = Float64(cos(M) * exp(Float64(Float64(n - Float64(m + l)) - t_0))); elseif (M <= -0.26) tmp = Float64(cos(Float64(Float64(Float64(n * K) / 2.0) - M)) * exp(Float64(m - Float64(n + l)))); elseif (M <= 0.0095) tmp = Float64(cos(M) * exp(Float64(Float64(m - n) + Float64(t_0 - l)))); else tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(m - M)) - Float64(m + l)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = M * (M + m); tmp = 0.0; if (M <= -9e+108) tmp = cos(M) * exp(((n - (m + l)) - t_0)); elseif (M <= -0.26) tmp = cos((((n * K) / 2.0) - M)) * exp((m - (n + l))); elseif (M <= 0.0095) tmp = cos(M) * exp(((m - n) + (t_0 - l))); else tmp = cos(M) * exp(((M * (m - M)) - (m + l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(M * N[(M + m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -9e+108], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(n - N[(m + l), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, -0.26], N[(N[Cos[N[(N[(N[(n * K), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(m - N[(n + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 0.0095], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(m - n), $MachinePrecision] + N[(t$95$0 - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(m - M), $MachinePrecision]), $MachinePrecision] - N[(m + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \left(M + m\right)\\
\mathbf{if}\;M \leq -9 \cdot 10^{+108}:\\
\;\;\;\;\cos M \cdot e^{\left(n - \left(m + \ell\right)\right) - t\_0}\\
\mathbf{elif}\;M \leq -0.26:\\
\;\;\;\;\cos \left(\frac{n \cdot K}{2} - M\right) \cdot e^{m - \left(n + \ell\right)}\\
\mathbf{elif}\;M \leq 0.0095:\\
\;\;\;\;\cos M \cdot e^{\left(m - n\right) + \left(t\_0 - \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(m - M\right) - \left(m + \ell\right)}\\
\end{array}
\end{array}
if M < -9e108Initial program 78.6%
associate-/l*78.6%
+-commutative78.6%
fabs-sub78.6%
+-commutative78.6%
Simplified78.6%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around 0 81.0%
+-commutative81.0%
unpow281.0%
distribute-rgt-out97.7%
*-commutative97.7%
*-commutative97.7%
Simplified97.7%
Taylor expanded in n around 0 95.3%
associate--r+95.3%
sub-neg95.3%
neg-mul-195.3%
associate-*r*95.3%
neg-mul-195.3%
cancel-sign-sub95.3%
neg-mul-195.3%
sub-neg95.3%
unpow195.3%
sqr-pow54.8%
fabs-sqr54.8%
sqr-pow95.3%
unpow195.3%
Simplified95.3%
add-sqr-sqrt52.5%
fma-def52.5%
add-sqr-sqrt0.0%
sqrt-unprod5.6%
sqr-neg5.6%
sqrt-unprod5.6%
add-sqr-sqrt5.6%
distribute-lft-neg-out5.6%
fma-neg5.6%
add-sqr-sqrt6.3%
associate--l-6.3%
sub-neg6.3%
add-sqr-sqrt6.3%
sqrt-unprod6.3%
sqr-neg6.3%
sqrt-unprod0.0%
add-sqr-sqrt90.6%
Applied egg-rr90.6%
if -9e108 < M < -0.26000000000000001Initial program 76.7%
Taylor expanded in m around 0 83.3%
Taylor expanded in m around 0 70.1%
+-commutative76.8%
unpow276.8%
distribute-rgt-out86.8%
*-commutative86.8%
*-commutative86.8%
Simplified73.5%
Taylor expanded in n around 0 50.5%
associate-*r*50.5%
neg-mul-150.5%
Simplified50.5%
Taylor expanded in M around 0 8.0%
rem-square-sqrt4.1%
fabs-sqr4.1%
rem-square-sqrt34.2%
associate--l-34.2%
Simplified34.2%
if -0.26000000000000001 < M < 0.00949999999999999976Initial program 68.5%
associate-/l*69.3%
+-commutative69.3%
fabs-sub69.3%
+-commutative69.3%
Simplified69.3%
Taylor expanded in K around 0 95.5%
cos-neg95.5%
Simplified95.5%
Taylor expanded in m around 0 66.0%
+-commutative66.0%
unpow266.0%
distribute-rgt-out68.5%
*-commutative68.5%
*-commutative68.5%
Simplified68.5%
Taylor expanded in n around 0 32.4%
associate--r+32.4%
sub-neg32.4%
neg-mul-132.4%
associate-*r*32.4%
neg-mul-132.4%
cancel-sign-sub32.4%
neg-mul-132.4%
sub-neg32.4%
unpow132.4%
sqr-pow18.2%
fabs-sqr18.2%
sqr-pow68.5%
unpow168.5%
Simplified68.5%
associate-+l-68.5%
add-sqr-sqrt18.2%
fabs-sqr18.2%
add-sqr-sqrt32.4%
fabs-sub32.4%
add-sqr-sqrt14.2%
fabs-sqr14.2%
add-sqr-sqrt56.2%
sub-neg56.2%
add-sqr-sqrt26.2%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod30.0%
add-sqr-sqrt56.2%
Applied egg-rr56.2%
if 0.00949999999999999976 < M Initial program 87.5%
associate-/l*87.5%
+-commutative87.5%
fabs-sub87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around 0 78.2%
+-commutative78.2%
unpow278.2%
distribute-rgt-out86.2%
*-commutative86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in n around 0 78.5%
associate--r+78.5%
sub-neg78.5%
neg-mul-178.5%
associate-*r*78.5%
neg-mul-178.5%
cancel-sign-sub78.5%
neg-mul-178.5%
sub-neg78.5%
unpow178.5%
sqr-pow43.8%
fabs-sqr43.8%
sqr-pow81.5%
unpow181.5%
Simplified81.5%
Taylor expanded in n around 0 86.2%
+-commutative86.2%
Simplified86.2%
Final simplification66.7%
(FPCore (K m n M l) :precision binary64 (if (or (<= M -2.05e+65) (not (<= M 0.0095))) (* (cos M) (exp (- (* M (- m M)) (+ m l)))) (* (cos M) (exp (+ (- m n) (- (* M (+ M m)) l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -2.05e+65) || !(M <= 0.0095)) {
tmp = cos(M) * exp(((M * (m - M)) - (m + l)));
} else {
tmp = cos(M) * exp(((m - n) + ((M * (M + 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_1 <= (-2.05d+65)) .or. (.not. (m_1 <= 0.0095d0))) then
tmp = cos(m_1) * exp(((m_1 * (m - m_1)) - (m + l)))
else
tmp = cos(m_1) * exp(((m - n) + ((m_1 * (m_1 + 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 <= -2.05e+65) || !(M <= 0.0095)) {
tmp = Math.cos(M) * Math.exp(((M * (m - M)) - (m + l)));
} else {
tmp = Math.cos(M) * Math.exp(((m - n) + ((M * (M + m)) - l)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (M <= -2.05e+65) or not (M <= 0.0095): tmp = math.cos(M) * math.exp(((M * (m - M)) - (m + l))) else: tmp = math.cos(M) * math.exp(((m - n) + ((M * (M + m)) - l))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((M <= -2.05e+65) || !(M <= 0.0095)) tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(m - M)) - Float64(m + l)))); else tmp = Float64(cos(M) * exp(Float64(Float64(m - n) + Float64(Float64(M * Float64(M + m)) - l)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((M <= -2.05e+65) || ~((M <= 0.0095))) tmp = cos(M) * exp(((M * (m - M)) - (m + l))); else tmp = cos(M) * exp(((m - n) + ((M * (M + m)) - l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[M, -2.05e+65], N[Not[LessEqual[M, 0.0095]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(m - M), $MachinePrecision]), $MachinePrecision] - N[(m + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(m - n), $MachinePrecision] + N[(N[(M * N[(M + m), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -2.05 \cdot 10^{+65} \lor \neg \left(M \leq 0.0095\right):\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(m - M\right) - \left(m + \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(m - n\right) + \left(M \cdot \left(M + m\right) - \ell\right)}\\
\end{array}
\end{array}
if M < -2.0500000000000001e65 or 0.00949999999999999976 < M Initial program 84.7%
associate-/l*84.7%
+-commutative84.7%
fabs-sub84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around 0 78.9%
+-commutative78.9%
unpow278.9%
distribute-rgt-out90.8%
*-commutative90.8%
*-commutative90.8%
Simplified90.8%
Taylor expanded in n around 0 84.2%
associate--r+84.2%
sub-neg84.2%
neg-mul-184.2%
associate-*r*84.2%
neg-mul-184.2%
cancel-sign-sub84.2%
neg-mul-184.2%
sub-neg84.2%
unpow184.2%
sqr-pow46.7%
fabs-sqr46.7%
sqr-pow86.7%
unpow186.7%
Simplified86.7%
Taylor expanded in n around 0 90.0%
+-commutative90.0%
Simplified90.0%
if -2.0500000000000001e65 < M < 0.00949999999999999976Initial program 68.2%
associate-/l*69.7%
+-commutative69.7%
fabs-sub69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in K around 0 95.4%
cos-neg95.4%
Simplified95.4%
Taylor expanded in m around 0 67.5%
+-commutative67.5%
unpow267.5%
distribute-rgt-out70.4%
*-commutative70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in n around 0 32.6%
associate--r+32.6%
sub-neg32.6%
neg-mul-132.6%
associate-*r*32.6%
neg-mul-132.6%
cancel-sign-sub32.6%
neg-mul-132.6%
sub-neg32.6%
unpow132.6%
sqr-pow15.9%
fabs-sqr15.9%
sqr-pow67.6%
unpow167.6%
Simplified67.6%
associate-+l-67.6%
add-sqr-sqrt15.9%
fabs-sqr15.9%
add-sqr-sqrt32.6%
fabs-sub32.6%
add-sqr-sqrt16.8%
fabs-sqr16.8%
add-sqr-sqrt56.2%
sub-neg56.2%
add-sqr-sqrt30.1%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod26.0%
add-sqr-sqrt55.4%
Applied egg-rr55.4%
Final simplification71.4%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* M (+ M m))))
(if (<= M -1.15e+63)
(* (cos M) (exp (- (- n (+ m l)) t_0)))
(if (<= M 0.0095)
(* (cos M) (exp (+ (- m n) (- t_0 l))))
(* (cos M) (exp (- (* M (- m M)) (+ m l))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = M * (M + m);
double tmp;
if (M <= -1.15e+63) {
tmp = cos(M) * exp(((n - (m + l)) - t_0));
} else if (M <= 0.0095) {
tmp = cos(M) * exp(((m - n) + (t_0 - l)));
} else {
tmp = cos(M) * exp(((M * (m - M)) - (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_1 * (m_1 + m)
if (m_1 <= (-1.15d+63)) then
tmp = cos(m_1) * exp(((n - (m + l)) - t_0))
else if (m_1 <= 0.0095d0) then
tmp = cos(m_1) * exp(((m - n) + (t_0 - l)))
else
tmp = cos(m_1) * exp(((m_1 * (m - m_1)) - (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 * (M + m);
double tmp;
if (M <= -1.15e+63) {
tmp = Math.cos(M) * Math.exp(((n - (m + l)) - t_0));
} else if (M <= 0.0095) {
tmp = Math.cos(M) * Math.exp(((m - n) + (t_0 - l)));
} else {
tmp = Math.cos(M) * Math.exp(((M * (m - M)) - (m + l)));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = M * (M + m) tmp = 0 if M <= -1.15e+63: tmp = math.cos(M) * math.exp(((n - (m + l)) - t_0)) elif M <= 0.0095: tmp = math.cos(M) * math.exp(((m - n) + (t_0 - l))) else: tmp = math.cos(M) * math.exp(((M * (m - M)) - (m + l))) return tmp
function code(K, m, n, M, l) t_0 = Float64(M * Float64(M + m)) tmp = 0.0 if (M <= -1.15e+63) tmp = Float64(cos(M) * exp(Float64(Float64(n - Float64(m + l)) - t_0))); elseif (M <= 0.0095) tmp = Float64(cos(M) * exp(Float64(Float64(m - n) + Float64(t_0 - l)))); else tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(m - M)) - Float64(m + l)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = M * (M + m); tmp = 0.0; if (M <= -1.15e+63) tmp = cos(M) * exp(((n - (m + l)) - t_0)); elseif (M <= 0.0095) tmp = cos(M) * exp(((m - n) + (t_0 - l))); else tmp = cos(M) * exp(((M * (m - M)) - (m + l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(M * N[(M + m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -1.15e+63], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(n - N[(m + l), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 0.0095], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(m - n), $MachinePrecision] + N[(t$95$0 - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(m - M), $MachinePrecision]), $MachinePrecision] - N[(m + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M \cdot \left(M + m\right)\\
\mathbf{if}\;M \leq -1.15 \cdot 10^{+63}:\\
\;\;\;\;\cos M \cdot e^{\left(n - \left(m + \ell\right)\right) - t\_0}\\
\mathbf{elif}\;M \leq 0.0095:\\
\;\;\;\;\cos M \cdot e^{\left(m - n\right) + \left(t\_0 - \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(m - M\right) - \left(m + \ell\right)}\\
\end{array}
\end{array}
if M < -1.14999999999999997e63Initial program 81.5%
associate-/l*81.5%
+-commutative81.5%
fabs-sub81.5%
+-commutative81.5%
Simplified81.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around 0 79.7%
+-commutative79.7%
unpow279.7%
distribute-rgt-out96.4%
*-commutative96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in n around 0 90.9%
associate--r+90.9%
sub-neg90.9%
neg-mul-190.9%
associate-*r*90.9%
neg-mul-190.9%
cancel-sign-sub90.9%
neg-mul-190.9%
sub-neg90.9%
unpow190.9%
sqr-pow50.1%
fabs-sqr50.1%
sqr-pow92.7%
unpow192.7%
Simplified92.7%
add-sqr-sqrt48.3%
fma-def48.3%
add-sqr-sqrt0.0%
sqrt-unprod6.3%
sqr-neg6.3%
sqrt-unprod6.3%
add-sqr-sqrt6.3%
distribute-lft-neg-out6.3%
fma-neg6.3%
add-sqr-sqrt8.9%
associate--l-8.9%
sub-neg8.9%
add-sqr-sqrt8.9%
sqrt-unprod8.9%
sqr-neg8.9%
sqrt-unprod0.0%
add-sqr-sqrt83.6%
Applied egg-rr83.6%
if -1.14999999999999997e63 < M < 0.00949999999999999976Initial program 68.2%
associate-/l*69.7%
+-commutative69.7%
fabs-sub69.7%
+-commutative69.7%
Simplified69.7%
Taylor expanded in K around 0 95.4%
cos-neg95.4%
Simplified95.4%
Taylor expanded in m around 0 67.5%
+-commutative67.5%
unpow267.5%
distribute-rgt-out70.4%
*-commutative70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in n around 0 32.6%
associate--r+32.6%
sub-neg32.6%
neg-mul-132.6%
associate-*r*32.6%
neg-mul-132.6%
cancel-sign-sub32.6%
neg-mul-132.6%
sub-neg32.6%
unpow132.6%
sqr-pow15.9%
fabs-sqr15.9%
sqr-pow67.6%
unpow167.6%
Simplified67.6%
associate-+l-67.6%
add-sqr-sqrt15.9%
fabs-sqr15.9%
add-sqr-sqrt32.6%
fabs-sub32.6%
add-sqr-sqrt16.8%
fabs-sqr16.8%
add-sqr-sqrt56.2%
sub-neg56.2%
add-sqr-sqrt30.1%
sqrt-unprod56.2%
sqr-neg56.2%
sqrt-unprod26.0%
add-sqr-sqrt55.4%
Applied egg-rr55.4%
if 0.00949999999999999976 < M Initial program 87.5%
associate-/l*87.5%
+-commutative87.5%
fabs-sub87.5%
+-commutative87.5%
Simplified87.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around 0 78.2%
+-commutative78.2%
unpow278.2%
distribute-rgt-out86.2%
*-commutative86.2%
*-commutative86.2%
Simplified86.2%
Taylor expanded in n around 0 78.5%
associate--r+78.5%
sub-neg78.5%
neg-mul-178.5%
associate-*r*78.5%
neg-mul-178.5%
cancel-sign-sub78.5%
neg-mul-178.5%
sub-neg78.5%
unpow178.5%
sqr-pow43.8%
fabs-sqr43.8%
sqr-pow81.5%
unpow181.5%
Simplified81.5%
Taylor expanded in n around 0 86.2%
+-commutative86.2%
Simplified86.2%
Final simplification69.1%
(FPCore (K m n M l) :precision binary64 (if (<= l -2.2) (* (cos M) (exp l)) (if (<= l 3.6) (* (cos M) (exp (* m (- M (* n 0.5))))) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -2.2) {
tmp = cos(M) * exp(l);
} else if (l <= 3.6) {
tmp = cos(M) * exp((m * (M - (n * 0.5))));
} 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 <= (-2.2d0)) then
tmp = cos(m_1) * exp(l)
else if (l <= 3.6d0) then
tmp = cos(m_1) * exp((m * (m_1 - (n * 0.5d0))))
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 <= -2.2) {
tmp = Math.cos(M) * Math.exp(l);
} else if (l <= 3.6) {
tmp = Math.cos(M) * Math.exp((m * (M - (n * 0.5))));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -2.2: tmp = math.cos(M) * math.exp(l) elif l <= 3.6: tmp = math.cos(M) * math.exp((m * (M - (n * 0.5)))) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -2.2) tmp = Float64(cos(M) * exp(l)); elseif (l <= 3.6) tmp = Float64(cos(M) * exp(Float64(m * Float64(M - Float64(n * 0.5))))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -2.2) tmp = cos(M) * exp(l); elseif (l <= 3.6) tmp = cos(M) * exp((m * (M - (n * 0.5)))); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -2.2], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.6], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.2:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{elif}\;\ell \leq 3.6:\\
\;\;\;\;\cos M \cdot e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < -2.2000000000000002Initial program 80.3%
associate-/l*83.1%
+-commutative83.1%
fabs-sub83.1%
+-commutative83.1%
Simplified83.1%
Taylor expanded in K around 0 94.4%
cos-neg94.4%
Simplified94.4%
Taylor expanded in l around inf 25.1%
mul-1-neg25.1%
Simplified25.1%
expm1-log1p-u24.7%
expm1-udef24.7%
add-sqr-sqrt24.7%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod0.0%
add-sqr-sqrt69.5%
Applied egg-rr69.5%
expm1-def69.5%
expm1-log1p69.5%
Simplified69.5%
if -2.2000000000000002 < l < 3.60000000000000009Initial program 71.3%
associate-/l*71.4%
+-commutative71.4%
fabs-sub71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in K around 0 98.0%
cos-neg98.0%
Simplified98.0%
Taylor expanded in m around 0 71.1%
+-commutative71.1%
unpow271.1%
distribute-rgt-out78.8%
*-commutative78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in m around inf 43.8%
*-commutative43.8%
Simplified43.8%
if 3.60000000000000009 < l Initial program 79.1%
associate-/l*79.1%
+-commutative79.1%
fabs-sub79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 97.1%
mul-1-neg97.1%
Simplified97.1%
Taylor expanded in M around 0 97.1%
Final simplification64.9%
(FPCore (K m n M l) :precision binary64 (if (<= l -2.2) (* (cos M) (exp l)) (if (<= l 3.6) (* (cos M) (exp (* m (+ M -1.0)))) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -2.2) {
tmp = cos(M) * exp(l);
} else if (l <= 3.6) {
tmp = cos(M) * exp((m * (M + -1.0)));
} 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 <= (-2.2d0)) then
tmp = cos(m_1) * exp(l)
else if (l <= 3.6d0) then
tmp = cos(m_1) * exp((m * (m_1 + (-1.0d0))))
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 <= -2.2) {
tmp = Math.cos(M) * Math.exp(l);
} else if (l <= 3.6) {
tmp = Math.cos(M) * Math.exp((m * (M + -1.0)));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -2.2: tmp = math.cos(M) * math.exp(l) elif l <= 3.6: tmp = math.cos(M) * math.exp((m * (M + -1.0))) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -2.2) tmp = Float64(cos(M) * exp(l)); elseif (l <= 3.6) tmp = Float64(cos(M) * exp(Float64(m * Float64(M + -1.0)))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -2.2) tmp = cos(M) * exp(l); elseif (l <= 3.6) tmp = cos(M) * exp((m * (M + -1.0))); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -2.2], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 3.6], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(m * N[(M + -1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.2:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{elif}\;\ell \leq 3.6:\\
\;\;\;\;\cos M \cdot e^{m \cdot \left(M + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < -2.2000000000000002Initial program 80.3%
associate-/l*83.1%
+-commutative83.1%
fabs-sub83.1%
+-commutative83.1%
Simplified83.1%
Taylor expanded in K around 0 94.4%
cos-neg94.4%
Simplified94.4%
Taylor expanded in l around inf 25.1%
mul-1-neg25.1%
Simplified25.1%
expm1-log1p-u24.7%
expm1-udef24.7%
add-sqr-sqrt24.7%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod0.0%
add-sqr-sqrt69.5%
Applied egg-rr69.5%
expm1-def69.5%
expm1-log1p69.5%
Simplified69.5%
if -2.2000000000000002 < l < 3.60000000000000009Initial program 71.3%
associate-/l*71.4%
+-commutative71.4%
fabs-sub71.4%
+-commutative71.4%
Simplified71.4%
Taylor expanded in K around 0 98.0%
cos-neg98.0%
Simplified98.0%
Taylor expanded in m around 0 71.1%
+-commutative71.1%
unpow271.1%
distribute-rgt-out78.8%
*-commutative78.8%
*-commutative78.8%
Simplified78.8%
Taylor expanded in n around 0 48.8%
associate--r+48.8%
sub-neg48.8%
neg-mul-148.8%
associate-*r*48.8%
neg-mul-148.8%
cancel-sign-sub48.8%
neg-mul-148.8%
sub-neg48.8%
unpow148.8%
sqr-pow23.5%
fabs-sqr23.5%
sqr-pow72.2%
unpow172.2%
Simplified72.2%
Taylor expanded in m around inf 39.7%
if 3.60000000000000009 < l Initial program 79.1%
associate-/l*79.1%
+-commutative79.1%
fabs-sub79.1%
+-commutative79.1%
Simplified79.1%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 97.1%
mul-1-neg97.1%
Simplified97.1%
Taylor expanded in M around 0 97.1%
Final simplification63.0%
(FPCore (K m n M l) :precision binary64 (if (<= m -7e+138) (* (cos M) (exp (* m (- M (* n 0.5))))) (* (cos M) (exp (- (* M (- m M)) (+ m l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -7e+138) {
tmp = cos(M) * exp((m * (M - (n * 0.5))));
} else {
tmp = cos(M) * exp(((M * (m - M)) - (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 <= (-7d+138)) then
tmp = cos(m_1) * exp((m * (m_1 - (n * 0.5d0))))
else
tmp = cos(m_1) * exp(((m_1 * (m - m_1)) - (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 <= -7e+138) {
tmp = Math.cos(M) * Math.exp((m * (M - (n * 0.5))));
} else {
tmp = Math.cos(M) * Math.exp(((M * (m - M)) - (m + l)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -7e+138: tmp = math.cos(M) * math.exp((m * (M - (n * 0.5)))) else: tmp = math.cos(M) * math.exp(((M * (m - M)) - (m + l))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -7e+138) tmp = Float64(cos(M) * exp(Float64(m * Float64(M - Float64(n * 0.5))))); else tmp = Float64(cos(M) * exp(Float64(Float64(M * Float64(m - M)) - Float64(m + l)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -7e+138) tmp = cos(M) * exp((m * (M - (n * 0.5)))); else tmp = cos(M) * exp(((M * (m - M)) - (m + l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -7e+138], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(M * N[(m - M), $MachinePrecision]), $MachinePrecision] - N[(m + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -7 \cdot 10^{+138}:\\
\;\;\;\;\cos M \cdot e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{M \cdot \left(m - M\right) - \left(m + \ell\right)}\\
\end{array}
\end{array}
if m < -6.9999999999999996e138Initial program 60.0%
associate-/l*60.0%
+-commutative60.0%
fabs-sub60.0%
+-commutative60.0%
Simplified60.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around 0 40.6%
+-commutative40.6%
unpow240.6%
distribute-rgt-out60.6%
*-commutative60.6%
*-commutative60.6%
Simplified60.6%
Taylor expanded in m around inf 47.5%
*-commutative47.5%
Simplified47.5%
if -6.9999999999999996e138 < m Initial program 78.0%
associate-/l*78.8%
+-commutative78.8%
fabs-sub78.8%
+-commutative78.8%
Simplified78.8%
Taylor expanded in K around 0 97.2%
cos-neg97.2%
Simplified97.2%
Taylor expanded in m around 0 77.0%
+-commutative77.0%
unpow277.0%
distribute-rgt-out82.4%
*-commutative82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in n around 0 58.4%
associate--r+58.4%
sub-neg58.4%
neg-mul-158.4%
associate-*r*58.4%
neg-mul-158.4%
cancel-sign-sub58.4%
neg-mul-158.4%
sub-neg58.4%
unpow158.4%
sqr-pow28.7%
fabs-sqr28.7%
sqr-pow80.2%
unpow180.2%
Simplified80.2%
Taylor expanded in n around 0 79.0%
+-commutative79.0%
Simplified79.0%
Final simplification75.3%
(FPCore (K m n M l) :precision binary64 (if (<= l -0.00052) (* (cos M) (exp l)) (/ 1.0 (exp l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -0.00052) {
tmp = cos(M) * exp(l);
} else {
tmp = 1.0 / 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 <= (-0.00052d0)) then
tmp = cos(m_1) * exp(l)
else
tmp = 1.0d0 / 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 <= -0.00052) {
tmp = Math.cos(M) * Math.exp(l);
} else {
tmp = 1.0 / Math.exp(l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -0.00052: tmp = math.cos(M) * math.exp(l) else: tmp = 1.0 / math.exp(l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -0.00052) tmp = Float64(cos(M) * exp(l)); else tmp = Float64(1.0 / exp(l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -0.00052) tmp = cos(M) * exp(l); else tmp = 1.0 / exp(l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -0.00052], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Exp[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.00052:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{e^{\ell}}\\
\end{array}
\end{array}
if l < -5.19999999999999954e-4Initial program 80.6%
associate-/l*83.3%
+-commutative83.3%
fabs-sub83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in K around 0 94.4%
cos-neg94.4%
Simplified94.4%
Taylor expanded in l around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
expm1-log1p-u24.4%
expm1-udef24.4%
add-sqr-sqrt24.4%
sqrt-unprod24.4%
sqr-neg24.4%
sqrt-unprod0.0%
add-sqr-sqrt68.6%
Applied egg-rr68.6%
expm1-def68.6%
expm1-log1p68.6%
Simplified68.6%
if -5.19999999999999954e-4 < l Initial program 74.0%
associate-/l*74.0%
+-commutative74.0%
fabs-sub74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in K around 0 98.7%
cos-neg98.7%
Simplified98.7%
Taylor expanded in l around inf 40.8%
mul-1-neg40.8%
Simplified40.8%
exp-neg40.8%
un-div-inv40.8%
Applied egg-rr40.8%
Taylor expanded in M around 0 40.8%
Final simplification48.6%
(FPCore (K m n M l) :precision binary64 (if (<= l -9.2e-6) (* (cos M) (exp l)) (/ (cos M) (exp l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -9.2e-6) {
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 <= (-9.2d-6)) 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 <= -9.2e-6) {
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 <= -9.2e-6: 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 <= -9.2e-6) 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 <= -9.2e-6) 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, -9.2e-6], 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 -9.2 \cdot 10^{-6}:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\end{array}
\end{array}
if l < -9.2e-6Initial program 80.6%
associate-/l*83.3%
+-commutative83.3%
fabs-sub83.3%
+-commutative83.3%
Simplified83.3%
Taylor expanded in K around 0 94.4%
cos-neg94.4%
Simplified94.4%
Taylor expanded in l around inf 24.8%
mul-1-neg24.8%
Simplified24.8%
expm1-log1p-u24.4%
expm1-udef24.4%
add-sqr-sqrt24.4%
sqrt-unprod24.4%
sqr-neg24.4%
sqrt-unprod0.0%
add-sqr-sqrt68.6%
Applied egg-rr68.6%
expm1-def68.6%
expm1-log1p68.6%
Simplified68.6%
if -9.2e-6 < l Initial program 74.0%
associate-/l*74.0%
+-commutative74.0%
fabs-sub74.0%
+-commutative74.0%
Simplified74.0%
Taylor expanded in K around 0 98.7%
cos-neg98.7%
Simplified98.7%
Taylor expanded in l around inf 40.8%
mul-1-neg40.8%
Simplified40.8%
exp-neg40.8%
un-div-inv40.8%
Applied egg-rr40.8%
Final simplification48.6%
(FPCore (K m n M l) :precision binary64 (/ 1.0 (exp l)))
double code(double K, double m, double n, double M, double l) {
return 1.0 / 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 = 1.0d0 / exp(l)
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0 / Math.exp(l);
}
def code(K, m, n, M, l): return 1.0 / math.exp(l)
function code(K, m, n, M, l) return Float64(1.0 / exp(l)) end
function tmp = code(K, m, n, M, l) tmp = 1.0 / exp(l); end
code[K_, m_, n_, M_, l_] := N[(1.0 / N[Exp[l], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{e^{\ell}}
\end{array}
Initial program 75.9%
associate-/l*76.6%
+-commutative76.6%
fabs-sub76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in K around 0 97.5%
cos-neg97.5%
Simplified97.5%
Taylor expanded in l around inf 36.3%
mul-1-neg36.3%
Simplified36.3%
exp-neg36.3%
un-div-inv36.3%
Applied egg-rr36.3%
Taylor expanded in M around 0 36.3%
Final simplification36.3%
(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 75.9%
associate-/l*76.6%
+-commutative76.6%
fabs-sub76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in K around 0 97.5%
cos-neg97.5%
Simplified97.5%
Taylor expanded in l around inf 36.3%
mul-1-neg36.3%
Simplified36.3%
Taylor expanded in M around 0 36.3%
Final simplification36.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 75.9%
associate-/l*76.6%
+-commutative76.6%
fabs-sub76.6%
+-commutative76.6%
Simplified76.6%
Taylor expanded in K around 0 97.5%
cos-neg97.5%
Simplified97.5%
Taylor expanded in l around inf 36.3%
mul-1-neg36.3%
Simplified36.3%
Taylor expanded in l around 0 5.4%
Final simplification5.4%
herbie shell --seed 2024040
(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)))))))