
(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 9 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 (- (- (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(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(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(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(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(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(M) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n))))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $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 M \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}
Initial program 75.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6494.7
Applied rewrites94.7%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (* 0.5 (+ n m)) M))
(t_1 (fabs (- m n)))
(t_2
(*
(cos (- (/ (* K (+ m n)) 2.0) M))
(exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l t_1)))))
(t_3 (* 1.0 (* (+ (- l) 1.0) (exp (- t_1 (* t_0 t_0)))))))
(if (<= t_2 0.8)
t_3
(if (<= t_2 INFINITY) (* (cos (* 0.5 (* (+ n m) K))) (exp (- l))) t_3))))
double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = fabs((m - n));
double t_2 = cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - t_1)));
double t_3 = 1.0 * ((-l + 1.0) * exp((t_1 - (t_0 * t_0))));
double tmp;
if (t_2 <= 0.8) {
tmp = t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = cos((0.5 * ((n + m) * K))) * exp(-l);
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = Math.abs((m - n));
double t_2 = Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - t_1)));
double t_3 = 1.0 * ((-l + 1.0) * Math.exp((t_1 - (t_0 * t_0))));
double tmp;
if (t_2 <= 0.8) {
tmp = t_3;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.cos((0.5 * ((n + m) * K))) * Math.exp(-l);
} else {
tmp = t_3;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = (0.5 * (n + m)) - M t_1 = math.fabs((m - n)) t_2 = math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - t_1))) t_3 = 1.0 * ((-l + 1.0) * math.exp((t_1 - (t_0 * t_0)))) tmp = 0 if t_2 <= 0.8: tmp = t_3 elif t_2 <= math.inf: tmp = math.cos((0.5 * ((n + m) * K))) * math.exp(-l) else: tmp = t_3 return tmp
function code(K, m, n, M, l) t_0 = Float64(Float64(0.5 * Float64(n + m)) - M) t_1 = abs(Float64(m - n)) t_2 = 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 - t_1)))) t_3 = Float64(1.0 * Float64(Float64(Float64(-l) + 1.0) * exp(Float64(t_1 - Float64(t_0 * t_0))))) tmp = 0.0 if (t_2 <= 0.8) tmp = t_3; elseif (t_2 <= Inf) tmp = Float64(cos(Float64(0.5 * Float64(Float64(n + m) * K))) * exp(Float64(-l))); else tmp = t_3; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (0.5 * (n + m)) - M; t_1 = abs((m - n)); t_2 = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - t_1))); t_3 = 1.0 * ((-l + 1.0) * exp((t_1 - (t_0 * t_0)))); tmp = 0.0; if (t_2 <= 0.8) tmp = t_3; elseif (t_2 <= Inf) tmp = cos((0.5 * ((n + m) * K))) * exp(-l); else tmp = t_3; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(0.5 * N[(n + m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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 - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 * N[(N[((-l) + 1.0), $MachinePrecision] * N[Exp[N[(t$95$1 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.8], t$95$3, If[LessEqual[t$95$2, Infinity], N[(N[Cos[N[(0.5 * N[(N[(n + m), $MachinePrecision] * K), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(n + m\right) - M\\
t_1 := \left|m - n\right|\\
t_2 := \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 - t\_1\right)}\\
t_3 := 1 \cdot \left(\left(\left(-\ell\right) + 1\right) \cdot e^{t\_1 - t\_0 \cdot t\_0}\right)\\
\mathbf{if}\;t\_2 \leq 0.8:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\cos \left(0.5 \cdot \left(\left(n + m\right) \cdot K\right)\right) \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < 0.80000000000000004 or +inf.0 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) Initial program 74.5%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6496.1
Applied rewrites96.1%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6427.6
Applied rewrites27.6%
Taylor expanded in M around 0
Applied rewrites27.2%
Taylor expanded in l around 0
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-fabs.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites92.2%
if 0.80000000000000004 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < +inf.0Initial program 86.3%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6486.3
Applied rewrites86.3%
Taylor expanded in K around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6486.3
Applied rewrites86.3%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (* 0.5 (+ n m)) M))
(t_1 (fabs (- m n)))
(t_2
(*
(cos (- (/ (* K (+ m n)) 2.0) M))
(exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l t_1)))))
(t_3 (* 1.0 (* (+ (- l) 1.0) (exp (- t_1 (* t_0 t_0)))))))
(if (<= t_2 0.9)
t_3
(if (<= t_2 INFINITY) (* (cos (* 0.5 (* n K))) (exp (- l))) t_3))))
double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = fabs((m - n));
double t_2 = cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - t_1)));
double t_3 = 1.0 * ((-l + 1.0) * exp((t_1 - (t_0 * t_0))));
double tmp;
if (t_2 <= 0.9) {
tmp = t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = cos((0.5 * (n * K))) * exp(-l);
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = Math.abs((m - n));
double t_2 = Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - t_1)));
double t_3 = 1.0 * ((-l + 1.0) * Math.exp((t_1 - (t_0 * t_0))));
double tmp;
if (t_2 <= 0.9) {
tmp = t_3;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = Math.cos((0.5 * (n * K))) * Math.exp(-l);
} else {
tmp = t_3;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = (0.5 * (n + m)) - M t_1 = math.fabs((m - n)) t_2 = math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - t_1))) t_3 = 1.0 * ((-l + 1.0) * math.exp((t_1 - (t_0 * t_0)))) tmp = 0 if t_2 <= 0.9: tmp = t_3 elif t_2 <= math.inf: tmp = math.cos((0.5 * (n * K))) * math.exp(-l) else: tmp = t_3 return tmp
function code(K, m, n, M, l) t_0 = Float64(Float64(0.5 * Float64(n + m)) - M) t_1 = abs(Float64(m - n)) t_2 = 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 - t_1)))) t_3 = Float64(1.0 * Float64(Float64(Float64(-l) + 1.0) * exp(Float64(t_1 - Float64(t_0 * t_0))))) tmp = 0.0 if (t_2 <= 0.9) tmp = t_3; elseif (t_2 <= Inf) tmp = Float64(cos(Float64(0.5 * Float64(n * K))) * exp(Float64(-l))); else tmp = t_3; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (0.5 * (n + m)) - M; t_1 = abs((m - n)); t_2 = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - t_1))); t_3 = 1.0 * ((-l + 1.0) * exp((t_1 - (t_0 * t_0)))); tmp = 0.0; if (t_2 <= 0.9) tmp = t_3; elseif (t_2 <= Inf) tmp = cos((0.5 * (n * K))) * exp(-l); else tmp = t_3; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(0.5 * N[(n + m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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 - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 * N[(N[((-l) + 1.0), $MachinePrecision] * N[Exp[N[(t$95$1 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.9], t$95$3, If[LessEqual[t$95$2, Infinity], N[(N[Cos[N[(0.5 * N[(n * K), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(n + m\right) - M\\
t_1 := \left|m - n\right|\\
t_2 := \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 - t\_1\right)}\\
t_3 := 1 \cdot \left(\left(\left(-\ell\right) + 1\right) \cdot e^{t\_1 - t\_0 \cdot t\_0}\right)\\
\mathbf{if}\;t\_2 \leq 0.9:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\cos \left(0.5 \cdot \left(n \cdot K\right)\right) \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < 0.900000000000000022 or +inf.0 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) Initial program 74.1%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6495.7
Applied rewrites95.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6427.5
Applied rewrites27.5%
Taylor expanded in M around 0
Applied rewrites27.0%
Taylor expanded in l around 0
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-fabs.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites91.9%
if 0.900000000000000022 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < +inf.0Initial program 89.3%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6489.3
Applied rewrites89.3%
Taylor expanded in n around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6486.9
Applied rewrites86.9%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (* 0.5 (+ n m)) M))
(t_1 (fabs (- m n)))
(t_2
(*
(cos (- (/ (* K (+ m n)) 2.0) M))
(exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l t_1)))))
(t_3 (* 1.0 (* (+ (- l) 1.0) (exp (- t_1 (* t_0 t_0)))))))
(if (<= t_2 0.9) t_3 (if (<= t_2 INFINITY) (* 1.0 (exp (- l))) t_3))))
double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = fabs((m - n));
double t_2 = cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - t_1)));
double t_3 = 1.0 * ((-l + 1.0) * exp((t_1 - (t_0 * t_0))));
double tmp;
if (t_2 <= 0.9) {
tmp = t_3;
} else if (t_2 <= ((double) INFINITY)) {
tmp = 1.0 * exp(-l);
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = Math.abs((m - n));
double t_2 = Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - t_1)));
double t_3 = 1.0 * ((-l + 1.0) * Math.exp((t_1 - (t_0 * t_0))));
double tmp;
if (t_2 <= 0.9) {
tmp = t_3;
} else if (t_2 <= Double.POSITIVE_INFINITY) {
tmp = 1.0 * Math.exp(-l);
} else {
tmp = t_3;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = (0.5 * (n + m)) - M t_1 = math.fabs((m - n)) t_2 = math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - t_1))) t_3 = 1.0 * ((-l + 1.0) * math.exp((t_1 - (t_0 * t_0)))) tmp = 0 if t_2 <= 0.9: tmp = t_3 elif t_2 <= math.inf: tmp = 1.0 * math.exp(-l) else: tmp = t_3 return tmp
function code(K, m, n, M, l) t_0 = Float64(Float64(0.5 * Float64(n + m)) - M) t_1 = abs(Float64(m - n)) t_2 = 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 - t_1)))) t_3 = Float64(1.0 * Float64(Float64(Float64(-l) + 1.0) * exp(Float64(t_1 - Float64(t_0 * t_0))))) tmp = 0.0 if (t_2 <= 0.9) tmp = t_3; elseif (t_2 <= Inf) tmp = Float64(1.0 * exp(Float64(-l))); else tmp = t_3; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (0.5 * (n + m)) - M; t_1 = abs((m - n)); t_2 = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - t_1))); t_3 = 1.0 * ((-l + 1.0) * exp((t_1 - (t_0 * t_0)))); tmp = 0.0; if (t_2 <= 0.9) tmp = t_3; elseif (t_2 <= Inf) tmp = 1.0 * exp(-l); else tmp = t_3; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(0.5 * N[(n + m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = 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 - t$95$1), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 * N[(N[((-l) + 1.0), $MachinePrecision] * N[Exp[N[(t$95$1 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.9], t$95$3, If[LessEqual[t$95$2, Infinity], N[(1.0 * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(n + m\right) - M\\
t_1 := \left|m - n\right|\\
t_2 := \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 - t\_1\right)}\\
t_3 := 1 \cdot \left(\left(\left(-\ell\right) + 1\right) \cdot e^{t\_1 - t\_0 \cdot t\_0}\right)\\
\mathbf{if}\;t\_2 \leq 0.9:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;1 \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < 0.900000000000000022 or +inf.0 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) Initial program 74.1%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6495.7
Applied rewrites95.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6427.5
Applied rewrites27.5%
Taylor expanded in M around 0
Applied rewrites27.0%
Taylor expanded in l around 0
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-fabs.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites91.9%
if 0.900000000000000022 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < +inf.0Initial program 89.3%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6486.9
Applied rewrites86.9%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6486.9
Applied rewrites86.9%
Taylor expanded in M around 0
Applied rewrites86.9%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (- (* 0.5 (+ n m)) M))
(t_1 (cos (- (/ (* K (+ m n)) 2.0) M)))
(t_2 (fabs (- m n))))
(if (<=
(* t_1 (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l t_2))))
INFINITY)
(*
t_1
(exp
(*
M
(fma
M
(/
(+ (/ (- (fabs (- n m)) (fma (* 0.25 (+ n m)) (+ n m) l)) M) (+ n m))
M)
(- M)))))
(* 1.0 (* (+ (- l) 1.0) (exp (- t_2 (* t_0 t_0))))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = (0.5 * (n + m)) - M;
double t_1 = cos((((K * (m + n)) / 2.0) - M));
double t_2 = fabs((m - n));
double tmp;
if ((t_1 * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - t_2)))) <= ((double) INFINITY)) {
tmp = t_1 * exp((M * fma(M, ((((fabs((n - m)) - fma((0.25 * (n + m)), (n + m), l)) / M) + (n + m)) / M), -M)));
} else {
tmp = 1.0 * ((-l + 1.0) * exp((t_2 - (t_0 * t_0))));
}
return tmp;
}
function code(K, m, n, M, l) t_0 = Float64(Float64(0.5 * Float64(n + m)) - M) t_1 = cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) t_2 = abs(Float64(m - n)) tmp = 0.0 if (Float64(t_1 * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - t_2)))) <= Inf) tmp = Float64(t_1 * exp(Float64(M * fma(M, Float64(Float64(Float64(Float64(abs(Float64(n - m)) - fma(Float64(0.25 * Float64(n + m)), Float64(n + m), l)) / M) + Float64(n + m)) / M), Float64(-M))))); else tmp = Float64(1.0 * Float64(Float64(Float64(-l) + 1.0) * exp(Float64(t_2 - Float64(t_0 * t_0))))); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(0.5 * N[(n + m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$1 * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 * N[Exp[N[(M * N[(M * N[(N[(N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(N[(0.25 * N[(n + m), $MachinePrecision]), $MachinePrecision] * N[(n + m), $MachinePrecision] + l), $MachinePrecision]), $MachinePrecision] / M), $MachinePrecision] + N[(n + m), $MachinePrecision]), $MachinePrecision] / M), $MachinePrecision] + (-M)), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[(N[((-l) + 1.0), $MachinePrecision] * N[Exp[N[(t$95$2 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(n + m\right) - M\\
t_1 := \cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right)\\
t_2 := \left|m - n\right|\\
\mathbf{if}\;t\_1 \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - t\_2\right)} \leq \infty:\\
\;\;\;\;t\_1 \cdot e^{M \cdot \mathsf{fma}\left(M, \frac{\frac{\left|n - m\right| - \mathsf{fma}\left(0.25 \cdot \left(n + m\right), n + m, \ell\right)}{M} + \left(n + m\right)}{M}, -M\right)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\left(\left(-\ell\right) + 1\right) \cdot e^{t\_2 - t\_0 \cdot t\_0}\right)\\
\end{array}
\end{array}
if (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) < +inf.0Initial program 94.2%
Taylor expanded in M around -inf
Applied rewrites92.7%
if +inf.0 < (*.f64 (cos.f64 (-.f64 (/.f64 (*.f64 K (+.f64 m n)) #s(literal 2 binary64)) M)) (exp.f64 (-.f64 (neg.f64 (pow.f64 (-.f64 (/.f64 (+.f64 m n) #s(literal 2 binary64)) M) #s(literal 2 binary64))) (-.f64 l (fabs.f64 (-.f64 m n)))))) Initial program 0.0%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f64100.0
Applied rewrites100.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6433.9
Applied rewrites33.9%
Taylor expanded in M around 0
Applied rewrites33.9%
Taylor expanded in l around 0
associate-*r*N/A
distribute-rgt1-inN/A
lower-*.f64N/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-fabs.f64N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites100.0%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* 1.0 (exp (* M (- M))))))
(if (<= M -1000000.0)
t_0
(if (<= M 6.8e-44)
(* 1.0 (exp (* (* m m) -0.25)))
(if (<= M 26.5) (* 1.0 (exp (- l))) t_0)))))
double code(double K, double m, double n, double M, double l) {
double t_0 = 1.0 * exp((M * -M));
double tmp;
if (M <= -1000000.0) {
tmp = t_0;
} else if (M <= 6.8e-44) {
tmp = 1.0 * exp(((m * m) * -0.25));
} else if (M <= 26.5) {
tmp = 1.0 * 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 = 1.0d0 * exp((m_1 * -m_1))
if (m_1 <= (-1000000.0d0)) then
tmp = t_0
else if (m_1 <= 6.8d-44) then
tmp = 1.0d0 * exp(((m * m) * (-0.25d0)))
else if (m_1 <= 26.5d0) then
tmp = 1.0d0 * 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 = 1.0 * Math.exp((M * -M));
double tmp;
if (M <= -1000000.0) {
tmp = t_0;
} else if (M <= 6.8e-44) {
tmp = 1.0 * Math.exp(((m * m) * -0.25));
} else if (M <= 26.5) {
tmp = 1.0 * Math.exp(-l);
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = 1.0 * math.exp((M * -M)) tmp = 0 if M <= -1000000.0: tmp = t_0 elif M <= 6.8e-44: tmp = 1.0 * math.exp(((m * m) * -0.25)) elif M <= 26.5: tmp = 1.0 * math.exp(-l) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = Float64(1.0 * exp(Float64(M * Float64(-M)))) tmp = 0.0 if (M <= -1000000.0) tmp = t_0; elseif (M <= 6.8e-44) tmp = Float64(1.0 * exp(Float64(Float64(m * m) * -0.25))); elseif (M <= 26.5) tmp = Float64(1.0 * exp(Float64(-l))); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = 1.0 * exp((M * -M)); tmp = 0.0; if (M <= -1000000.0) tmp = t_0; elseif (M <= 6.8e-44) tmp = 1.0 * exp(((m * m) * -0.25)); elseif (M <= 26.5) tmp = 1.0 * exp(-l); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(1.0 * N[Exp[N[(M * (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -1000000.0], t$95$0, If[LessEqual[M, 6.8e-44], N[(1.0 * N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 26.5], N[(1.0 * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot e^{M \cdot \left(-M\right)}\\
\mathbf{if}\;M \leq -1000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;M \leq 6.8 \cdot 10^{-44}:\\
\;\;\;\;1 \cdot e^{\left(m \cdot m\right) \cdot -0.25}\\
\mathbf{elif}\;M \leq 26.5:\\
\;\;\;\;1 \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if M < -1e6 or 26.5 < M Initial program 83.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f64100.0
Applied rewrites100.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6425.1
Applied rewrites25.1%
Taylor expanded in M around 0
Applied rewrites24.3%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6499.2
Applied rewrites99.2%
if -1e6 < M < 6.80000000000000033e-44Initial program 67.7%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6490.1
Applied rewrites90.1%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6438.1
Applied rewrites38.1%
Taylor expanded in M around 0
Applied rewrites38.1%
Taylor expanded in m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6452.3
Applied rewrites52.3%
if 6.80000000000000033e-44 < M < 26.5Initial program 84.7%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6492.9
Applied rewrites92.9%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6476.8
Applied rewrites76.8%
Taylor expanded in M around 0
Applied rewrites76.8%
(FPCore (K m n M l)
:precision binary64
(if (<= n 4.4e-203)
(* 1.0 (exp (* (* m m) -0.25)))
(if (<= n 450.0)
(* 1.0 (exp (* M (- M))))
(* 1.0 (exp (* (* n n) -0.25))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 4.4e-203) {
tmp = 1.0 * exp(((m * m) * -0.25));
} else if (n <= 450.0) {
tmp = 1.0 * exp((M * -M));
} else {
tmp = 1.0 * exp(((n * n) * -0.25));
}
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 <= 4.4d-203) then
tmp = 1.0d0 * exp(((m * m) * (-0.25d0)))
else if (n <= 450.0d0) then
tmp = 1.0d0 * exp((m_1 * -m_1))
else
tmp = 1.0d0 * exp(((n * n) * (-0.25d0)))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 4.4e-203) {
tmp = 1.0 * Math.exp(((m * m) * -0.25));
} else if (n <= 450.0) {
tmp = 1.0 * Math.exp((M * -M));
} else {
tmp = 1.0 * Math.exp(((n * n) * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 4.4e-203: tmp = 1.0 * math.exp(((m * m) * -0.25)) elif n <= 450.0: tmp = 1.0 * math.exp((M * -M)) else: tmp = 1.0 * math.exp(((n * n) * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 4.4e-203) tmp = Float64(1.0 * exp(Float64(Float64(m * m) * -0.25))); elseif (n <= 450.0) tmp = Float64(1.0 * exp(Float64(M * Float64(-M)))); else tmp = Float64(1.0 * exp(Float64(Float64(n * n) * -0.25))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 4.4e-203) tmp = 1.0 * exp(((m * m) * -0.25)); elseif (n <= 450.0) tmp = 1.0 * exp((M * -M)); else tmp = 1.0 * exp(((n * n) * -0.25)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 4.4e-203], N[(1.0 * N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 450.0], N[(1.0 * N[Exp[N[(M * (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(1.0 * N[Exp[N[(N[(n * n), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 4.4 \cdot 10^{-203}:\\
\;\;\;\;1 \cdot e^{\left(m \cdot m\right) \cdot -0.25}\\
\mathbf{elif}\;n \leq 450:\\
\;\;\;\;1 \cdot e^{M \cdot \left(-M\right)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot e^{\left(n \cdot n\right) \cdot -0.25}\\
\end{array}
\end{array}
if n < 4.3999999999999999e-203Initial program 75.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6492.4
Applied rewrites92.4%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6434.6
Applied rewrites34.6%
Taylor expanded in M around 0
Applied rewrites33.9%
Taylor expanded in m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
if 4.3999999999999999e-203 < n < 450Initial program 91.7%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6496.3
Applied rewrites96.3%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6435.5
Applied rewrites35.5%
Taylor expanded in M around 0
Applied rewrites35.5%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6468.0
Applied rewrites68.0%
if 450 < n Initial program 61.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f64100.0
Applied rewrites100.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6431.1
Applied rewrites31.1%
Taylor expanded in M around 0
Applied rewrites31.1%
Taylor expanded in n around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6498.2
Applied rewrites98.2%
(FPCore (K m n M l) :precision binary64 (let* ((t_0 (* 1.0 (exp (* M (- M)))))) (if (<= M -3.25e-9) t_0 (if (<= M 26.5) (* 1.0 (exp (- l))) t_0))))
double code(double K, double m, double n, double M, double l) {
double t_0 = 1.0 * exp((M * -M));
double tmp;
if (M <= -3.25e-9) {
tmp = t_0;
} else if (M <= 26.5) {
tmp = 1.0 * 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 = 1.0d0 * exp((m_1 * -m_1))
if (m_1 <= (-3.25d-9)) then
tmp = t_0
else if (m_1 <= 26.5d0) then
tmp = 1.0d0 * 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 = 1.0 * Math.exp((M * -M));
double tmp;
if (M <= -3.25e-9) {
tmp = t_0;
} else if (M <= 26.5) {
tmp = 1.0 * Math.exp(-l);
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = 1.0 * math.exp((M * -M)) tmp = 0 if M <= -3.25e-9: tmp = t_0 elif M <= 26.5: tmp = 1.0 * math.exp(-l) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = Float64(1.0 * exp(Float64(M * Float64(-M)))) tmp = 0.0 if (M <= -3.25e-9) tmp = t_0; elseif (M <= 26.5) tmp = Float64(1.0 * exp(Float64(-l))); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = 1.0 * exp((M * -M)); tmp = 0.0; if (M <= -3.25e-9) tmp = t_0; elseif (M <= 26.5) tmp = 1.0 * exp(-l); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(1.0 * N[Exp[N[(M * (-M)), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -3.25e-9], t$95$0, If[LessEqual[M, 26.5], N[(1.0 * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 \cdot e^{M \cdot \left(-M\right)}\\
\mathbf{if}\;M \leq -3.25 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;M \leq 26.5:\\
\;\;\;\;1 \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if M < -3.2500000000000002e-9 or 26.5 < M Initial program 83.3%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f64100.0
Applied rewrites100.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6424.6
Applied rewrites24.6%
Taylor expanded in M around 0
Applied rewrites23.7%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower-neg.f6497.6
Applied rewrites97.6%
if -3.2500000000000002e-9 < M < 26.5Initial program 69.2%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6490.1
Applied rewrites90.1%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6442.3
Applied rewrites42.3%
Taylor expanded in M around 0
Applied rewrites42.3%
(FPCore (K m n M l) :precision binary64 (* 1.0 (exp (- l))))
double code(double K, double m, double n, double M, double l) {
return 1.0 * exp(-l);
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = 1.0d0 * exp(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0 * Math.exp(-l);
}
def code(K, m, n, M, l): return 1.0 * math.exp(-l)
function code(K, m, n, M, l) return Float64(1.0 * exp(Float64(-l))) end
function tmp = code(K, m, n, M, l) tmp = 1.0 * exp(-l); end
code[K_, m_, n_, M_, l_] := N[(1.0 * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot e^{-\ell}
\end{array}
Initial program 75.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6494.7
Applied rewrites94.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6434.0
Applied rewrites34.0%
Taylor expanded in M around 0
Applied rewrites33.6%
herbie shell --seed 2024254
(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)))))))