
(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 (* (exp (- (fabs (- n m)) (+ (pow (fma 0.5 (+ n m) (- M)) 2.0) l))) (cos M)))
double code(double K, double m, double n, double M, double l) {
return exp((fabs((n - m)) - (pow(fma(0.5, (n + m), -M), 2.0) + l))) * cos(M);
}
function code(K, m, n, M, l) return Float64(exp(Float64(abs(Float64(n - m)) - Float64((fma(0.5, Float64(n + m), Float64(-M)) ^ 2.0) + l))) * cos(M)) end
code[K_, m_, n_, M_, l_] := N[(N[Exp[N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(N[Power[N[(0.5 * N[(n + m), $MachinePrecision] + (-M)), $MachinePrecision], 2.0], $MachinePrecision] + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\left|n - m\right| - \left({\left(\mathsf{fma}\left(0.5, n + m, -M\right)\right)}^{2} + \ell\right)} \cdot \cos M
\end{array}
Initial program 77.2%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.2%
Final simplification96.2%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (- l)))
(t_1
(*
(cos (- (/ (* K (+ m n)) 2.0) M))
(exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- n m))))))))
(if (or (<= t_1 0.4) (not (<= t_1 INFINITY)))
(* (* (* M M) -0.5) t_0)
(* (fma (fma 0.041666666666666664 (* M M) -0.5) (* M M) 1.0) t_0))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(-l);
double t_1 = cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((n - m)))));
double tmp;
if ((t_1 <= 0.4) || !(t_1 <= ((double) INFINITY))) {
tmp = ((M * M) * -0.5) * t_0;
} else {
tmp = fma(fma(0.041666666666666664, (M * M), -0.5), (M * M), 1.0) * t_0;
}
return tmp;
}
function code(K, m, n, M, l) t_0 = exp(Float64(-l)) t_1 = 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(n - m)))))) tmp = 0.0 if ((t_1 <= 0.4) || !(t_1 <= Inf)) tmp = Float64(Float64(Float64(M * M) * -0.5) * t_0); else tmp = Float64(fma(fma(0.041666666666666664, Float64(M * M), -0.5), Float64(M * M), 1.0) * t_0); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[(-l)], $MachinePrecision]}, Block[{t$95$1 = 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[(n - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 0.4], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(0.041666666666666664 * N[(M * M), $MachinePrecision] + -0.5), $MachinePrecision] * N[(M * M), $MachinePrecision] + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-\ell}\\
t_1 := \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|n - m\right|\right)}\\
\mathbf{if}\;t\_1 \leq 0.4 \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\left(\left(M \cdot M\right) \cdot -0.5\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.041666666666666664, M \cdot M, -0.5\right), M \cdot M, 1\right) \cdot t\_0\\
\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.40000000000000002 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 75.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6427.2
Applied rewrites27.2%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6433.9
Applied rewrites33.9%
Taylor expanded in M around 0
Applied rewrites25.1%
Taylor expanded in M around inf
Applied rewrites36.4%
if 0.40000000000000002 < (*.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 92.3%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6490.3
Applied rewrites90.3%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6489.8
Applied rewrites89.8%
Taylor expanded in M around 0
Applied rewrites89.8%
Final simplification43.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (- l)))
(t_1
(*
(cos (- (/ (* K (+ m n)) 2.0) M))
(exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- n m))))))))
(if (or (<= t_1 0.4) (not (<= t_1 INFINITY)))
(* (* (* M M) -0.5) t_0)
(* (fma (* M M) -0.5 1.0) t_0))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(-l);
double t_1 = cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((n - m)))));
double tmp;
if ((t_1 <= 0.4) || !(t_1 <= ((double) INFINITY))) {
tmp = ((M * M) * -0.5) * t_0;
} else {
tmp = fma((M * M), -0.5, 1.0) * t_0;
}
return tmp;
}
function code(K, m, n, M, l) t_0 = exp(Float64(-l)) t_1 = 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(n - m)))))) tmp = 0.0 if ((t_1 <= 0.4) || !(t_1 <= Inf)) tmp = Float64(Float64(Float64(M * M) * -0.5) * t_0); else tmp = Float64(fma(Float64(M * M), -0.5, 1.0) * t_0); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[(-l)], $MachinePrecision]}, Block[{t$95$1 = 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[(n - m), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 0.4], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(M * M), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-\ell}\\
t_1 := \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|n - m\right|\right)}\\
\mathbf{if}\;t\_1 \leq 0.4 \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\left(\left(M \cdot M\right) \cdot -0.5\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(M \cdot M, -0.5, 1\right) \cdot t\_0\\
\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.40000000000000002 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 75.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6427.2
Applied rewrites27.2%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6433.9
Applied rewrites33.9%
Taylor expanded in M around 0
Applied rewrites25.1%
Taylor expanded in M around inf
Applied rewrites36.4%
if 0.40000000000000002 < (*.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 92.3%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6490.3
Applied rewrites90.3%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6489.8
Applied rewrites89.8%
Taylor expanded in M around 0
Applied rewrites80.4%
Final simplification41.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 (- n m))))
(if (<=
(* t_1 (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l t_2))))
INFINITY)
(* t_1 (exp (fma t_0 (- t_0) (+ (- l) t_2))))
(* (exp (* (* m m) -0.25)) (cos M)))))
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((n - m));
double tmp;
if ((t_1 * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - t_2)))) <= ((double) INFINITY)) {
tmp = t_1 * exp(fma(t_0, -t_0, (-l + t_2)));
} else {
tmp = exp(((m * m) * -0.25)) * cos(M);
}
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(n - m)) 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(fma(t_0, Float64(-t_0), Float64(Float64(-l) + t_2)))); else tmp = Float64(exp(Float64(Float64(m * m) * -0.25)) * cos(M)); 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[(n - m), $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[(t$95$0 * (-t$95$0) + N[((-l) + t$95$2), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $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|n - m\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^{\mathsf{fma}\left(t\_0, -t\_0, \left(-\ell\right) + t\_2\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{\left(m \cdot m\right) \cdot -0.25} \cdot \cos M\\
\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.5%
lift--.f64N/A
sub-negN/A
lift-neg.f64N/A
lift-pow.f64N/A
unpow2N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
Applied rewrites94.5%
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
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in m around inf
Applied rewrites65.0%
Final simplification89.1%
(FPCore (K m n M l)
:precision binary64
(if (or (<= M -4.5e+23) (not (<= M 1.7e-5)))
(* (exp (* (- M) M)) (cos M))
(*
(exp (- (fabs (- n m)) (+ (pow (fma 0.5 (+ n m) (- M)) 2.0) l)))
(fma (* (* M (+ n m)) K) 0.5 1.0))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -4.5e+23) || !(M <= 1.7e-5)) {
tmp = exp((-M * M)) * cos(M);
} else {
tmp = exp((fabs((n - m)) - (pow(fma(0.5, (n + m), -M), 2.0) + l))) * fma(((M * (n + m)) * K), 0.5, 1.0);
}
return tmp;
}
function code(K, m, n, M, l) tmp = 0.0 if ((M <= -4.5e+23) || !(M <= 1.7e-5)) tmp = Float64(exp(Float64(Float64(-M) * M)) * cos(M)); else tmp = Float64(exp(Float64(abs(Float64(n - m)) - Float64((fma(0.5, Float64(n + m), Float64(-M)) ^ 2.0) + l))) * fma(Float64(Float64(M * Float64(n + m)) * K), 0.5, 1.0)); end return tmp end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[M, -4.5e+23], N[Not[LessEqual[M, 1.7e-5]], $MachinePrecision]], N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(N[Power[N[(0.5 * N[(n + m), $MachinePrecision] + (-M)), $MachinePrecision], 2.0], $MachinePrecision] + l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(M * N[(n + m), $MachinePrecision]), $MachinePrecision] * K), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -4.5 \cdot 10^{+23} \lor \neg \left(M \leq 1.7 \cdot 10^{-5}\right):\\
\;\;\;\;e^{\left(-M\right) \cdot M} \cdot \cos M\\
\mathbf{else}:\\
\;\;\;\;e^{\left|n - m\right| - \left({\left(\mathsf{fma}\left(0.5, n + m, -M\right)\right)}^{2} + \ell\right)} \cdot \mathsf{fma}\left(\left(M \cdot \left(n + m\right)\right) \cdot K, 0.5, 1\right)\\
\end{array}
\end{array}
if M < -4.49999999999999979e23 or 1.7e-5 < M Initial program 81.2%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in M around inf
Applied rewrites98.3%
if -4.49999999999999979e23 < M < 1.7e-5Initial program 73.8%
Taylor expanded in K around 0
Applied rewrites85.6%
Taylor expanded in M around 0
Applied rewrites85.6%
Final simplification91.4%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (exp (* (* m m) -0.25)) (cos M)))
(t_1 (* (exp (* (- M) M)) (cos M))))
(if (<= M -0.0075)
t_1
(if (<= M -9.6e-137)
t_0
(if (<= M 8.2e-202)
(* (* (* M M) -0.5) (exp (- l)))
(if (<= M 5.6e-8) t_0 t_1))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(((m * m) * -0.25)) * cos(M);
double t_1 = exp((-M * M)) * cos(M);
double tmp;
if (M <= -0.0075) {
tmp = t_1;
} else if (M <= -9.6e-137) {
tmp = t_0;
} else if (M <= 8.2e-202) {
tmp = ((M * M) * -0.5) * exp(-l);
} else if (M <= 5.6e-8) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((m * m) * (-0.25d0))) * cos(m_1)
t_1 = exp((-m_1 * m_1)) * cos(m_1)
if (m_1 <= (-0.0075d0)) then
tmp = t_1
else if (m_1 <= (-9.6d-137)) then
tmp = t_0
else if (m_1 <= 8.2d-202) then
tmp = ((m_1 * m_1) * (-0.5d0)) * exp(-l)
else if (m_1 <= 5.6d-8) then
tmp = t_0
else
tmp = t_1
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)) * Math.cos(M);
double t_1 = Math.exp((-M * M)) * Math.cos(M);
double tmp;
if (M <= -0.0075) {
tmp = t_1;
} else if (M <= -9.6e-137) {
tmp = t_0;
} else if (M <= 8.2e-202) {
tmp = ((M * M) * -0.5) * Math.exp(-l);
} else if (M <= 5.6e-8) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp(((m * m) * -0.25)) * math.cos(M) t_1 = math.exp((-M * M)) * math.cos(M) tmp = 0 if M <= -0.0075: tmp = t_1 elif M <= -9.6e-137: tmp = t_0 elif M <= 8.2e-202: tmp = ((M * M) * -0.5) * math.exp(-l) elif M <= 5.6e-8: tmp = t_0 else: tmp = t_1 return tmp
function code(K, m, n, M, l) t_0 = Float64(exp(Float64(Float64(m * m) * -0.25)) * cos(M)) t_1 = Float64(exp(Float64(Float64(-M) * M)) * cos(M)) tmp = 0.0 if (M <= -0.0075) tmp = t_1; elseif (M <= -9.6e-137) tmp = t_0; elseif (M <= 8.2e-202) tmp = Float64(Float64(Float64(M * M) * -0.5) * exp(Float64(-l))); elseif (M <= 5.6e-8) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(((m * m) * -0.25)) * cos(M); t_1 = exp((-M * M)) * cos(M); tmp = 0.0; if (M <= -0.0075) tmp = t_1; elseif (M <= -9.6e-137) tmp = t_0; elseif (M <= 8.2e-202) tmp = ((M * M) * -0.5) * exp(-l); elseif (M <= 5.6e-8) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -0.0075], t$95$1, If[LessEqual[M, -9.6e-137], t$95$0, If[LessEqual[M, 8.2e-202], N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 5.6e-8], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(m \cdot m\right) \cdot -0.25} \cdot \cos M\\
t_1 := e^{\left(-M\right) \cdot M} \cdot \cos M\\
\mathbf{if}\;M \leq -0.0075:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;M \leq -9.6 \cdot 10^{-137}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;M \leq 8.2 \cdot 10^{-202}:\\
\;\;\;\;\left(\left(M \cdot M\right) \cdot -0.5\right) \cdot e^{-\ell}\\
\mathbf{elif}\;M \leq 5.6 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if M < -0.0074999999999999997 or 5.5999999999999999e-8 < M Initial program 81.5%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in M around inf
Applied rewrites96.1%
if -0.0074999999999999997 < M < -9.6000000000000002e-137 or 8.2000000000000008e-202 < M < 5.5999999999999999e-8Initial program 68.7%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.5%
Taylor expanded in m around inf
Applied rewrites57.8%
if -9.6000000000000002e-137 < M < 8.2000000000000008e-202Initial program 77.9%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6439.9
Applied rewrites39.9%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6442.8
Applied rewrites42.8%
Taylor expanded in M around 0
Applied rewrites42.8%
Taylor expanded in M around inf
Applied rewrites65.2%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (- l))) (t_1 (* (exp (* (- M) M)) (cos M))))
(if (<= M -1.05e-20)
t_1
(if (<= M 1.35e-200)
(* (* (* M M) -0.5) t_0)
(if (<= M 1.7e-5) (* (fma (* M M) -0.5 1.0) t_0) t_1)))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(-l);
double t_1 = exp((-M * M)) * cos(M);
double tmp;
if (M <= -1.05e-20) {
tmp = t_1;
} else if (M <= 1.35e-200) {
tmp = ((M * M) * -0.5) * t_0;
} else if (M <= 1.7e-5) {
tmp = fma((M * M), -0.5, 1.0) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
function code(K, m, n, M, l) t_0 = exp(Float64(-l)) t_1 = Float64(exp(Float64(Float64(-M) * M)) * cos(M)) tmp = 0.0 if (M <= -1.05e-20) tmp = t_1; elseif (M <= 1.35e-200) tmp = Float64(Float64(Float64(M * M) * -0.5) * t_0); elseif (M <= 1.7e-5) tmp = Float64(fma(Float64(M * M), -0.5, 1.0) * t_0); else tmp = t_1; end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[(-l)], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[M, -1.05e-20], t$95$1, If[LessEqual[M, 1.35e-200], N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[M, 1.7e-5], N[(N[(N[(M * M), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-\ell}\\
t_1 := e^{\left(-M\right) \cdot M} \cdot \cos M\\
\mathbf{if}\;M \leq -1.05 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;M \leq 1.35 \cdot 10^{-200}:\\
\;\;\;\;\left(\left(M \cdot M\right) \cdot -0.5\right) \cdot t\_0\\
\mathbf{elif}\;M \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(M \cdot M, -0.5, 1\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if M < -1.0499999999999999e-20 or 1.7e-5 < M Initial program 80.8%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites100.0%
Taylor expanded in M around inf
Applied rewrites96.1%
if -1.0499999999999999e-20 < M < 1.3500000000000001e-200Initial program 73.6%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6437.9
Applied rewrites37.9%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6441.8
Applied rewrites41.8%
Taylor expanded in M around 0
Applied rewrites41.8%
Taylor expanded in M around inf
Applied rewrites55.6%
if 1.3500000000000001e-200 < M < 1.7e-5Initial program 73.9%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6444.5
Applied rewrites44.5%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6449.0
Applied rewrites49.0%
Taylor expanded in M around 0
Applied rewrites49.0%
(FPCore (K m n M l)
:precision binary64
(if (<= n 8e-226)
(* (exp (* (* m m) -0.25)) (cos M))
(if (<= n 3.55)
(* (exp (- (fabs (- n m)) (* M M))) (cos M))
(* (cos M) (exp (* (* n n) -0.25))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 8e-226) {
tmp = exp(((m * m) * -0.25)) * cos(M);
} else if (n <= 3.55) {
tmp = exp((fabs((n - m)) - (M * M))) * cos(M);
} else {
tmp = cos(M) * 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 <= 8d-226) then
tmp = exp(((m * m) * (-0.25d0))) * cos(m_1)
else if (n <= 3.55d0) then
tmp = exp((abs((n - m)) - (m_1 * m_1))) * cos(m_1)
else
tmp = cos(m_1) * 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 <= 8e-226) {
tmp = Math.exp(((m * m) * -0.25)) * Math.cos(M);
} else if (n <= 3.55) {
tmp = Math.exp((Math.abs((n - m)) - (M * M))) * Math.cos(M);
} else {
tmp = Math.cos(M) * Math.exp(((n * n) * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 8e-226: tmp = math.exp(((m * m) * -0.25)) * math.cos(M) elif n <= 3.55: tmp = math.exp((math.fabs((n - m)) - (M * M))) * math.cos(M) else: tmp = math.cos(M) * math.exp(((n * n) * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 8e-226) tmp = Float64(exp(Float64(Float64(m * m) * -0.25)) * cos(M)); elseif (n <= 3.55) tmp = Float64(exp(Float64(abs(Float64(n - m)) - Float64(M * M))) * cos(M)); else tmp = Float64(cos(M) * 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 <= 8e-226) tmp = exp(((m * m) * -0.25)) * cos(M); elseif (n <= 3.55) tmp = exp((abs((n - m)) - (M * M))) * cos(M); else tmp = cos(M) * exp(((n * n) * -0.25)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 8e-226], N[(N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.55], N[(N[Exp[N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - N[(M * M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(n * n), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 8 \cdot 10^{-226}:\\
\;\;\;\;e^{\left(m \cdot m\right) \cdot -0.25} \cdot \cos M\\
\mathbf{elif}\;n \leq 3.55:\\
\;\;\;\;e^{\left|n - m\right| - M \cdot M} \cdot \cos M\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot n\right) \cdot -0.25}\\
\end{array}
\end{array}
if n < 7.99999999999999937e-226Initial program 79.1%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.0%
Taylor expanded in m around inf
Applied rewrites55.5%
if 7.99999999999999937e-226 < n < 3.5499999999999998Initial program 77.8%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.5%
Taylor expanded in M around inf
Applied rewrites58.5%
if 3.5499999999999998 < n Initial program 72.3%
Taylor expanded in n around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6498.5
Applied rewrites98.5%
Final simplification66.9%
(FPCore (K m n M l)
:precision binary64
(if (<= n 5.6e-226)
(* (exp (* (* m m) -0.25)) (cos M))
(if (<= n 3.55)
(* (exp (* (- M) M)) (cos M))
(* (cos M) (exp (* (* n n) -0.25))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 5.6e-226) {
tmp = exp(((m * m) * -0.25)) * cos(M);
} else if (n <= 3.55) {
tmp = exp((-M * M)) * cos(M);
} else {
tmp = cos(M) * 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 <= 5.6d-226) then
tmp = exp(((m * m) * (-0.25d0))) * cos(m_1)
else if (n <= 3.55d0) then
tmp = exp((-m_1 * m_1)) * cos(m_1)
else
tmp = cos(m_1) * 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 <= 5.6e-226) {
tmp = Math.exp(((m * m) * -0.25)) * Math.cos(M);
} else if (n <= 3.55) {
tmp = Math.exp((-M * M)) * Math.cos(M);
} else {
tmp = Math.cos(M) * Math.exp(((n * n) * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 5.6e-226: tmp = math.exp(((m * m) * -0.25)) * math.cos(M) elif n <= 3.55: tmp = math.exp((-M * M)) * math.cos(M) else: tmp = math.cos(M) * math.exp(((n * n) * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 5.6e-226) tmp = Float64(exp(Float64(Float64(m * m) * -0.25)) * cos(M)); elseif (n <= 3.55) tmp = Float64(exp(Float64(Float64(-M) * M)) * cos(M)); else tmp = Float64(cos(M) * 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 <= 5.6e-226) tmp = exp(((m * m) * -0.25)) * cos(M); elseif (n <= 3.55) tmp = exp((-M * M)) * cos(M); else tmp = cos(M) * exp(((n * n) * -0.25)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 5.6e-226], N[(N[Exp[N[(N[(m * m), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 3.55], N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(n * n), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 5.6 \cdot 10^{-226}:\\
\;\;\;\;e^{\left(m \cdot m\right) \cdot -0.25} \cdot \cos M\\
\mathbf{elif}\;n \leq 3.55:\\
\;\;\;\;e^{\left(-M\right) \cdot M} \cdot \cos M\\
\mathbf{else}:\\
\;\;\;\;\cos M \cdot e^{\left(n \cdot n\right) \cdot -0.25}\\
\end{array}
\end{array}
if n < 5.60000000000000016e-226Initial program 79.1%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.0%
Taylor expanded in m around inf
Applied rewrites55.5%
if 5.60000000000000016e-226 < n < 3.5499999999999998Initial program 77.8%
Taylor expanded in K around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.5%
Taylor expanded in M around inf
Applied rewrites58.1%
if 3.5499999999999998 < n Initial program 72.3%
Taylor expanded in n around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.3
Applied rewrites72.3%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6498.5
Applied rewrites98.5%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (- l))))
(if (or (<= M -7.5e-165) (not (<= M 1.35e-200)))
(* (cos M) t_0)
(* (* (* M M) -0.5) t_0))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp(-l);
double tmp;
if ((M <= -7.5e-165) || !(M <= 1.35e-200)) {
tmp = cos(M) * t_0;
} else {
tmp = ((M * M) * -0.5) * 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(-l)
if ((m_1 <= (-7.5d-165)) .or. (.not. (m_1 <= 1.35d-200))) then
tmp = cos(m_1) * t_0
else
tmp = ((m_1 * m_1) * (-0.5d0)) * t_0
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double t_0 = Math.exp(-l);
double tmp;
if ((M <= -7.5e-165) || !(M <= 1.35e-200)) {
tmp = Math.cos(M) * t_0;
} else {
tmp = ((M * M) * -0.5) * t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp(-l) tmp = 0 if (M <= -7.5e-165) or not (M <= 1.35e-200): tmp = math.cos(M) * t_0 else: tmp = ((M * M) * -0.5) * t_0 return tmp
function code(K, m, n, M, l) t_0 = exp(Float64(-l)) tmp = 0.0 if ((M <= -7.5e-165) || !(M <= 1.35e-200)) tmp = Float64(cos(M) * t_0); else tmp = Float64(Float64(Float64(M * M) * -0.5) * t_0); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(-l); tmp = 0.0; if ((M <= -7.5e-165) || ~((M <= 1.35e-200))) tmp = cos(M) * t_0; else tmp = ((M * M) * -0.5) * t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[(-l)], $MachinePrecision]}, If[Or[LessEqual[M, -7.5e-165], N[Not[LessEqual[M, 1.35e-200]], $MachinePrecision]], N[(N[Cos[M], $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] * t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-\ell}\\
\mathbf{if}\;M \leq -7.5 \cdot 10^{-165} \lor \neg \left(M \leq 1.35 \cdot 10^{-200}\right):\\
\;\;\;\;\cos M \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\left(\left(M \cdot M\right) \cdot -0.5\right) \cdot t\_0\\
\end{array}
\end{array}
if M < -7.5000000000000002e-165 or 1.3500000000000001e-200 < M Initial program 77.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6435.2
Applied rewrites35.2%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6441.5
Applied rewrites41.5%
if -7.5000000000000002e-165 < M < 1.3500000000000001e-200Initial program 75.1%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6434.8
Applied rewrites34.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6438.3
Applied rewrites38.3%
Taylor expanded in M around 0
Applied rewrites38.3%
Taylor expanded in M around inf
Applied rewrites66.5%
Final simplification46.7%
(FPCore (K m n M l) :precision binary64 (* (* (* M M) -0.5) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
return ((M * M) * -0.5) * 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 = ((m_1 * m_1) * (-0.5d0)) * exp(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return ((M * M) * -0.5) * Math.exp(-l);
}
def code(K, m, n, M, l): return ((M * M) * -0.5) * math.exp(-l)
function code(K, m, n, M, l) return Float64(Float64(Float64(M * M) * -0.5) * exp(Float64(-l))) end
function tmp = code(K, m, n, M, l) tmp = ((M * M) * -0.5) * exp(-l); end
code[K_, m_, n_, M_, l_] := N[(N[(N[(M * M), $MachinePrecision] * -0.5), $MachinePrecision] * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(M \cdot M\right) \cdot -0.5\right) \cdot e^{-\ell}
\end{array}
Initial program 77.2%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6435.1
Applied rewrites35.1%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6440.9
Applied rewrites40.9%
Taylor expanded in M around 0
Applied rewrites32.0%
Taylor expanded in M around inf
Applied rewrites32.0%
herbie shell --seed 2024296
(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)))))))