
(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 (* (exp (- (- (fabs (- n m)) l) (pow (- (/ (+ n m) 2.0) M) 2.0))) (cos M)))
double code(double K, double m, double n, double M, double l) {
return exp(((fabs((n - m)) - l) - pow((((n + m) / 2.0) - M), 2.0))) * 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 = exp(((abs((n - m)) - l) - ((((n + m) / 2.0d0) - m_1) ** 2.0d0))) * cos(m_1)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(((Math.abs((n - m)) - l) - Math.pow((((n + m) / 2.0) - M), 2.0))) * Math.cos(M);
}
def code(K, m, n, M, l): return math.exp(((math.fabs((n - m)) - l) - math.pow((((n + m) / 2.0) - M), 2.0))) * math.cos(M)
function code(K, m, n, M, l) return Float64(exp(Float64(Float64(abs(Float64(n - m)) - l) - (Float64(Float64(Float64(n + m) / 2.0) - M) ^ 2.0))) * cos(M)) end
function tmp = code(K, m, n, M, l) tmp = exp(((abs((n - m)) - l) - ((((n + m) / 2.0) - M) ^ 2.0))) * cos(M); end
code[K_, m_, n_, M_, l_] := N[(N[Exp[N[(N[(N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[Power[N[(N[(N[(n + m), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{\left(\left|n - m\right| - \ell\right) - {\left(\frac{n + m}{2} - M\right)}^{2}} \cdot \cos M
\end{array}
Initial program 77.7%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6497.1
Applied rewrites97.1%
Final simplification97.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (fma (+ n m) 0.5 (- M)))
(t_1 (fabs (- n m)))
(t_2 (exp (- l)))
(t_3 (cos (- (/ (* (+ n m) K) 2.0) M)))
(t_4 (* t_3 (exp (- (- t_1 l) (pow (- (/ (+ n m) 2.0) M) 2.0))))))
(if (<= t_4 -0.1)
(* (cos (- (/ 1.0 (/ (/ (fma -2.0 (/ m n) 2.0) n) K)) M)) t_2)
(if (<= t_4 0.0)
(* (* (- l) (exp (- t_1 (* t_0 t_0)))) t_3)
(if (<= t_4 INFINITY)
(* t_2 (cos M))
(* (exp (* -0.25 (* m m))) (cos M)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fma((n + m), 0.5, -M);
double t_1 = fabs((n - m));
double t_2 = exp(-l);
double t_3 = cos(((((n + m) * K) / 2.0) - M));
double t_4 = t_3 * exp(((t_1 - l) - pow((((n + m) / 2.0) - M), 2.0)));
double tmp;
if (t_4 <= -0.1) {
tmp = cos(((1.0 / ((fma(-2.0, (m / n), 2.0) / n) / K)) - M)) * t_2;
} else if (t_4 <= 0.0) {
tmp = (-l * exp((t_1 - (t_0 * t_0)))) * t_3;
} else if (t_4 <= ((double) INFINITY)) {
tmp = t_2 * cos(M);
} else {
tmp = exp((-0.25 * (m * m))) * cos(M);
}
return tmp;
}
function code(K, m, n, M, l) t_0 = fma(Float64(n + m), 0.5, Float64(-M)) t_1 = abs(Float64(n - m)) t_2 = exp(Float64(-l)) t_3 = cos(Float64(Float64(Float64(Float64(n + m) * K) / 2.0) - M)) t_4 = Float64(t_3 * exp(Float64(Float64(t_1 - l) - (Float64(Float64(Float64(n + m) / 2.0) - M) ^ 2.0)))) tmp = 0.0 if (t_4 <= -0.1) tmp = Float64(cos(Float64(Float64(1.0 / Float64(Float64(fma(-2.0, Float64(m / n), 2.0) / n) / K)) - M)) * t_2); elseif (t_4 <= 0.0) tmp = Float64(Float64(Float64(-l) * exp(Float64(t_1 - Float64(t_0 * t_0)))) * t_3); elseif (t_4 <= Inf) tmp = Float64(t_2 * cos(M)); else tmp = Float64(exp(Float64(-0.25 * Float64(m * m))) * cos(M)); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(n + m), $MachinePrecision] * 0.5 + (-M)), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Exp[(-l)], $MachinePrecision]}, Block[{t$95$3 = N[Cos[N[(N[(N[(N[(n + m), $MachinePrecision] * K), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * N[Exp[N[(N[(t$95$1 - l), $MachinePrecision] - N[Power[N[(N[(N[(n + m), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -0.1], N[(N[Cos[N[(N[(1.0 / N[(N[(N[(-2.0 * N[(m / n), $MachinePrecision] + 2.0), $MachinePrecision] / n), $MachinePrecision] / K), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$4, 0.0], N[(N[((-l) * N[Exp[N[(t$95$1 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$3), $MachinePrecision], If[LessEqual[t$95$4, Infinity], N[(t$95$2 * N[Cos[M], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(n + m, 0.5, -M\right)\\
t_1 := \left|n - m\right|\\
t_2 := e^{-\ell}\\
t_3 := \cos \left(\frac{\left(n + m\right) \cdot K}{2} - M\right)\\
t_4 := t\_3 \cdot e^{\left(t\_1 - \ell\right) - {\left(\frac{n + m}{2} - M\right)}^{2}}\\
\mathbf{if}\;t\_4 \leq -0.1:\\
\;\;\;\;\cos \left(\frac{1}{\frac{\frac{\mathsf{fma}\left(-2, \frac{m}{n}, 2\right)}{n}}{K}} - M\right) \cdot t\_2\\
\mathbf{elif}\;t\_4 \leq 0:\\
\;\;\;\;\left(\left(-\ell\right) \cdot e^{t\_1 - t\_0 \cdot t\_0}\right) \cdot t\_3\\
\mathbf{elif}\;t\_4 \leq \infty:\\
\;\;\;\;t\_2 \cdot \cos M\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)} \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)))))) < -0.10000000000000001Initial program 34.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6432.1
lift-+.f64N/A
+-commutativeN/A
lower-+.f6432.1
Applied rewrites32.1%
Taylor expanded in n around inf
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-mul-1N/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
neg-mul-1N/A
distribute-lft-neg-inN/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6449.0
Applied rewrites49.0%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6449.0
Applied rewrites49.0%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
if -0.10000000000000001 < (*.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.0Initial program 100.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
Applied rewrites96.7%
Taylor expanded in l around inf
Applied rewrites96.7%
if -0.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)))))) < +inf.0Initial program 78.1%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6474.7
Applied rewrites74.7%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6479.9
Applied rewrites79.9%
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 m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f640.0
Applied rewrites0.0%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6461.7
Applied rewrites61.7%
Final simplification87.5%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (fma (+ n m) 0.5 (- M)))
(t_1 (fabs (- n m)))
(t_2 (cos (- (/ (* (+ n m) K) 2.0) M)))
(t_3 (* t_2 (exp (- (- t_1 l) (pow (- (/ (+ n m) 2.0) M) 2.0))))))
(if (<= t_3 0.0)
(* (* (exp (- t_1 (* t_0 t_0))) (- 1.0 l)) t_2)
(if (<= t_3 INFINITY)
(* (exp (- l)) (cos M))
(* (exp (* -0.25 (* m m))) (cos M))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = fma((n + m), 0.5, -M);
double t_1 = fabs((n - m));
double t_2 = cos(((((n + m) * K) / 2.0) - M));
double t_3 = t_2 * exp(((t_1 - l) - pow((((n + m) / 2.0) - M), 2.0)));
double tmp;
if (t_3 <= 0.0) {
tmp = (exp((t_1 - (t_0 * t_0))) * (1.0 - l)) * t_2;
} else if (t_3 <= ((double) INFINITY)) {
tmp = exp(-l) * cos(M);
} else {
tmp = exp((-0.25 * (m * m))) * cos(M);
}
return tmp;
}
function code(K, m, n, M, l) t_0 = fma(Float64(n + m), 0.5, Float64(-M)) t_1 = abs(Float64(n - m)) t_2 = cos(Float64(Float64(Float64(Float64(n + m) * K) / 2.0) - M)) t_3 = Float64(t_2 * exp(Float64(Float64(t_1 - l) - (Float64(Float64(Float64(n + m) / 2.0) - M) ^ 2.0)))) tmp = 0.0 if (t_3 <= 0.0) tmp = Float64(Float64(exp(Float64(t_1 - Float64(t_0 * t_0))) * Float64(1.0 - l)) * t_2); elseif (t_3 <= Inf) tmp = Float64(exp(Float64(-l)) * cos(M)); else tmp = Float64(exp(Float64(-0.25 * Float64(m * m))) * cos(M)); end return tmp end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[(n + m), $MachinePrecision] * 0.5 + (-M)), $MachinePrecision]}, Block[{t$95$1 = N[Abs[N[(n - m), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Cos[N[(N[(N[(N[(n + m), $MachinePrecision] * K), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[Exp[N[(N[(t$95$1 - l), $MachinePrecision] - N[Power[N[(N[(N[(n + m), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 0.0], N[(N[(N[Exp[N[(t$95$1 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 - l), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(N[Exp[(-l)], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(n + m, 0.5, -M\right)\\
t_1 := \left|n - m\right|\\
t_2 := \cos \left(\frac{\left(n + m\right) \cdot K}{2} - M\right)\\
t_3 := t\_2 \cdot e^{\left(t\_1 - \ell\right) - {\left(\frac{n + m}{2} - M\right)}^{2}}\\
\mathbf{if}\;t\_3 \leq 0:\\
\;\;\;\;\left(e^{t\_1 - t\_0 \cdot t\_0} \cdot \left(1 - \ell\right)\right) \cdot t\_2\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;e^{-\ell} \cdot \cos M\\
\mathbf{else}:\\
\;\;\;\;e^{-0.25 \cdot \left(m \cdot m\right)} \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)))))) < -0.0Initial program 97.5%
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
Applied rewrites93.4%
if -0.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)))))) < +inf.0Initial program 78.1%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6474.7
Applied rewrites74.7%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6479.9
Applied rewrites79.9%
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 m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f640.0
Applied rewrites0.0%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6461.7
Applied rewrites61.7%
Final simplification86.3%
(FPCore (K m n M l)
:precision binary64
(if (<= m -6600.0)
(* 1.0 (exp (* -0.25 (* m m))))
(if (<= m -1.25e-226)
(* (exp (* (- M) M)) (cos (- (/ K (/ 2.0 m)) M)))
(* (exp (* (* n n) -0.25)) (cos M)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -6600.0) {
tmp = 1.0 * exp((-0.25 * (m * m)));
} else if (m <= -1.25e-226) {
tmp = exp((-M * M)) * cos(((K / (2.0 / m)) - M));
} else {
tmp = exp(((n * n) * -0.25)) * cos(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 <= (-6600.0d0)) then
tmp = 1.0d0 * exp(((-0.25d0) * (m * m)))
else if (m <= (-1.25d-226)) then
tmp = exp((-m_1 * m_1)) * cos(((k / (2.0d0 / m)) - m_1))
else
tmp = exp(((n * n) * (-0.25d0))) * cos(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 <= -6600.0) {
tmp = 1.0 * Math.exp((-0.25 * (m * m)));
} else if (m <= -1.25e-226) {
tmp = Math.exp((-M * M)) * Math.cos(((K / (2.0 / m)) - M));
} else {
tmp = Math.exp(((n * n) * -0.25)) * Math.cos(M);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -6600.0: tmp = 1.0 * math.exp((-0.25 * (m * m))) elif m <= -1.25e-226: tmp = math.exp((-M * M)) * math.cos(((K / (2.0 / m)) - M)) else: tmp = math.exp(((n * n) * -0.25)) * math.cos(M) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -6600.0) tmp = Float64(1.0 * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -1.25e-226) tmp = Float64(exp(Float64(Float64(-M) * M)) * cos(Float64(Float64(K / Float64(2.0 / m)) - M))); else tmp = Float64(exp(Float64(Float64(n * n) * -0.25)) * cos(M)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -6600.0) tmp = 1.0 * exp((-0.25 * (m * m))); elseif (m <= -1.25e-226) tmp = exp((-M * M)) * cos(((K / (2.0 / m)) - M)); else tmp = exp(((n * n) * -0.25)) * cos(M); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -6600.0], N[(1.0 * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -1.25e-226], N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(N[(K / N[(2.0 / m), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Exp[N[(N[(n * n), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6600:\\
\;\;\;\;1 \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -1.25 \cdot 10^{-226}:\\
\;\;\;\;e^{\left(-M\right) \cdot M} \cdot \cos \left(\frac{K}{\frac{2}{m}} - M\right)\\
\mathbf{else}:\\
\;\;\;\;e^{\left(n \cdot n\right) \cdot -0.25} \cdot \cos M\\
\end{array}
\end{array}
if m < -6600Initial program 73.9%
Taylor expanded in m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.5
Applied rewrites72.5%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6498.6
Applied rewrites98.6%
Taylor expanded in M around 0
Applied rewrites98.6%
if -6600 < m < -1.2499999999999999e-226Initial program 80.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lower-/.f6480.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6480.4
Applied rewrites80.4%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6457.1
Applied rewrites57.1%
Taylor expanded in n around 0
lower-/.f6464.3
Applied rewrites64.3%
if -1.2499999999999999e-226 < m Initial program 78.6%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6496.5
Applied rewrites96.5%
Taylor expanded in n around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6451.1
Applied rewrites51.1%
Final simplification66.6%
(FPCore (K m n M l)
:precision binary64
(if (<= m -6600.0)
(* 1.0 (exp (* -0.25 (* m m))))
(if (<= m -1.55e-223)
(* (exp (* (- M) M)) 1.0)
(* (exp (* (* n n) -0.25)) (cos M)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -6600.0) {
tmp = 1.0 * exp((-0.25 * (m * m)));
} else if (m <= -1.55e-223) {
tmp = exp((-M * M)) * 1.0;
} else {
tmp = exp(((n * n) * -0.25)) * cos(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 <= (-6600.0d0)) then
tmp = 1.0d0 * exp(((-0.25d0) * (m * m)))
else if (m <= (-1.55d-223)) then
tmp = exp((-m_1 * m_1)) * 1.0d0
else
tmp = exp(((n * n) * (-0.25d0))) * cos(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 <= -6600.0) {
tmp = 1.0 * Math.exp((-0.25 * (m * m)));
} else if (m <= -1.55e-223) {
tmp = Math.exp((-M * M)) * 1.0;
} else {
tmp = Math.exp(((n * n) * -0.25)) * Math.cos(M);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -6600.0: tmp = 1.0 * math.exp((-0.25 * (m * m))) elif m <= -1.55e-223: tmp = math.exp((-M * M)) * 1.0 else: tmp = math.exp(((n * n) * -0.25)) * math.cos(M) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -6600.0) tmp = Float64(1.0 * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -1.55e-223) tmp = Float64(exp(Float64(Float64(-M) * M)) * 1.0); else tmp = Float64(exp(Float64(Float64(n * n) * -0.25)) * cos(M)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -6600.0) tmp = 1.0 * exp((-0.25 * (m * m))); elseif (m <= -1.55e-223) tmp = exp((-M * M)) * 1.0; else tmp = exp(((n * n) * -0.25)) * cos(M); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -6600.0], N[(1.0 * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -1.55e-223], N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Exp[N[(N[(n * n), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * N[Cos[M], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6600:\\
\;\;\;\;1 \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -1.55 \cdot 10^{-223}:\\
\;\;\;\;e^{\left(-M\right) \cdot M} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;e^{\left(n \cdot n\right) \cdot -0.25} \cdot \cos M\\
\end{array}
\end{array}
if m < -6600Initial program 73.9%
Taylor expanded in m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.5
Applied rewrites72.5%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6498.6
Applied rewrites98.6%
Taylor expanded in M around 0
Applied rewrites98.6%
if -6600 < m < -1.55000000000000009e-223Initial program 82.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6435.8
Applied rewrites35.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6443.7
Applied rewrites43.7%
Taylor expanded in M around 0
Applied rewrites43.7%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6466.4
Applied rewrites66.4%
if -1.55000000000000009e-223 < m Initial program 77.6%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6495.9
Applied rewrites95.9%
Taylor expanded in n around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6451.2
Applied rewrites51.2%
Final simplification67.0%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (exp (* (- M) M)) 1.0)))
(if (<= M -0.08)
t_0
(if (<= M 3.7e-268)
(* 1.0 (exp (* -0.25 (* m m))))
(if (<= M 27.0) (* 1.0 (exp (- l))) t_0)))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp((-M * M)) * 1.0;
double tmp;
if (M <= -0.08) {
tmp = t_0;
} else if (M <= 3.7e-268) {
tmp = 1.0 * exp((-0.25 * (m * m)));
} else if (M <= 27.0) {
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 = exp((-m_1 * m_1)) * 1.0d0
if (m_1 <= (-0.08d0)) then
tmp = t_0
else if (m_1 <= 3.7d-268) then
tmp = 1.0d0 * exp(((-0.25d0) * (m * m)))
else if (m_1 <= 27.0d0) 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 = Math.exp((-M * M)) * 1.0;
double tmp;
if (M <= -0.08) {
tmp = t_0;
} else if (M <= 3.7e-268) {
tmp = 1.0 * Math.exp((-0.25 * (m * m)));
} else if (M <= 27.0) {
tmp = 1.0 * Math.exp(-l);
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp((-M * M)) * 1.0 tmp = 0 if M <= -0.08: tmp = t_0 elif M <= 3.7e-268: tmp = 1.0 * math.exp((-0.25 * (m * m))) elif M <= 27.0: tmp = 1.0 * math.exp(-l) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = Float64(exp(Float64(Float64(-M) * M)) * 1.0) tmp = 0.0 if (M <= -0.08) tmp = t_0; elseif (M <= 3.7e-268) tmp = Float64(1.0 * exp(Float64(-0.25 * Float64(m * m)))); elseif (M <= 27.0) 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 = exp((-M * M)) * 1.0; tmp = 0.0; if (M <= -0.08) tmp = t_0; elseif (M <= 3.7e-268) tmp = 1.0 * exp((-0.25 * (m * m))); elseif (M <= 27.0) 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[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[M, -0.08], t$95$0, If[LessEqual[M, 3.7e-268], N[(1.0 * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[M, 27.0], N[(1.0 * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-M\right) \cdot M} \cdot 1\\
\mathbf{if}\;M \leq -0.08:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;M \leq 3.7 \cdot 10^{-268}:\\
\;\;\;\;1 \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;M \leq 27:\\
\;\;\;\;1 \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if M < -0.0800000000000000017 or 27 < M Initial program 80.4%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6421.4
Applied rewrites21.4%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6425.2
Applied rewrites25.2%
Taylor expanded in M around 0
Applied rewrites24.5%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6496.8
Applied rewrites96.8%
if -0.0800000000000000017 < M < 3.70000000000000018e-268Initial program 70.9%
Taylor expanded in m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6447.6
Applied rewrites47.6%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6468.9
Applied rewrites68.9%
Taylor expanded in M around 0
Applied rewrites68.9%
if 3.70000000000000018e-268 < M < 27Initial program 77.5%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6449.8
Applied rewrites49.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6456.5
Applied rewrites56.5%
Taylor expanded in M around 0
Applied rewrites56.5%
Final simplification81.8%
(FPCore (K m n M l)
:precision binary64
(if (<= m -6600.0)
(* 1.0 (exp (* -0.25 (* m m))))
(if (<= m -1.5e-223)
(* (exp (* (- M) M)) 1.0)
(* (exp (* (* n n) -0.25)) 1.0))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -6600.0) {
tmp = 1.0 * exp((-0.25 * (m * m)));
} else if (m <= -1.5e-223) {
tmp = exp((-M * M)) * 1.0;
} else {
tmp = exp(((n * n) * -0.25)) * 1.0;
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (m <= (-6600.0d0)) then
tmp = 1.0d0 * exp(((-0.25d0) * (m * m)))
else if (m <= (-1.5d-223)) then
tmp = exp((-m_1 * m_1)) * 1.0d0
else
tmp = exp(((n * n) * (-0.25d0))) * 1.0d0
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (m <= -6600.0) {
tmp = 1.0 * Math.exp((-0.25 * (m * m)));
} else if (m <= -1.5e-223) {
tmp = Math.exp((-M * M)) * 1.0;
} else {
tmp = Math.exp(((n * n) * -0.25)) * 1.0;
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if m <= -6600.0: tmp = 1.0 * math.exp((-0.25 * (m * m))) elif m <= -1.5e-223: tmp = math.exp((-M * M)) * 1.0 else: tmp = math.exp(((n * n) * -0.25)) * 1.0 return tmp
function code(K, m, n, M, l) tmp = 0.0 if (m <= -6600.0) tmp = Float64(1.0 * exp(Float64(-0.25 * Float64(m * m)))); elseif (m <= -1.5e-223) tmp = Float64(exp(Float64(Float64(-M) * M)) * 1.0); else tmp = Float64(exp(Float64(Float64(n * n) * -0.25)) * 1.0); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (m <= -6600.0) tmp = 1.0 * exp((-0.25 * (m * m))); elseif (m <= -1.5e-223) tmp = exp((-M * M)) * 1.0; else tmp = exp(((n * n) * -0.25)) * 1.0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[m, -6600.0], N[(1.0 * N[Exp[N[(-0.25 * N[(m * m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[m, -1.5e-223], N[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision], N[(N[Exp[N[(N[(n * n), $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;m \leq -6600:\\
\;\;\;\;1 \cdot e^{-0.25 \cdot \left(m \cdot m\right)}\\
\mathbf{elif}\;m \leq -1.5 \cdot 10^{-223}:\\
\;\;\;\;e^{\left(-M\right) \cdot M} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;e^{\left(n \cdot n\right) \cdot -0.25} \cdot 1\\
\end{array}
\end{array}
if m < -6600Initial program 73.9%
Taylor expanded in m around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6472.5
Applied rewrites72.5%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6498.6
Applied rewrites98.6%
Taylor expanded in M around 0
Applied rewrites98.6%
if -6600 < m < -1.49999999999999996e-223Initial program 82.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6435.8
Applied rewrites35.8%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6443.7
Applied rewrites43.7%
Taylor expanded in M around 0
Applied rewrites43.7%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6466.4
Applied rewrites66.4%
if -1.49999999999999996e-223 < m Initial program 77.6%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6434.6
Applied rewrites34.6%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6437.7
Applied rewrites37.7%
Taylor expanded in M around 0
Applied rewrites37.0%
Taylor expanded in n around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6451.2
Applied rewrites51.2%
Final simplification67.0%
(FPCore (K m n M l) :precision binary64 (let* ((t_0 (* (exp (* (- M) M)) 1.0))) (if (<= M -2.9e-67) t_0 (if (<= M 27.0) (* 1.0 (exp (- l))) t_0))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp((-M * M)) * 1.0;
double tmp;
if (M <= -2.9e-67) {
tmp = t_0;
} else if (M <= 27.0) {
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 = exp((-m_1 * m_1)) * 1.0d0
if (m_1 <= (-2.9d-67)) then
tmp = t_0
else if (m_1 <= 27.0d0) 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 = Math.exp((-M * M)) * 1.0;
double tmp;
if (M <= -2.9e-67) {
tmp = t_0;
} else if (M <= 27.0) {
tmp = 1.0 * Math.exp(-l);
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp((-M * M)) * 1.0 tmp = 0 if M <= -2.9e-67: tmp = t_0 elif M <= 27.0: tmp = 1.0 * math.exp(-l) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = Float64(exp(Float64(Float64(-M) * M)) * 1.0) tmp = 0.0 if (M <= -2.9e-67) tmp = t_0; elseif (M <= 27.0) 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 = exp((-M * M)) * 1.0; tmp = 0.0; if (M <= -2.9e-67) tmp = t_0; elseif (M <= 27.0) 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[(N[Exp[N[((-M) * M), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision]}, If[LessEqual[M, -2.9e-67], t$95$0, If[LessEqual[M, 27.0], N[(1.0 * N[Exp[(-l)], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left(-M\right) \cdot M} \cdot 1\\
\mathbf{if}\;M \leq -2.9 \cdot 10^{-67}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;M \leq 27:\\
\;\;\;\;1 \cdot e^{-\ell}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if M < -2.90000000000000005e-67 or 27 < M Initial program 79.3%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6420.4
Applied rewrites20.4%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6424.0
Applied rewrites24.0%
Taylor expanded in M around 0
Applied rewrites23.4%
Taylor expanded in M around inf
mul-1-negN/A
unpow2N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6490.9
Applied rewrites90.9%
if -2.90000000000000005e-67 < M < 27Initial program 75.2%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6446.9
Applied rewrites46.9%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6453.6
Applied rewrites53.6%
Taylor expanded in M around 0
Applied rewrites53.6%
Final simplification75.9%
(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 77.7%
Taylor expanded in l around inf
mul-1-negN/A
lower-neg.f6431.0
Applied rewrites31.0%
Taylor expanded in K around 0
cos-negN/A
lower-cos.f6435.9
Applied rewrites35.9%
Taylor expanded in M around 0
Applied rewrites35.6%
herbie shell --seed 2024235
(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)))))))