
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (J l K U) :precision binary64 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U): return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U) return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U) end
function tmp = code(J, l, K, U) tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U; end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}
\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (- (exp l) (exp (- l)))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e-7)))
(+ (* (* t_1 J) t_0) U)
(+ U (* t_0 (* l (* J 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = exp(l) - exp(-l);
double tmp;
if ((t_1 <= -((double) INFINITY)) || !(t_1 <= 1e-7)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (l * (J * 2.0)));
}
return tmp;
}
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_1 <= -Double.POSITIVE_INFINITY) || !(t_1 <= 1e-7)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (l * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = math.exp(l) - math.exp(-l) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e-7): tmp = ((t_1 * J) * t_0) + U else: tmp = U + (t_0 * (l * (J * 2.0))) return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_1 <= Float64(-Inf)) || !(t_1 <= 1e-7)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(l * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = exp(l) - exp(-l); tmp = 0.0; if ((t_1 <= -Inf) || ~((t_1 <= 1e-7))) tmp = ((t_1 * J) * t_0) + U; else tmp = U + (t_0 * (l * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e-7]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{-7}\right):\\
\;\;\;\;\left(t\_1 \cdot J\right) \cdot t\_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t\_0 \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < -inf.0 or 9.9999999999999995e-8 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) Initial program 100.0%
if -inf.0 < (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l))) < 9.9999999999999995e-8Initial program 71.2%
Taylor expanded in l around 0 100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (pow l 3.0) (* (* J 0.3333333333333333) (cos (* K 0.5))))))
(t_1 (+ (* (- (exp l) (exp (- l))) J) U)))
(if (<= l -5.6e+75)
t_0
(if (<= l -0.118)
t_1
(if (<= l 7.8e-6)
(+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))
(if (<= l 5e+102) t_1 t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (pow(l, 3.0) * ((J * 0.3333333333333333) * cos((K * 0.5))));
double t_1 = ((exp(l) - exp(-l)) * J) + U;
double tmp;
if (l <= -5.6e+75) {
tmp = t_0;
} else if (l <= -0.118) {
tmp = t_1;
} else if (l <= 7.8e-6) {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 5e+102) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = u + ((l ** 3.0d0) * ((j * 0.3333333333333333d0) * cos((k * 0.5d0))))
t_1 = ((exp(l) - exp(-l)) * j) + u
if (l <= (-5.6d+75)) then
tmp = t_0
else if (l <= (-0.118d0)) then
tmp = t_1
else if (l <= 7.8d-6) then
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
else if (l <= 5d+102) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = U + (Math.pow(l, 3.0) * ((J * 0.3333333333333333) * Math.cos((K * 0.5))));
double t_1 = ((Math.exp(l) - Math.exp(-l)) * J) + U;
double tmp;
if (l <= -5.6e+75) {
tmp = t_0;
} else if (l <= -0.118) {
tmp = t_1;
} else if (l <= 7.8e-6) {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
} else if (l <= 5e+102) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.pow(l, 3.0) * ((J * 0.3333333333333333) * math.cos((K * 0.5)))) t_1 = ((math.exp(l) - math.exp(-l)) * J) + U tmp = 0 if l <= -5.6e+75: tmp = t_0 elif l <= -0.118: tmp = t_1 elif l <= 7.8e-6: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) elif l <= 5e+102: tmp = t_1 else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64((l ^ 3.0) * Float64(Float64(J * 0.3333333333333333) * cos(Float64(K * 0.5))))) t_1 = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U) tmp = 0.0 if (l <= -5.6e+75) tmp = t_0; elseif (l <= -0.118) tmp = t_1; elseif (l <= 7.8e-6) tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); elseif (l <= 5e+102) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + ((l ^ 3.0) * ((J * 0.3333333333333333) * cos((K * 0.5)))); t_1 = ((exp(l) - exp(-l)) * J) + U; tmp = 0.0; if (l <= -5.6e+75) tmp = t_0; elseif (l <= -0.118) tmp = t_1; elseif (l <= 7.8e-6) tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); elseif (l <= 5e+102) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(N[(J * 0.3333333333333333), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]}, If[LessEqual[l, -5.6e+75], t$95$0, If[LessEqual[l, -0.118], t$95$1, If[LessEqual[l, 7.8e-6], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 5e+102], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + {\ell}^{3} \cdot \left(\left(J \cdot 0.3333333333333333\right) \cdot \cos \left(K \cdot 0.5\right)\right)\\
t_1 := \left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
\mathbf{if}\;\ell \leq -5.6 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;\ell \leq -0.118:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;\ell \leq 7.8 \cdot 10^{-6}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 5 \cdot 10^{+102}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if l < -5.60000000000000023e75 or 5e102 < l Initial program 100.0%
Taylor expanded in l around 0 96.9%
Taylor expanded in l around inf 96.9%
*-commutative96.9%
associate-*r*96.9%
associate-*l*96.9%
*-commutative96.9%
associate-*r*96.9%
*-commutative96.9%
Simplified96.9%
if -5.60000000000000023e75 < l < -0.11799999999999999 or 7.7999999999999999e-6 < l < 5e102Initial program 99.9%
Taylor expanded in K around 0 79.3%
if -0.11799999999999999 < l < 7.7999999999999999e-6Initial program 71.2%
Taylor expanded in l around 0 100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification96.1%
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) 0.7) (+ U (* l (* 2.0 (* J (cos (* K 0.5)))))) (+ U (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= 0.7) {
tmp = U + (l * (2.0 * (J * cos((K * 0.5)))));
} else {
tmp = U + (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0)))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (cos((k / 2.0d0)) <= 0.7d0) then
tmp = u + (l * (2.0d0 * (j * cos((k * 0.5d0)))))
else
tmp = u + (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (Math.cos((K / 2.0)) <= 0.7) {
tmp = U + (l * (2.0 * (J * Math.cos((K * 0.5)))));
} else {
tmp = U + (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= 0.7: tmp = U + (l * (2.0 * (J * math.cos((K * 0.5))))) else: tmp = U + (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= 0.7) tmp = Float64(U + Float64(l * Float64(2.0 * Float64(J * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= 0.7) tmp = U + (l * (2.0 * (J * cos((K * 0.5))))); else tmp = U + (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.7], N[(U + N[(l * N[(2.0 * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.7:\\
\;\;\;\;U + \ell \cdot \left(2 \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\\
\end{array}
\end{array}
if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.69999999999999996Initial program 84.1%
Taylor expanded in l around 0 83.1%
associate-*r*83.1%
*-commutative83.1%
associate-*r*83.1%
associate-*r*83.1%
*-commutative83.1%
associate-*l*83.1%
*-commutative83.1%
distribute-lft-out83.1%
fma-define83.1%
Simplified83.1%
Taylor expanded in l around 0 71.0%
if 0.69999999999999996 < (cos.f64 (/.f64 K #s(literal 2 binary64))) Initial program 86.2%
Taylor expanded in l around 0 92.2%
Taylor expanded in K around 0 90.8%
Final simplification83.8%
(FPCore (J l K U) :precision binary64 (if (or (<= l -0.06) (not (<= l 7.8e-6))) (+ (* (- (exp l) (exp (- l))) J) U) (+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.06) || !(l <= 7.8e-6)) {
tmp = ((exp(l) - exp(-l)) * J) + U;
} else {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-0.06d0)) .or. (.not. (l <= 7.8d-6))) then
tmp = ((exp(l) - exp(-l)) * j) + u
else
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -0.06) || !(l <= 7.8e-6)) {
tmp = ((Math.exp(l) - Math.exp(-l)) * J) + U;
} else {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -0.06) or not (l <= 7.8e-6): tmp = ((math.exp(l) - math.exp(-l)) * J) + U else: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -0.06) || !(l <= 7.8e-6)) tmp = Float64(Float64(Float64(exp(l) - exp(Float64(-l))) * J) + U); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -0.06) || ~((l <= 7.8e-6))) tmp = ((exp(l) - exp(-l)) * J) + U; else tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -0.06], N[Not[LessEqual[l, 7.8e-6]], $MachinePrecision]], N[(N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -0.06 \lor \neg \left(\ell \leq 7.8 \cdot 10^{-6}\right):\\
\;\;\;\;\left(e^{\ell} - e^{-\ell}\right) \cdot J + U\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -0.059999999999999998 or 7.7999999999999999e-6 < l Initial program 100.0%
Taylor expanded in K around 0 76.4%
if -0.059999999999999998 < l < 7.7999999999999999e-6Initial program 71.2%
Taylor expanded in l around 0 100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification88.3%
(FPCore (J l K U) :precision binary64 (+ U (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* 0.3333333333333333 (pow l 2.0))))))))
double code(double J, double l, double K, double U) {
return U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * pow(l, 2.0))))));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + (0.3333333333333333d0 * (l ** 2.0d0))))))
end function
public static double code(double J, double l, double K, double U) {
return U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * Math.pow(l, 2.0))))));
}
def code(J, l, K, U): return U + (math.cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * math.pow(l, 2.0))))))
function code(J, l, K, U) return Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(0.3333333333333333 * (l ^ 2.0))))))) end
function tmp = code(J, l, K, U) tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + (0.3333333333333333 * (l ^ 2.0)))))); end
code[J_, l_, K_, U_] := N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(0.3333333333333333 * N[Power[l, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + 0.3333333333333333 \cdot {\ell}^{2}\right)\right)\right)
\end{array}
Initial program 85.5%
Taylor expanded in l around 0 90.8%
Final simplification90.8%
(FPCore (J l K U)
:precision binary64
(if (<= l -3e+197)
(- -4.0 (* U U))
(if (<= l -1.05e+62)
(+ U (* J (- 8.0 (pow K 2.0))))
(if (<= l -72000000000000.0)
(pow U -4.0)
(if (<= l 12200.0)
U
(if (or (<= l 6.7e+140) (not (<= l 4.1e+273)))
(/ (pow U 3.0) (+ U -4.0))
(-
(*
U
(+
0.4444444444444444
(* U (- (* U 0.7901234567901234) 0.5925925925925926))))
0.3333333333333333)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -3e+197) {
tmp = -4.0 - (U * U);
} else if (l <= -1.05e+62) {
tmp = U + (J * (8.0 - pow(K, 2.0)));
} else if (l <= -72000000000000.0) {
tmp = pow(U, -4.0);
} else if (l <= 12200.0) {
tmp = U;
} else if ((l <= 6.7e+140) || !(l <= 4.1e+273)) {
tmp = pow(U, 3.0) / (U + -4.0);
} else {
tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-3d+197)) then
tmp = (-4.0d0) - (u * u)
else if (l <= (-1.05d+62)) then
tmp = u + (j * (8.0d0 - (k ** 2.0d0)))
else if (l <= (-72000000000000.0d0)) then
tmp = u ** (-4.0d0)
else if (l <= 12200.0d0) then
tmp = u
else if ((l <= 6.7d+140) .or. (.not. (l <= 4.1d+273))) then
tmp = (u ** 3.0d0) / (u + (-4.0d0))
else
tmp = (u * (0.4444444444444444d0 + (u * ((u * 0.7901234567901234d0) - 0.5925925925925926d0)))) - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -3e+197) {
tmp = -4.0 - (U * U);
} else if (l <= -1.05e+62) {
tmp = U + (J * (8.0 - Math.pow(K, 2.0)));
} else if (l <= -72000000000000.0) {
tmp = Math.pow(U, -4.0);
} else if (l <= 12200.0) {
tmp = U;
} else if ((l <= 6.7e+140) || !(l <= 4.1e+273)) {
tmp = Math.pow(U, 3.0) / (U + -4.0);
} else {
tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -3e+197: tmp = -4.0 - (U * U) elif l <= -1.05e+62: tmp = U + (J * (8.0 - math.pow(K, 2.0))) elif l <= -72000000000000.0: tmp = math.pow(U, -4.0) elif l <= 12200.0: tmp = U elif (l <= 6.7e+140) or not (l <= 4.1e+273): tmp = math.pow(U, 3.0) / (U + -4.0) else: tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333 return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -3e+197) tmp = Float64(-4.0 - Float64(U * U)); elseif (l <= -1.05e+62) tmp = Float64(U + Float64(J * Float64(8.0 - (K ^ 2.0)))); elseif (l <= -72000000000000.0) tmp = U ^ -4.0; elseif (l <= 12200.0) tmp = U; elseif ((l <= 6.7e+140) || !(l <= 4.1e+273)) tmp = Float64((U ^ 3.0) / Float64(U + -4.0)); else tmp = Float64(Float64(U * Float64(0.4444444444444444 + Float64(U * Float64(Float64(U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -3e+197) tmp = -4.0 - (U * U); elseif (l <= -1.05e+62) tmp = U + (J * (8.0 - (K ^ 2.0))); elseif (l <= -72000000000000.0) tmp = U ^ -4.0; elseif (l <= 12200.0) tmp = U; elseif ((l <= 6.7e+140) || ~((l <= 4.1e+273))) tmp = (U ^ 3.0) / (U + -4.0); else tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -3e+197], N[(-4.0 - N[(U * U), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -1.05e+62], N[(U + N[(J * N[(8.0 - N[Power[K, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -72000000000000.0], N[Power[U, -4.0], $MachinePrecision], If[LessEqual[l, 12200.0], U, If[Or[LessEqual[l, 6.7e+140], N[Not[LessEqual[l, 4.1e+273]], $MachinePrecision]], N[(N[Power[U, 3.0], $MachinePrecision] / N[(U + -4.0), $MachinePrecision]), $MachinePrecision], N[(N[(U * N[(0.4444444444444444 + N[(U * N[(N[(U * 0.7901234567901234), $MachinePrecision] - 0.5925925925925926), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -3 \cdot 10^{+197}:\\
\;\;\;\;-4 - U \cdot U\\
\mathbf{elif}\;\ell \leq -1.05 \cdot 10^{+62}:\\
\;\;\;\;U + J \cdot \left(8 - {K}^{2}\right)\\
\mathbf{elif}\;\ell \leq -72000000000000:\\
\;\;\;\;{U}^{-4}\\
\mathbf{elif}\;\ell \leq 12200:\\
\;\;\;\;U\\
\mathbf{elif}\;\ell \leq 6.7 \cdot 10^{+140} \lor \neg \left(\ell \leq 4.1 \cdot 10^{+273}\right):\\
\;\;\;\;\frac{{U}^{3}}{U + -4}\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(0.4444444444444444 + U \cdot \left(U \cdot 0.7901234567901234 - 0.5925925925925926\right)\right) - 0.3333333333333333\\
\end{array}
\end{array}
if l < -3.0000000000000002e197Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr27.7%
cancel-sign-sub-inv27.7%
Simplified27.7%
if -3.0000000000000002e197 < l < -1.05e62Initial program 100.0%
Applied egg-rr1.1%
Taylor expanded in K around 0 23.3%
associate-*r*23.3%
+-commutative23.3%
mul-1-neg23.3%
cancel-sign-sub-inv23.3%
*-commutative23.3%
distribute-lft-out--26.5%
Simplified26.5%
if -1.05e62 < l < -7.2e13Initial program 100.0%
Applied egg-rr30.7%
if -7.2e13 < l < 12200Initial program 72.4%
Taylor expanded in J around 0 69.8%
if 12200 < l < 6.7e140 or 4.09999999999999991e273 < l Initial program 100.0%
Applied egg-rr31.6%
*-commutative31.6%
flip--31.6%
associate-*l/34.3%
fmm-def34.3%
metadata-eval34.3%
metadata-eval34.3%
Applied egg-rr34.3%
Taylor expanded in U around inf 34.3%
if 6.7e140 < l < 4.09999999999999991e273Initial program 100.0%
Applied egg-rr1.8%
associate-+r+1.8%
distribute-rgt1-in1.8%
metadata-eval1.8%
*-commutative1.8%
distribute-lft-out1.8%
associate-/r*1.7%
*-inverses1.7%
+-commutative1.7%
*-commutative1.7%
Simplified1.7%
Taylor expanded in U around 0 36.9%
Final simplification51.8%
(FPCore (J l K U) :precision binary64 (if (or (<= l -2.8e+84) (not (<= l 0.47))) (+ U (* (pow l 3.0) (* J 0.3333333333333333))) (+ U (* 2.0 (* J (* l (cos (* K 0.5))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.8e+84) || !(l <= 0.47)) {
tmp = U + (pow(l, 3.0) * (J * 0.3333333333333333));
} else {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-2.8d+84)) .or. (.not. (l <= 0.47d0))) then
tmp = u + ((l ** 3.0d0) * (j * 0.3333333333333333d0))
else
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.8e+84) || !(l <= 0.47)) {
tmp = U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
} else {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -2.8e+84) or not (l <= 0.47): tmp = U + (math.pow(l, 3.0) * (J * 0.3333333333333333)) else: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -2.8e+84) || !(l <= 0.47)) tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); else tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -2.8e+84) || ~((l <= 0.47))) tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); else tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -2.8e+84], N[Not[LessEqual[l, 0.47]], $MachinePrecision]], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{+84} \lor \neg \left(\ell \leq 0.47\right):\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if l < -2.79999999999999982e84 or 0.46999999999999997 < l Initial program 100.0%
Taylor expanded in l around 0 88.7%
Taylor expanded in l around inf 88.7%
*-commutative88.7%
associate-*r*88.7%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in K around 0 70.7%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
*-commutative70.7%
Simplified70.7%
if -2.79999999999999982e84 < l < 0.46999999999999997Initial program 74.3%
Taylor expanded in l around 0 91.4%
Final simplification82.4%
(FPCore (J l K U) :precision binary64 (if (or (<= l -2.8e+84) (not (<= l 0.47))) (+ U (* (pow l 3.0) (* J 0.3333333333333333))) (+ U (* l (* 2.0 (* J (cos (* K 0.5))))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.8e+84) || !(l <= 0.47)) {
tmp = U + (pow(l, 3.0) * (J * 0.3333333333333333));
} else {
tmp = U + (l * (2.0 * (J * cos((K * 0.5)))));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-2.8d+84)) .or. (.not. (l <= 0.47d0))) then
tmp = u + ((l ** 3.0d0) * (j * 0.3333333333333333d0))
else
tmp = u + (l * (2.0d0 * (j * cos((k * 0.5d0)))))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.8e+84) || !(l <= 0.47)) {
tmp = U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
} else {
tmp = U + (l * (2.0 * (J * Math.cos((K * 0.5)))));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -2.8e+84) or not (l <= 0.47): tmp = U + (math.pow(l, 3.0) * (J * 0.3333333333333333)) else: tmp = U + (l * (2.0 * (J * math.cos((K * 0.5))))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -2.8e+84) || !(l <= 0.47)) tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); else tmp = Float64(U + Float64(l * Float64(2.0 * Float64(J * cos(Float64(K * 0.5)))))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -2.8e+84) || ~((l <= 0.47))) tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); else tmp = U + (l * (2.0 * (J * cos((K * 0.5))))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -2.8e+84], N[Not[LessEqual[l, 0.47]], $MachinePrecision]], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(2.0 * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.8 \cdot 10^{+84} \lor \neg \left(\ell \leq 0.47\right):\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(2 \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\end{array}
\end{array}
if l < -2.79999999999999982e84 or 0.46999999999999997 < l Initial program 100.0%
Taylor expanded in l around 0 88.7%
Taylor expanded in l around inf 88.7%
*-commutative88.7%
associate-*r*88.7%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in K around 0 70.7%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
*-commutative70.7%
Simplified70.7%
if -2.79999999999999982e84 < l < 0.46999999999999997Initial program 74.3%
Taylor expanded in l around 0 92.3%
associate-*r*92.3%
*-commutative92.3%
associate-*r*92.3%
associate-*r*92.3%
*-commutative92.3%
associate-*l*92.3%
*-commutative92.3%
distribute-lft-out92.3%
fma-define92.3%
Simplified92.3%
Taylor expanded in l around 0 91.4%
Final simplification82.5%
(FPCore (J l K U) :precision binary64 (if (or (<= l -2.9e+84) (not (<= l 0.47))) (+ U (* (pow l 3.0) (* J 0.3333333333333333))) (+ U (* (cos (/ K 2.0)) (* l (* J 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.9e+84) || !(l <= 0.47)) {
tmp = U + (pow(l, 3.0) * (J * 0.3333333333333333));
} else {
tmp = U + (cos((K / 2.0)) * (l * (J * 2.0)));
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if ((l <= (-2.9d+84)) .or. (.not. (l <= 0.47d0))) then
tmp = u + ((l ** 3.0d0) * (j * 0.3333333333333333d0))
else
tmp = u + (cos((k / 2.0d0)) * (l * (j * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -2.9e+84) || !(l <= 0.47)) {
tmp = U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
} else {
tmp = U + (Math.cos((K / 2.0)) * (l * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -2.9e+84) or not (l <= 0.47): tmp = U + (math.pow(l, 3.0) * (J * 0.3333333333333333)) else: tmp = U + (math.cos((K / 2.0)) * (l * (J * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -2.9e+84) || !(l <= 0.47)) tmp = Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))); else tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(l * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -2.9e+84) || ~((l <= 0.47))) tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); else tmp = U + (cos((K / 2.0)) * (l * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -2.9e+84], N[Not[LessEqual[l, 0.47]], $MachinePrecision]], N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.9 \cdot 10^{+84} \lor \neg \left(\ell \leq 0.47\right):\\
\;\;\;\;U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(\ell \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
if l < -2.89999999999999989e84 or 0.46999999999999997 < l Initial program 100.0%
Taylor expanded in l around 0 88.7%
Taylor expanded in l around inf 88.7%
*-commutative88.7%
associate-*r*88.7%
associate-*l*88.7%
*-commutative88.7%
associate-*r*88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in K around 0 70.7%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
*-commutative70.7%
Simplified70.7%
if -2.89999999999999989e84 < l < 0.46999999999999997Initial program 74.3%
Taylor expanded in l around 0 91.5%
associate-*r*91.5%
Simplified91.5%
Final simplification82.5%
(FPCore (J l K U) :precision binary64 (if (<= l -940.0) (/ (- (/ (+ 0.1875 (/ -0.140625 U)) U) 0.25) U) (if (<= l 12200.0) U (/ (pow U 3.0) (+ U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -940.0) {
tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U;
} else if (l <= 12200.0) {
tmp = U;
} else {
tmp = pow(U, 3.0) / (U + -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-940.0d0)) then
tmp = (((0.1875d0 + ((-0.140625d0) / u)) / u) - 0.25d0) / u
else if (l <= 12200.0d0) then
tmp = u
else
tmp = (u ** 3.0d0) / (u + (-4.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -940.0) {
tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U;
} else if (l <= 12200.0) {
tmp = U;
} else {
tmp = Math.pow(U, 3.0) / (U + -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -940.0: tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U elif l <= 12200.0: tmp = U else: tmp = math.pow(U, 3.0) / (U + -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -940.0) tmp = Float64(Float64(Float64(Float64(0.1875 + Float64(-0.140625 / U)) / U) - 0.25) / U); elseif (l <= 12200.0) tmp = U; else tmp = Float64((U ^ 3.0) / Float64(U + -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -940.0) tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U; elseif (l <= 12200.0) tmp = U; else tmp = (U ^ 3.0) / (U + -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -940.0], N[(N[(N[(N[(0.1875 + N[(-0.140625 / U), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision] - 0.25), $MachinePrecision] / U), $MachinePrecision], If[LessEqual[l, 12200.0], U, N[(N[Power[U, 3.0], $MachinePrecision] / N[(U + -4.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -940:\\
\;\;\;\;\frac{\frac{0.1875 + \frac{-0.140625}{U}}{U} - 0.25}{U}\\
\mathbf{elif}\;\ell \leq 12200:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;\frac{{U}^{3}}{U + -4}\\
\end{array}
\end{array}
if l < -940Initial program 100.0%
Applied egg-rr1.6%
associate-+r+1.6%
distribute-rgt1-in1.6%
metadata-eval1.6%
*-commutative1.6%
distribute-lft-out1.6%
associate-/r*1.5%
*-inverses1.5%
+-commutative1.5%
*-commutative1.5%
Simplified1.5%
Taylor expanded in U around inf 18.8%
+-commutative18.8%
associate--r+18.8%
associate-*r/18.8%
metadata-eval18.8%
unpow218.8%
associate-/r*18.8%
metadata-eval18.8%
associate-*r/18.8%
div-sub18.8%
sub-neg18.8%
associate-*r/18.8%
metadata-eval18.8%
distribute-neg-frac18.8%
metadata-eval18.8%
Simplified18.8%
if -940 < l < 12200Initial program 72.2%
Taylor expanded in J around 0 70.3%
if 12200 < l Initial program 100.0%
Applied egg-rr21.9%
*-commutative21.9%
flip--21.9%
associate-*l/27.7%
fmm-def27.7%
metadata-eval27.7%
metadata-eval27.7%
Applied egg-rr27.7%
Taylor expanded in U around inf 27.6%
Final simplification48.0%
(FPCore (J l K U) :precision binary64 (+ U (* (pow l 3.0) (* J 0.3333333333333333))))
double code(double J, double l, double K, double U) {
return U + (pow(l, 3.0) * (J * 0.3333333333333333));
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u + ((l ** 3.0d0) * (j * 0.3333333333333333d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (Math.pow(l, 3.0) * (J * 0.3333333333333333));
}
def code(J, l, K, U): return U + (math.pow(l, 3.0) * (J * 0.3333333333333333))
function code(J, l, K, U) return Float64(U + Float64((l ^ 3.0) * Float64(J * 0.3333333333333333))) end
function tmp = code(J, l, K, U) tmp = U + ((l ^ 3.0) * (J * 0.3333333333333333)); end
code[J_, l_, K_, U_] := N[(U + N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)
\end{array}
Initial program 85.5%
Taylor expanded in l around 0 90.8%
Taylor expanded in l around inf 76.0%
*-commutative76.0%
associate-*r*76.0%
associate-*l*76.0%
*-commutative76.0%
associate-*r*76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in K around 0 67.3%
associate-*r*67.3%
*-commutative67.3%
*-commutative67.3%
*-commutative67.3%
Simplified67.3%
Final simplification67.3%
(FPCore (J l K U)
:precision binary64
(if (<= l -600.0)
(/ (- (/ (+ 0.1875 (/ -0.140625 U)) U) 0.25) U)
(if (<= l 28500.0)
U
(if (<= l 4e+141)
(* U U)
(-
(*
U
(+
0.4444444444444444
(* U (- (* U 0.7901234567901234) 0.5925925925925926))))
0.3333333333333333)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -600.0) {
tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U;
} else if (l <= 28500.0) {
tmp = U;
} else if (l <= 4e+141) {
tmp = U * U;
} else {
tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-600.0d0)) then
tmp = (((0.1875d0 + ((-0.140625d0) / u)) / u) - 0.25d0) / u
else if (l <= 28500.0d0) then
tmp = u
else if (l <= 4d+141) then
tmp = u * u
else
tmp = (u * (0.4444444444444444d0 + (u * ((u * 0.7901234567901234d0) - 0.5925925925925926d0)))) - 0.3333333333333333d0
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -600.0) {
tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U;
} else if (l <= 28500.0) {
tmp = U;
} else if (l <= 4e+141) {
tmp = U * U;
} else {
tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -600.0: tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U elif l <= 28500.0: tmp = U elif l <= 4e+141: tmp = U * U else: tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333 return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -600.0) tmp = Float64(Float64(Float64(Float64(0.1875 + Float64(-0.140625 / U)) / U) - 0.25) / U); elseif (l <= 28500.0) tmp = U; elseif (l <= 4e+141) tmp = Float64(U * U); else tmp = Float64(Float64(U * Float64(0.4444444444444444 + Float64(U * Float64(Float64(U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -600.0) tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U; elseif (l <= 28500.0) tmp = U; elseif (l <= 4e+141) tmp = U * U; else tmp = (U * (0.4444444444444444 + (U * ((U * 0.7901234567901234) - 0.5925925925925926)))) - 0.3333333333333333; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -600.0], N[(N[(N[(N[(0.1875 + N[(-0.140625 / U), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision] - 0.25), $MachinePrecision] / U), $MachinePrecision], If[LessEqual[l, 28500.0], U, If[LessEqual[l, 4e+141], N[(U * U), $MachinePrecision], N[(N[(U * N[(0.4444444444444444 + N[(U * N[(N[(U * 0.7901234567901234), $MachinePrecision] - 0.5925925925925926), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -600:\\
\;\;\;\;\frac{\frac{0.1875 + \frac{-0.140625}{U}}{U} - 0.25}{U}\\
\mathbf{elif}\;\ell \leq 28500:\\
\;\;\;\;U\\
\mathbf{elif}\;\ell \leq 4 \cdot 10^{+141}:\\
\;\;\;\;U \cdot U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(0.4444444444444444 + U \cdot \left(U \cdot 0.7901234567901234 - 0.5925925925925926\right)\right) - 0.3333333333333333\\
\end{array}
\end{array}
if l < -600Initial program 100.0%
Applied egg-rr1.6%
associate-+r+1.6%
distribute-rgt1-in1.6%
metadata-eval1.6%
*-commutative1.6%
distribute-lft-out1.6%
associate-/r*1.5%
*-inverses1.5%
+-commutative1.5%
*-commutative1.5%
Simplified1.5%
Taylor expanded in U around inf 18.8%
+-commutative18.8%
associate--r+18.8%
associate-*r/18.8%
metadata-eval18.8%
unpow218.8%
associate-/r*18.8%
metadata-eval18.8%
associate-*r/18.8%
div-sub18.8%
sub-neg18.8%
associate-*r/18.8%
metadata-eval18.8%
distribute-neg-frac18.8%
metadata-eval18.8%
Simplified18.8%
if -600 < l < 28500Initial program 72.2%
Taylor expanded in J around 0 70.3%
if 28500 < l < 4.00000000000000007e141Initial program 100.0%
Applied egg-rr31.3%
if 4.00000000000000007e141 < l Initial program 100.0%
Applied egg-rr1.7%
associate-+r+1.7%
distribute-rgt1-in1.7%
metadata-eval1.7%
*-commutative1.7%
distribute-lft-out1.7%
associate-/r*1.6%
*-inverses1.6%
+-commutative1.6%
*-commutative1.6%
Simplified1.6%
Taylor expanded in U around 0 33.1%
Final simplification49.2%
(FPCore (J l K U) :precision binary64 (if (<= l -740.0) (/ (- (/ (+ 0.1875 (/ -0.140625 U)) U) 0.25) U) (if (<= l 485.0) U (* U (- U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -740.0) {
tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U;
} else if (l <= 485.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-740.0d0)) then
tmp = (((0.1875d0 + ((-0.140625d0) / u)) / u) - 0.25d0) / u
else if (l <= 485.0d0) then
tmp = u
else
tmp = u * (u - (-4.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -740.0) {
tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U;
} else if (l <= 485.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -740.0: tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U elif l <= 485.0: tmp = U else: tmp = U * (U - -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -740.0) tmp = Float64(Float64(Float64(Float64(0.1875 + Float64(-0.140625 / U)) / U) - 0.25) / U); elseif (l <= 485.0) tmp = U; else tmp = Float64(U * Float64(U - -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -740.0) tmp = (((0.1875 + (-0.140625 / U)) / U) - 0.25) / U; elseif (l <= 485.0) tmp = U; else tmp = U * (U - -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -740.0], N[(N[(N[(N[(0.1875 + N[(-0.140625 / U), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision] - 0.25), $MachinePrecision] / U), $MachinePrecision], If[LessEqual[l, 485.0], U, N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -740:\\
\;\;\;\;\frac{\frac{0.1875 + \frac{-0.140625}{U}}{U} - 0.25}{U}\\
\mathbf{elif}\;\ell \leq 485:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\end{array}
\end{array}
if l < -740Initial program 100.0%
Applied egg-rr1.6%
associate-+r+1.6%
distribute-rgt1-in1.6%
metadata-eval1.6%
*-commutative1.6%
distribute-lft-out1.6%
associate-/r*1.5%
*-inverses1.5%
+-commutative1.5%
*-commutative1.5%
Simplified1.5%
Taylor expanded in U around inf 18.8%
+-commutative18.8%
associate--r+18.8%
associate-*r/18.8%
metadata-eval18.8%
unpow218.8%
associate-/r*18.8%
metadata-eval18.8%
associate-*r/18.8%
div-sub18.8%
sub-neg18.8%
associate-*r/18.8%
metadata-eval18.8%
distribute-neg-frac18.8%
metadata-eval18.8%
Simplified18.8%
if -740 < l < 485Initial program 72.0%
Taylor expanded in J around 0 70.9%
if 485 < l Initial program 100.0%
Applied egg-rr21.6%
Final simplification46.6%
(FPCore (J l K U) :precision binary64 (if (<= l -2.3e+65) (- -4.0 (* U U)) (if (<= l 950.0) U (* U (- U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.3e+65) {
tmp = -4.0 - (U * U);
} else if (l <= 950.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-2.3d+65)) then
tmp = (-4.0d0) - (u * u)
else if (l <= 950.0d0) then
tmp = u
else
tmp = u * (u - (-4.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -2.3e+65) {
tmp = -4.0 - (U * U);
} else if (l <= 950.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -2.3e+65: tmp = -4.0 - (U * U) elif l <= 950.0: tmp = U else: tmp = U * (U - -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -2.3e+65) tmp = Float64(-4.0 - Float64(U * U)); elseif (l <= 950.0) tmp = U; else tmp = Float64(U * Float64(U - -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -2.3e+65) tmp = -4.0 - (U * U); elseif (l <= 950.0) tmp = U; else tmp = U * (U - -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -2.3e+65], N[(-4.0 - N[(U * U), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 950.0], U, N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -2.3 \cdot 10^{+65}:\\
\;\;\;\;-4 - U \cdot U\\
\mathbf{elif}\;\ell \leq 950:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\end{array}
\end{array}
if l < -2.3e65Initial program 100.0%
associate-*l*100.0%
fma-define100.0%
Simplified100.0%
Applied egg-rr14.2%
cancel-sign-sub-inv14.2%
Simplified14.2%
if -2.3e65 < l < 950Initial program 73.8%
Taylor expanded in J around 0 66.5%
if 950 < l Initial program 100.0%
Applied egg-rr21.6%
Final simplification45.1%
(FPCore (J l K U) :precision binary64 (if (<= l -580000000000.0) (/ (+ (/ 0.1875 U) -0.25) U) (if (<= l 620.0) U (* U (- U -4.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -580000000000.0) {
tmp = ((0.1875 / U) + -0.25) / U;
} else if (l <= 620.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= (-580000000000.0d0)) then
tmp = ((0.1875d0 / u) + (-0.25d0)) / u
else if (l <= 620.0d0) then
tmp = u
else
tmp = u * (u - (-4.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= -580000000000.0) {
tmp = ((0.1875 / U) + -0.25) / U;
} else if (l <= 620.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= -580000000000.0: tmp = ((0.1875 / U) + -0.25) / U elif l <= 620.0: tmp = U else: tmp = U * (U - -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= -580000000000.0) tmp = Float64(Float64(Float64(0.1875 / U) + -0.25) / U); elseif (l <= 620.0) tmp = U; else tmp = Float64(U * Float64(U - -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= -580000000000.0) tmp = ((0.1875 / U) + -0.25) / U; elseif (l <= 620.0) tmp = U; else tmp = U * (U - -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, -580000000000.0], N[(N[(N[(0.1875 / U), $MachinePrecision] + -0.25), $MachinePrecision] / U), $MachinePrecision], If[LessEqual[l, 620.0], U, N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -580000000000:\\
\;\;\;\;\frac{\frac{0.1875}{U} + -0.25}{U}\\
\mathbf{elif}\;\ell \leq 620:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\end{array}
\end{array}
if l < -5.8e11Initial program 100.0%
Applied egg-rr1.5%
associate-+r+1.5%
distribute-rgt1-in1.5%
metadata-eval1.5%
*-commutative1.5%
distribute-lft-out1.5%
associate-/r*1.5%
*-inverses1.5%
+-commutative1.5%
*-commutative1.5%
Simplified1.5%
Taylor expanded in U around inf 15.4%
sub-neg15.4%
associate-*r/15.4%
metadata-eval15.4%
metadata-eval15.4%
Simplified15.4%
if -5.8e11 < l < 620Initial program 72.2%
Taylor expanded in J around 0 70.3%
if 620 < l Initial program 100.0%
Applied egg-rr21.6%
Final simplification45.7%
(FPCore (J l K U) :precision binary64 (if (<= l 950.0) U (* U (- U -4.0))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 950.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 950.0d0) then
tmp = u
else
tmp = u * (u - (-4.0d0))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 950.0) {
tmp = U;
} else {
tmp = U * (U - -4.0);
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 950.0: tmp = U else: tmp = U * (U - -4.0) return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 950.0) tmp = U; else tmp = Float64(U * Float64(U - -4.0)); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 950.0) tmp = U; else tmp = U * (U - -4.0); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 950.0], U, N[(U * N[(U - -4.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 950:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot \left(U - -4\right)\\
\end{array}
\end{array}
if l < 950Initial program 80.5%
Taylor expanded in J around 0 50.0%
if 950 < l Initial program 100.0%
Applied egg-rr21.6%
Final simplification42.8%
(FPCore (J l K U) :precision binary64 (if (<= l 19000.0) U (* U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 19000.0) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
real(8) :: tmp
if (l <= 19000.0d0) then
tmp = u
else
tmp = u * u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double tmp;
if (l <= 19000.0) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 19000.0: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 19000.0) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 19000.0) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 19000.0], U, N[(U * U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 19000:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
if l < 19000Initial program 80.6%
Taylor expanded in J around 0 49.7%
if 19000 < l Initial program 100.0%
Applied egg-rr21.8%
Final simplification42.8%
(FPCore (J l K U) :precision binary64 -0.3333333333333333)
double code(double J, double l, double K, double U) {
return -0.3333333333333333;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = -0.3333333333333333d0
end function
public static double code(double J, double l, double K, double U) {
return -0.3333333333333333;
}
def code(J, l, K, U): return -0.3333333333333333
function code(J, l, K, U) return -0.3333333333333333 end
function tmp = code(J, l, K, U) tmp = -0.3333333333333333; end
code[J_, l_, K_, U_] := -0.3333333333333333
\begin{array}{l}
\\
-0.3333333333333333
\end{array}
Initial program 85.5%
Applied egg-rr2.1%
associate-+r+2.1%
distribute-rgt1-in2.1%
metadata-eval2.1%
*-commutative2.1%
distribute-lft-out2.1%
associate-/r*2.0%
*-inverses2.0%
+-commutative2.0%
*-commutative2.0%
Simplified2.0%
Taylor expanded in U around 0 2.6%
Final simplification2.6%
(FPCore (J l K U) :precision binary64 1.0)
double code(double J, double l, double K, double U) {
return 1.0;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = 1.0d0
end function
public static double code(double J, double l, double K, double U) {
return 1.0;
}
def code(J, l, K, U): return 1.0
function code(J, l, K, U) return 1.0 end
function tmp = code(J, l, K, U) tmp = 1.0; end
code[J_, l_, K_, U_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 85.5%
Applied egg-rr2.8%
*-inverses2.8%
Simplified2.8%
Final simplification2.8%
(FPCore (J l K U) :precision binary64 U)
double code(double J, double l, double K, double U) {
return U;
}
real(8) function code(j, l, k, u)
real(8), intent (in) :: j
real(8), intent (in) :: l
real(8), intent (in) :: k
real(8), intent (in) :: u
code = u
end function
public static double code(double J, double l, double K, double U) {
return U;
}
def code(J, l, K, U): return U
function code(J, l, K, U) return U end
function tmp = code(J, l, K, U) tmp = U; end
code[J_, l_, K_, U_] := U
\begin{array}{l}
\\
U
\end{array}
Initial program 85.5%
Taylor expanded in J around 0 37.9%
Final simplification37.9%
herbie shell --seed 2024131
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))