
(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 13 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 69.8%
associate-/l*69.7%
associate--r-69.7%
Simplified69.7%
Taylor expanded in K around 0 96.3%
Simplified96.3%
Final simplification96.3%
(FPCore (K m n M l) :precision binary64 (if (<= n 68000.0) (/ (cos M) (exp (+ (- l (fabs (- m n))) (* (* m m) 0.25)))) (pow (exp n) (* n -0.25))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 68000.0) {
tmp = cos(M) / exp(((l - fabs((m - n))) + ((m * m) * 0.25)));
} else {
tmp = pow(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 <= 68000.0d0) then
tmp = cos(m_1) / exp(((l - abs((m - n))) + ((m * m) * 0.25d0)))
else
tmp = 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 <= 68000.0) {
tmp = Math.cos(M) / Math.exp(((l - Math.abs((m - n))) + ((m * m) * 0.25)));
} else {
tmp = Math.pow(Math.exp(n), (n * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 68000.0: tmp = math.cos(M) / math.exp(((l - math.fabs((m - n))) + ((m * m) * 0.25))) else: tmp = math.pow(math.exp(n), (n * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 68000.0) tmp = Float64(cos(M) / exp(Float64(Float64(l - abs(Float64(m - n))) + Float64(Float64(m * m) * 0.25)))); else tmp = exp(n) ^ Float64(n * -0.25); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 68000.0) tmp = cos(M) / exp(((l - abs((m - n))) + ((m * m) * 0.25))); else tmp = exp(n) ^ (n * -0.25); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 68000.0], N[(N[Cos[M], $MachinePrecision] / N[Exp[N[(N[(l - N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(m * m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[Power[N[Exp[n], $MachinePrecision], N[(n * -0.25), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 68000:\\
\;\;\;\;\frac{\cos M}{e^{\left(\ell - \left|m - n\right|\right) + \left(m \cdot m\right) \cdot 0.25}}\\
\mathbf{else}:\\
\;\;\;\;{\left(e^{n}\right)}^{\left(n \cdot -0.25\right)}\\
\end{array}
\end{array}
if n < 68000Initial program 74.0%
Simplified74.0%
Taylor expanded in m around inf 52.9%
*-commutative52.9%
unpow252.9%
Simplified52.9%
Taylor expanded in K around 0 68.7%
cos-neg38.1%
Simplified68.7%
if 68000 < n Initial program 57.6%
associate-/l*57.6%
associate--r-57.6%
Simplified57.6%
Taylor expanded in K around 0 100.0%
Simplified100.0%
Taylor expanded in n around inf 77.6%
unpow277.6%
associate-*r*77.6%
Simplified77.6%
Taylor expanded in n around inf 97.0%
*-commutative97.0%
unpow297.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in M around 0 97.0%
*-commutative97.0%
unpow297.0%
associate-*r*97.0%
exp-prod97.0%
Simplified97.0%
Final simplification76.0%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (pow (exp n) (* n -0.25))))
(if (<= n -55.0)
t_0
(if (<= n -7.6e-295)
(exp (* m (- (+ (* n 0.5) 1.0) M)))
(if (<= n 4.3e-187)
(/ (cos (- (* 0.5 (* n K)) M)) (exp l))
(if (<= n 54.0)
(exp (+ (* n (* n 0.25)) (* n (+ (- (* m 0.5) M) -1.0))))
t_0))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = pow(exp(n), (n * -0.25));
double tmp;
if (n <= -55.0) {
tmp = t_0;
} else if (n <= -7.6e-295) {
tmp = exp((m * (((n * 0.5) + 1.0) - M)));
} else if (n <= 4.3e-187) {
tmp = cos(((0.5 * (n * K)) - M)) / exp(l);
} else if (n <= 54.0) {
tmp = exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0))));
} 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(n) ** (n * (-0.25d0))
if (n <= (-55.0d0)) then
tmp = t_0
else if (n <= (-7.6d-295)) then
tmp = exp((m * (((n * 0.5d0) + 1.0d0) - m_1)))
else if (n <= 4.3d-187) then
tmp = cos(((0.5d0 * (n * k)) - m_1)) / exp(l)
else if (n <= 54.0d0) then
tmp = exp(((n * (n * 0.25d0)) + (n * (((m * 0.5d0) - m_1) + (-1.0d0)))))
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.pow(Math.exp(n), (n * -0.25));
double tmp;
if (n <= -55.0) {
tmp = t_0;
} else if (n <= -7.6e-295) {
tmp = Math.exp((m * (((n * 0.5) + 1.0) - M)));
} else if (n <= 4.3e-187) {
tmp = Math.cos(((0.5 * (n * K)) - M)) / Math.exp(l);
} else if (n <= 54.0) {
tmp = Math.exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.pow(math.exp(n), (n * -0.25)) tmp = 0 if n <= -55.0: tmp = t_0 elif n <= -7.6e-295: tmp = math.exp((m * (((n * 0.5) + 1.0) - M))) elif n <= 4.3e-187: tmp = math.cos(((0.5 * (n * K)) - M)) / math.exp(l) elif n <= 54.0: tmp = math.exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0)))) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = exp(n) ^ Float64(n * -0.25) tmp = 0.0 if (n <= -55.0) tmp = t_0; elseif (n <= -7.6e-295) tmp = exp(Float64(m * Float64(Float64(Float64(n * 0.5) + 1.0) - M))); elseif (n <= 4.3e-187) tmp = Float64(cos(Float64(Float64(0.5 * Float64(n * K)) - M)) / exp(l)); elseif (n <= 54.0) tmp = exp(Float64(Float64(n * Float64(n * 0.25)) + Float64(n * Float64(Float64(Float64(m * 0.5) - M) + -1.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(n) ^ (n * -0.25); tmp = 0.0; if (n <= -55.0) tmp = t_0; elseif (n <= -7.6e-295) tmp = exp((m * (((n * 0.5) + 1.0) - M))); elseif (n <= 4.3e-187) tmp = cos(((0.5 * (n * K)) - M)) / exp(l); elseif (n <= 54.0) tmp = exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Power[N[Exp[n], $MachinePrecision], N[(n * -0.25), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -55.0], t$95$0, If[LessEqual[n, -7.6e-295], N[Exp[N[(m * N[(N[(N[(n * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 4.3e-187], N[(N[Cos[N[(N[(0.5 * N[(n * K), $MachinePrecision]), $MachinePrecision] - M), $MachinePrecision]], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[Exp[N[(N[(n * N[(n * 0.25), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(e^{n}\right)}^{\left(n \cdot -0.25\right)}\\
\mathbf{if}\;n \leq -55:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -7.6 \cdot 10^{-295}:\\
\;\;\;\;e^{m \cdot \left(\left(n \cdot 0.5 + 1\right) - M\right)}\\
\mathbf{elif}\;n \leq 4.3 \cdot 10^{-187}:\\
\;\;\;\;\frac{\cos \left(0.5 \cdot \left(n \cdot K\right) - M\right)}{e^{\ell}}\\
\mathbf{elif}\;n \leq 54:\\
\;\;\;\;e^{n \cdot \left(n \cdot 0.25\right) + n \cdot \left(\left(m \cdot 0.5 - M\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -55 or 54 < n Initial program 63.3%
associate-/l*63.3%
associate--r-63.3%
Simplified63.3%
Taylor expanded in K around 0 100.0%
Simplified100.0%
Taylor expanded in n around inf 83.1%
unpow283.1%
associate-*r*83.1%
Simplified83.1%
Taylor expanded in n around inf 97.7%
*-commutative97.7%
unpow297.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in M around 0 97.7%
*-commutative97.7%
unpow297.7%
associate-*r*97.7%
exp-prod97.7%
Simplified97.7%
if -55 < n < -7.60000000000000037e-295Initial program 78.8%
associate-/l*78.8%
associate--r-78.8%
Simplified78.8%
add-exp-log75.7%
*-commutative75.7%
log-prod49.5%
Applied egg-rr23.7%
Taylor expanded in K around 0 26.2%
associate--l+26.2%
+-commutative26.2%
+-commutative26.2%
cos-neg26.2%
Simplified26.2%
Taylor expanded in m around inf 23.2%
fma-def23.2%
unpow223.2%
*-commutative23.2%
associate--l+23.2%
*-commutative23.2%
Simplified23.2%
Taylor expanded in m around 0 49.1%
if -7.60000000000000037e-295 < n < 4.3e-187Initial program 76.1%
Simplified76.1%
Taylor expanded in l around inf 56.8%
Taylor expanded in m around 0 61.9%
if 4.3e-187 < n < 54Initial program 72.0%
associate-/l*71.6%
associate--r-71.6%
Simplified71.6%
add-exp-log71.6%
*-commutative71.6%
log-prod47.9%
Applied egg-rr13.5%
Taylor expanded in K around 0 14.5%
associate--l+14.5%
+-commutative14.5%
+-commutative14.5%
cos-neg14.5%
Simplified14.5%
Taylor expanded in n around -inf 32.2%
+-commutative32.2%
mul-1-neg32.2%
unsub-neg32.2%
unpow232.2%
associate-*r*32.2%
mul-1-neg32.2%
unsub-neg32.2%
*-commutative32.2%
Simplified32.2%
Final simplification72.1%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (exp (- (fabs (- m n)) (* (* m m) 0.25)))))
(if (<= n 5.6e-289)
t_0
(if (<= n 7.5e-224)
(/ (cos M) (exp l))
(if (<= n 54.0) t_0 (pow (exp n) (* n -0.25)))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = exp((fabs((m - n)) - ((m * m) * 0.25)));
double tmp;
if (n <= 5.6e-289) {
tmp = t_0;
} else if (n <= 7.5e-224) {
tmp = cos(M) / exp(l);
} else if (n <= 54.0) {
tmp = t_0;
} else {
tmp = pow(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) :: t_0
real(8) :: tmp
t_0 = exp((abs((m - n)) - ((m * m) * 0.25d0)))
if (n <= 5.6d-289) then
tmp = t_0
else if (n <= 7.5d-224) then
tmp = cos(m_1) / exp(l)
else if (n <= 54.0d0) then
tmp = t_0
else
tmp = 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 t_0 = Math.exp((Math.abs((m - n)) - ((m * m) * 0.25)));
double tmp;
if (n <= 5.6e-289) {
tmp = t_0;
} else if (n <= 7.5e-224) {
tmp = Math.cos(M) / Math.exp(l);
} else if (n <= 54.0) {
tmp = t_0;
} else {
tmp = Math.pow(Math.exp(n), (n * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.exp((math.fabs((m - n)) - ((m * m) * 0.25))) tmp = 0 if n <= 5.6e-289: tmp = t_0 elif n <= 7.5e-224: tmp = math.cos(M) / math.exp(l) elif n <= 54.0: tmp = t_0 else: tmp = math.pow(math.exp(n), (n * -0.25)) return tmp
function code(K, m, n, M, l) t_0 = exp(Float64(abs(Float64(m - n)) - Float64(Float64(m * m) * 0.25))) tmp = 0.0 if (n <= 5.6e-289) tmp = t_0; elseif (n <= 7.5e-224) tmp = Float64(cos(M) / exp(l)); elseif (n <= 54.0) tmp = t_0; else tmp = exp(n) ^ Float64(n * -0.25); end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp((abs((m - n)) - ((m * m) * 0.25))); tmp = 0.0; if (n <= 5.6e-289) tmp = t_0; elseif (n <= 7.5e-224) tmp = cos(M) / exp(l); elseif (n <= 54.0) tmp = t_0; else tmp = exp(n) ^ (n * -0.25); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - N[(N[(m * m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, 5.6e-289], t$95$0, If[LessEqual[n, 7.5e-224], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], t$95$0, N[Power[N[Exp[n], $MachinePrecision], N[(n * -0.25), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\left|m - n\right| - \left(m \cdot m\right) \cdot 0.25}\\
\mathbf{if}\;n \leq 5.6 \cdot 10^{-289}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq 7.5 \cdot 10^{-224}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\mathbf{elif}\;n \leq 54:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;{\left(e^{n}\right)}^{\left(n \cdot -0.25\right)}\\
\end{array}
\end{array}
if n < 5.5999999999999997e-289 or 7.49999999999999978e-224 < n < 54Initial program 73.5%
Simplified73.5%
Taylor expanded in m around inf 51.1%
*-commutative51.1%
unpow251.1%
Simplified51.1%
Taylor expanded in K around 0 67.3%
cos-neg36.3%
Simplified67.3%
Taylor expanded in M around 0 66.7%
rec-exp66.7%
associate--l+66.7%
associate--l+66.7%
unpow266.7%
Simplified66.7%
Taylor expanded in l around 0 55.7%
unpow255.7%
fabs-sub55.7%
Simplified55.7%
if 5.5999999999999997e-289 < n < 7.49999999999999978e-224Initial program 82.0%
Simplified82.0%
Taylor expanded in l around inf 64.3%
Taylor expanded in K around 0 66.3%
cos-neg66.3%
Simplified66.3%
if 54 < n Initial program 57.6%
associate-/l*57.6%
associate--r-57.6%
Simplified57.6%
Taylor expanded in K around 0 100.0%
Simplified100.0%
Taylor expanded in n around inf 77.6%
unpow277.6%
associate-*r*77.6%
Simplified77.6%
Taylor expanded in n around inf 97.0%
*-commutative97.0%
unpow297.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in M around 0 97.0%
*-commutative97.0%
unpow297.0%
associate-*r*97.0%
exp-prod97.0%
Simplified97.0%
Final simplification66.8%
(FPCore (K m n M l) :precision binary64 (if (<= n 68000.0) (exp (- (fabs (- m n)) (+ l (* (* m m) 0.25)))) (pow (exp n) (* n -0.25))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (n <= 68000.0) {
tmp = exp((fabs((m - n)) - (l + ((m * m) * 0.25))));
} else {
tmp = pow(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 <= 68000.0d0) then
tmp = exp((abs((m - n)) - (l + ((m * m) * 0.25d0))))
else
tmp = 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 <= 68000.0) {
tmp = Math.exp((Math.abs((m - n)) - (l + ((m * m) * 0.25))));
} else {
tmp = Math.pow(Math.exp(n), (n * -0.25));
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if n <= 68000.0: tmp = math.exp((math.fabs((m - n)) - (l + ((m * m) * 0.25)))) else: tmp = math.pow(math.exp(n), (n * -0.25)) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (n <= 68000.0) tmp = exp(Float64(abs(Float64(m - n)) - Float64(l + Float64(Float64(m * m) * 0.25)))); else tmp = exp(n) ^ Float64(n * -0.25); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (n <= 68000.0) tmp = exp((abs((m - n)) - (l + ((m * m) * 0.25)))); else tmp = exp(n) ^ (n * -0.25); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[n, 68000.0], N[Exp[N[(N[Abs[N[(m - n), $MachinePrecision]], $MachinePrecision] - N[(l + N[(N[(m * m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Power[N[Exp[n], $MachinePrecision], N[(n * -0.25), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;n \leq 68000:\\
\;\;\;\;e^{\left|m - n\right| - \left(\ell + \left(m \cdot m\right) \cdot 0.25\right)}\\
\mathbf{else}:\\
\;\;\;\;{\left(e^{n}\right)}^{\left(n \cdot -0.25\right)}\\
\end{array}
\end{array}
if n < 68000Initial program 74.0%
Simplified74.0%
Taylor expanded in m around inf 52.9%
*-commutative52.9%
unpow252.9%
Simplified52.9%
Taylor expanded in K around 0 68.7%
cos-neg38.1%
Simplified68.7%
Taylor expanded in M around 0 68.2%
rec-exp68.2%
associate--l+68.2%
associate--l+68.2%
unpow268.2%
Simplified68.2%
if 68000 < n Initial program 57.6%
associate-/l*57.6%
associate--r-57.6%
Simplified57.6%
Taylor expanded in K around 0 100.0%
Simplified100.0%
Taylor expanded in n around inf 77.6%
unpow277.6%
associate-*r*77.6%
Simplified77.6%
Taylor expanded in n around inf 97.0%
*-commutative97.0%
unpow297.0%
associate-*l*97.0%
Simplified97.0%
Taylor expanded in M around 0 97.0%
*-commutative97.0%
unpow297.0%
associate-*r*97.0%
exp-prod97.0%
Simplified97.0%
Final simplification75.6%
(FPCore (K m n M l)
:precision binary64
(let* ((t_0 (pow (exp n) (* n -0.25))))
(if (<= n -52.0)
t_0
(if (<= n -7.6e-295)
(exp (* m (- (+ (* n 0.5) 1.0) M)))
(if (<= n 1.4e-180)
(/ (cos M) (exp l))
(if (<= n 54.0)
(exp (+ (* n (* n 0.25)) (* n (+ (- (* m 0.5) M) -1.0))))
t_0))))))
double code(double K, double m, double n, double M, double l) {
double t_0 = pow(exp(n), (n * -0.25));
double tmp;
if (n <= -52.0) {
tmp = t_0;
} else if (n <= -7.6e-295) {
tmp = exp((m * (((n * 0.5) + 1.0) - M)));
} else if (n <= 1.4e-180) {
tmp = cos(M) / exp(l);
} else if (n <= 54.0) {
tmp = exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0))));
} 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(n) ** (n * (-0.25d0))
if (n <= (-52.0d0)) then
tmp = t_0
else if (n <= (-7.6d-295)) then
tmp = exp((m * (((n * 0.5d0) + 1.0d0) - m_1)))
else if (n <= 1.4d-180) then
tmp = cos(m_1) / exp(l)
else if (n <= 54.0d0) then
tmp = exp(((n * (n * 0.25d0)) + (n * (((m * 0.5d0) - m_1) + (-1.0d0)))))
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.pow(Math.exp(n), (n * -0.25));
double tmp;
if (n <= -52.0) {
tmp = t_0;
} else if (n <= -7.6e-295) {
tmp = Math.exp((m * (((n * 0.5) + 1.0) - M)));
} else if (n <= 1.4e-180) {
tmp = Math.cos(M) / Math.exp(l);
} else if (n <= 54.0) {
tmp = Math.exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(K, m, n, M, l): t_0 = math.pow(math.exp(n), (n * -0.25)) tmp = 0 if n <= -52.0: tmp = t_0 elif n <= -7.6e-295: tmp = math.exp((m * (((n * 0.5) + 1.0) - M))) elif n <= 1.4e-180: tmp = math.cos(M) / math.exp(l) elif n <= 54.0: tmp = math.exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0)))) else: tmp = t_0 return tmp
function code(K, m, n, M, l) t_0 = exp(n) ^ Float64(n * -0.25) tmp = 0.0 if (n <= -52.0) tmp = t_0; elseif (n <= -7.6e-295) tmp = exp(Float64(m * Float64(Float64(Float64(n * 0.5) + 1.0) - M))); elseif (n <= 1.4e-180) tmp = Float64(cos(M) / exp(l)); elseif (n <= 54.0) tmp = exp(Float64(Float64(n * Float64(n * 0.25)) + Float64(n * Float64(Float64(Float64(m * 0.5) - M) + -1.0)))); else tmp = t_0; end return tmp end
function tmp_2 = code(K, m, n, M, l) t_0 = exp(n) ^ (n * -0.25); tmp = 0.0; if (n <= -52.0) tmp = t_0; elseif (n <= -7.6e-295) tmp = exp((m * (((n * 0.5) + 1.0) - M))); elseif (n <= 1.4e-180) tmp = cos(M) / exp(l); elseif (n <= 54.0) tmp = exp(((n * (n * 0.25)) + (n * (((m * 0.5) - M) + -1.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := Block[{t$95$0 = N[Power[N[Exp[n], $MachinePrecision], N[(n * -0.25), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[n, -52.0], t$95$0, If[LessEqual[n, -7.6e-295], N[Exp[N[(m * N[(N[(N[(n * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[n, 1.4e-180], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision], If[LessEqual[n, 54.0], N[Exp[N[(N[(n * N[(n * 0.25), $MachinePrecision]), $MachinePrecision] + N[(n * N[(N[(N[(m * 0.5), $MachinePrecision] - M), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(e^{n}\right)}^{\left(n \cdot -0.25\right)}\\
\mathbf{if}\;n \leq -52:\\
\;\;\;\;t_0\\
\mathbf{elif}\;n \leq -7.6 \cdot 10^{-295}:\\
\;\;\;\;e^{m \cdot \left(\left(n \cdot 0.5 + 1\right) - M\right)}\\
\mathbf{elif}\;n \leq 1.4 \cdot 10^{-180}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\mathbf{elif}\;n \leq 54:\\
\;\;\;\;e^{n \cdot \left(n \cdot 0.25\right) + n \cdot \left(\left(m \cdot 0.5 - M\right) + -1\right)}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if n < -52 or 54 < n Initial program 63.3%
associate-/l*63.3%
associate--r-63.3%
Simplified63.3%
Taylor expanded in K around 0 100.0%
Simplified100.0%
Taylor expanded in n around inf 83.1%
unpow283.1%
associate-*r*83.1%
Simplified83.1%
Taylor expanded in n around inf 97.7%
*-commutative97.7%
unpow297.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in M around 0 97.7%
*-commutative97.7%
unpow297.7%
associate-*r*97.7%
exp-prod97.7%
Simplified97.7%
if -52 < n < -7.60000000000000037e-295Initial program 78.8%
associate-/l*78.8%
associate--r-78.8%
Simplified78.8%
add-exp-log75.7%
*-commutative75.7%
log-prod49.5%
Applied egg-rr23.7%
Taylor expanded in K around 0 26.2%
associate--l+26.2%
+-commutative26.2%
+-commutative26.2%
cos-neg26.2%
Simplified26.2%
Taylor expanded in m around inf 23.2%
fma-def23.2%
unpow223.2%
*-commutative23.2%
associate--l+23.2%
*-commutative23.2%
Simplified23.2%
Taylor expanded in m around 0 49.1%
if -7.60000000000000037e-295 < n < 1.39999999999999999e-180Initial program 73.8%
Simplified73.8%
Taylor expanded in l around inf 50.4%
Taylor expanded in K around 0 52.9%
cos-neg52.9%
Simplified52.9%
if 1.39999999999999999e-180 < n < 54Initial program 73.6%
associate-/l*73.6%
associate--r-73.6%
Simplified73.6%
add-exp-log73.6%
*-commutative73.6%
log-prod50.0%
Applied egg-rr14.0%
Taylor expanded in K around 0 14.4%
associate--l+14.4%
+-commutative14.4%
+-commutative14.4%
cos-neg14.4%
Simplified14.4%
Taylor expanded in n around -inf 34.1%
+-commutative34.1%
mul-1-neg34.1%
unsub-neg34.1%
unpow234.1%
associate-*r*34.1%
mul-1-neg34.1%
unsub-neg34.1%
*-commutative34.1%
Simplified34.1%
Final simplification71.8%
(FPCore (K m n M l) :precision binary64 (if (<= l 0.8) (exp (* m (- (+ (* n 0.5) 1.0) M))) (/ (cos M) (exp l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.8) {
tmp = exp((m * (((n * 0.5) + 1.0) - M)));
} 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 <= 0.8d0) then
tmp = exp((m * (((n * 0.5d0) + 1.0d0) - m_1)))
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 <= 0.8) {
tmp = Math.exp((m * (((n * 0.5) + 1.0) - M)));
} else {
tmp = Math.cos(M) / Math.exp(l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 0.8: tmp = math.exp((m * (((n * 0.5) + 1.0) - M))) else: tmp = math.cos(M) / math.exp(l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 0.8) tmp = exp(Float64(m * Float64(Float64(Float64(n * 0.5) + 1.0) - M))); 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 <= 0.8) tmp = exp((m * (((n * 0.5) + 1.0) - M))); else tmp = cos(M) / exp(l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 0.8], N[Exp[N[(m * N[(N[(N[(n * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(N[Cos[M], $MachinePrecision] / N[Exp[l], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.8:\\
\;\;\;\;e^{m \cdot \left(\left(n \cdot 0.5 + 1\right) - M\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos M}{e^{\ell}}\\
\end{array}
\end{array}
if l < 0.80000000000000004Initial program 69.1%
associate-/l*69.0%
associate--r-69.0%
Simplified69.0%
add-exp-log67.9%
*-commutative67.9%
log-prod38.3%
Applied egg-rr11.3%
Taylor expanded in K around 0 12.9%
associate--l+12.9%
+-commutative12.9%
+-commutative12.9%
cos-neg12.9%
Simplified12.9%
Taylor expanded in m around inf 24.6%
fma-def24.6%
unpow224.6%
*-commutative24.6%
associate--l+24.6%
*-commutative24.6%
Simplified24.6%
Taylor expanded in m around 0 44.6%
if 0.80000000000000004 < l Initial program 71.6%
Simplified71.6%
Taylor expanded in l around inf 71.0%
Taylor expanded in K around 0 97.9%
cos-neg97.9%
Simplified97.9%
Final simplification58.5%
(FPCore (K m n M l) :precision binary64 (if (<= l 0.75) (exp (* m (- (+ (* n 0.5) 1.0) M))) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.75) {
tmp = exp((m * (((n * 0.5) + 1.0) - M)));
} 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.75d0) then
tmp = exp((m * (((n * 0.5d0) + 1.0d0) - m_1)))
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.75) {
tmp = Math.exp((m * (((n * 0.5) + 1.0) - M)));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 0.75: tmp = math.exp((m * (((n * 0.5) + 1.0) - M))) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 0.75) tmp = exp(Float64(m * Float64(Float64(Float64(n * 0.5) + 1.0) - M))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 0.75) tmp = exp((m * (((n * 0.5) + 1.0) - M))); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 0.75], N[Exp[N[(m * N[(N[(N[(n * 0.5), $MachinePrecision] + 1.0), $MachinePrecision] - M), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.75:\\
\;\;\;\;e^{m \cdot \left(\left(n \cdot 0.5 + 1\right) - M\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < 0.75Initial program 69.1%
associate-/l*69.0%
associate--r-69.0%
Simplified69.0%
add-exp-log67.9%
*-commutative67.9%
log-prod38.3%
Applied egg-rr11.3%
Taylor expanded in K around 0 12.9%
associate--l+12.9%
+-commutative12.9%
+-commutative12.9%
cos-neg12.9%
Simplified12.9%
Taylor expanded in m around inf 24.6%
fma-def24.6%
unpow224.6%
*-commutative24.6%
associate--l+24.6%
*-commutative24.6%
Simplified24.6%
Taylor expanded in m around 0 44.6%
if 0.75 < l Initial program 71.6%
Simplified71.6%
Taylor expanded in l around inf 71.0%
Taylor expanded in K around 0 97.9%
cos-neg97.9%
Simplified97.9%
Taylor expanded in M around 0 97.9%
rec-exp97.9%
Simplified97.9%
Final simplification58.5%
(FPCore (K m n M l) :precision binary64 (if (<= l 4.2e-300) (exp (* n (* m 0.5))) (if (<= l 0.004) (exp (* M (- m))) (exp (- l)))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 4.2e-300) {
tmp = exp((n * (m * 0.5)));
} else if (l <= 0.004) {
tmp = exp((M * -m));
} 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 <= 4.2d-300) then
tmp = exp((n * (m * 0.5d0)))
else if (l <= 0.004d0) then
tmp = exp((m_1 * -m))
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 <= 4.2e-300) {
tmp = Math.exp((n * (m * 0.5)));
} else if (l <= 0.004) {
tmp = Math.exp((M * -m));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 4.2e-300: tmp = math.exp((n * (m * 0.5))) elif l <= 0.004: tmp = math.exp((M * -m)) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 4.2e-300) tmp = exp(Float64(n * Float64(m * 0.5))); elseif (l <= 0.004) tmp = exp(Float64(M * Float64(-m))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 4.2e-300) tmp = exp((n * (m * 0.5))); elseif (l <= 0.004) tmp = exp((M * -m)); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 4.2e-300], N[Exp[N[(n * N[(m * 0.5), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[l, 0.004], N[Exp[N[(M * (-m)), $MachinePrecision]], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.2 \cdot 10^{-300}:\\
\;\;\;\;e^{n \cdot \left(m \cdot 0.5\right)}\\
\mathbf{elif}\;\ell \leq 0.004:\\
\;\;\;\;e^{M \cdot \left(-m\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < 4.20000000000000007e-300Initial program 70.6%
associate-/l*70.6%
associate--r-70.6%
Simplified70.6%
add-exp-log68.9%
*-commutative68.9%
log-prod38.4%
Applied egg-rr11.8%
Taylor expanded in K around 0 13.5%
associate--l+13.5%
+-commutative13.5%
+-commutative13.5%
cos-neg13.5%
Simplified13.5%
Taylor expanded in m around inf 24.3%
fma-def24.3%
unpow224.3%
*-commutative24.3%
associate--l+24.3%
*-commutative24.3%
Simplified24.3%
Taylor expanded in n around inf 34.1%
*-commutative34.1%
associate-*l*34.1%
Simplified34.1%
if 4.20000000000000007e-300 < l < 0.0040000000000000001Initial program 66.8%
associate-/l*66.6%
associate--r-66.6%
Simplified66.6%
add-exp-log66.5%
*-commutative66.5%
log-prod38.1%
Applied egg-rr10.4%
Taylor expanded in K around 0 12.1%
associate--l+12.1%
+-commutative12.1%
+-commutative12.1%
cos-neg12.1%
Simplified12.1%
Taylor expanded in m around inf 25.1%
fma-def25.1%
unpow225.1%
*-commutative25.1%
associate--l+25.1%
*-commutative25.1%
Simplified25.1%
Taylor expanded in M around inf 37.6%
associate-*r*37.6%
neg-mul-137.6%
Simplified37.6%
if 0.0040000000000000001 < l Initial program 71.6%
Simplified71.6%
Taylor expanded in l around inf 71.0%
Taylor expanded in K around 0 97.9%
cos-neg97.9%
Simplified97.9%
Taylor expanded in M around 0 97.9%
rec-exp97.9%
Simplified97.9%
Final simplification51.8%
(FPCore (K m n M l) :precision binary64 (if (<= l 0.41) (exp (* M (- m))) (exp (- l))))
double code(double K, double m, double n, double M, double l) {
double tmp;
if (l <= 0.41) {
tmp = exp((M * -m));
} 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.41d0) then
tmp = exp((m_1 * -m))
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.41) {
tmp = Math.exp((M * -m));
} else {
tmp = Math.exp(-l);
}
return tmp;
}
def code(K, m, n, M, l): tmp = 0 if l <= 0.41: tmp = math.exp((M * -m)) else: tmp = math.exp(-l) return tmp
function code(K, m, n, M, l) tmp = 0.0 if (l <= 0.41) tmp = exp(Float64(M * Float64(-m))); else tmp = exp(Float64(-l)); end return tmp end
function tmp_2 = code(K, m, n, M, l) tmp = 0.0; if (l <= 0.41) tmp = exp((M * -m)); else tmp = exp(-l); end tmp_2 = tmp; end
code[K_, m_, n_, M_, l_] := If[LessEqual[l, 0.41], N[Exp[N[(M * (-m)), $MachinePrecision]], $MachinePrecision], N[Exp[(-l)], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.41:\\
\;\;\;\;e^{M \cdot \left(-m\right)}\\
\mathbf{else}:\\
\;\;\;\;e^{-\ell}\\
\end{array}
\end{array}
if l < 0.409999999999999976Initial program 69.1%
associate-/l*69.0%
associate--r-69.0%
Simplified69.0%
add-exp-log67.9%
*-commutative67.9%
log-prod38.3%
Applied egg-rr11.3%
Taylor expanded in K around 0 12.9%
associate--l+12.9%
+-commutative12.9%
+-commutative12.9%
cos-neg12.9%
Simplified12.9%
Taylor expanded in m around inf 24.6%
fma-def24.6%
unpow224.6%
*-commutative24.6%
associate--l+24.6%
*-commutative24.6%
Simplified24.6%
Taylor expanded in M around inf 30.4%
associate-*r*30.4%
neg-mul-130.4%
Simplified30.4%
if 0.409999999999999976 < l Initial program 71.6%
Simplified71.6%
Taylor expanded in l around inf 71.0%
Taylor expanded in K around 0 97.9%
cos-neg97.9%
Simplified97.9%
Taylor expanded in M around 0 97.9%
rec-exp97.9%
Simplified97.9%
Final simplification48.0%
(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 69.8%
Simplified69.8%
Taylor expanded in l around inf 28.6%
Taylor expanded in K around 0 37.0%
cos-neg37.0%
Simplified37.0%
Taylor expanded in M around 0 36.2%
rec-exp36.2%
Simplified36.2%
Final simplification36.2%
(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 69.8%
Simplified69.8%
Taylor expanded in l around inf 28.6%
Taylor expanded in K around 0 37.0%
cos-neg37.0%
Simplified37.0%
Taylor expanded in l around 0 8.1%
Final simplification8.1%
(FPCore (K m n M l) :precision binary64 1.0)
double code(double K, double m, double n, double M, double l) {
return 1.0;
}
real(8) function code(k, m, n, m_1, l)
real(8), intent (in) :: k
real(8), intent (in) :: m
real(8), intent (in) :: n
real(8), intent (in) :: m_1
real(8), intent (in) :: l
code = 1.0d0
end function
public static double code(double K, double m, double n, double M, double l) {
return 1.0;
}
def code(K, m, n, M, l): return 1.0
function code(K, m, n, M, l) return 1.0 end
function tmp = code(K, m, n, M, l) tmp = 1.0; end
code[K_, m_, n_, M_, l_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 69.8%
associate-/l*69.7%
associate--r-69.7%
Simplified69.7%
add-exp-log68.9%
*-commutative68.9%
log-prod40.4%
Applied egg-rr11.4%
Taylor expanded in K around 0 14.3%
associate--l+14.3%
+-commutative14.3%
+-commutative14.3%
cos-neg14.3%
Simplified14.3%
Taylor expanded in m around inf 23.0%
fma-def23.0%
unpow223.0%
*-commutative23.0%
associate--l+23.0%
*-commutative23.0%
Simplified23.0%
Taylor expanded in m around 0 8.1%
Final simplification8.1%
herbie shell --seed 2023222
(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)))))))