\[\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)\\
\mathbf{if}\;J \leq -8.5 \cdot 10^{-182} \lor \neg \left(J \leq 1.45 \cdot 10^{-285}\right):\\
\;\;\;\;\left(J \cdot \left(-2 \cdot t_0\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot t_0\right)}\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))))
(if (or (<= J -8.5e-182) (not (<= J 1.45e-285)))
(* (* J (* -2.0 t_0)) (hypot 1.0 (/ U (* J (* 2.0 t_0)))))
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 tmp;
if ((J <= -8.5e-182) || !(J <= 1.45e-285)) {
tmp = (J * (-2.0 * t_0)) * hypot(1.0, (U / (J * (2.0 * t_0))));
} 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 tmp;
if ((J <= -8.5e-182) || !(J <= 1.45e-285)) {
tmp = (J * (-2.0 * t_0)) * Math.hypot(1.0, (U / (J * (2.0 * t_0))));
} 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))
tmp = 0
if (J <= -8.5e-182) or not (J <= 1.45e-285):
tmp = (J * (-2.0 * t_0)) * math.hypot(1.0, (U / (J * (2.0 * t_0))))
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))
tmp = 0.0
if ((J <= -8.5e-182) || !(J <= 1.45e-285))
tmp = Float64(Float64(J * Float64(-2.0 * t_0)) * hypot(1.0, Float64(U / Float64(J * Float64(2.0 * t_0)))));
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));
tmp = 0.0;
if ((J <= -8.5e-182) || ~((J <= 1.45e-285)))
tmp = (J * (-2.0 * t_0)) * hypot(1.0, (U / (J * (2.0 * t_0))));
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]}, If[Or[LessEqual[J, -8.5e-182], N[Not[LessEqual[J, 1.45e-285]], $MachinePrecision]], N[(N[(J * N[(-2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * N[Sqrt[1.0 ^ 2 + N[(U / N[(J * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $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)\\
\mathbf{if}\;J \leq -8.5 \cdot 10^{-182} \lor \neg \left(J \leq 1.45 \cdot 10^{-285}\right):\\
\;\;\;\;\left(J \cdot \left(-2 \cdot t_0\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot t_0\right)}\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 72.2% |
|---|
| Cost | 13961 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -1.1 \cdot 10^{-168} \lor \neg \left(J \leq 3.8 \cdot 10^{-174}\right):\\
\;\;\;\;\left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, U \cdot \frac{0.5}{J}\right)\\
\mathbf{else}:\\
\;\;\;\;-U\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 72.3% |
|---|
| Cost | 13961 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -1.3 \cdot 10^{-168} \lor \neg \left(J \leq 4.6 \cdot 10^{-175}\right):\\
\;\;\;\;\left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot 2}\right)\\
\mathbf{else}:\\
\;\;\;\;-U\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 63.9% |
|---|
| Cost | 7568 |
|---|
\[\begin{array}{l}
t_0 := -2 \cdot \left(J \cdot \mathsf{hypot}\left(1, 0.5 \cdot \frac{U}{J}\right)\right)\\
\mathbf{if}\;U \leq -1.75 \cdot 10^{+223}:\\
\;\;\;\;-U\\
\mathbf{elif}\;U \leq -6 \cdot 10^{-67}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;U \leq 6.8 \cdot 10^{-41}:\\
\;\;\;\;\left(J \cdot -2\right) \cdot \cos \left(K \cdot 0.5\right)\\
\mathbf{elif}\;U \leq 8.4 \cdot 10^{+130}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 57.6% |
|---|
| Cost | 7440 |
|---|
\[\begin{array}{l}
\mathbf{if}\;U \leq -1.15 \cdot 10^{+224}:\\
\;\;\;\;-U\\
\mathbf{elif}\;U \leq -3.2 \cdot 10^{+137}:\\
\;\;\;\;-2 \cdot \left(U \cdot -0.5 - \frac{J}{\frac{U}{J}}\right)\\
\mathbf{elif}\;U \leq 32000000000:\\
\;\;\;\;\left(J \cdot -2\right) \cdot \cos \left(K \cdot 0.5\right)\\
\mathbf{elif}\;U \leq 1.26 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(-2, \frac{J \cdot J}{U}, -U\right)\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 57.7% |
|---|
| Cost | 7244 |
|---|
\[\begin{array}{l}
\mathbf{if}\;U \leq -4.1 \cdot 10^{+223}:\\
\;\;\;\;-U\\
\mathbf{elif}\;U \leq -5.6 \cdot 10^{+137}:\\
\;\;\;\;-2 \cdot \left(U \cdot -0.5 - \frac{J}{\frac{U}{J}}\right)\\
\mathbf{elif}\;U \leq 31000000000:\\
\;\;\;\;\left(J \cdot -2\right) \cdot \cos \left(K \cdot 0.5\right)\\
\mathbf{elif}\;U \leq 1.1 \cdot 10^{+132}:\\
\;\;\;\;-U\\
\mathbf{else}:\\
\;\;\;\;U\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 40.7% |
|---|
| Cost | 836 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -2.4 \cdot 10^{-23}:\\
\;\;\;\;-2 \cdot \left(J + \frac{U}{J} \cdot \left(U \cdot 0.125\right)\right)\\
\mathbf{elif}\;J \leq 2.6 \cdot 10^{-291}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 3.8 \cdot 10^{-171}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq 0.0255:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;J \cdot -2\\
\end{array}
\]
| Alternative 7 |
|---|
| Accuracy | 40.7% |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;J \leq -1.15 \cdot 10^{-26}:\\
\;\;\;\;J \cdot -2\\
\mathbf{elif}\;J \leq 2.7 \cdot 10^{-291}:\\
\;\;\;\;U\\
\mathbf{elif}\;J \leq 3.4 \cdot 10^{-171}:\\
\;\;\;\;-U\\
\mathbf{elif}\;J \leq 4.8 \cdot 10^{-6}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;J \cdot -2\\
\end{array}
\]
| Alternative 8 |
|---|
| Accuracy | 27.2% |
|---|
| Cost | 524 |
|---|
\[\begin{array}{l}
\mathbf{if}\;K \leq -3.6 \cdot 10^{-152}:\\
\;\;\;\;U\\
\mathbf{elif}\;K \leq 1.8 \cdot 10^{-129}:\\
\;\;\;\;-U\\
\mathbf{elif}\;K \leq 1.2 \cdot 10^{+132}:\\
\;\;\;\;U\\
\mathbf{else}:\\
\;\;\;\;-U\\
\end{array}
\]
| Alternative 9 |
|---|
| Accuracy | 27.7% |
|---|
| Cost | 64 |
|---|
\[U
\]