
(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 17 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 -1e+90) (not (<= t_1 0.0)))
(+ (* (* t_1 J) t_0) U)
(+ U (* t_0 (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 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 <= -1e+90) || !(t_1 <= 0.0)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (J * ((0.3333333333333333 * pow(l, 3.0)) + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = exp(l) - exp(-l)
if ((t_1 <= (-1d+90)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = ((t_1 * j) * t_0) + u
else
tmp = u + (t_0 * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))))
end if
code = tmp
end function
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 <= -1e+90) || !(t_1 <= 0.0)) {
tmp = ((t_1 * J) * t_0) + U;
} else {
tmp = U + (t_0 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 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 <= -1e+90) or not (t_1 <= 0.0): tmp = ((t_1 * J) * t_0) + U else: tmp = U + (t_0 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 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 <= -1e+90) || !(t_1 <= 0.0)) tmp = Float64(Float64(Float64(t_1 * J) * t_0) + U); else tmp = Float64(U + Float64(t_0 * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 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 <= -1e+90) || ~((t_1 <= 0.0))) tmp = ((t_1 * J) * t_0) + U; else tmp = U + (t_0 * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 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, -1e+90], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(t$95$1 * J), $MachinePrecision] * t$95$0), $MachinePrecision] + U), $MachinePrecision], N[(U + N[(t$95$0 * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $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 -1 \cdot 10^{+90} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;\left(t_1 \cdot J\right) \cdot t_0 + U\\
\mathbf{else}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (- (exp l) (exp (- l)))))
(if (or (<= t_0 -1e+90) (not (<= t_0 1e-5)))
(* t_0 J)
(+ U (* l (* (cos (* K 0.5)) (* J 2.0)))))))
double code(double J, double l, double K, double U) {
double t_0 = exp(l) - exp(-l);
double tmp;
if ((t_0 <= -1e+90) || !(t_0 <= 1e-5)) {
tmp = t_0 * J;
} else {
tmp = U + (l * (cos((K * 0.5)) * (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) :: t_0
real(8) :: tmp
t_0 = exp(l) - exp(-l)
if ((t_0 <= (-1d+90)) .or. (.not. (t_0 <= 1d-5))) then
tmp = t_0 * j
else
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.exp(l) - Math.exp(-l);
double tmp;
if ((t_0 <= -1e+90) || !(t_0 <= 1e-5)) {
tmp = t_0 * J;
} else {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): t_0 = math.exp(l) - math.exp(-l) tmp = 0 if (t_0 <= -1e+90) or not (t_0 <= 1e-5): tmp = t_0 * J else: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) return tmp
function code(J, l, K, U) t_0 = Float64(exp(l) - exp(Float64(-l))) tmp = 0.0 if ((t_0 <= -1e+90) || !(t_0 <= 1e-5)) tmp = Float64(t_0 * J); else tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = exp(l) - exp(-l); tmp = 0.0; if ((t_0 <= -1e+90) || ~((t_0 <= 1e-5))) tmp = t_0 * J; else tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -1e+90], N[Not[LessEqual[t$95$0, 1e-5]], $MachinePrecision]], N[(t$95$0 * J), $MachinePrecision], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\ell} - e^{-\ell}\\
\mathbf{if}\;t_0 \leq -1 \cdot 10^{+90} \lor \neg \left(t_0 \leq 10^{-5}\right):\\
\;\;\;\;t_0 \cdot J\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0)))
(t_1 (+ U (* t_0 (* (pow l 3.0) (* J 0.3333333333333333)))))
(t_2 (* (- (exp l) (exp (- l))) J)))
(if (<= l -4.2e+151)
t_1
(if (<= l -150.0)
t_2
(if (<= l 2.6e-30)
(+ U (* t_0 (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))
(if (<= l 1.56e+100) (+ t_2 U) t_1))))))
double code(double J, double l, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = U + (t_0 * (pow(l, 3.0) * (J * 0.3333333333333333)));
double t_2 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -4.2e+151) {
tmp = t_1;
} else if (l <= -150.0) {
tmp = t_2;
} else if (l <= 2.6e-30) {
tmp = U + (t_0 * (J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0))));
} else if (l <= 1.56e+100) {
tmp = t_2 + U;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_0 = cos((k / 2.0d0))
t_1 = u + (t_0 * ((l ** 3.0d0) * (j * 0.3333333333333333d0)))
t_2 = (exp(l) - exp(-l)) * j
if (l <= (-4.2d+151)) then
tmp = t_1
else if (l <= (-150.0d0)) then
tmp = t_2
else if (l <= 2.6d-30) then
tmp = u + (t_0 * (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (l * 2.0d0))))
else if (l <= 1.56d+100) then
tmp = t_2 + u
else
tmp = t_1
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = U + (t_0 * (Math.pow(l, 3.0) * (J * 0.3333333333333333)));
double t_2 = (Math.exp(l) - Math.exp(-l)) * J;
double tmp;
if (l <= -4.2e+151) {
tmp = t_1;
} else if (l <= -150.0) {
tmp = t_2;
} else if (l <= 2.6e-30) {
tmp = U + (t_0 * (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0))));
} else if (l <= 1.56e+100) {
tmp = t_2 + U;
} else {
tmp = t_1;
}
return tmp;
}
def code(J, l, K, U): t_0 = math.cos((K / 2.0)) t_1 = U + (t_0 * (math.pow(l, 3.0) * (J * 0.3333333333333333))) t_2 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -4.2e+151: tmp = t_1 elif l <= -150.0: tmp = t_2 elif l <= 2.6e-30: tmp = U + (t_0 * (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0)))) elif l <= 1.56e+100: tmp = t_2 + U else: tmp = t_1 return tmp
function code(J, l, K, U) t_0 = cos(Float64(K / 2.0)) t_1 = Float64(U + Float64(t_0 * Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)))) t_2 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -4.2e+151) tmp = t_1; elseif (l <= -150.0) tmp = t_2; elseif (l <= 2.6e-30) tmp = Float64(U + Float64(t_0 * Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))))); elseif (l <= 1.56e+100) tmp = Float64(t_2 + U); else tmp = t_1; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = cos((K / 2.0)); t_1 = U + (t_0 * ((l ^ 3.0) * (J * 0.3333333333333333))); t_2 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -4.2e+151) tmp = t_1; elseif (l <= -150.0) tmp = t_2; elseif (l <= 2.6e-30) tmp = U + (t_0 * (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0)))); elseif (l <= 1.56e+100) tmp = t_2 + U; else tmp = t_1; 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[(U + N[(t$95$0 * N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -4.2e+151], t$95$1, If[LessEqual[l, -150.0], t$95$2, If[LessEqual[l, 2.6e-30], N[(U + N[(t$95$0 * N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.56e+100], N[(t$95$2 + U), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := U + t_0 \cdot \left({\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
t_2 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{+151}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq -150:\\
\;\;\;\;t_2\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-30}:\\
\;\;\;\;U + t_0 \cdot \left(J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.56 \cdot 10^{+100}:\\
\;\;\;\;t_2 + U\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0
(+ U (* (cos (/ K 2.0)) (* (pow l 3.0) (* J 0.3333333333333333)))))
(t_1 (* (- (exp l) (exp (- l))) J)))
(if (<= l -4.2e+151)
t_0
(if (<= l -190.0)
t_1
(if (<= l 2.6e-30)
(+ U (* l (* (cos (* K 0.5)) (* J 2.0))))
(if (<= l 1.56e+100) (+ t_1 U) t_0))))))
double code(double J, double l, double K, double U) {
double t_0 = U + (cos((K / 2.0)) * (pow(l, 3.0) * (J * 0.3333333333333333)));
double t_1 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -4.2e+151) {
tmp = t_0;
} else if (l <= -190.0) {
tmp = t_1;
} else if (l <= 2.6e-30) {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
} else if (l <= 1.56e+100) {
tmp = t_1 + U;
} 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 + (cos((k / 2.0d0)) * ((l ** 3.0d0) * (j * 0.3333333333333333d0)))
t_1 = (exp(l) - exp(-l)) * j
if (l <= (-4.2d+151)) then
tmp = t_0
else if (l <= (-190.0d0)) then
tmp = t_1
else if (l <= 2.6d-30) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
else if (l <= 1.56d+100) then
tmp = t_1 + u
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.cos((K / 2.0)) * (Math.pow(l, 3.0) * (J * 0.3333333333333333)));
double t_1 = (Math.exp(l) - Math.exp(-l)) * J;
double tmp;
if (l <= -4.2e+151) {
tmp = t_0;
} else if (l <= -190.0) {
tmp = t_1;
} else if (l <= 2.6e-30) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
} else if (l <= 1.56e+100) {
tmp = t_1 + U;
} else {
tmp = t_0;
}
return tmp;
}
def code(J, l, K, U): t_0 = U + (math.cos((K / 2.0)) * (math.pow(l, 3.0) * (J * 0.3333333333333333))) t_1 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -4.2e+151: tmp = t_0 elif l <= -190.0: tmp = t_1 elif l <= 2.6e-30: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) elif l <= 1.56e+100: tmp = t_1 + U else: tmp = t_0 return tmp
function code(J, l, K, U) t_0 = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)))) t_1 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -4.2e+151) tmp = t_0; elseif (l <= -190.0) tmp = t_1; elseif (l <= 2.6e-30) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); elseif (l <= 1.56e+100) tmp = Float64(t_1 + U); else tmp = t_0; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = U + (cos((K / 2.0)) * ((l ^ 3.0) * (J * 0.3333333333333333))); t_1 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -4.2e+151) tmp = t_0; elseif (l <= -190.0) tmp = t_1; elseif (l <= 2.6e-30) tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); elseif (l <= 1.56e+100) tmp = t_1 + U; else tmp = t_0; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -4.2e+151], t$95$0, If[LessEqual[l, -190.0], t$95$1, If[LessEqual[l, 2.6e-30], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1.56e+100], N[(t$95$1 + U), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := U + \cos \left(\frac{K}{2}\right) \cdot \left({\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\right)\\
t_1 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -4.2 \cdot 10^{+151}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -190:\\
\;\;\;\;t_1\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-30}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{elif}\;\ell \leq 1.56 \cdot 10^{+100}:\\
\;\;\;\;t_1 + U\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (J l K U) :precision binary64 (if (<= (cos (/ K 2.0)) -0.117) (+ U (* 2.0 (* J (* l (cos (* K 0.5)))))) (+ U (* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if (cos((K / 2.0)) <= -0.117) {
tmp = U + (2.0 * (J * (l * cos((K * 0.5)))));
} else {
tmp = U + (J * ((0.3333333333333333 * pow(l, 3.0)) + (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.117d0)) then
tmp = u + (2.0d0 * (j * (l * cos((k * 0.5d0)))))
else
tmp = u + (j * ((0.3333333333333333d0 * (l ** 3.0d0)) + (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.117) {
tmp = U + (2.0 * (J * (l * Math.cos((K * 0.5)))));
} else {
tmp = U + (J * ((0.3333333333333333 * Math.pow(l, 3.0)) + (l * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if math.cos((K / 2.0)) <= -0.117: tmp = U + (2.0 * (J * (l * math.cos((K * 0.5))))) else: tmp = U + (J * ((0.3333333333333333 * math.pow(l, 3.0)) + (l * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if (cos(Float64(K / 2.0)) <= -0.117) tmp = Float64(U + Float64(2.0 * Float64(J * Float64(l * cos(Float64(K * 0.5)))))); else tmp = Float64(U + Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (cos((K / 2.0)) <= -0.117) tmp = U + (2.0 * (J * (l * cos((K * 0.5))))); else tmp = U + (J * ((0.3333333333333333 * (l ^ 3.0)) + (l * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.117], N[(U + N[(2.0 * N[(J * N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.117:\\
\;\;\;\;U + 2 \cdot \left(J \cdot \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;U + J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (- (exp l) (exp (- l))) J)))
(if (<= l -0.0295)
t_0
(if (<= l 2.6e-30) (+ U (* l (* (cos (* K 0.5)) (* J 2.0)))) (+ t_0 U)))))
double code(double J, double l, double K, double U) {
double t_0 = (exp(l) - exp(-l)) * J;
double tmp;
if (l <= -0.0295) {
tmp = t_0;
} else if (l <= 2.6e-30) {
tmp = U + (l * (cos((K * 0.5)) * (J * 2.0)));
} else {
tmp = t_0 + 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) :: t_0
real(8) :: tmp
t_0 = (exp(l) - exp(-l)) * j
if (l <= (-0.0295d0)) then
tmp = t_0
else if (l <= 2.6d-30) then
tmp = u + (l * (cos((k * 0.5d0)) * (j * 2.0d0)))
else
tmp = t_0 + u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = (Math.exp(l) - Math.exp(-l)) * J;
double tmp;
if (l <= -0.0295) {
tmp = t_0;
} else if (l <= 2.6e-30) {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
} else {
tmp = t_0 + U;
}
return tmp;
}
def code(J, l, K, U): t_0 = (math.exp(l) - math.exp(-l)) * J tmp = 0 if l <= -0.0295: tmp = t_0 elif l <= 2.6e-30: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) else: tmp = t_0 + U return tmp
function code(J, l, K, U) t_0 = Float64(Float64(exp(l) - exp(Float64(-l))) * J) tmp = 0.0 if (l <= -0.0295) tmp = t_0; elseif (l <= 2.6e-30) tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); else tmp = Float64(t_0 + U); end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = (exp(l) - exp(-l)) * J; tmp = 0.0; if (l <= -0.0295) tmp = t_0; elseif (l <= 2.6e-30) tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); else tmp = t_0 + U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]}, If[LessEqual[l, -0.0295], t$95$0, If[LessEqual[l, 2.6e-30], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + U), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(e^{\ell} - e^{-\ell}\right) \cdot J\\
\mathbf{if}\;\ell \leq -0.0295:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq 2.6 \cdot 10^{-30}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_0 + U\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(if (<= l -1.75e+84)
(* (pow l 3.0) (* J 0.3333333333333333))
(if (<= l -205.0)
(pow U -3.0)
(if (<= l 0.44)
(fma (* l 2.0) J U)
(* J (+ (* 0.3333333333333333 (pow l 3.0)) (* l 2.0)))))))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= -1.75e+84) {
tmp = pow(l, 3.0) * (J * 0.3333333333333333);
} else if (l <= -205.0) {
tmp = pow(U, -3.0);
} else if (l <= 0.44) {
tmp = fma((l * 2.0), J, U);
} else {
tmp = J * ((0.3333333333333333 * pow(l, 3.0)) + (l * 2.0));
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if (l <= -1.75e+84) tmp = Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)); elseif (l <= -205.0) tmp = U ^ -3.0; elseif (l <= 0.44) tmp = fma(Float64(l * 2.0), J, U); else tmp = Float64(J * Float64(Float64(0.3333333333333333 * (l ^ 3.0)) + Float64(l * 2.0))); end return tmp end
code[J_, l_, K_, U_] := If[LessEqual[l, -1.75e+84], N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -205.0], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 0.44], N[(N[(l * 2.0), $MachinePrecision] * J + U), $MachinePrecision], N[(J * N[(N[(0.3333333333333333 * N[Power[l, 3.0], $MachinePrecision]), $MachinePrecision] + N[(l * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -1.75 \cdot 10^{+84}:\\
\;\;\;\;{\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{elif}\;\ell \leq -205:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 0.44:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot 2, J, U\right)\\
\mathbf{else}:\\
\;\;\;\;J \cdot \left(0.3333333333333333 \cdot {\ell}^{3} + \ell \cdot 2\right)\\
\end{array}
\end{array}
(FPCore (J l K U) :precision binary64 (if (or (<= l -2.9e+67) (not (<= l 2.5e+61))) (* (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.9e+67) || !(l <= 2.5e+61)) {
tmp = 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.9d+67)) .or. (.not. (l <= 2.5d+61))) then
tmp = (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.9e+67) || !(l <= 2.5e+61)) {
tmp = 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.9e+67) or not (l <= 2.5e+61): tmp = 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.9e+67) || !(l <= 2.5e+61)) tmp = 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.9e+67) || ~((l <= 2.5e+61))) tmp = (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.9e+67], N[Not[LessEqual[l, 2.5e+61]], $MachinePrecision]], N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $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.9 \cdot 10^{+67} \lor \neg \left(\ell \leq 2.5 \cdot 10^{+61}\right):\\
\;\;\;\;{\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}
(FPCore (J l K U) :precision binary64 (if (or (<= l -4.8e+69) (not (<= l 4.6e+58))) (* (pow l 3.0) (* J 0.3333333333333333)) (+ U (* l (* (cos (* K 0.5)) (* J 2.0))))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -4.8e+69) || !(l <= 4.6e+58)) {
tmp = pow(l, 3.0) * (J * 0.3333333333333333);
} else {
tmp = U + (l * (cos((K * 0.5)) * (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 <= (-4.8d+69)) .or. (.not. (l <= 4.6d+58))) then
tmp = (l ** 3.0d0) * (j * 0.3333333333333333d0)
else
tmp = u + (l * (cos((k * 0.5d0)) * (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 <= -4.8e+69) || !(l <= 4.6e+58)) {
tmp = Math.pow(l, 3.0) * (J * 0.3333333333333333);
} else {
tmp = U + (l * (Math.cos((K * 0.5)) * (J * 2.0)));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -4.8e+69) or not (l <= 4.6e+58): tmp = math.pow(l, 3.0) * (J * 0.3333333333333333) else: tmp = U + (l * (math.cos((K * 0.5)) * (J * 2.0))) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -4.8e+69) || !(l <= 4.6e+58)) tmp = Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)); else tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * 2.0)))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -4.8e+69) || ~((l <= 4.6e+58))) tmp = (l ^ 3.0) * (J * 0.3333333333333333); else tmp = U + (l * (cos((K * 0.5)) * (J * 2.0))); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -4.8e+69], N[Not[LessEqual[l, 4.6e+58]], $MachinePrecision]], N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -4.8 \cdot 10^{+69} \lor \neg \left(\ell \leq 4.6 \cdot 10^{+58}\right):\\
\;\;\;\;{\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot 2\right)\right)\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* (pow l 3.0) (* J 0.3333333333333333))))
(if (<= l -7.5e+86)
t_0
(if (<= l -205.0) (pow U -3.0) (if (<= l 1.4) (fma (* l 2.0) J U) t_0)))))
double code(double J, double l, double K, double U) {
double t_0 = pow(l, 3.0) * (J * 0.3333333333333333);
double tmp;
if (l <= -7.5e+86) {
tmp = t_0;
} else if (l <= -205.0) {
tmp = pow(U, -3.0);
} else if (l <= 1.4) {
tmp = fma((l * 2.0), J, U);
} else {
tmp = t_0;
}
return tmp;
}
function code(J, l, K, U) t_0 = Float64((l ^ 3.0) * Float64(J * 0.3333333333333333)) tmp = 0.0 if (l <= -7.5e+86) tmp = t_0; elseif (l <= -205.0) tmp = U ^ -3.0; elseif (l <= 1.4) tmp = fma(Float64(l * 2.0), J, U); else tmp = t_0; end return tmp end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[Power[l, 3.0], $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7.5e+86], t$95$0, If[LessEqual[l, -205.0], N[Power[U, -3.0], $MachinePrecision], If[LessEqual[l, 1.4], N[(N[(l * 2.0), $MachinePrecision] * J + U), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{3} \cdot \left(J \cdot 0.3333333333333333\right)\\
\mathbf{if}\;\ell \leq -7.5 \cdot 10^{+86}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;\ell \leq -205:\\
\;\;\;\;{U}^{-3}\\
\mathbf{elif}\;\ell \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot 2, J, U\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
(FPCore (J l K U) :precision binary64 (if (or (<= l -820000000.0) (not (<= l 1.4))) (pow U -64.0) (fma (* l 2.0) J U)))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -820000000.0) || !(l <= 1.4)) {
tmp = pow(U, -64.0);
} else {
tmp = fma((l * 2.0), J, U);
}
return tmp;
}
function code(J, l, K, U) tmp = 0.0 if ((l <= -820000000.0) || !(l <= 1.4)) tmp = U ^ -64.0; else tmp = fma(Float64(l * 2.0), J, U); end return tmp end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -820000000.0], N[Not[LessEqual[l, 1.4]], $MachinePrecision]], N[Power[U, -64.0], $MachinePrecision], N[(N[(l * 2.0), $MachinePrecision] * J + U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -820000000 \lor \neg \left(\ell \leq 1.4\right):\\
\;\;\;\;{U}^{-64}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\ell \cdot 2, J, U\right)\\
\end{array}
\end{array}
(FPCore (J l K U) :precision binary64 (if (or (<= l -820000000.0) (not (<= l 1.4))) (pow U -64.0) (+ U (* l (* J 2.0)))))
double code(double J, double l, double K, double U) {
double tmp;
if ((l <= -820000000.0) || !(l <= 1.4)) {
tmp = pow(U, -64.0);
} else {
tmp = U + (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 <= (-820000000.0d0)) .or. (.not. (l <= 1.4d0))) then
tmp = u ** (-64.0d0)
else
tmp = u + (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 <= -820000000.0) || !(l <= 1.4)) {
tmp = Math.pow(U, -64.0);
} else {
tmp = U + (l * (J * 2.0));
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if (l <= -820000000.0) or not (l <= 1.4): tmp = math.pow(U, -64.0) else: tmp = U + (l * (J * 2.0)) return tmp
function code(J, l, K, U) tmp = 0.0 if ((l <= -820000000.0) || !(l <= 1.4)) tmp = U ^ -64.0; else tmp = Float64(U + Float64(l * Float64(J * 2.0))); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if ((l <= -820000000.0) || ~((l <= 1.4))) tmp = U ^ -64.0; else tmp = U + (l * (J * 2.0)); end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[Or[LessEqual[l, -820000000.0], N[Not[LessEqual[l, 1.4]], $MachinePrecision]], N[Power[U, -64.0], $MachinePrecision], N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq -820000000 \lor \neg \left(\ell \leq 1.4\right):\\
\;\;\;\;{U}^{-64}\\
\mathbf{else}:\\
\;\;\;\;U + \ell \cdot \left(J \cdot 2\right)\\
\end{array}
\end{array}
(FPCore (J l K U)
:precision binary64
(let* ((t_0 (* J (* l 2.0))))
(if (<= J -9.2e+212)
t_0
(if (<= J -5.4e+166)
(+ U 4096.0)
(if (or (<= J -1.95e+73) (not (<= J 1.2e+78))) t_0 U)))))
double code(double J, double l, double K, double U) {
double t_0 = J * (l * 2.0);
double tmp;
if (J <= -9.2e+212) {
tmp = t_0;
} else if (J <= -5.4e+166) {
tmp = U + 4096.0;
} else if ((J <= -1.95e+73) || !(J <= 1.2e+78)) {
tmp = t_0;
} else {
tmp = 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) :: t_0
real(8) :: tmp
t_0 = j * (l * 2.0d0)
if (j <= (-9.2d+212)) then
tmp = t_0
else if (j <= (-5.4d+166)) then
tmp = u + 4096.0d0
else if ((j <= (-1.95d+73)) .or. (.not. (j <= 1.2d+78))) then
tmp = t_0
else
tmp = u
end if
code = tmp
end function
public static double code(double J, double l, double K, double U) {
double t_0 = J * (l * 2.0);
double tmp;
if (J <= -9.2e+212) {
tmp = t_0;
} else if (J <= -5.4e+166) {
tmp = U + 4096.0;
} else if ((J <= -1.95e+73) || !(J <= 1.2e+78)) {
tmp = t_0;
} else {
tmp = U;
}
return tmp;
}
def code(J, l, K, U): t_0 = J * (l * 2.0) tmp = 0 if J <= -9.2e+212: tmp = t_0 elif J <= -5.4e+166: tmp = U + 4096.0 elif (J <= -1.95e+73) or not (J <= 1.2e+78): tmp = t_0 else: tmp = U return tmp
function code(J, l, K, U) t_0 = Float64(J * Float64(l * 2.0)) tmp = 0.0 if (J <= -9.2e+212) tmp = t_0; elseif (J <= -5.4e+166) tmp = Float64(U + 4096.0); elseif ((J <= -1.95e+73) || !(J <= 1.2e+78)) tmp = t_0; else tmp = U; end return tmp end
function tmp_2 = code(J, l, K, U) t_0 = J * (l * 2.0); tmp = 0.0; if (J <= -9.2e+212) tmp = t_0; elseif (J <= -5.4e+166) tmp = U + 4096.0; elseif ((J <= -1.95e+73) || ~((J <= 1.2e+78))) tmp = t_0; else tmp = U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[J, -9.2e+212], t$95$0, If[LessEqual[J, -5.4e+166], N[(U + 4096.0), $MachinePrecision], If[Or[LessEqual[J, -1.95e+73], N[Not[LessEqual[J, 1.2e+78]], $MachinePrecision]], t$95$0, U]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := J \cdot \left(\ell \cdot 2\right)\\
\mathbf{if}\;J \leq -9.2 \cdot 10^{+212}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;J \leq -5.4 \cdot 10^{+166}:\\
\;\;\;\;U + 4096\\
\mathbf{elif}\;J \leq -1.95 \cdot 10^{+73} \lor \neg \left(J \leq 1.2 \cdot 10^{+78}\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\end{array}
(FPCore (J l K U) :precision binary64 (+ U (* l (* J 2.0))))
double code(double J, double l, double K, double U) {
return U + (l * (J * 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 + (l * (j * 2.0d0))
end function
public static double code(double J, double l, double K, double U) {
return U + (l * (J * 2.0));
}
def code(J, l, K, U): return U + (l * (J * 2.0))
function code(J, l, K, U) return Float64(U + Float64(l * Float64(J * 2.0))) end
function tmp = code(J, l, K, U) tmp = U + (l * (J * 2.0)); end
code[J_, l_, K_, U_] := N[(U + N[(l * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
U + \ell \cdot \left(J \cdot 2\right)
\end{array}
(FPCore (J l K U) :precision binary64 (if (<= l 2.6e+80) U (* U U)))
double code(double J, double l, double K, double U) {
double tmp;
if (l <= 2.6e+80) {
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 <= 2.6d+80) 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 <= 2.6e+80) {
tmp = U;
} else {
tmp = U * U;
}
return tmp;
}
def code(J, l, K, U): tmp = 0 if l <= 2.6e+80: tmp = U else: tmp = U * U return tmp
function code(J, l, K, U) tmp = 0.0 if (l <= 2.6e+80) tmp = U; else tmp = Float64(U * U); end return tmp end
function tmp_2 = code(J, l, K, U) tmp = 0.0; if (l <= 2.6e+80) tmp = U; else tmp = U * U; end tmp_2 = tmp; end
code[J_, l_, K_, U_] := If[LessEqual[l, 2.6e+80], U, N[(U * U), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 2.6 \cdot 10^{+80}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;U \cdot U\\
\end{array}
\end{array}
(FPCore (J l K U) :precision binary64 -64.0)
double code(double J, double l, double K, double U) {
return -64.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 = -64.0d0
end function
public static double code(double J, double l, double K, double U) {
return -64.0;
}
def code(J, l, K, U): return -64.0
function code(J, l, K, U) return -64.0 end
function tmp = code(J, l, K, U) tmp = -64.0; end
code[J_, l_, K_, U_] := -64.0
\begin{array}{l}
\\
-64
\end{array}
(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}
herbie shell --seed 2023364
(FPCore (J l K U)
:name "Maksimov and Kolovsky, Equation (4)"
:precision binary64
(+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))