
(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 11 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 75.7%
*-commutative75.7%
associate-*r/76.1%
associate--r-76.1%
+-commutative76.1%
associate-+r-76.1%
unsub-neg76.1%
associate--r+76.1%
+-commutative76.1%
associate--r+76.1%
Simplified76.1%
Taylor expanded in K around 0 97.1%
cos-neg97.1%
Simplified97.1%
Final simplification97.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (fabs (- m n))))
(if (<= m -1.75)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= m -1.18e-203)
(* (cos M) (exp (- t_0 (+ l (* M M)))))
(/ (cos M) (pow E (+ l (- (* n (* n 0.25)) t_0))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fabs((m - n));
double tmp;
if (m <= -1.75) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (m <= -1.18e-203) {
tmp = cos(M) * exp((t_0 - (l + (M * M))));
} else {
tmp = cos(M) / pow(((double) M_E), (l + ((n * (n * 0.25)) - t_0)));
}
return tmp;
}
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.abs((m - n));
double tmp;
if (m <= -1.75) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (m <= -1.18e-203) {
tmp = Math.cos(M) * Math.exp((t_0 - (l + (M * M))));
} else {
tmp = Math.cos(M) / Math.pow(Math.E, (l + ((n * (n * 0.25)) - t_0)));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.fabs((m - n)) tmp = 0 if m <= -1.75: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif m <= -1.18e-203: tmp = math.cos(M) * math.exp((t_0 - (l + (M * M)))) else: tmp = math.cos(M) / math.pow(math.e, (l + ((n * (n * 0.25)) - t_0))) return tmp
function code(K, m, n, M, l) t_0 = abs(Float64(m - n)) tmp = 0.0 if (m <= -1.75) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -1.18e-203) tmp = Float64(cos(M) * exp(Float64(t_0 - Float64(l + Float64(M * M))))); else tmp = Float64(cos(M) / (exp(1) ^ Float64(l + Float64(Float64(n * Float64(n * 0.25)) - t_0)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = abs((m - n)); tmp = 0.0; if (m <= -1.75) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (m <= -1.18e-203) tmp = cos(M) * exp((t_0 - (l + (M * M)))); else tmp = cos(M) / (2.71828182845904523536 ^ (l + ((n * (n * 0.25)) - t_0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[m, -1.75], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -1.18e-203], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(t$95$0 - N[(l + N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Power[E, N[(l + N[(N[(n * N[(n * 0.25), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|m - n\right|\\
\mathbf{if}\;m \leq -1.75:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -1.18 \cdot 10^{-203}:\\
\;\;\;\;\cos M \cdot e^{t_0 - \left(\ell + M \cdot M\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{{e}^{\left(\ell + \left(n \cdot \left(n \cdot 0.25\right) - t_0\right)\right)}}\\
\end{array}
\end{array}
if m < -1.75Initial program 77.8%
*-commutative77.8%
associate-*r/77.8%
associate--r-77.8%
+-commutative77.8%
associate-+r-77.8%
unsub-neg77.8%
associate--r+77.8%
+-commutative77.8%
associate--r+77.8%
Simplified77.8%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around inf 96.9%
unpow296.9%
Simplified96.9%
if -1.75 < m < -1.1800000000000001e-203Initial program 84.4%
*-commutative84.4%
associate-*r/84.4%
associate--r-84.4%
+-commutative84.4%
associate-+r-84.4%
unsub-neg84.4%
associate--r+84.4%
+-commutative84.4%
associate--r+84.4%
Simplified84.4%
Taylor expanded in M around inf 70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in K around 0 80.3%
*-commutative80.3%
fabs-sub80.3%
sub-neg80.3%
mul-1-neg80.3%
fabs-neg80.3%
fabs-neg80.3%
mul-1-neg80.3%
sub-neg80.3%
unpow280.3%
cos-neg80.3%
Simplified80.3%
if -1.1800000000000001e-203 < m Initial program 71.7%
Simplified72.4%
*-un-lft-identity72.4%
exp-prod72.4%
fabs-sub72.4%
div-inv72.4%
metadata-eval72.4%
Applied egg-rr72.4%
exp-1-e72.4%
associate-+r-72.4%
+-commutative72.4%
associate-+r-72.4%
+-commutative72.4%
*-commutative72.4%
fabs-sub72.4%
Simplified72.4%
Taylor expanded in n around inf 49.8%
*-commutative49.8%
unpow249.8%
Simplified49.8%
Taylor expanded in K around 0 64.7%
cos-neg64.7%
fabs-sub64.7%
associate--l+64.7%
fabs-sub64.7%
*-commutative64.7%
unpow264.7%
associate-*r*64.7%
Simplified64.7%
Final simplification75.7%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (fabs (- m n))))
(if (<= m -1.75)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= m -9.5e-202)
(* (cos M) (exp (- t_0 (+ l (* M M)))))
(/ (cos M) (exp (- (+ l (* 0.25 (* n n))) t_0)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fabs((m - n));
double tmp;
if (m <= -1.75) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (m <= -9.5e-202) {
tmp = cos(M) * exp((t_0 - (l + (M * M))));
} else {
tmp = cos(M) / exp(((l + (0.25 * (n * n))) - t_0));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = abs((m - n))
if (m <= (-1.75d0)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (m <= (-9.5d-202)) then
tmp = cos(m_1) * exp((t_0 - (l + (m_1 * m_1))))
else
tmp = cos(m_1) / exp(((l + (0.25d0 * (n * n))) - t_0))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.abs((m - n));
double tmp;
if (m <= -1.75) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (m <= -9.5e-202) {
tmp = Math.cos(M) * Math.exp((t_0 - (l + (M * M))));
} else {
tmp = Math.cos(M) / Math.exp(((l + (0.25 * (n * n))) - t_0));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.fabs((m - n)) tmp = 0 if m <= -1.75: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif m <= -9.5e-202: tmp = math.cos(M) * math.exp((t_0 - (l + (M * M)))) else: tmp = math.cos(M) / math.exp(((l + (0.25 * (n * n))) - t_0)) return tmp
function code(K, m, n, M, l) t_0 = abs(Float64(m - n)) tmp = 0.0 if (m <= -1.75) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -9.5e-202) tmp = Float64(cos(M) * exp(Float64(t_0 - Float64(l + Float64(M * M))))); else tmp = Float64(cos(M) / exp(Float64(Float64(l + Float64(0.25 * Float64(n * n))) - t_0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = abs((m - n)); tmp = 0.0; if (m <= -1.75) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (m <= -9.5e-202) tmp = cos(M) * exp((t_0 - (l + (M * M)))); else tmp = cos(M) / exp(((l + (0.25 * (n * n))) - t_0)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[m, -1.75], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -9.5e-202], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(t$95$0 - N[(l + N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(l + N[(0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left|m - n\right|\\
\mathbf{if}\;m \leq -1.75:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -9.5 \cdot 10^{-202}:\\
\;\;\;\;\cos M \cdot e^{t_0 - \left(\ell + M \cdot M\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\left(\ell + 0.25 \cdot \left(n \cdot n\right)\right) - t_0}}\\
\end{array}
\end{array}
if m < -1.75Initial program 77.8%
*-commutative77.8%
associate-*r/77.8%
associate--r-77.8%
+-commutative77.8%
associate-+r-77.8%
unsub-neg77.8%
associate--r+77.8%
+-commutative77.8%
associate--r+77.8%
Simplified77.8%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around inf 96.9%
unpow296.9%
Simplified96.9%
if -1.75 < m < -9.5000000000000001e-202Initial program 84.4%
*-commutative84.4%
associate-*r/84.4%
associate--r-84.4%
+-commutative84.4%
associate-+r-84.4%
unsub-neg84.4%
associate--r+84.4%
+-commutative84.4%
associate--r+84.4%
Simplified84.4%
Taylor expanded in M around inf 70.6%
unpow270.6%
Simplified70.6%
Taylor expanded in K around 0 80.3%
*-commutative80.3%
fabs-sub80.3%
sub-neg80.3%
mul-1-neg80.3%
fabs-neg80.3%
fabs-neg80.3%
mul-1-neg80.3%
sub-neg80.3%
unpow280.3%
cos-neg80.3%
Simplified80.3%
if -9.5000000000000001e-202 < m Initial program 71.7%
Simplified72.4%
Taylor expanded in n around inf 49.8%
*-commutative49.8%
unpow249.8%
Simplified49.8%
Taylor expanded in K around 0 64.7%
cos-neg64.7%
exp-diff18.5%
sub-neg18.5%
mul-1-neg18.5%
+-commutative18.5%
*-lft-identity18.5%
metadata-eval18.5%
cancel-sign-sub-inv18.5%
mul-1-neg18.5%
sub-neg18.5%
fabs-sub18.5%
exp-diff64.7%
Simplified64.7%
Final simplification75.7%
(FPCore (K m n M l)
:precision binary64
(if (<= n -3.8e-219)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= n 22.5)
(* (cos M) (exp (- (fabs (- m n)) (+ l (* M M)))))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -3.8e-219) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (n <= 22.5) {
tmp = cos(M) * exp((fabs((m - n)) - (l + (M * M))));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (n <= (-3.8d-219)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (n <= 22.5d0) then
tmp = cos(m_1) * exp((abs((m - n)) - (l + (m_1 * m_1))))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -3.8e-219) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (n <= 22.5) {
tmp = Math.cos(M) * Math.exp((Math.abs((m - n)) - (l + (M * M))));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= -3.8e-219: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif n <= 22.5: tmp = math.cos(M) * math.exp((math.fabs((m - n)) - (l + (M * M)))) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= -3.8e-219) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (n <= 22.5) tmp = Float64(cos(M) * exp(Float64(abs(Float64(m - n)) - Float64(l + Float64(M * M))))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= -3.8e-219) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (n <= 22.5) tmp = cos(M) * exp((abs((m - n)) - (l + (M * M)))); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -3.8e-219], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 22.5], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - N[(l + N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -3.8 \cdot 10^{-219}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;n \leq 22.5:\\
\;\;\;\;\cos M \cdot e^{\left|m - n\right| - \left(\ell + M \cdot M\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < -3.80000000000000025e-219Initial program 75.7%
*-commutative75.7%
associate-*r/75.7%
associate--r-75.7%
+-commutative75.7%
associate-+r-75.7%
unsub-neg75.7%
associate--r+75.7%
+-commutative75.7%
associate--r+75.7%
Simplified75.7%
Taylor expanded in K around 0 99.1%
cos-neg99.1%
Simplified99.1%
Taylor expanded in m around inf 51.6%
unpow251.6%
Simplified51.6%
if -3.80000000000000025e-219 < n < 22.5Initial program 78.7%
*-commutative78.7%
associate-*r/79.9%
associate--r-79.9%
+-commutative79.9%
associate-+r-79.9%
unsub-neg79.9%
associate--r+79.9%
+-commutative79.9%
associate--r+79.9%
Simplified79.9%
Taylor expanded in M around inf 60.8%
unpow260.8%
Simplified60.8%
Taylor expanded in K around 0 64.7%
*-commutative64.7%
fabs-sub64.7%
sub-neg64.7%
mul-1-neg64.7%
fabs-neg64.7%
fabs-neg64.7%
mul-1-neg64.7%
sub-neg64.7%
unpow264.7%
cos-neg64.7%
Simplified64.7%
if 22.5 < n Initial program 71.9%
*-commutative71.9%
associate-*r/71.9%
associate--r-71.9%
+-commutative71.9%
associate-+r-71.9%
unsub-neg71.9%
associate--r+71.9%
+-commutative71.9%
associate--r+71.9%
Simplified71.9%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in n around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification67.9%
(FPCore (K m n M l)
:precision binary64
(if (<= n -1.1e-219)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= n 22.5)
(exp (- (fabs (- m n)) (+ l (* M M))))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -1.1e-219) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (n <= 22.5) {
tmp = exp((fabs((m - n)) - (l + (M * M))));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (n <= (-1.1d-219)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (n <= 22.5d0) then
tmp = exp((abs((m - n)) - (l + (m_1 * m_1))))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -1.1e-219) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (n <= 22.5) {
tmp = Math.exp((Math.abs((m - n)) - (l + (M * M))));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= -1.1e-219: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif n <= 22.5: tmp = math.exp((math.fabs((m - n)) - (l + (M * M)))) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= -1.1e-219) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (n <= 22.5) tmp = exp(Float64(abs(Float64(m - n)) - Float64(l + Float64(M * M)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= -1.1e-219) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (n <= 22.5) tmp = exp((abs((m - n)) - (l + (M * M)))); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -1.1e-219], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 22.5], N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - N[(l + N[(M * M), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -1.1 \cdot 10^{-219}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;n \leq 22.5:\\
\;\;\;\;e^{\left|m - n\right| - \left(\ell + M \cdot M\right)}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if n < -1.1e-219Initial program 75.7%
*-commutative75.7%
associate-*r/75.7%
associate--r-75.7%
+-commutative75.7%
associate-+r-75.7%
unsub-neg75.7%
associate--r+75.7%
+-commutative75.7%
associate--r+75.7%
Simplified75.7%
Taylor expanded in K around 0 99.1%
cos-neg99.1%
Simplified99.1%
Taylor expanded in m around inf 51.6%
unpow251.6%
Simplified51.6%
if -1.1e-219 < n < 22.5Initial program 78.7%
*-commutative78.7%
associate-*r/79.9%
associate--r-79.9%
+-commutative79.9%
associate-+r-79.9%
unsub-neg79.9%
associate--r+79.9%
+-commutative79.9%
associate--r+79.9%
Simplified79.9%
Taylor expanded in M around inf 60.8%
unpow260.8%
Simplified60.8%
Taylor expanded in m around inf 59.8%
associate-*r*61.0%
Simplified61.0%
Taylor expanded in K around 0 64.7%
exp-diff45.1%
unpow245.1%
cancel-sign-sub45.1%
distribute-lft-neg-in45.1%
exp-diff64.7%
fabs-sub64.7%
distribute-lft-neg-in64.7%
cancel-sign-sub64.7%
Simplified64.7%
if 22.5 < n Initial program 71.9%
*-commutative71.9%
associate-*r/71.9%
associate--r-71.9%
+-commutative71.9%
associate-+r-71.9%
unsub-neg71.9%
associate--r+71.9%
+-commutative71.9%
associate--r+71.9%
Simplified71.9%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in n around inf 100.0%
unpow2100.0%
Simplified100.0%
Final simplification67.9%
(FPCore (K m n M l) :precision binary64 (if (or (<= M -17.0) (not (<= M 8e-26))) (* (cos M) (exp (- (* M M)))) (* (cos M) (exp (* -0.25 (* m m))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -17.0) || !(M <= 8e-26)) {
tmp = cos(M) * exp(-(M * M));
} else {
tmp = cos(M) * exp((-0.25 * (m * m)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if ((m_1 <= (-17.0d0)) .or. (.not. (m_1 <= 8d-26))) then
tmp = cos(m_1) * exp(-(m_1 * m_1))
else
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -17.0) || !(M <= 8e-26)) {
tmp = Math.cos(M) * Math.exp(-(M * M));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (M <= -17.0) or not (M <= 8e-26): tmp = math.cos(M) * math.exp(-(M * M)) else: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((M <= -17.0) || !(M <= 8e-26)) tmp = Float64(cos(M) * exp(Float64(-Float64(M * M)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((M <= -17.0) || ~((M <= 8e-26))) tmp = cos(M) * exp(-(M * M)); else tmp = cos(M) * exp((-0.25 * (m * m))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[M, -17.0], N[Not[LessEqual[M, 8e-26]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[(M * M), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -17 \lor \neg \left(M \leq 8 \cdot 10^{-26}\right):\\
\;\;\;\;\cos M \cdot e^{-M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\end{array}
\end{array}
if M < -17 or 8.0000000000000003e-26 < M Initial program 74.3%
*-commutative74.3%
associate-*r/75.0%
associate--r-75.0%
+-commutative75.0%
associate-+r-75.0%
unsub-neg75.0%
associate--r+75.0%
+-commutative75.0%
associate--r+75.0%
Simplified75.0%
Taylor expanded in K around 0 98.2%
cos-neg98.2%
Simplified98.2%
Taylor expanded in M around inf 94.1%
mul-1-neg94.1%
unpow294.1%
Simplified94.1%
if -17 < M < 8.0000000000000003e-26Initial program 77.5%
*-commutative77.5%
associate-*r/77.5%
associate--r-77.5%
+-commutative77.5%
associate-+r-77.5%
unsub-neg77.5%
associate--r+77.5%
+-commutative77.5%
associate--r+77.5%
Simplified77.5%
Taylor expanded in K around 0 95.7%
cos-neg95.7%
Simplified95.7%
Taylor expanded in m around inf 64.8%
unpow264.8%
Simplified64.8%
Final simplification81.2%
(FPCore (K m n M l)
:precision binary64
(if (<= m -350000000.0)
(* (cos M) (exp (* -0.25 (* m m))))
(if (<= m -2.2e-210)
(* (cos M) (exp (- (* M M))))
(* (cos M) (exp (* -0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -350000000.0) {
tmp = cos(M) * exp((-0.25 * (m * m)));
} else if (m <= -2.2e-210) {
tmp = cos(M) * exp(-(M * M));
} else {
tmp = cos(M) * exp((-0.25 * (n * n)));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-350000000.0d0)) then
tmp = cos(m_1) * exp(((-0.25d0) * (m * m)))
else if (m <= (-2.2d-210)) then
tmp = cos(m_1) * exp(-(m_1 * m_1))
else
tmp = cos(m_1) * exp(((-0.25d0) * (n * n)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -350000000.0) {
tmp = Math.cos(M) * Math.exp((-0.25 * (m * m)));
} else if (m <= -2.2e-210) {
tmp = Math.cos(M) * Math.exp(-(M * M));
} else {
tmp = Math.cos(M) * Math.exp((-0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -350000000.0: tmp = math.cos(M) * math.exp((-0.25 * (m * m))) elif m <= -2.2e-210: tmp = math.cos(M) * math.exp(-(M * M)) else: tmp = math.cos(M) * math.exp((-0.25 * (n * n))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -350000000.0) tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -2.2e-210) tmp = Float64(cos(M) * exp(Float64(-Float64(M * M)))); else tmp = Float64(cos(M) * exp(Float64(-0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -350000000.0) tmp = cos(M) * exp((-0.25 * (m * m))); elseif (m <= -2.2e-210) tmp = cos(M) * exp(-(M * M)); else tmp = cos(M) * exp((-0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -350000000.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -2.2e-210], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-N[(M * M), $MachinePrecision])], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(-0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -350000000:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -2.2 \cdot 10^{-210}:\\
\;\;\;\;\cos M \cdot e^{-M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-0.25 \cdot \left(n \cdot n\right)}\\
\end{array}
\end{array}
if m < -3.5e8Initial program 77.6%
*-commutative77.6%
associate-*r/77.6%
associate--r-77.6%
+-commutative77.6%
associate-+r-77.6%
unsub-neg77.6%
associate--r+77.6%
+-commutative77.6%
associate--r+77.6%
Simplified77.6%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
Simplified100.0%
Taylor expanded in m around inf 100.0%
unpow2100.0%
Simplified100.0%
if -3.5e8 < m < -2.19999999999999989e-210Initial program 84.0%
*-commutative84.0%
associate-*r/84.0%
associate--r-84.0%
+-commutative84.0%
associate-+r-84.0%
unsub-neg84.0%
associate--r+84.0%
+-commutative84.0%
associate--r+84.0%
Simplified84.0%
Taylor expanded in K around 0 98.2%
cos-neg98.2%
Simplified98.2%
Taylor expanded in M around inf 75.3%
mul-1-neg75.3%
unpow275.3%
Simplified75.3%
if -2.19999999999999989e-210 < m Initial program 71.7%
*-commutative71.7%
associate-*r/72.4%
associate--r-72.4%
+-commutative72.4%
associate-+r-72.4%
unsub-neg72.4%
associate--r+72.4%
+-commutative72.4%
associate--r+72.4%
Simplified72.4%
Taylor expanded in K around 0 95.5%
cos-neg95.5%
Simplified95.5%
Taylor expanded in n around inf 50.7%
unpow250.7%
Simplified50.7%
Final simplification67.2%
(FPCore (K m n M l) :precision binary64 (if (or (<= M -4.2) (not (<= M 44000000000.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 ((M <= -4.2) || !(M <= 44000000000.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 ((m_1 <= (-4.2d0)) .or. (.not. (m_1 <= 44000000000.0d0))) then
tmp = cos(m_1) * exp(-(m_1 * m_1))
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 ((M <= -4.2) || !(M <= 44000000000.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 (M <= -4.2) or not (M <= 44000000000.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 ((M <= -4.2) || !(M <= 44000000000.0)) tmp = Float64(cos(M) * exp(Float64(-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 ((M <= -4.2) || ~((M <= 44000000000.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[Or[LessEqual[M, -4.2], N[Not[LessEqual[M, 44000000000.0]], $MachinePrecision]], 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}\;M \leq -4.2 \lor \neg \left(M \leq 44000000000\right):\\
\;\;\;\;\cos M \cdot e^{-M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if M < -4.20000000000000018 or 4.4e10 < M Initial program 75.0%
*-commutative75.0%
associate-*r/75.7%
associate--r-75.7%
+-commutative75.7%
associate-+r-75.7%
unsub-neg75.7%
associate--r+75.7%
+-commutative75.7%
associate--r+75.7%
Simplified75.7%
Taylor expanded in K around 0 99.3%
cos-neg99.3%
Simplified99.3%
Taylor expanded in M around inf 97.9%
mul-1-neg97.9%
unpow297.9%
Simplified97.9%
if -4.20000000000000018 < M < 4.4e10Initial program 76.4%
*-commutative76.4%
associate-*r/76.4%
associate--r-76.4%
+-commutative76.4%
associate-+r-76.4%
unsub-neg76.4%
associate--r+76.4%
+-commutative76.4%
associate--r+76.4%
Simplified76.4%
Taylor expanded in K around 0 94.6%
cos-neg94.6%
Simplified94.6%
Taylor expanded in l around inf 41.2%
mul-1-neg41.2%
Simplified41.2%
Final simplification71.3%
(FPCore (K m n M l) :precision binary64 (* (cos M) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * 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 = cos(m_1) * exp(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M) * Math.exp(-l);
}
def code(K, m, n, M, l): return math.cos(M) * math.exp(-l)
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(-l))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp(-l); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{-\ell}
\end{array}
Initial program 75.7%
*-commutative75.7%
associate-*r/76.1%
associate--r-76.1%
+-commutative76.1%
associate-+r-76.1%
unsub-neg76.1%
associate--r+76.1%
+-commutative76.1%
associate--r+76.1%
Simplified76.1%
Taylor expanded in K around 0 97.1%
cos-neg97.1%
Simplified97.1%
Taylor expanded in l around inf 32.5%
mul-1-neg32.5%
Simplified32.5%
Final simplification32.5%
(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.7%
*-commutative75.7%
associate-*r/76.1%
associate--r-76.1%
+-commutative76.1%
associate-+r-76.1%
unsub-neg76.1%
associate--r+76.1%
+-commutative76.1%
associate--r+76.1%
Simplified76.1%
Taylor expanded in K around 0 97.1%
cos-neg97.1%
Simplified97.1%
Taylor expanded in M around inf 58.1%
mul-1-neg58.1%
unpow258.1%
Simplified58.1%
Taylor expanded in M around 0 7.4%
Final simplification7.4%
(FPCore (K m n M l) :precision binary64 (+ 1.0 (* (* M M) -1.5)))
double code(double K, double m, double n, double M, double l) {
return 1.0 + ((M * M) * -1.5);
}
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 + ((m_1 * m_1) * (-1.5d0))
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0 + ((M * M) * -1.5);
}
def code(K, m, n, M, l): return 1.0 + ((M * M) * -1.5)
function code(K, m, n, M, l) return Float64(1.0 + Float64(Float64(M * M) * -1.5)) end
function tmp = code(K, m, n, M, l) tmp = 1.0 + ((M * M) * -1.5); end
code[K_, m_, n_, M_, l_] := N[(1.0 + N[(N[(M * M), $MachinePrecision] * -1.5), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 + \left(M \cdot M\right) \cdot -1.5
\end{array}
Initial program 75.7%
*-commutative75.7%
associate-*r/76.1%
associate--r-76.1%
+-commutative76.1%
associate-+r-76.1%
unsub-neg76.1%
associate--r+76.1%
+-commutative76.1%
associate--r+76.1%
Simplified76.1%
Taylor expanded in K around 0 97.1%
cos-neg97.1%
Simplified97.1%
Taylor expanded in M around inf 58.1%
mul-1-neg58.1%
unpow258.1%
Simplified58.1%
Taylor expanded in M around 0 6.8%
*-commutative6.8%
unpow26.8%
Simplified6.8%
Final simplification6.8%
herbie shell --seed 2023240
(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)))))))