
(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) 0.5) 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) * 0.5) - 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) * 0.5d0) - 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) * 0.5) - 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) * 0.5) - 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) * 0.5) - M) ^ 2.0)))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp(((abs((m - n)) - l) - ((((m + n) * 0.5) - 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] * 0.5), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) - {\left(\left(m + n\right) \cdot 0.5 - M\right)}^{2}}
\end{array}
Initial program 74.8%
Taylor expanded in K around 0 99.0%
cos-neg99.0%
associate--r+99.0%
*-commutative99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- M (* n 0.5))))
(if (<= m -2e+17)
(exp (* (pow m 2.0) -0.25))
(* (cos M) (exp (+ (- (fabs (- m n)) l) (* t_0 (- m t_0))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = M - (n * 0.5);
double tmp;
if (m <= -2e+17) {
tmp = exp((pow(m, 2.0) * -0.25));
} else {
tmp = cos(M) * exp(((fabs((m - n)) - l) + (t_0 * (m - 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 = m_1 - (n * 0.5d0)
if (m <= (-2d+17)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else
tmp = cos(m_1) * exp(((abs((m - n)) - l) + (t_0 * (m - 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 = M - (n * 0.5);
double tmp;
if (m <= -2e+17) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else {
tmp = Math.cos(M) * Math.exp(((Math.abs((m - n)) - l) + (t_0 * (m - t_0))));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = M - (n * 0.5) tmp = 0 if m <= -2e+17: tmp = math.exp((math.pow(m, 2.0) * -0.25)) else: tmp = math.cos(M) * math.exp(((math.fabs((m - n)) - l) + (t_0 * (m - t_0)))) return tmp
function code(K, m, n, M, l) t_0 = Float64(M - Float64(n * 0.5)) tmp = 0.0 if (m <= -2e+17) tmp = exp(Float64((m ^ 2.0) * -0.25)); else tmp = Float64(cos(M) * exp(Float64(Float64(abs(Float64(m - n)) - l) + Float64(t_0 * Float64(m - t_0))))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = M - (n * 0.5); tmp = 0.0; if (m <= -2e+17) tmp = exp(((m ^ 2.0) * -0.25)); else tmp = cos(M) * exp(((abs((m - n)) - l) + (t_0 * (m - t_0)))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -2e+17], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] + N[(t$95$0 * N[(m - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M - n \cdot 0.5\\
\mathbf{if}\;m \leq -2 \cdot 10^{+17}:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(\left|m - n\right| - \ell\right) + t_0 \cdot \left(m - t_0\right)}\\
\end{array}
\end{array}
if m < -2e17Initial program 60.9%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in m around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -2e17 < m Initial program 79.9%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
associate--r+98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in m around 0 81.7%
+-commutative81.7%
unpow281.7%
distribute-rgt-out86.5%
Simplified86.5%
Final simplification90.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (* (pow m 2.0) -0.25))))
(if (<= n 3.6e-300)
t_0
(if (<= n 1.5e-263)
(* (/ n (/ (exp l) (sin (* m (* 0.5 K))))) (* K -0.5))
(if (<= n 1.25e-184)
t_0
(if (<= n 1.8e-11)
(* -0.5 (/ K (/ (exp l) (* (sin M) (- n)))))
(exp (* -0.25 (pow n 2.0)))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp((pow(m, 2.0) * -0.25));
double tmp;
if (n <= 3.6e-300) {
tmp = t_0;
} else if (n <= 1.5e-263) {
tmp = (n / (exp(l) / sin((m * (0.5 * K))))) * (K * -0.5);
} else if (n <= 1.25e-184) {
tmp = t_0;
} else if (n <= 1.8e-11) {
tmp = -0.5 * (K / (exp(l) / (sin(M) * -n)));
} else {
tmp = exp((-0.25 * pow(n, 2.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 = exp(((m ** 2.0d0) * (-0.25d0)))
if (n <= 3.6d-300) then
tmp = t_0
else if (n <= 1.5d-263) then
tmp = (n / (exp(l) / sin((m * (0.5d0 * k))))) * (k * (-0.5d0))
else if (n <= 1.25d-184) then
tmp = t_0
else if (n <= 1.8d-11) then
tmp = (-0.5d0) * (k / (exp(l) / (sin(m_1) * -n)))
else
tmp = exp(((-0.25d0) * (n ** 2.0d0)))
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((Math.pow(m, 2.0) * -0.25));
double tmp;
if (n <= 3.6e-300) {
tmp = t_0;
} else if (n <= 1.5e-263) {
tmp = (n / (Math.exp(l) / Math.sin((m * (0.5 * K))))) * (K * -0.5);
} else if (n <= 1.25e-184) {
tmp = t_0;
} else if (n <= 1.8e-11) {
tmp = -0.5 * (K / (Math.exp(l) / (Math.sin(M) * -n)));
} else {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp((math.pow(m, 2.0) * -0.25)) tmp = 0 if n <= 3.6e-300: tmp = t_0 elif n <= 1.5e-263: tmp = (n / (math.exp(l) / math.sin((m * (0.5 * K))))) * (K * -0.5) elif n <= 1.25e-184: tmp = t_0 elif n <= 1.8e-11: tmp = -0.5 * (K / (math.exp(l) / (math.sin(M) * -n))) else: tmp = math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) t_0 = exp(Float64((m ^ 2.0) * -0.25)) tmp = 0.0 if (n <= 3.6e-300) tmp = t_0; elseif (n <= 1.5e-263) tmp = Float64(Float64(n / Float64(exp(l) / sin(Float64(m * Float64(0.5 * K))))) * Float64(K * -0.5)); elseif (n <= 1.25e-184) tmp = t_0; elseif (n <= 1.8e-11) tmp = Float64(-0.5 * Float64(K / Float64(exp(l) / Float64(sin(M) * Float64(-n))))); else tmp = exp(Float64(-0.25 * (n ^ 2.0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(((m ^ 2.0) * -0.25)); tmp = 0.0; if (n <= 3.6e-300) tmp = t_0; elseif (n <= 1.5e-263) tmp = (n / (exp(l) / sin((m * (0.5 * K))))) * (K * -0.5); elseif (n <= 1.25e-184) tmp = t_0; elseif (n <= 1.8e-11) tmp = -0.5 * (K / (exp(l) / (sin(M) * -n))); else tmp = exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, 3.6e-300], t$95$0, If[LessEqual[n, 1.5e-263], N[(N[(n / N[(N[Exp[l], $MachinePrecision] / N[Sin[N[(m * N[(0.5 * K), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(K * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 1.25e-184], t$95$0, If[LessEqual[n, 1.8e-11], N[(-0.5 * N[(K / N[(N[Exp[l], $MachinePrecision] / N[(N[Sin[M], $MachinePrecision] * (-n)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{{m}^{2} \cdot -0.25}\\
\mathbf{if}\;n \leq 3.6 \cdot 10^{-300}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 1.5 \cdot 10^{-263}:\\
\;\;\;\;\frac{n}{\frac{e^{\ell}}{\sin \left(m \cdot \left(0.5 \cdot K\right)\right)}} \cdot \left(K \cdot -0.5\right)\\
\mathbf{elif}\;n \leq 1.25 \cdot 10^{-184}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;-0.5 \cdot \frac{K}{\frac{e^{\ell}}{\sin M \cdot \left(-n\right)}}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
if n < 3.60000000000000016e-300 or 1.5e-263 < n < 1.25000000000000001e-184Initial program 76.9%
Taylor expanded in K around 0 98.3%
cos-neg98.3%
associate--r+98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in M around 0 82.0%
+-commutative82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in m around inf 53.6%
*-commutative53.6%
Simplified53.6%
if 3.60000000000000016e-300 < n < 1.5e-263Initial program 85.7%
Taylor expanded in l around inf 53.0%
mul-1-neg53.0%
Simplified53.0%
Taylor expanded in n around 0 53.0%
Taylor expanded in K around inf 44.5%
associate-*r*44.5%
*-commutative44.5%
associate-*r*44.5%
fma-neg44.5%
*-commutative44.5%
*-commutative44.5%
*-commutative44.5%
fma-neg44.5%
associate-*r*44.5%
*-commutative44.5%
exp-neg44.5%
associate-*r/44.5%
*-rgt-identity44.5%
Simplified44.5%
Taylor expanded in M around 0 58.0%
associate-/l*58.0%
associate-*r*58.0%
*-commutative58.0%
Simplified58.0%
if 1.25000000000000001e-184 < n < 1.79999999999999992e-11Initial program 80.0%
Taylor expanded in l around inf 41.2%
mul-1-neg41.2%
Simplified41.2%
Taylor expanded in n around 0 41.1%
Taylor expanded in K around inf 49.7%
associate-*r*49.7%
*-commutative49.7%
associate-*r*49.7%
fma-neg49.7%
*-commutative49.7%
*-commutative49.7%
*-commutative49.7%
fma-neg49.7%
associate-*r*49.7%
*-commutative49.7%
exp-neg49.7%
associate-*r/49.7%
*-rgt-identity49.7%
Simplified49.7%
Taylor expanded in m around 0 66.8%
associate-/l*66.9%
sin-neg66.9%
Simplified66.9%
if 1.79999999999999992e-11 < n Initial program 65.6%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 95.4%
+-commutative95.4%
+-commutative95.4%
Simplified95.4%
Taylor expanded in n around inf 91.7%
*-commutative91.7%
Simplified91.7%
Final simplification65.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- M (* n 0.5))))
(if (<= m -1.5e+44)
(exp (* (pow m 2.0) -0.25))
(* (cos M) (exp (- (* t_0 (- m t_0)) (+ (- n 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 <= -1.5e+44) {
tmp = exp((pow(m, 2.0) * -0.25));
} else {
tmp = cos(M) * exp(((t_0 * (m - t_0)) - ((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) :: t_0
real(8) :: tmp
t_0 = m_1 - (n * 0.5d0)
if (m <= (-1.5d+44)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else
tmp = cos(m_1) * exp(((t_0 * (m - t_0)) - ((n - 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 <= -1.5e+44) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else {
tmp = Math.cos(M) * Math.exp(((t_0 * (m - t_0)) - ((n - m) + l)));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = M - (n * 0.5) tmp = 0 if m <= -1.5e+44: tmp = math.exp((math.pow(m, 2.0) * -0.25)) else: tmp = math.cos(M) * math.exp(((t_0 * (m - t_0)) - ((n - m) + l))) return tmp
function code(K, m, n, M, l) t_0 = Float64(M - Float64(n * 0.5)) tmp = 0.0 if (m <= -1.5e+44) tmp = exp(Float64((m ^ 2.0) * -0.25)); else tmp = Float64(cos(M) * exp(Float64(Float64(t_0 * Float64(m - t_0)) - Float64(Float64(n - 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 <= -1.5e+44) tmp = exp(((m ^ 2.0) * -0.25)); else tmp = cos(M) * exp(((t_0 * (m - t_0)) - ((n - m) + l))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[m, -1.5e+44], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(t$95$0 * N[(m - t$95$0), $MachinePrecision]), $MachinePrecision] - N[(N[(n - m), $MachinePrecision] + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := M - n \cdot 0.5\\
\mathbf{if}\;m \leq -1.5 \cdot 10^{+44}:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{t_0 \cdot \left(m - t_0\right) - \left(\left(n - m\right) + \ell\right)}\\
\end{array}
\end{array}
if m < -1.49999999999999993e44Initial program 60.3%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 100.0%
+-commutative100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in m around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -1.49999999999999993e44 < m Initial program 79.5%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
associate--r+98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in m around 0 80.7%
+-commutative80.7%
unpow280.7%
distribute-rgt-out86.4%
Simplified86.4%
cancel-sign-sub-inv86.4%
add-sqr-sqrt44.9%
fabs-sqr44.9%
add-sqr-sqrt86.7%
*-commutative86.7%
+-commutative86.7%
*-commutative86.7%
Applied egg-rr86.7%
Final simplification90.0%
(FPCore (K m n M l)
:precision binary64
(if (<= m -3.6e-6)
(exp (* (pow m 2.0) -0.25))
(if (or (<= m -2.15e-106) (not (<= m 2.1e-229)))
(exp (* -0.25 (pow n 2.0)))
(* (exp (- l)) (cos (- (* m (* 0.5 K)) M))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -3.6e-6) {
tmp = exp((pow(m, 2.0) * -0.25));
} else if ((m <= -2.15e-106) || !(m <= 2.1e-229)) {
tmp = exp((-0.25 * pow(n, 2.0)));
} else {
tmp = exp(-l) * cos(((m * (0.5 * K)) - 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 <= (-3.6d-6)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else if ((m <= (-2.15d-106)) .or. (.not. (m <= 2.1d-229))) then
tmp = exp(((-0.25d0) * (n ** 2.0d0)))
else
tmp = exp(-l) * cos(((m * (0.5d0 * k)) - m_1))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -3.6e-6) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else if ((m <= -2.15e-106) || !(m <= 2.1e-229)) {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
} else {
tmp = Math.exp(-l) * Math.cos(((m * (0.5 * K)) - M));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -3.6e-6: tmp = math.exp((math.pow(m, 2.0) * -0.25)) elif (m <= -2.15e-106) or not (m <= 2.1e-229): tmp = math.exp((-0.25 * math.pow(n, 2.0))) else: tmp = math.exp(-l) * math.cos(((m * (0.5 * K)) - M)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -3.6e-6) tmp = exp(Float64((m ^ 2.0) * -0.25)); elseif ((m <= -2.15e-106) || !(m <= 2.1e-229)) tmp = exp(Float64(-0.25 * (n ^ 2.0))); else tmp = Float64(exp(Float64(-l)) * cos(Float64(Float64(m * Float64(0.5 * K)) - M))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -3.6e-6) tmp = exp(((m ^ 2.0) * -0.25)); elseif ((m <= -2.15e-106) || ~((m <= 2.1e-229))) tmp = exp((-0.25 * (n ^ 2.0))); else tmp = exp(-l) * cos(((m * (0.5 * K)) - M)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -3.6e-6], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[m, -2.15e-106], N[Not[LessEqual[m, 2.1e-229]], $MachinePrecision]], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Exp[(-l)], $MachinePrecision] * N[Cos[N[(N[(m * N[(0.5 * K), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.6 \cdot 10^{-6}:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -2.15 \cdot 10^{-106} \lor \neg \left(m \leq 2.1 \cdot 10^{-229}\right):\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell} \cdot \cos \left(m \cdot \left(0.5 \cdot K\right) - M\right)\\
\end{array}
\end{array}
if m < -3.59999999999999984e-6Initial program 63.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in m around inf 97.3%
*-commutative97.3%
Simplified97.3%
if -3.59999999999999984e-6 < m < -2.1500000000000001e-106 or 2.09999999999999983e-229 < m Initial program 76.1%
Taylor expanded in K around 0 97.9%
cos-neg97.9%
associate--r+97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in M around 0 85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in n around inf 55.9%
*-commutative55.9%
Simplified55.9%
if -2.1500000000000001e-106 < m < 2.09999999999999983e-229Initial program 86.4%
Taylor expanded in l around inf 41.8%
mul-1-neg41.8%
Simplified41.8%
Taylor expanded in n around 0 43.8%
*-commutative43.8%
associate-*r*43.8%
Simplified43.8%
Final simplification64.9%
(FPCore (K m n M l) :precision binary64 (if (<= m -6500000000000.0) (exp (* (pow m 2.0) -0.25)) (exp (- (fabs (- m n)) (+ l (* 0.5 (* n (+ m (* n 0.5)))))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -6500000000000.0) {
tmp = exp((pow(m, 2.0) * -0.25));
} else {
tmp = exp((fabs((m - n)) - (l + (0.5 * (n * (m + (n * 0.5)))))));
}
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 <= (-6500000000000.0d0)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else
tmp = exp((abs((m - n)) - (l + (0.5d0 * (n * (m + (n * 0.5d0)))))))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -6500000000000.0) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else {
tmp = Math.exp((Math.abs((m - n)) - (l + (0.5 * (n * (m + (n * 0.5)))))));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -6500000000000.0: tmp = math.exp((math.pow(m, 2.0) * -0.25)) else: tmp = math.exp((math.fabs((m - n)) - (l + (0.5 * (n * (m + (n * 0.5))))))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -6500000000000.0) tmp = exp(Float64((m ^ 2.0) * -0.25)); else tmp = exp(Float64(abs(Float64(m - n)) - Float64(l + Float64(0.5 * Float64(n * Float64(m + Float64(n * 0.5))))))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -6500000000000.0) tmp = exp(((m ^ 2.0) * -0.25)); else tmp = exp((abs((m - n)) - (l + (0.5 * (n * (m + (n * 0.5))))))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -6500000000000.0], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - N[(l + N[(0.5 * N[(n * N[(m + N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6500000000000:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;e^{\left|m - n\right| - \left(\ell + 0.5 \cdot \left(n \cdot \left(m + n \cdot 0.5\right)\right)\right)}\\
\end{array}
\end{array}
if m < -6.5e12Initial program 61.4%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 98.6%
+-commutative98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in m around inf 100.0%
*-commutative100.0%
Simplified100.0%
if -6.5e12 < m Initial program 79.8%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
associate--r+98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in m around 0 81.6%
+-commutative81.6%
unpow281.6%
distribute-rgt-out86.4%
Simplified86.4%
Taylor expanded in M around 0 65.4%
*-commutative65.4%
Simplified65.4%
Final simplification74.9%
(FPCore (K m n M l)
:precision binary64
(if (<= m -3.6e-6)
(exp (* (pow m 2.0) -0.25))
(if (or (<= m -1.4e-106) (not (<= m 2.1e-229)))
(exp (* -0.25 (pow n 2.0)))
(* (cos M) (exp (- l))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -3.6e-6) {
tmp = exp((pow(m, 2.0) * -0.25));
} else if ((m <= -1.4e-106) || !(m <= 2.1e-229)) {
tmp = exp((-0.25 * pow(n, 2.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) :: tmp
if (m <= (-3.6d-6)) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else if ((m <= (-1.4d-106)) .or. (.not. (m <= 2.1d-229))) then
tmp = exp(((-0.25d0) * (n ** 2.0d0)))
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 <= -3.6e-6) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else if ((m <= -1.4e-106) || !(m <= 2.1e-229)) {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
} else {
tmp = Math.cos(M) * Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -3.6e-6: tmp = math.exp((math.pow(m, 2.0) * -0.25)) elif (m <= -1.4e-106) or not (m <= 2.1e-229): tmp = math.exp((-0.25 * math.pow(n, 2.0))) else: tmp = math.cos(M) * math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -3.6e-6) tmp = exp(Float64((m ^ 2.0) * -0.25)); elseif ((m <= -1.4e-106) || !(m <= 2.1e-229)) tmp = exp(Float64(-0.25 * (n ^ 2.0))); 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 <= -3.6e-6) tmp = exp(((m ^ 2.0) * -0.25)); elseif ((m <= -1.4e-106) || ~((m <= 2.1e-229))) tmp = exp((-0.25 * (n ^ 2.0))); else tmp = cos(M) * exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -3.6e-6], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[m, -1.4e-106], N[Not[LessEqual[m, 2.1e-229]], $MachinePrecision]], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -3.6 \cdot 10^{-6}:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;m \leq -1.4 \cdot 10^{-106} \lor \neg \left(m \leq 2.1 \cdot 10^{-229}\right):\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{-\ell}\\
\end{array}
\end{array}
if m < -3.59999999999999984e-6Initial program 63.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 97.3%
+-commutative97.3%
+-commutative97.3%
Simplified97.3%
Taylor expanded in m around inf 97.3%
*-commutative97.3%
Simplified97.3%
if -3.59999999999999984e-6 < m < -1.39999999999999994e-106 or 2.09999999999999983e-229 < m Initial program 76.1%
Taylor expanded in K around 0 97.9%
cos-neg97.9%
associate--r+97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in M around 0 85.3%
+-commutative85.3%
+-commutative85.3%
Simplified85.3%
Taylor expanded in n around inf 55.9%
*-commutative55.9%
Simplified55.9%
if -1.39999999999999994e-106 < m < 2.09999999999999983e-229Initial program 86.4%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in l around inf 43.8%
neg-mul-143.8%
Simplified43.8%
Final simplification64.9%
(FPCore (K m n M l) :precision binary64 (if (or (<= m -6500000000000.0) (not (<= m 53.0))) (exp (* (pow m 2.0) -0.25)) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((m <= -6500000000000.0) || !(m <= 53.0)) {
tmp = exp((pow(m, 2.0) * -0.25));
} 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 ((m <= (-6500000000000.0d0)) .or. (.not. (m <= 53.0d0))) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
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 ((m <= -6500000000000.0) || !(m <= 53.0)) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (m <= -6500000000000.0) or not (m <= 53.0): tmp = math.exp((math.pow(m, 2.0) * -0.25)) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((m <= -6500000000000.0) || !(m <= 53.0)) tmp = exp(Float64((m ^ 2.0) * -0.25)); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((m <= -6500000000000.0) || ~((m <= 53.0))) tmp = exp(((m ^ 2.0) * -0.25)); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[m, -6500000000000.0], N[Not[LessEqual[m, 53.0]], $MachinePrecision]], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6500000000000 \lor \neg \left(m \leq 53\right):\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if m < -6.5e12 or 53 < m Initial program 65.6%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in m around inf 99.2%
*-commutative99.2%
Simplified99.2%
if -6.5e12 < m < 53Initial program 83.9%
Taylor expanded in K around 0 98.0%
cos-neg98.0%
associate--r+98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in M around 0 72.8%
+-commutative72.8%
+-commutative72.8%
Simplified72.8%
Taylor expanded in l around inf 42.6%
neg-mul-142.6%
Simplified42.6%
Final simplification70.9%
(FPCore (K m n M l) :precision binary64 (if (<= n 9.2e-195) (exp (* (pow m 2.0) -0.25)) (if (<= n 0.0138) (exp (- l)) (exp (* -0.25 (pow n 2.0))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 9.2e-195) {
tmp = exp((pow(m, 2.0) * -0.25));
} else if (n <= 0.0138) {
tmp = exp(-l);
} else {
tmp = exp((-0.25 * pow(n, 2.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) :: tmp
if (n <= 9.2d-195) then
tmp = exp(((m ** 2.0d0) * (-0.25d0)))
else if (n <= 0.0138d0) then
tmp = exp(-l)
else
tmp = exp(((-0.25d0) * (n ** 2.0d0)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 9.2e-195) {
tmp = Math.exp((Math.pow(m, 2.0) * -0.25));
} else if (n <= 0.0138) {
tmp = Math.exp(-l);
} else {
tmp = Math.exp((-0.25 * Math.pow(n, 2.0)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 9.2e-195: tmp = math.exp((math.pow(m, 2.0) * -0.25)) elif n <= 0.0138: tmp = math.exp(-l) else: tmp = math.exp((-0.25 * math.pow(n, 2.0))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 9.2e-195) tmp = exp(Float64((m ^ 2.0) * -0.25)); elseif (n <= 0.0138) tmp = exp(Float64(-l)); else tmp = exp(Float64(-0.25 * (n ^ 2.0))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 9.2e-195) tmp = exp(((m ^ 2.0) * -0.25)); elseif (n <= 0.0138) tmp = exp(-l); else tmp = exp((-0.25 * (n ^ 2.0))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 9.2e-195], N[Exp[N[(N[Power[m, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 0.0138], N[Exp[(-l)], $MachinePrecision], N[Exp[N[(-0.25 * N[Power[n, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 9.2 \cdot 10^{-195}:\\
\;\;\;\;e^{{m}^{2} \cdot -0.25}\\
\mathbf{elif}\;n \leq 0.0138:\\
\;\;\;\;e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot {n}^{2}}\\
\end{array}
\end{array}
if n < 9.2000000000000007e-195Initial program 77.0%
Taylor expanded in K around 0 98.3%
cos-neg98.3%
associate--r+98.3%
*-commutative98.3%
Simplified98.3%
Taylor expanded in M around 0 82.0%
+-commutative82.0%
+-commutative82.0%
Simplified82.0%
Taylor expanded in m around inf 53.1%
*-commutative53.1%
Simplified53.1%
if 9.2000000000000007e-195 < n < 0.0138Initial program 82.5%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 83.0%
+-commutative83.0%
+-commutative83.0%
Simplified83.0%
Taylor expanded in l around inf 50.4%
neg-mul-150.4%
Simplified50.4%
if 0.0138 < n Initial program 63.9%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
associate--r+100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in M around 0 96.7%
+-commutative96.7%
+-commutative96.7%
Simplified96.7%
Taylor expanded in n around inf 95.2%
*-commutative95.2%
Simplified95.2%
Final simplification62.7%
(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 74.8%
Taylor expanded in K around 0 99.0%
cos-neg99.0%
associate--r+99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in M around 0 85.6%
+-commutative85.6%
+-commutative85.6%
Simplified85.6%
Taylor expanded in l around inf 35.2%
neg-mul-135.2%
Simplified35.2%
Final simplification35.2%
(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 74.8%
Taylor expanded in m around inf 38.9%
*-commutative38.9%
Simplified38.9%
Taylor expanded in m around 0 7.0%
Taylor expanded in K around 0 7.5%
cos-neg7.5%
Simplified7.5%
Final simplification7.5%
herbie shell --seed 2024023
(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)))))))