
(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 (let* ((t_0 (- (/ (+ m n) 2.0) M))) (/ (cos M) (exp (- (+ (* t_0 t_0) l) (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = ((m + n) / 2.0) - M;
return cos(M) / exp((((t_0 * t_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
real(8) :: t_0
t_0 = ((m + n) / 2.0d0) - m_1
code = cos(m_1) / exp((((t_0 * t_0) + l) - abs((m - n))))
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = ((m + n) / 2.0) - M;
return Math.cos(M) / Math.exp((((t_0 * t_0) + l) - Math.abs((m - n))));
}
def code(K, m, n, M, l): t_0 = ((m + n) / 2.0) - M return math.cos(M) / math.exp((((t_0 * t_0) + l) - math.fabs((m - n))))
function code(K, m, n, M, l) t_0 = Float64(Float64(Float64(m + n) / 2.0) - M) return Float64(cos(M) / exp(Float64(Float64(Float64(t_0 * t_0) + l) - abs(Float64(m - n))))) end
function tmp = code(K, m, n, M, l) t_0 = ((m + n) / 2.0) - M; tmp = cos(M) / exp((((t_0 * t_0) + l) - abs((m - n)))); end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]}, N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] + l), $MachinePrecision] - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{m + n}{2} - M\\
\frac{\cos M}{e^{\left(t\_0 \cdot t\_0 + \ell\right) - \left|m - n\right|}}
\end{array}
\end{array}
Initial program 73.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.3%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6494.6%
Simplified94.6%
(FPCore (K m n M l)
:precision binary64
(if (<= n 3.5e-198)
(/ (cos M) (exp (* 0.25 (* m m))))
(if (<= n 53.0)
(*
(cos (- (/ (* (+ m n) K) 2.0) 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.5e-198) {
tmp = cos(M) / exp((0.25 * (m * m)));
} else if (n <= 53.0) {
tmp = cos(((((m + n) * K) / 2.0) - 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.5d-198) then
tmp = cos(m_1) / exp((0.25d0 * (m * m)))
else if (n <= 53.0d0) then
tmp = cos(((((m + n) * k) / 2.0d0) - 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.5e-198) {
tmp = Math.cos(M) / Math.exp((0.25 * (m * m)));
} else if (n <= 53.0) {
tmp = Math.cos(((((m + n) * K) / 2.0) - 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.5e-198: tmp = math.cos(M) / math.exp((0.25 * (m * m))) elif n <= 53.0: tmp = math.cos(((((m + n) * K) / 2.0) - 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.5e-198) tmp = Float64(cos(M) / exp(Float64(0.25 * Float64(m * m)))); elseif (n <= 53.0) tmp = Float64(cos(Float64(Float64(Float64(Float64(m + n) * K) / 2.0) - M)) * exp(Float64(Float64(abs(Float64(m - n)) - l) - Float64(M * M)))); else tmp = Float64(cos(M) / exp(Float64(0.25 * Float64(n * n)))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 3.5e-198) tmp = cos(M) / exp((0.25 * (m * m))); elseif (n <= 53.0) tmp = cos(((((m + n) * K) / 2.0) - 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.5e-198], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 53.0], N[(N[Cos[N[(N[(N[(N[(m + n), $MachinePrecision] * K), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(0.25 * N[(n * n), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 3.5 \cdot 10^{-198}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(m \cdot m\right)}}\\
\mathbf{elif}\;n \leq 53:\\
\;\;\;\;\cos \left(\frac{\left(m + n\right) \cdot K}{2} - M\right) \cdot e^{\left(\left|m - n\right| - \ell\right) - M \cdot M}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(n \cdot n\right)}}\\
\end{array}
\end{array}
if n < 3.50000000000000025e-198Initial program 69.2%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified69.2%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6493.3%
Simplified93.3%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.0%
Simplified53.0%
if 3.50000000000000025e-198 < n < 53Initial program 83.8%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6465.5%
Simplified65.5%
if 53 < n Initial program 75.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6498.6%
Simplified98.6%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
Final simplification66.6%
(FPCore (K m n M l)
:precision binary64
(if (<= n 1.6e-198)
(/ (cos M) (exp (* 0.25 (* m m))))
(if (<= n 53.0)
(/
(cos (- (/ (* (+ m n) K) 2.0) M))
(exp (- (+ l (* M M)) (fabs (- m n)))))
(/ (cos M) (exp (* 0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 1.6e-198) {
tmp = cos(M) / exp((0.25 * (m * m)));
} else if (n <= 53.0) {
tmp = cos(((((m + n) * K) / 2.0) - M)) / exp(((l + (M * M)) - fabs((m - n))));
} 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.6d-198) then
tmp = cos(m_1) / exp((0.25d0 * (m * m)))
else if (n <= 53.0d0) then
tmp = cos(((((m + n) * k) / 2.0d0) - m_1)) / exp(((l + (m_1 * m_1)) - abs((m - n))))
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.6e-198) {
tmp = Math.cos(M) / Math.exp((0.25 * (m * m)));
} else if (n <= 53.0) {
tmp = Math.cos(((((m + n) * K) / 2.0) - M)) / Math.exp(((l + (M * M)) - Math.abs((m - n))));
} 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.6e-198: tmp = math.cos(M) / math.exp((0.25 * (m * m))) elif n <= 53.0: tmp = math.cos(((((m + n) * K) / 2.0) - M)) / math.exp(((l + (M * M)) - math.fabs((m - n)))) 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.6e-198) tmp = Float64(cos(M) / exp(Float64(0.25 * Float64(m * m)))); elseif (n <= 53.0) tmp = Float64(cos(Float64(Float64(Float64(Float64(m + n) * K) / 2.0) - M)) / exp(Float64(Float64(l + Float64(M * M)) - abs(Float64(m - n))))); 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.6e-198) tmp = cos(M) / exp((0.25 * (m * m))); elseif (n <= 53.0) tmp = cos(((((m + n) * K) / 2.0) - M)) / exp(((l + (M * M)) - abs((m - n)))); else tmp = cos(M) / exp((0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 1.6e-198], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 53.0], N[(N[Cos[N[(N[(N[(N[(m + n), $MachinePrecision] * K), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] / N[Exp[N[(N[(l + N[(M * M), $MachinePrecision]), $MachinePrecision] - N[Abs[N[(m - n), $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 1.6 \cdot 10^{-198}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(m \cdot m\right)}}\\
\mathbf{elif}\;n \leq 53:\\
\;\;\;\;\frac{\cos \left(\frac{\left(m + n\right) \cdot K}{2} - M\right)}{e^{\left(\ell + M \cdot M\right) - \left|m - n\right|}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(n \cdot n\right)}}\\
\end{array}
\end{array}
if n < 1.59999999999999997e-198Initial program 69.2%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified69.2%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6493.3%
Simplified93.3%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.0%
Simplified53.0%
if 1.59999999999999997e-198 < n < 53Initial program 83.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified83.7%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6465.4%
Simplified65.4%
if 53 < n Initial program 75.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6498.6%
Simplified98.6%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
Final simplification66.6%
(FPCore (K m n M l)
:precision binary64
(if (<= n 2.25e-197)
(/ (cos M) (exp (* 0.25 (* m m))))
(if (<= n 5.1e-155)
(* (cos (* 0.5 (* n K))) (exp (- 0.0 l)))
(if (<= n 53.0)
(/ (cos (- (/ K (/ 2.0 (+ m n))) 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 (n <= 2.25e-197) {
tmp = cos(M) / exp((0.25 * (m * m)));
} else if (n <= 5.1e-155) {
tmp = cos((0.5 * (n * K))) * exp((0.0 - l));
} else if (n <= 53.0) {
tmp = cos(((K / (2.0 / (m + n))) - 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 (n <= 2.25d-197) then
tmp = cos(m_1) / exp((0.25d0 * (m * m)))
else if (n <= 5.1d-155) then
tmp = cos((0.5d0 * (n * k))) * exp((0.0d0 - l))
else if (n <= 53.0d0) then
tmp = cos(((k / (2.0d0 / (m + n))) - 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 (n <= 2.25e-197) {
tmp = Math.cos(M) / Math.exp((0.25 * (m * m)));
} else if (n <= 5.1e-155) {
tmp = Math.cos((0.5 * (n * K))) * Math.exp((0.0 - l));
} else if (n <= 53.0) {
tmp = Math.cos(((K / (2.0 / (m + n))) - 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 n <= 2.25e-197: tmp = math.cos(M) / math.exp((0.25 * (m * m))) elif n <= 5.1e-155: tmp = math.cos((0.5 * (n * K))) * math.exp((0.0 - l)) elif n <= 53.0: tmp = math.cos(((K / (2.0 / (m + n))) - 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 (n <= 2.25e-197) tmp = Float64(cos(M) / exp(Float64(0.25 * Float64(m * m)))); elseif (n <= 5.1e-155) tmp = Float64(cos(Float64(0.5 * Float64(n * K))) * exp(Float64(0.0 - l))); elseif (n <= 53.0) tmp = Float64(cos(Float64(Float64(K / Float64(2.0 / Float64(m + n))) - M)) / exp(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 <= 2.25e-197) tmp = cos(M) / exp((0.25 * (m * m))); elseif (n <= 5.1e-155) tmp = cos((0.5 * (n * K))) * exp((0.0 - l)); elseif (n <= 53.0) tmp = cos(((K / (2.0 / (m + n))) - 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[n, 2.25e-197], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 5.1e-155], N[(N[Cos[N[(0.5 * N[(n * K), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(0.0 - l), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 53.0], N[(N[Cos[N[(N[(K / N[(2.0 / N[(m + n), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $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}\;n \leq 2.25 \cdot 10^{-197}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(m \cdot m\right)}}\\
\mathbf{elif}\;n \leq 5.1 \cdot 10^{-155}:\\
\;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right)\right) \cdot e^{0 - \ell}\\
\mathbf{elif}\;n \leq 53:\\
\;\;\;\;\frac{\cos \left(\frac{K}{\frac{2}{m + n}} - M\right)}{e^{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(n \cdot n\right)}}\\
\end{array}
\end{array}
if n < 2.25e-197Initial program 69.2%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified69.2%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6493.3%
Simplified93.3%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.0%
Simplified53.0%
if 2.25e-197 < n < 5.0999999999999996e-155Initial program 82.0%
Taylor expanded in l around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6437.5%
Simplified37.5%
Taylor expanded in n around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6440.4%
Simplified40.4%
if 5.0999999999999996e-155 < n < 53Initial program 84.4%
Taylor expanded in M around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6448.1%
Simplified48.1%
exp-diffN/A
1-expN/A
un-div-invN/A
/-lowering-/.f64N/A
cos-lowering-cos.f64N/A
--lowering--.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f6448.3%
Applied egg-rr48.3%
if 53 < n Initial program 75.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6498.6%
Simplified98.6%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
(FPCore (K m n M l)
:precision binary64
(if (<= n 8.5e-194)
(/ (cos M) (exp (* 0.25 (* m m))))
(if (<= n 0.0082)
(* (cos (* 0.5 (* n K))) (exp (- 0.0 l)))
(/ (cos M) (exp (* 0.25 (* n n)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 8.5e-194) {
tmp = cos(M) / exp((0.25 * (m * m)));
} else if (n <= 0.0082) {
tmp = cos((0.5 * (n * K))) * exp((0.0 - l));
} 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 <= 8.5d-194) then
tmp = cos(m_1) / exp((0.25d0 * (m * m)))
else if (n <= 0.0082d0) then
tmp = cos((0.5d0 * (n * k))) * exp((0.0d0 - l))
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 <= 8.5e-194) {
tmp = Math.cos(M) / Math.exp((0.25 * (m * m)));
} else if (n <= 0.0082) {
tmp = Math.cos((0.5 * (n * K))) * Math.exp((0.0 - l));
} else {
tmp = Math.cos(M) / Math.exp((0.25 * (n * n)));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 8.5e-194: tmp = math.cos(M) / math.exp((0.25 * (m * m))) elif n <= 0.0082: tmp = math.cos((0.5 * (n * K))) * math.exp((0.0 - l)) 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 <= 8.5e-194) tmp = Float64(cos(M) / exp(Float64(0.25 * Float64(m * m)))); elseif (n <= 0.0082) tmp = Float64(cos(Float64(0.5 * Float64(n * K))) * exp(Float64(0.0 - l))); 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 <= 8.5e-194) tmp = cos(M) / exp((0.25 * (m * m))); elseif (n <= 0.0082) tmp = cos((0.5 * (n * K))) * exp((0.0 - l)); else tmp = cos(M) / exp((0.25 * (n * n))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 8.5e-194], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 0.0082], N[(N[Cos[N[(0.5 * N[(n * K), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[N[(0.0 - l), $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 8.5 \cdot 10^{-194}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(m \cdot m\right)}}\\
\mathbf{elif}\;n \leq 0.0082:\\
\;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right)\right) \cdot e^{0 - \ell}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(n \cdot n\right)}}\\
\end{array}
\end{array}
if n < 8.5000000000000005e-194Initial program 69.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified69.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6493.4%
Simplified93.4%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.3%
Simplified53.3%
if 8.5000000000000005e-194 < n < 0.00820000000000000069Initial program 83.4%
Taylor expanded in l around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f6448.6%
Simplified48.6%
Taylor expanded in n around inf
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6453.1%
Simplified53.1%
if 0.00820000000000000069 < n Initial program 75.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6498.6%
Simplified98.6%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
(FPCore (K m n M l)
:precision binary64
(if (<= n 5.3e-154)
(/ (cos M) (exp (* 0.25 (* m m))))
(if (<= n 53.0)
(/ (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 (n <= 5.3e-154) {
tmp = cos(M) / exp((0.25 * (m * m)));
} else if (n <= 53.0) {
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 (n <= 5.3d-154) then
tmp = cos(m_1) / exp((0.25d0 * (m * m)))
else if (n <= 53.0d0) 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 (n <= 5.3e-154) {
tmp = Math.cos(M) / Math.exp((0.25 * (m * m)));
} else if (n <= 53.0) {
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 n <= 5.3e-154: tmp = math.cos(M) / math.exp((0.25 * (m * m))) elif n <= 53.0: 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 (n <= 5.3e-154) tmp = Float64(cos(M) / exp(Float64(0.25 * Float64(m * m)))); elseif (n <= 53.0) tmp = Float64(cos(M) / exp(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 <= 5.3e-154) tmp = cos(M) / exp((0.25 * (m * m))); elseif (n <= 53.0) 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[n, 5.3e-154], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 53.0], 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}\;n \leq 5.3 \cdot 10^{-154}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(m \cdot m\right)}}\\
\mathbf{elif}\;n \leq 53:\\
\;\;\;\;\frac{\cos M}{e^{M \cdot M}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{0.25 \cdot \left(n \cdot n\right)}}\\
\end{array}
\end{array}
if n < 5.3000000000000002e-154Initial program 70.1%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified70.1%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6493.4%
Simplified93.4%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6453.4%
Simplified53.4%
if 5.3000000000000002e-154 < n < 53Initial program 84.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified84.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6491.9%
Simplified91.9%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6449.6%
Simplified49.6%
if 53 < n Initial program 75.4%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.4%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6498.6%
Simplified98.6%
Taylor expanded in n around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6495.7%
Simplified95.7%
(FPCore (K m n M l) :precision binary64 (if (<= m -1.25e-6) (exp (* (* m m) -0.25)) (if (<= m -7e-249) (/ (cos M) (exp l)) (/ (cos M) (exp (* M M))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -1.25e-6) {
tmp = exp(((m * m) * -0.25));
} else if (m <= -7e-249) {
tmp = cos(M) / exp(l);
} else {
tmp = cos(M) / exp((M * M));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-1.25d-6)) then
tmp = exp(((m * m) * (-0.25d0)))
else if (m <= (-7d-249)) then
tmp = cos(m_1) / exp(l)
else
tmp = cos(m_1) / exp((m_1 * m_1))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -1.25e-6) {
tmp = Math.exp(((m * m) * -0.25));
} else if (m <= -7e-249) {
tmp = Math.cos(M) / Math.exp(l);
} else {
tmp = Math.cos(M) / Math.exp((M * M));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -1.25e-6: tmp = math.exp(((m * m) * -0.25)) elif m <= -7e-249: tmp = math.cos(M) / math.exp(l) else: tmp = math.cos(M) / math.exp((M * M)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -1.25e-6) tmp = exp(Float64(Float64(m * m) * -0.25)); elseif (m <= -7e-249) tmp = Float64(cos(M) / exp(l)); else tmp = Float64(cos(M) / exp(Float64(M * M))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -1.25e-6) tmp = exp(((m * m) * -0.25)); elseif (m <= -7e-249) tmp = cos(M) / exp(l); else tmp = cos(M) / exp((M * M)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -1.25e-6], N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision], If[LessEqual[m, -7e-249], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(M * M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -1.25 \cdot 10^{-6}:\\
\;\;\;\;e^{\left(m \cdot m\right) \cdot -0.25}\\
\mathbf{elif}\;m \leq -7 \cdot 10^{-249}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{M \cdot M}}\\
\end{array}
\end{array}
if m < -1.2500000000000001e-6Initial program 60.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified60.3%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6498.6%
Simplified98.6%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.5%
Simplified91.5%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6447.9%
Simplified47.9%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6491.5%
Simplified91.5%
if -1.2500000000000001e-6 < m < -7.00000000000000025e-249Initial program 80.2%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified80.2%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6495.6%
Simplified95.6%
Taylor expanded in l around inf
Simplified56.0%
if -7.00000000000000025e-249 < m Initial program 75.6%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified75.6%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6492.7%
Simplified92.7%
Taylor expanded in M around inf
unpow2N/A
*-lowering-*.f6455.8%
Simplified55.8%
Final simplification63.5%
(FPCore (K m n M l) :precision binary64 (let* ((t_0 (exp (* (* m m) -0.25)))) (if (<= m -0.00102) t_0 (if (<= m 8.5e-30) (/ (cos M) (exp l)) t_0))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(((m * m) * -0.25));
double tmp;
if (m <= -0.00102) {
tmp = t_0;
} else if (m <= 8.5e-30) {
tmp = cos(M) / exp(l);
} 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) :: tmp
t_0 = exp(((m * m) * (-0.25d0)))
if (m <= (-0.00102d0)) then
tmp = t_0
else if (m <= 8.5d-30) then
tmp = cos(m_1) / exp(l)
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(((m * m) * -0.25));
double tmp;
if (m <= -0.00102) {
tmp = t_0;
} else if (m <= 8.5e-30) {
tmp = Math.cos(M) / Math.exp(l);
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp(((m * m) * -0.25)) tmp = 0 if m <= -0.00102: tmp = t_0 elif m <= 8.5e-30: tmp = math.cos(M) / math.exp(l) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = exp(Float64(Float64(m * m) * -0.25)) tmp = 0.0 if (m <= -0.00102) tmp = t_0; elseif (m <= 8.5e-30) tmp = Float64(cos(M) / exp(l)); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(((m * m) * -0.25)); tmp = 0.0; if (m <= -0.00102) tmp = t_0; elseif (m <= 8.5e-30) tmp = cos(M) / exp(l); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[m, -0.00102], t$95$0, If[LessEqual[m, 8.5e-30], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(m \cdot m\right) \cdot -0.25}\\
\mathbf{if}\;m \leq -0.00102:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;m \leq 8.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if m < -0.00102 or 8.49999999999999931e-30 < m Initial program 66.8%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified66.8%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6495.7%
Simplified95.7%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.2%
Simplified88.2%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6446.3%
Simplified46.3%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6488.2%
Simplified88.2%
if -0.00102 < m < 8.49999999999999931e-30Initial program 79.9%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified79.9%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6493.4%
Simplified93.4%
Taylor expanded in l around inf
Simplified40.6%
Final simplification64.6%
(FPCore (K m n M l) :precision binary64 (exp (* (* m m) -0.25)))
double code(double K, double m, double n, double M, double l) {
return exp(((m * m) * -0.25));
}
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(((m * m) * (-0.25d0)))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(((m * m) * -0.25));
}
def code(K, m, n, M, l): return math.exp(((m * m) * -0.25))
function code(K, m, n, M, l) return exp(Float64(Float64(m * m) * -0.25)) end
function tmp = code(K, m, n, M, l) tmp = exp(((m * m) * -0.25)); end
code[K_, m_, n_, M_, l_] := N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
e^{\left(m \cdot m\right) \cdot -0.25}
\end{array}
Initial program 73.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.3%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6494.6%
Simplified94.6%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.8%
Simplified48.8%
Taylor expanded in M around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6427.4%
Simplified27.4%
Taylor expanded in M around 0
rec-expN/A
exp-lowering-exp.f64N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.8%
Simplified48.8%
Final simplification48.8%
(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 73.3%
neg-sub0N/A
associate--l-N/A
exp-diffN/A
associate-*r/N/A
exp-0N/A
*-rgt-identityN/A
/-lowering-/.f64N/A
Simplified73.3%
Taylor expanded in K around 0
cos-negN/A
cos-lowering-cos.f6494.6%
Simplified94.6%
Taylor expanded in m around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6448.8%
Simplified48.8%
Taylor expanded in m around 0
cos-lowering-cos.f646.4%
Simplified6.4%
(FPCore (K m n M l) :precision binary64 1.0)
double code(double K, double m, double n, double M, double l) {
return 1.0;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = 1.0d0
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0;
}
def code(K, m, n, M, l): return 1.0
function code(K, m, n, M, l) return 1.0 end
function tmp = code(K, m, n, M, l) tmp = 1.0; end
code[K_, m_, n_, M_, l_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 73.3%
Taylor expanded in M around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6439.6%
Simplified39.6%
Taylor expanded in M around 0
cos-lowering-cos.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
+-lowering-+.f646.1%
Simplified6.1%
Taylor expanded in K around 0
Simplified6.4%
herbie shell --seed 2024138
(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)))))))