
(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 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (K m n M l) :precision binary64 (* (cos (- (/ (* K (+ m n)) 2.0) M)) (exp (- (- (pow (- (/ (+ m n) 2.0) M) 2.0)) (- l (fabs (- m n)))))))
double code(double K, double m, double n, double M, double l) {
return cos((((K * (m + n)) / 2.0) - M)) * exp((-pow((((m + n) / 2.0) - M), 2.0) - (l - fabs((m - n)))));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos((((k * (m + n)) / 2.0d0) - m_1)) * exp((-((((m + n) / 2.0d0) - m_1) ** 2.0d0) - (l - abs((m - n)))))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos((((K * (m + n)) / 2.0) - M)) * Math.exp((-Math.pow((((m + n) / 2.0) - M), 2.0) - (l - Math.abs((m - n)))));
}
def code(K, m, n, M, l): return math.cos((((K * (m + n)) / 2.0) - M)) * math.exp((-math.pow((((m + n) / 2.0) - M), 2.0) - (l - math.fabs((m - n)))))
function code(K, m, n, M, l) return Float64(cos(Float64(Float64(Float64(K * Float64(m + n)) / 2.0) - M)) * exp(Float64(Float64(-(Float64(Float64(Float64(m + n) / 2.0) - M) ^ 2.0)) - Float64(l - abs(Float64(m - n)))))) end
function tmp = code(K, m, n, M, l) tmp = cos((((K * (m + n)) / 2.0) - M)) * exp((-((((m + n) / 2.0) - M) ^ 2.0) - (l - abs((m - n))))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[N[(N[(N[(K * N[(m + n), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] * N[Exp[N[((-N[Power[N[(N[(N[(m + n), $MachinePrecision] / 2.0), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]) - N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos \left(\frac{K \cdot \left(m + n\right)}{2} - M\right) \cdot e^{\left(-{\left(\frac{m + n}{2} - M\right)}^{2}\right) - \left(\ell - \left|m - n\right|\right)}
\end{array}
(FPCore (K m n M l) :precision binary64 (* (cos M) (exp (- (fabs (- m n)) (+ l (pow (- (* (+ m n) 0.5) M) 2.0))))))
double code(double K, double m, double n, double M, double l) {
return cos(M) * exp((fabs((m - n)) - (l + pow((((m + n) * 0.5) - M), 2.0))));
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos(m_1) * exp((abs((m - n)) - (l + ((((m + n) * 0.5d0) - m_1) ** 2.0d0))))
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M) * Math.exp((Math.abs((m - n)) - (l + Math.pow((((m + n) * 0.5) - M), 2.0))));
}
def code(K, m, n, M, l): return math.cos(M) * math.exp((math.fabs((m - n)) - (l + math.pow((((m + n) * 0.5) - M), 2.0))))
function code(K, m, n, M, l) return Float64(cos(M) * exp(Float64(abs(Float64(m - n)) - Float64(l + (Float64(Float64(Float64(m + n) * 0.5) - M) ^ 2.0))))) end
function tmp = code(K, m, n, M, l) tmp = cos(M) * exp((abs((m - n)) - (l + ((((m + n) * 0.5) - M) ^ 2.0)))); end
code[K_, m_, n_, M_, l_] := N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - N[(l + N[Power[N[(N[(N[(m + n), $MachinePrecision] * 0.5), $MachinePrecision] - M), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\cos M \cdot e^{\left|m - n\right| - \left(\ell + {\left(\left(m + n\right) \cdot 0.5 - M\right)}^{2}\right)}
\end{array}
Initial program 75.7%
Taylor expanded in K around 0 94.9%
cos-neg94.9%
sub-neg94.9%
sub-neg94.9%
associate--r+94.9%
*-commutative94.9%
associate--r+94.9%
Simplified94.9%
Final simplification94.9%
(FPCore (K m n M l)
:precision binary64
(if (<= n 2.9e+42)
(*
(cos M)
(exp (+ (fabs (- m n)) (- (* (- (* m 0.5) M) (- (- M (* m 0.5)) n)) l))))
(exp (* (pow n 2.0) -0.25))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 2.9e+42) {
tmp = cos(M) * exp((fabs((m - n)) + ((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - l)));
} else {
tmp = exp((pow(n, 2.0) * -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 <= 2.9d+42) then
tmp = cos(m_1) * exp((abs((m - n)) + ((((m * 0.5d0) - m_1) * ((m_1 - (m * 0.5d0)) - n)) - l)))
else
tmp = exp(((n ** 2.0d0) * (-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 <= 2.9e+42) {
tmp = Math.cos(M) * Math.exp((Math.abs((m - n)) + ((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - l)));
} else {
tmp = Math.exp((Math.pow(n, 2.0) * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 2.9e+42: tmp = math.cos(M) * math.exp((math.fabs((m - n)) + ((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - l))) else: tmp = math.exp((math.pow(n, 2.0) * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 2.9e+42) tmp = Float64(cos(M) * exp(Float64(abs(Float64(m - n)) + Float64(Float64(Float64(Float64(m * 0.5) - M) * Float64(Float64(M - Float64(m * 0.5)) - n)) - l)))); else tmp = exp(Float64((n ^ 2.0) * -0.25)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 2.9e+42) tmp = cos(M) * exp((abs((m - n)) + ((((m * 0.5) - M) * ((M - (m * 0.5)) - n)) - l))); else tmp = exp(((n ^ 2.0) * -0.25)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 2.9e+42], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(m * 0.5), $MachinePrecision]), $MachinePrecision] - n), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[Power[n, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 2.9 \cdot 10^{+42}:\\
\;\;\;\;\cos M \cdot e^{\left|m - n\right| + \left(\left(m \cdot 0.5 - M\right) \cdot \left(\left(M - m \cdot 0.5\right) - n\right) - \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{{n}^{2} \cdot -0.25}\\
\end{array}
\end{array}
if n < 2.89999999999999981e42Initial program 77.4%
Taylor expanded in K around 0 93.6%
cos-neg93.6%
sub-neg93.6%
sub-neg93.6%
associate--r+93.6%
*-commutative93.6%
associate--r+93.6%
Simplified93.6%
Taylor expanded in n around 0 77.1%
*-commutative77.1%
*-commutative77.1%
unpow277.1%
distribute-rgt-out84.5%
*-commutative84.5%
*-commutative84.5%
Simplified84.5%
if 2.89999999999999981e42 < n Initial program 68.6%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 78.6%
+-commutative78.6%
unpow278.6%
distribute-rgt-out86.5%
Simplified86.5%
Taylor expanded in M around 0 86.5%
Taylor expanded in n around inf 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification87.6%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (pow n 2.0) -0.25)))
(if (<= n -7.5e-126)
(* (cos M) (exp (+ (* n (- (* 0.5 (- M m)) (* M -0.5))) t_0)))
(if (<= n 14600000000.0)
(exp (+ (fabs (- m n)) (- (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) l)))
(exp t_0)))))
double code(double K, double m, double n, double M, double l) {
double t_0 = pow(n, 2.0) * -0.25;
double tmp;
if (n <= -7.5e-126) {
tmp = cos(M) * exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0));
} else if (n <= 14600000000.0) {
tmp = exp((fabs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)));
} else {
tmp = exp(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 = (n ** 2.0d0) * (-0.25d0)
if (n <= (-7.5d-126)) then
tmp = cos(m_1) * exp(((n * ((0.5d0 * (m_1 - m)) - (m_1 * (-0.5d0)))) + t_0))
else if (n <= 14600000000.0d0) then
tmp = exp((abs((m - n)) + ((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) - l)))
else
tmp = exp(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.pow(n, 2.0) * -0.25;
double tmp;
if (n <= -7.5e-126) {
tmp = Math.cos(M) * Math.exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0));
} else if (n <= 14600000000.0) {
tmp = Math.exp((Math.abs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)));
} else {
tmp = Math.exp(t_0);
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.pow(n, 2.0) * -0.25 tmp = 0 if n <= -7.5e-126: tmp = math.cos(M) * math.exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0)) elif n <= 14600000000.0: tmp = math.exp((math.fabs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l))) else: tmp = math.exp(t_0) return tmp
function code(K, m, n, M, l) t_0 = Float64((n ^ 2.0) * -0.25) tmp = 0.0 if (n <= -7.5e-126) tmp = Float64(cos(M) * exp(Float64(Float64(n * Float64(Float64(0.5 * Float64(M - m)) - Float64(M * -0.5))) + t_0))); elseif (n <= 14600000000.0) tmp = exp(Float64(abs(Float64(m - n)) + Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) - l))); else tmp = exp(t_0); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (n ^ 2.0) * -0.25; tmp = 0.0; if (n <= -7.5e-126) tmp = cos(M) * exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0)); elseif (n <= 14600000000.0) tmp = exp((abs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l))); else tmp = exp(t_0); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Power[n, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[n, -7.5e-126], N[(N[Cos[M], $MachinePrecision] * N[Exp[N[(N[(n * N[(N[(0.5 * N[(M - m), $MachinePrecision]), $MachinePrecision] - N[(M * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 14600000000.0], N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {n}^{2} \cdot -0.25\\
\mathbf{if}\;n \leq -7.5 \cdot 10^{-126}:\\
\;\;\;\;\cos M \cdot e^{n \cdot \left(0.5 \cdot \left(M - m\right) - M \cdot -0.5\right) + t\_0}\\
\mathbf{elif}\;n \leq 14600000000:\\
\;\;\;\;e^{\left|m - n\right| + \left(\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) - \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{t\_0}\\
\end{array}
\end{array}
if n < -7.49999999999999976e-126Initial program 72.2%
Taylor expanded in K around 0 94.5%
cos-neg94.5%
sub-neg94.5%
sub-neg94.5%
associate--r+94.5%
*-commutative94.5%
associate--r+94.5%
Simplified94.5%
Taylor expanded in m around 0 74.2%
+-commutative74.2%
unpow274.2%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in n around inf 58.2%
if -7.49999999999999976e-126 < n < 1.46e10Initial program 82.7%
Taylor expanded in K around 0 92.1%
cos-neg92.1%
sub-neg92.1%
sub-neg92.1%
associate--r+92.1%
*-commutative92.1%
associate--r+92.1%
Simplified92.1%
Taylor expanded in m around 0 68.7%
+-commutative68.7%
unpow268.7%
distribute-rgt-out70.8%
Simplified70.8%
Taylor expanded in M around 0 69.7%
if 1.46e10 < n Initial program 70.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 75.2%
+-commutative75.2%
unpow275.2%
distribute-rgt-out83.6%
Simplified83.6%
Taylor expanded in M around 0 83.6%
Taylor expanded in n around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification72.0%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (* (pow n 2.0) -0.25)))
(if (<= n -2.2e-127)
(exp (+ (* n (- (* 0.5 (- M m)) (* M -0.5))) t_0))
(if (<= n 14600000000.0)
(exp (+ (fabs (- m n)) (- (* (- (* n 0.5) M) (- (- M (* n 0.5)) m)) l)))
(exp t_0)))))
double code(double K, double m, double n, double M, double l) {
double t_0 = pow(n, 2.0) * -0.25;
double tmp;
if (n <= -2.2e-127) {
tmp = exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0));
} else if (n <= 14600000000.0) {
tmp = exp((fabs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)));
} else {
tmp = exp(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 = (n ** 2.0d0) * (-0.25d0)
if (n <= (-2.2d-127)) then
tmp = exp(((n * ((0.5d0 * (m_1 - m)) - (m_1 * (-0.5d0)))) + t_0))
else if (n <= 14600000000.0d0) then
tmp = exp((abs((m - n)) + ((((n * 0.5d0) - m_1) * ((m_1 - (n * 0.5d0)) - m)) - l)))
else
tmp = exp(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.pow(n, 2.0) * -0.25;
double tmp;
if (n <= -2.2e-127) {
tmp = Math.exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0));
} else if (n <= 14600000000.0) {
tmp = Math.exp((Math.abs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l)));
} else {
tmp = Math.exp(t_0);
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.pow(n, 2.0) * -0.25 tmp = 0 if n <= -2.2e-127: tmp = math.exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0)) elif n <= 14600000000.0: tmp = math.exp((math.fabs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l))) else: tmp = math.exp(t_0) return tmp
function code(K, m, n, M, l) t_0 = Float64((n ^ 2.0) * -0.25) tmp = 0.0 if (n <= -2.2e-127) tmp = exp(Float64(Float64(n * Float64(Float64(0.5 * Float64(M - m)) - Float64(M * -0.5))) + t_0)); elseif (n <= 14600000000.0) tmp = exp(Float64(abs(Float64(m - n)) + Float64(Float64(Float64(Float64(n * 0.5) - M) * Float64(Float64(M - Float64(n * 0.5)) - m)) - l))); else tmp = exp(t_0); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = (n ^ 2.0) * -0.25; tmp = 0.0; if (n <= -2.2e-127) tmp = exp(((n * ((0.5 * (M - m)) - (M * -0.5))) + t_0)); elseif (n <= 14600000000.0) tmp = exp((abs((m - n)) + ((((n * 0.5) - M) * ((M - (n * 0.5)) - m)) - l))); else tmp = exp(t_0); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[(N[Power[n, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]}, If[LessEqual[n, -2.2e-127], N[Exp[N[(N[(n * N[(N[(0.5 * N[(M - m), $MachinePrecision]), $MachinePrecision] - N[(M * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 14600000000.0], N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(N[(n * 0.5), $MachinePrecision] - M), $MachinePrecision] * N[(N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision] - m), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[t$95$0], $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {n}^{2} \cdot -0.25\\
\mathbf{if}\;n \leq -2.2 \cdot 10^{-127}:\\
\;\;\;\;e^{n \cdot \left(0.5 \cdot \left(M - m\right) - M \cdot -0.5\right) + t\_0}\\
\mathbf{elif}\;n \leq 14600000000:\\
\;\;\;\;e^{\left|m - n\right| + \left(\left(n \cdot 0.5 - M\right) \cdot \left(\left(M - n \cdot 0.5\right) - m\right) - \ell\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{t\_0}\\
\end{array}
\end{array}
if n < -2.2000000000000001e-127Initial program 72.2%
Taylor expanded in K around 0 94.5%
cos-neg94.5%
sub-neg94.5%
sub-neg94.5%
associate--r+94.5%
*-commutative94.5%
associate--r+94.5%
Simplified94.5%
Taylor expanded in m around 0 74.2%
+-commutative74.2%
unpow274.2%
distribute-rgt-out79.4%
Simplified79.4%
Taylor expanded in M around 0 79.4%
Taylor expanded in n around inf 58.2%
if -2.2000000000000001e-127 < n < 1.46e10Initial program 82.7%
Taylor expanded in K around 0 92.1%
cos-neg92.1%
sub-neg92.1%
sub-neg92.1%
associate--r+92.1%
*-commutative92.1%
associate--r+92.1%
Simplified92.1%
Taylor expanded in m around 0 68.7%
+-commutative68.7%
unpow268.7%
distribute-rgt-out70.8%
Simplified70.8%
Taylor expanded in M around 0 69.7%
if 1.46e10 < n Initial program 70.0%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 75.2%
+-commutative75.2%
unpow275.2%
distribute-rgt-out83.6%
Simplified83.6%
Taylor expanded in M around 0 83.6%
Taylor expanded in n around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification72.0%
(FPCore (K m n M l) :precision binary64 (if (or (<= M -2.12e-13) (not (<= M 5.3e+14))) (exp (- (pow M 2.0))) (exp (- (- (fabs (- m n)) l) (* (* n 0.5) (+ m (* n 0.5)))))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -2.12e-13) || !(M <= 5.3e+14)) {
tmp = exp(-pow(M, 2.0));
} else {
tmp = exp(((fabs((m - n)) - l) - ((n * 0.5) * (m + (n * 0.5)))));
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if ((m_1 <= (-2.12d-13)) .or. (.not. (m_1 <= 5.3d+14))) then
tmp = exp(-(m_1 ** 2.0d0))
else
tmp = exp(((abs((m - n)) - l) - ((n * 0.5d0) * (m + (n * 0.5d0)))))
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if ((M <= -2.12e-13) || !(M <= 5.3e+14)) {
tmp = Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.exp(((Math.abs((m - n)) - l) - ((n * 0.5) * (m + (n * 0.5)))));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if (M <= -2.12e-13) or not (M <= 5.3e+14): tmp = math.exp(-math.pow(M, 2.0)) else: tmp = math.exp(((math.fabs((m - n)) - l) - ((n * 0.5) * (m + (n * 0.5))))) return tmp
function code(K, m, n, M, l) tmp = 0.0 if ((M <= -2.12e-13) || !(M <= 5.3e+14)) tmp = exp(Float64(-(M ^ 2.0))); else tmp = exp(Float64(Float64(abs(Float64(m - n)) - l) - Float64(Float64(n * 0.5) * Float64(m + Float64(n * 0.5))))); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if ((M <= -2.12e-13) || ~((M <= 5.3e+14))) tmp = exp(-(M ^ 2.0)); else tmp = exp(((abs((m - n)) - l) - ((n * 0.5) * (m + (n * 0.5))))); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[Or[LessEqual[M, -2.12e-13], N[Not[LessEqual[M, 5.3e+14]], $MachinePrecision]], N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision], N[Exp[N[(N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - l), $MachinePrecision] - N[(N[(n * 0.5), $MachinePrecision] * N[(m + N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;M \leq -2.12 \cdot 10^{-13} \lor \neg \left(M \leq 5.3 \cdot 10^{+14}\right):\\
\;\;\;\;e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;e^{\left(\left|m - n\right| - \ell\right) - \left(n \cdot 0.5\right) \cdot \left(m + n \cdot 0.5\right)}\\
\end{array}
\end{array}
if M < -2.1200000000000001e-13 or 5.3e14 < M Initial program 75.2%
Taylor expanded in K around 0 98.6%
cos-neg98.6%
sub-neg98.6%
sub-neg98.6%
associate--r+98.6%
*-commutative98.6%
associate--r+98.6%
Simplified98.6%
Taylor expanded in m around 0 81.5%
+-commutative81.5%
unpow281.5%
distribute-rgt-out87.8%
Simplified87.8%
Taylor expanded in M around 0 87.1%
Taylor expanded in M around inf 95.9%
mul-1-neg95.9%
Simplified95.9%
if -2.1200000000000001e-13 < M < 5.3e14Initial program 76.3%
Taylor expanded in K around 0 90.0%
cos-neg90.0%
sub-neg90.0%
sub-neg90.0%
associate--r+90.0%
*-commutative90.0%
associate--r+90.0%
Simplified90.0%
Taylor expanded in m around 0 60.4%
+-commutative60.4%
unpow260.4%
distribute-rgt-out63.2%
Simplified63.2%
Taylor expanded in M around 0 63.2%
Taylor expanded in M around 0 62.3%
associate--r+62.3%
associate-*r*62.3%
*-commutative62.3%
*-commutative62.3%
Simplified62.3%
Final simplification81.3%
(FPCore (K m n M l) :precision binary64 (if (<= n -7.6e+71) (exp (* m (- M (* n 0.5)))) (if (<= n 55.0) (exp (- (pow M 2.0))) (exp (* (pow n 2.0) -0.25)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= -7.6e+71) {
tmp = exp((m * (M - (n * 0.5))));
} else if (n <= 55.0) {
tmp = exp(-pow(M, 2.0));
} else {
tmp = exp((pow(n, 2.0) * -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 <= (-7.6d+71)) then
tmp = exp((m * (m_1 - (n * 0.5d0))))
else if (n <= 55.0d0) then
tmp = exp(-(m_1 ** 2.0d0))
else
tmp = exp(((n ** 2.0d0) * (-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 <= -7.6e+71) {
tmp = Math.exp((m * (M - (n * 0.5))));
} else if (n <= 55.0) {
tmp = Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.exp((Math.pow(n, 2.0) * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= -7.6e+71: tmp = math.exp((m * (M - (n * 0.5)))) elif n <= 55.0: tmp = math.exp(-math.pow(M, 2.0)) else: tmp = math.exp((math.pow(n, 2.0) * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= -7.6e+71) tmp = exp(Float64(m * Float64(M - Float64(n * 0.5)))); elseif (n <= 55.0) tmp = exp(Float64(-(M ^ 2.0))); else tmp = exp(Float64((n ^ 2.0) * -0.25)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= -7.6e+71) tmp = exp((m * (M - (n * 0.5)))); elseif (n <= 55.0) tmp = exp(-(M ^ 2.0)); else tmp = exp(((n ^ 2.0) * -0.25)); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, -7.6e+71], N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 55.0], N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision], N[Exp[N[(N[Power[n, 2.0], $MachinePrecision] * -0.25), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq -7.6 \cdot 10^{+71}:\\
\;\;\;\;e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{elif}\;n \leq 55:\\
\;\;\;\;e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;e^{{n}^{2} \cdot -0.25}\\
\end{array}
\end{array}
if n < -7.6000000000000001e71Initial program 66.1%
Taylor expanded in K around 0 98.2%
cos-neg98.2%
sub-neg98.2%
sub-neg98.2%
associate--r+98.2%
*-commutative98.2%
associate--r+98.2%
Simplified98.2%
Taylor expanded in m around 0 80.4%
+-commutative80.4%
unpow280.4%
distribute-rgt-out85.9%
Simplified85.9%
Taylor expanded in M around 0 85.9%
Taylor expanded in m around inf 47.5%
if -7.6000000000000001e71 < n < 55Initial program 81.5%
Taylor expanded in K around 0 91.2%
cos-neg91.2%
sub-neg91.2%
sub-neg91.2%
associate--r+91.2%
*-commutative91.2%
associate--r+91.2%
Simplified91.2%
Taylor expanded in m around 0 67.2%
+-commutative67.2%
unpow267.2%
distribute-rgt-out70.1%
Simplified70.1%
Taylor expanded in M around 0 69.4%
Taylor expanded in M around inf 63.0%
mul-1-neg63.0%
Simplified63.0%
if 55 < n Initial program 71.4%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 76.4%
+-commutative76.4%
unpow276.4%
distribute-rgt-out84.4%
Simplified84.4%
Taylor expanded in M around 0 84.4%
Taylor expanded in n around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification68.3%
(FPCore (K m n M l) :precision binary64 (if (<= l -3400000000000.0) (* (cos M) (exp l)) (if (<= l 0.0065) (exp (* m (- M (* n 0.5)))) (/ (cos M) (exp l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -3400000000000.0) {
tmp = cos(M) * exp(l);
} else if (l <= 0.0065) {
tmp = exp((m * (M - (n * 0.5))));
} else {
tmp = cos(M) / exp(l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-3400000000000.0d0)) then
tmp = cos(m_1) * exp(l)
else if (l <= 0.0065d0) then
tmp = exp((m * (m_1 - (n * 0.5d0))))
else
tmp = cos(m_1) / exp(l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -3400000000000.0) {
tmp = Math.cos(M) * Math.exp(l);
} else if (l <= 0.0065) {
tmp = Math.exp((m * (M - (n * 0.5))));
} else {
tmp = Math.cos(M) / Math.exp(l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -3400000000000.0: tmp = math.cos(M) * math.exp(l) elif l <= 0.0065: tmp = math.exp((m * (M - (n * 0.5)))) else: tmp = math.cos(M) / math.exp(l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -3400000000000.0) tmp = Float64(cos(M) * exp(l)); elseif (l <= 0.0065) tmp = exp(Float64(m * Float64(M - Float64(n * 0.5)))); else tmp = Float64(cos(M) / exp(l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -3400000000000.0) tmp = cos(M) * exp(l); elseif (l <= 0.0065) tmp = exp((m * (M - (n * 0.5)))); else tmp = cos(M) / exp(l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -3400000000000.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.0065], N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3400000000000:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{elif}\;\ell \leq 0.0065:\\
\;\;\;\;e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\end{array}
\end{array}
if l < -3.4e12Initial program 81.3%
Taylor expanded in K around 0 91.3%
cos-neg91.3%
sub-neg91.3%
sub-neg91.3%
associate--r+91.3%
*-commutative91.3%
associate--r+91.3%
Simplified91.3%
Taylor expanded in m around 0 67.8%
+-commutative67.8%
unpow267.8%
distribute-rgt-out71.6%
Simplified71.6%
Taylor expanded in l around inf 17.4%
mul-1-neg17.4%
Simplified17.4%
pow117.4%
add-sqr-sqrt17.4%
sqrt-unprod17.4%
sqr-neg17.4%
sqrt-unprod0.0%
add-sqr-sqrt75.4%
Applied egg-rr75.4%
unpow175.4%
Simplified75.4%
if -3.4e12 < l < 0.0064999999999999997Initial program 67.8%
Taylor expanded in K around 0 94.9%
cos-neg94.9%
sub-neg94.9%
sub-neg94.9%
associate--r+94.9%
*-commutative94.9%
associate--r+94.9%
Simplified94.9%
Taylor expanded in m around 0 70.5%
+-commutative70.5%
unpow270.5%
distribute-rgt-out75.6%
Simplified75.6%
Taylor expanded in M around 0 75.6%
Taylor expanded in m around inf 44.9%
if 0.0064999999999999997 < l Initial program 84.2%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 82.6%
+-commutative82.6%
unpow282.6%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in l around inf 98.3%
mul-1-neg98.3%
Simplified98.3%
exp-neg98.3%
un-div-inv98.3%
Applied egg-rr98.3%
Final simplification66.3%
(FPCore (K m n M l) :precision binary64 (if (<= l -950000.0) (* (cos M) (exp l)) (if (<= l 720.0) (exp (- (pow M 2.0))) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -950000.0) {
tmp = cos(M) * exp(l);
} else if (l <= 720.0) {
tmp = exp(-pow(M, 2.0));
} else {
tmp = exp(-l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-950000.0d0)) then
tmp = cos(m_1) * exp(l)
else if (l <= 720.0d0) then
tmp = exp(-(m_1 ** 2.0d0))
else
tmp = exp(-l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -950000.0) {
tmp = Math.cos(M) * Math.exp(l);
} else if (l <= 720.0) {
tmp = Math.exp(-Math.pow(M, 2.0));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -950000.0: tmp = math.cos(M) * math.exp(l) elif l <= 720.0: tmp = math.exp(-math.pow(M, 2.0)) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -950000.0) tmp = Float64(cos(M) * exp(l)); elseif (l <= 720.0) tmp = exp(Float64(-(M ^ 2.0))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -950000.0) tmp = cos(M) * exp(l); elseif (l <= 720.0) tmp = exp(-(M ^ 2.0)); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -950000.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 720.0], N[Exp[(-N[Power[M, 2.0], $MachinePrecision])], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -950000:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{elif}\;\ell \leq 720:\\
\;\;\;\;e^{-{M}^{2}}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < -9.5e5Initial program 80.2%
Taylor expanded in K around 0 91.4%
cos-neg91.4%
sub-neg91.4%
sub-neg91.4%
associate--r+91.4%
*-commutative91.4%
associate--r+91.4%
Simplified91.4%
Taylor expanded in m around 0 68.2%
+-commutative68.2%
unpow268.2%
distribute-rgt-out71.9%
Simplified71.9%
Taylor expanded in l around inf 17.2%
mul-1-neg17.2%
Simplified17.2%
pow117.2%
add-sqr-sqrt17.2%
sqrt-unprod17.2%
sqr-neg17.2%
sqrt-unprod0.0%
add-sqr-sqrt75.7%
Applied egg-rr75.7%
unpow175.7%
Simplified75.7%
if -9.5e5 < l < 720Initial program 67.8%
Taylor expanded in K around 0 94.9%
cos-neg94.9%
sub-neg94.9%
sub-neg94.9%
associate--r+94.9%
*-commutative94.9%
associate--r+94.9%
Simplified94.9%
Taylor expanded in m around 0 70.5%
+-commutative70.5%
unpow270.5%
distribute-rgt-out75.6%
Simplified75.6%
Taylor expanded in M around 0 75.6%
Taylor expanded in M around inf 68.2%
mul-1-neg68.2%
Simplified68.2%
if 720 < l Initial program 85.7%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 82.3%
+-commutative82.3%
unpow282.3%
distribute-rgt-out87.7%
Simplified87.7%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
Simplified100.0%
Taylor expanded in M around 0 100.0%
Final simplification77.5%
(FPCore (K m n M l) :precision binary64 (if (<= l -3400000000000.0) (* (cos M) (exp l)) (if (<= l 0.0065) (exp (* m (- M (* n 0.5)))) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -3400000000000.0) {
tmp = cos(M) * exp(l);
} else if (l <= 0.0065) {
tmp = exp((m * (M - (n * 0.5))));
} else {
tmp = exp(-l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= (-3400000000000.0d0)) then
tmp = cos(m_1) * exp(l)
else if (l <= 0.0065d0) then
tmp = exp((m * (m_1 - (n * 0.5d0))))
else
tmp = exp(-l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= -3400000000000.0) {
tmp = Math.cos(M) * Math.exp(l);
} else if (l <= 0.0065) {
tmp = Math.exp((m * (M - (n * 0.5))));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= -3400000000000.0: tmp = math.cos(M) * math.exp(l) elif l <= 0.0065: tmp = math.exp((m * (M - (n * 0.5)))) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= -3400000000000.0) tmp = Float64(cos(M) * exp(l)); elseif (l <= 0.0065) tmp = exp(Float64(m * Float64(M - Float64(n * 0.5)))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= -3400000000000.0) tmp = cos(M) * exp(l); elseif (l <= 0.0065) tmp = exp((m * (M - (n * 0.5)))); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, -3400000000000.0], N[(N[Cos[M], $MachinePrecision] * N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.0065], N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3400000000000:\\
\;\;\;\;\cos M \cdot e^{\ell}\\
\mathbf{elif}\;\ell \leq 0.0065:\\
\;\;\;\;e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < -3.4e12Initial program 81.3%
Taylor expanded in K around 0 91.3%
cos-neg91.3%
sub-neg91.3%
sub-neg91.3%
associate--r+91.3%
*-commutative91.3%
associate--r+91.3%
Simplified91.3%
Taylor expanded in m around 0 67.8%
+-commutative67.8%
unpow267.8%
distribute-rgt-out71.6%
Simplified71.6%
Taylor expanded in l around inf 17.4%
mul-1-neg17.4%
Simplified17.4%
pow117.4%
add-sqr-sqrt17.4%
sqrt-unprod17.4%
sqr-neg17.4%
sqrt-unprod0.0%
add-sqr-sqrt75.4%
Applied egg-rr75.4%
unpow175.4%
Simplified75.4%
if -3.4e12 < l < 0.0064999999999999997Initial program 67.8%
Taylor expanded in K around 0 94.9%
cos-neg94.9%
sub-neg94.9%
sub-neg94.9%
associate--r+94.9%
*-commutative94.9%
associate--r+94.9%
Simplified94.9%
Taylor expanded in m around 0 70.5%
+-commutative70.5%
unpow270.5%
distribute-rgt-out75.6%
Simplified75.6%
Taylor expanded in M around 0 75.6%
Taylor expanded in m around inf 44.9%
if 0.0064999999999999997 < l Initial program 84.2%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 82.6%
+-commutative82.6%
unpow282.6%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in l around inf 98.3%
mul-1-neg98.3%
Simplified98.3%
Taylor expanded in M around 0 98.3%
Final simplification66.3%
(FPCore (K m n M l) :precision binary64 (if (<= l 0.0065) (exp (* m (- M (* n 0.5)))) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.0065) {
tmp = exp((m * (M - (n * 0.5))));
} else {
tmp = exp(-l);
}
return tmp;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 0.0065d0) then
tmp = exp((m * (m_1 - (n * 0.5d0))))
else
tmp = exp(-l)
end if
code = tmp
end function
public static double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.0065) {
tmp = Math.exp((m * (M - (n * 0.5))));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 0.0065: tmp = math.exp((m * (M - (n * 0.5)))) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 0.0065) tmp = exp(Float64(m * Float64(M - Float64(n * 0.5)))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 0.0065) tmp = exp((m * (M - (n * 0.5)))); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 0.0065], N[Exp[N[(m * N[(M - N[(n * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.0065:\\
\;\;\;\;e^{m \cdot \left(M - n \cdot 0.5\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < 0.0064999999999999997Initial program 73.2%
Taylor expanded in K around 0 93.4%
cos-neg93.4%
sub-neg93.4%
sub-neg93.4%
associate--r+93.4%
*-commutative93.4%
associate--r+93.4%
Simplified93.4%
Taylor expanded in m around 0 69.4%
+-commutative69.4%
unpow269.4%
distribute-rgt-out74.0%
Simplified74.0%
Taylor expanded in M around 0 73.5%
Taylor expanded in m around inf 41.4%
if 0.0064999999999999997 < l Initial program 84.2%
Taylor expanded in K around 0 100.0%
cos-neg100.0%
sub-neg100.0%
sub-neg100.0%
associate--r+100.0%
*-commutative100.0%
associate--r+100.0%
Simplified100.0%
Taylor expanded in m around 0 82.6%
+-commutative82.6%
unpow282.6%
distribute-rgt-out87.9%
Simplified87.9%
Taylor expanded in l around inf 98.3%
mul-1-neg98.3%
Simplified98.3%
Taylor expanded in M around 0 98.3%
Final simplification54.1%
(FPCore (K m n M l) :precision binary64 (exp (- l)))
double code(double K, double m, double n, double M, double l) {
return exp(-l);
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = exp(-l)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.exp(-l);
}
def code(K, m, n, M, l): return math.exp(-l)
function code(K, m, n, M, l) return exp(Float64(-l)) end
function tmp = code(K, m, n, M, l) tmp = exp(-l); end
code[K_, m_, n_, M_, l_] := N[Exp[(-l)], $MachinePrecision]
\begin{array}{l}
\\
e^{-\ell}
\end{array}
Initial program 75.7%
Taylor expanded in K around 0 94.9%
cos-neg94.9%
sub-neg94.9%
sub-neg94.9%
associate--r+94.9%
*-commutative94.9%
associate--r+94.9%
Simplified94.9%
Taylor expanded in m around 0 72.4%
+-commutative72.4%
unpow272.4%
distribute-rgt-out77.1%
Simplified77.1%
Taylor expanded in l around inf 32.2%
mul-1-neg32.2%
Simplified32.2%
Taylor expanded in M around 0 31.8%
Final simplification31.8%
(FPCore (K m n M l) :precision binary64 (cos M))
double code(double K, double m, double n, double M, double l) {
return cos(M);
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = cos(m_1)
end function
public static double code(double K, double m, double n, double M, double l) {
return Math.cos(M);
}
def code(K, m, n, M, l): return math.cos(M)
function code(K, m, n, M, l) return cos(M) end
function tmp = code(K, m, n, M, l) tmp = cos(M); end
code[K_, m_, n_, M_, l_] := N[Cos[M], $MachinePrecision]
\begin{array}{l}
\\
\cos M
\end{array}
Initial program 75.7%
Taylor expanded in K around 0 94.9%
cos-neg94.9%
sub-neg94.9%
sub-neg94.9%
associate--r+94.9%
*-commutative94.9%
associate--r+94.9%
Simplified94.9%
Taylor expanded in m around 0 72.4%
+-commutative72.4%
unpow272.4%
distribute-rgt-out77.1%
Simplified77.1%
Taylor expanded in l around inf 32.2%
mul-1-neg32.2%
Simplified32.2%
Taylor expanded in l around 0 6.4%
Final simplification6.4%
herbie shell --seed 2024041
(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)))))))