\[\left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}
\]
↓
\[\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\left(t_0 \cdot \left(-2 \cdot J\right)\right) \cdot \sqrt{1 + {\left(\frac{U}{t_0 \cdot \left(J \cdot 2\right)}\right)}^{2}} \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\left(J \cdot \mathsf{hypot}\left(1, \frac{U}{\left(J \cdot 2\right) \cdot t_1}\right)\right) \cdot \left(-2 \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
(FPCore (J K U)
:precision binary64
(*
(* (* -2.0 J) (cos (/ K 2.0)))
(sqrt (+ 1.0 (pow (/ U (* (* 2.0 J) (cos (/ K 2.0)))) 2.0)))))
↓
(FPCore (J K U)
:precision binary64
(let* ((t_0 (cos (/ K 2.0))) (t_1 (cos (* K 0.5))))
(if (<=
(* (* t_0 (* -2.0 J)) (sqrt (+ 1.0 (pow (/ U (* t_0 (* J 2.0))) 2.0))))
2e+306)
(* (* J (hypot 1.0 (/ U (* (* J 2.0) t_1)))) (* -2.0 t_1))
U)))double code(double J, double K, double U) {
return ((-2.0 * J) * cos((K / 2.0))) * sqrt((1.0 + pow((U / ((2.0 * J) * cos((K / 2.0)))), 2.0)));
}
↓
double code(double J, double K, double U) {
double t_0 = cos((K / 2.0));
double t_1 = cos((K * 0.5));
double tmp;
if (((t_0 * (-2.0 * J)) * sqrt((1.0 + pow((U / (t_0 * (J * 2.0))), 2.0)))) <= 2e+306) {
tmp = (J * hypot(1.0, (U / ((J * 2.0) * t_1)))) * (-2.0 * t_1);
} else {
tmp = U;
}
return tmp;
}
public static double code(double J, double K, double U) {
return ((-2.0 * J) * Math.cos((K / 2.0))) * Math.sqrt((1.0 + Math.pow((U / ((2.0 * J) * Math.cos((K / 2.0)))), 2.0)));
}
↓
public static double code(double J, double K, double U) {
double t_0 = Math.cos((K / 2.0));
double t_1 = Math.cos((K * 0.5));
double tmp;
if (((t_0 * (-2.0 * J)) * Math.sqrt((1.0 + Math.pow((U / (t_0 * (J * 2.0))), 2.0)))) <= 2e+306) {
tmp = (J * Math.hypot(1.0, (U / ((J * 2.0) * t_1)))) * (-2.0 * t_1);
} else {
tmp = U;
}
return tmp;
}
def code(J, K, U):
return ((-2.0 * J) * math.cos((K / 2.0))) * math.sqrt((1.0 + math.pow((U / ((2.0 * J) * math.cos((K / 2.0)))), 2.0)))
↓
def code(J, K, U):
t_0 = math.cos((K / 2.0))
t_1 = math.cos((K * 0.5))
tmp = 0
if ((t_0 * (-2.0 * J)) * math.sqrt((1.0 + math.pow((U / (t_0 * (J * 2.0))), 2.0)))) <= 2e+306:
tmp = (J * math.hypot(1.0, (U / ((J * 2.0) * t_1)))) * (-2.0 * t_1)
else:
tmp = U
return tmp
function code(J, K, U)
return Float64(Float64(Float64(-2.0 * J) * cos(Float64(K / 2.0))) * sqrt(Float64(1.0 + (Float64(U / Float64(Float64(2.0 * J) * cos(Float64(K / 2.0)))) ^ 2.0))))
end
↓
function code(J, K, U)
t_0 = cos(Float64(K / 2.0))
t_1 = cos(Float64(K * 0.5))
tmp = 0.0
if (Float64(Float64(t_0 * Float64(-2.0 * J)) * sqrt(Float64(1.0 + (Float64(U / Float64(t_0 * Float64(J * 2.0))) ^ 2.0)))) <= 2e+306)
tmp = Float64(Float64(J * hypot(1.0, Float64(U / Float64(Float64(J * 2.0) * t_1)))) * Float64(-2.0 * t_1));
else
tmp = U;
end
return tmp
end
function tmp = code(J, K, U)
tmp = ((-2.0 * J) * cos((K / 2.0))) * sqrt((1.0 + ((U / ((2.0 * J) * cos((K / 2.0)))) ^ 2.0)));
end
↓
function tmp_2 = code(J, K, U)
t_0 = cos((K / 2.0));
t_1 = cos((K * 0.5));
tmp = 0.0;
if (((t_0 * (-2.0 * J)) * sqrt((1.0 + ((U / (t_0 * (J * 2.0))) ^ 2.0)))) <= 2e+306)
tmp = (J * hypot(1.0, (U / ((J * 2.0) * t_1)))) * (-2.0 * t_1);
else
tmp = U;
end
tmp_2 = tmp;
end
code[J_, K_, U_] := N[(N[(N[(-2.0 * J), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 + N[Power[N[(U / N[(N[(2.0 * J), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
↓
code[J_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(N[(t$95$0 * N[(-2.0 * J), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 + N[Power[N[(U / N[(t$95$0 * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e+306], N[(N[(J * N[Sqrt[1.0 ^ 2 + N[(U / N[(N[(J * 2.0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] * N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision], U]]]
\left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}
↓
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
t_1 := \cos \left(K \cdot 0.5\right)\\
\mathbf{if}\;\left(t_0 \cdot \left(-2 \cdot J\right)\right) \cdot \sqrt{1 + {\left(\frac{U}{t_0 \cdot \left(J \cdot 2\right)}\right)}^{2}} \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\left(J \cdot \mathsf{hypot}\left(1, \frac{U}{\left(J \cdot 2\right) \cdot t_1}\right)\right) \cdot \left(-2 \cdot t_1\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 16.8 |
|---|
| Cost | 13960 |
|---|
\[\begin{array}{l}
\mathbf{if}\;U \leq -1.890002561498521 \cdot 10^{+179}:\\
\;\;\;\;U\\
\mathbf{elif}\;U \leq 2.5599760365168285 \cdot 10^{+229}:\\
\;\;\;\;\left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot J\right)\right) \cdot \mathsf{hypot}\left(1, 0.5 \cdot \frac{U}{J}\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 27.5 |
|---|
| Cost | 7888 |
|---|
\[\begin{array}{l}
t_0 := J \cdot \left(-2 \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{if}\;U \leq -7.509153478492834 \cdot 10^{+56}:\\
\;\;\;\;U\\
\mathbf{elif}\;U \leq 2.1643678618369995 \cdot 10^{-133}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;U \leq 2.8723561608757963 \cdot 10^{-84}:\\
\;\;\;\;\left(-2 \cdot J\right) \cdot \sqrt{1 + 0.25 \cdot \left(\frac{U}{J} \cdot \frac{U}{J}\right)}\\
\mathbf{elif}\;U \leq 2.0682147269950717 \cdot 10^{+35}:\\
\;\;\;\;t_0 + \frac{U}{J} \cdot \left(U \cdot -0.25\right)\\
\mathbf{elif}\;U \leq 4.6649191171322224 \cdot 10^{+108}:\\
\;\;\;\;U\\
\mathbf{elif}\;U \leq 2.5599760365168285 \cdot 10^{+229}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 27.2 |
|---|
| Cost | 7376 |
|---|
\[\begin{array}{l}
t_0 := J \cdot \left(-2 \cdot \cos \left(K \cdot 0.5\right)\right)\\
\mathbf{if}\;U \leq -7.509153478492834 \cdot 10^{+56}:\\
\;\;\;\;U\\
\mathbf{elif}\;U \leq 2.0682147269950717 \cdot 10^{+35}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;U \leq 4.6649191171322224 \cdot 10^{+108}:\\
\;\;\;\;U\\
\mathbf{elif}\;U \leq 2.5599760365168285 \cdot 10^{+229}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 37.7 |
|---|
| Cost | 1116 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -1.1797990684181379 \cdot 10^{-26}:\\
\;\;\;\;-2 \cdot J\\
\mathbf{elif}\;J \leq -1.200607791964246 \cdot 10^{-81}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq -6.363955357020148 \cdot 10^{-169}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq -2.027678991683289 \cdot 10^{-273}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 8.230462987396467 \cdot 10^{-273}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq 6.99801920754704 \cdot 10^{-195}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 1.7739290511688193 \cdot 10^{-125}:\\
\;\;\;\;-U\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot J\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 37.7 |
|---|
| Cost | 1116 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -1.1797990684181379 \cdot 10^{-26}:\\
\;\;\;\;-2 \cdot J\\
\mathbf{elif}\;J \leq -1.200607791964246 \cdot 10^{-81}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq -6.363955357020148 \cdot 10^{-169}:\\
\;\;\;\;\frac{J \cdot U}{-J}\\
\mathbf{elif}\;J \leq -2.027678991683289 \cdot 10^{-273}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 8.230462987396467 \cdot 10^{-273}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq 6.99801920754704 \cdot 10^{-195}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 1.7739290511688193 \cdot 10^{-125}:\\
\;\;\;\;-U\\
\mathbf{else}:\\
\;\;\;\;-2 \cdot J\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 46.4 |
|---|
| Cost | 920 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -1.200607791964246 \cdot 10^{-81}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq -9.4863694884569 \cdot 10^{-188}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq -2.027678991683289 \cdot 10^{-273}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 8.230462987396467 \cdot 10^{-273}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq 6.99801920754704 \cdot 10^{-195}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 1.7739290511688193 \cdot 10^{-125}:\\
\;\;\;\;-U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 46.3 |
|---|
| Cost | 64 |
|---|
\[U
\]