?

Average Accuracy: 71.2% → 85.9%
Time: 22.7s
Precision: binary64
Cost: 20880

?

\[\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 := \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot t_0\right)}\right)\\ t_2 := \left(J \cdot \left(-2 \cdot t_0\right)\right) \cdot t_1\\ \mathbf{if}\;J \leq -3.2 \cdot 10^{-206}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;J \leq -1.46 \cdot 10^{-260}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 3.4 \cdot 10^{-197}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;J \leq 10^{-181}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(t_0 \cdot \left(-2 \cdot t_1\right)\right)\\ \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 (hypot 1.0 (/ U (* J (* 2.0 t_0)))))
        (t_2 (* (* J (* -2.0 t_0)) t_1)))
   (if (<= J -3.2e-206)
     t_2
     (if (<= J -1.46e-260)
       U
       (if (<= J 3.4e-197)
         t_2
         (if (<= J 1e-181) U (* J (* t_0 (* -2.0 t_1)))))))))
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 = hypot(1.0, (U / (J * (2.0 * t_0))));
	double t_2 = (J * (-2.0 * t_0)) * t_1;
	double tmp;
	if (J <= -3.2e-206) {
		tmp = t_2;
	} else if (J <= -1.46e-260) {
		tmp = U;
	} else if (J <= 3.4e-197) {
		tmp = t_2;
	} else if (J <= 1e-181) {
		tmp = U;
	} else {
		tmp = J * (t_0 * (-2.0 * t_1));
	}
	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.hypot(1.0, (U / (J * (2.0 * t_0))));
	double t_2 = (J * (-2.0 * t_0)) * t_1;
	double tmp;
	if (J <= -3.2e-206) {
		tmp = t_2;
	} else if (J <= -1.46e-260) {
		tmp = U;
	} else if (J <= 3.4e-197) {
		tmp = t_2;
	} else if (J <= 1e-181) {
		tmp = U;
	} else {
		tmp = J * (t_0 * (-2.0 * t_1));
	}
	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.hypot(1.0, (U / (J * (2.0 * t_0))))
	t_2 = (J * (-2.0 * t_0)) * t_1
	tmp = 0
	if J <= -3.2e-206:
		tmp = t_2
	elif J <= -1.46e-260:
		tmp = U
	elif J <= 3.4e-197:
		tmp = t_2
	elif J <= 1e-181:
		tmp = U
	else:
		tmp = J * (t_0 * (-2.0 * t_1))
	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 = hypot(1.0, Float64(U / Float64(J * Float64(2.0 * t_0))))
	t_2 = Float64(Float64(J * Float64(-2.0 * t_0)) * t_1)
	tmp = 0.0
	if (J <= -3.2e-206)
		tmp = t_2;
	elseif (J <= -1.46e-260)
		tmp = U;
	elseif (J <= 3.4e-197)
		tmp = t_2;
	elseif (J <= 1e-181)
		tmp = U;
	else
		tmp = Float64(J * Float64(t_0 * Float64(-2.0 * t_1)));
	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 = hypot(1.0, (U / (J * (2.0 * t_0))));
	t_2 = (J * (-2.0 * t_0)) * t_1;
	tmp = 0.0;
	if (J <= -3.2e-206)
		tmp = t_2;
	elseif (J <= -1.46e-260)
		tmp = U;
	elseif (J <= 3.4e-197)
		tmp = t_2;
	elseif (J <= 1e-181)
		tmp = U;
	else
		tmp = J * (t_0 * (-2.0 * t_1));
	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[Sqrt[1.0 ^ 2 + N[(U / N[(J * N[(2.0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]}, Block[{t$95$2 = N[(N[(J * N[(-2.0 * t$95$0), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[J, -3.2e-206], t$95$2, If[LessEqual[J, -1.46e-260], U, If[LessEqual[J, 3.4e-197], t$95$2, If[LessEqual[J, 1e-181], U, N[(J * N[(t$95$0 * N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\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 := \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot t_0\right)}\right)\\
t_2 := \left(J \cdot \left(-2 \cdot t_0\right)\right) \cdot t_1\\
\mathbf{if}\;J \leq -3.2 \cdot 10^{-206}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;J \leq -1.46 \cdot 10^{-260}:\\
\;\;\;\;U\\

\mathbf{elif}\;J \leq 3.4 \cdot 10^{-197}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;J \leq 10^{-181}:\\
\;\;\;\;U\\

\mathbf{else}:\\
\;\;\;\;J \cdot \left(t_0 \cdot \left(-2 \cdot t_1\right)\right)\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 3 regimes
  2. if J < -3.19999999999999976e-206 or -1.45999999999999995e-260 < J < 3.3999999999999998e-197

    1. Initial program 66.9%

      \[\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}} \]
    2. Simplified84.0%

      \[\leadsto \color{blue}{\left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}\right)} \]
      Proof

      [Start]66.9

      \[ \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}} \]

      *-commutative [=>]66.9

      \[ \left(\color{blue}{\left(J \cdot -2\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}} \]

      associate-*l* [=>]66.9

      \[ \color{blue}{\left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right)} \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \]

      unpow2 [=>]66.9

      \[ \left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \sqrt{1 + \color{blue}{\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)} \cdot \frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}}} \]

      hypot-1-def [=>]84.0

      \[ \left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \color{blue}{\mathsf{hypot}\left(1, \frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)} \]

      *-commutative [=>]84.0

      \[ \left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{\color{blue}{\left(J \cdot 2\right)} \cdot \cos \left(\frac{K}{2}\right)}\right) \]

      associate-*l* [=>]84.0

      \[ \left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{\color{blue}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}}\right) \]

    if -3.19999999999999976e-206 < J < -1.45999999999999995e-260 or 3.3999999999999998e-197 < J < 1.00000000000000005e-181

    1. Initial program 42.3%

      \[\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}} \]
    2. Simplified62.2%

      \[\leadsto \color{blue}{J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}\right)\right)\right)} \]
      Proof

      [Start]42.3

      \[ \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}} \]

      *-commutative [=>]42.3

      \[ \color{blue}{\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot \left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right)} \]

      associate-*l* [=>]42.3

      \[ \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot \color{blue}{\left(-2 \cdot \left(J \cdot \cos \left(\frac{K}{2}\right)\right)\right)} \]

      associate-*r* [=>]42.3

      \[ \color{blue}{\left(\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot -2\right) \cdot \left(J \cdot \cos \left(\frac{K}{2}\right)\right)} \]

      *-commutative [=>]42.3

      \[ \color{blue}{\left(J \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot -2\right)} \]

      associate-*l* [=>]42.2

      \[ \color{blue}{J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot -2\right)\right)} \]

      *-commutative [=>]42.2

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \color{blue}{\left(-2 \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}\right)}\right) \]

      unpow2 [=>]42.2

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \sqrt{1 + \color{blue}{\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)} \cdot \frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}}}\right)\right) \]

      hypot-1-def [=>]62.2

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \color{blue}{\mathsf{hypot}\left(1, \frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}\right)\right) \]

      *-commutative [=>]62.2

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{\color{blue}{\left(J \cdot 2\right)} \cdot \cos \left(\frac{K}{2}\right)}\right)\right)\right) \]

      associate-*l* [=>]62.2

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{\color{blue}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}}\right)\right)\right) \]
    3. Taylor expanded in U around -inf 42.0%

      \[\leadsto \color{blue}{U} \]

    if 1.00000000000000005e-181 < J

    1. Initial program 80.9%

      \[\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}} \]
    2. Simplified94.3%

      \[\leadsto \color{blue}{J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}\right)\right)\right)} \]
      Proof

      [Start]80.9

      \[ \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}} \]

      *-commutative [=>]80.9

      \[ \color{blue}{\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot \left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right)} \]

      associate-*l* [=>]80.9

      \[ \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot \color{blue}{\left(-2 \cdot \left(J \cdot \cos \left(\frac{K}{2}\right)\right)\right)} \]

      associate-*r* [=>]80.9

      \[ \color{blue}{\left(\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot -2\right) \cdot \left(J \cdot \cos \left(\frac{K}{2}\right)\right)} \]

      *-commutative [=>]80.9

      \[ \color{blue}{\left(J \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot -2\right)} \]

      associate-*l* [=>]80.9

      \[ \color{blue}{J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(\sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}} \cdot -2\right)\right)} \]

      *-commutative [=>]80.9

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \color{blue}{\left(-2 \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}\right)}\right) \]

      unpow2 [=>]80.9

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \sqrt{1 + \color{blue}{\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)} \cdot \frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}}}\right)\right) \]

      hypot-1-def [=>]94.3

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \color{blue}{\mathsf{hypot}\left(1, \frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}\right)\right) \]

      *-commutative [=>]94.3

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{\color{blue}{\left(J \cdot 2\right)} \cdot \cos \left(\frac{K}{2}\right)}\right)\right)\right) \]

      associate-*l* [=>]94.3

      \[ J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{\color{blue}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}}\right)\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification85.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq -3.2 \cdot 10^{-206}:\\ \;\;\;\;\left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}\right)\\ \mathbf{elif}\;J \leq -1.46 \cdot 10^{-260}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 3.4 \cdot 10^{-197}:\\ \;\;\;\;\left(J \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}\right)\\ \mathbf{elif}\;J \leq 10^{-181}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot \cos \left(\frac{K}{2}\right)\right)}\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Accuracy85.9%
Cost20882
\[\begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;J \leq -2.15 \cdot 10^{-206} \lor \neg \left(J \leq -8 \cdot 10^{-261} \lor \neg \left(J \leq 6 \cdot 10^{-197}\right) \land J \leq 5.2 \cdot 10^{-182}\right):\\ \;\;\;\;J \cdot \left(t_0 \cdot \left(-2 \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 \cdot t_0\right)}\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 2
Accuracy71.5%
Cost14224
\[\begin{array}{l} t_0 := \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{if}\;J \leq -2.1 \cdot 10^{-90}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -4.5 \cdot 10^{-303}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.4 \cdot 10^{-201}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 5.2 \cdot 10^{-182}:\\ \;\;\;\;\frac{J \cdot U}{J}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Accuracy64.9%
Cost8204
\[\begin{array}{l} t_0 := -2 \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\\ \mathbf{if}\;K \leq -5.6 \cdot 10^{+159}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;K \leq -2.8 \cdot 10^{+46}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 1.1 \cdot 10^{-12}:\\ \;\;\;\;\left(J \cdot \left(-2 + 0.25 \cdot \left(K \cdot K\right)\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Accuracy64.7%
Cost7820
\[\begin{array}{l} t_0 := -2 \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\\ \mathbf{if}\;K \leq -1.15 \cdot 10^{+159}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;K \leq -3.2 \cdot 10^{+24}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 1.1 \cdot 10^{-12}:\\ \;\;\;\;\mathsf{hypot}\left(1, \frac{U}{J \cdot \left(2 + \left(K \cdot K\right) \cdot -0.25\right)}\right) \cdot \left(J \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Accuracy59.5%
Cost7376
\[\begin{array}{l} t_0 := -2 \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right)\\ \mathbf{if}\;J \leq -1.35 \cdot 10^{-89}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -1.8 \cdot 10^{-300}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.9 \cdot 10^{-202}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 2.9 \cdot 10^{-76}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Accuracy37.3%
Cost1316
\[\begin{array}{l} \mathbf{if}\;U \leq -2.8 \cdot 10^{-14}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 4.3 \cdot 10^{-153}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 4.4 \cdot 10^{-51}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 3.5 \cdot 10^{-37}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 2.2 \cdot 10^{-13}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 26000000:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 1.6 \cdot 10^{+35}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 2.8 \cdot 10^{+183}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 3.7 \cdot 10^{+195}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 7
Accuracy37.3%
Cost1316
\[\begin{array}{l} \mathbf{if}\;U \leq -1.7 \cdot 10^{-13}:\\ \;\;\;\;-2 \cdot \left(U \cdot -0.5 - J \cdot \frac{J}{U}\right)\\ \mathbf{elif}\;U \leq 7.5 \cdot 10^{-151}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 1.9 \cdot 10^{-54}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 1.15 \cdot 10^{-43}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 4.3 \cdot 10^{-16}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 3700000:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 8 \cdot 10^{+35}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 3.5 \cdot 10^{+183}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 1.62 \cdot 10^{+192}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 8
Accuracy37.2%
Cost1316
\[\begin{array}{l} \mathbf{if}\;U \leq -1.4 \cdot 10^{-14}:\\ \;\;\;\;-2 \cdot \left(U \cdot -0.5 - J \cdot \frac{J}{U}\right)\\ \mathbf{elif}\;U \leq 7.5 \cdot 10^{-151}:\\ \;\;\;\;J \cdot -2 + \left(U \cdot -0.25\right) \cdot \frac{U}{J}\\ \mathbf{elif}\;U \leq 1.3 \cdot 10^{-52}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 3.8 \cdot 10^{-37}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 1.72 \cdot 10^{-15}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 43:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 1.1 \cdot 10^{+35}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;U \leq 9.5 \cdot 10^{+182}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 7.1 \cdot 10^{+193}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 9
Accuracy26.5%
Cost656
\[\begin{array}{l} \mathbf{if}\;J \leq -1.05 \cdot 10^{-303}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.4 \cdot 10^{-201}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 2.25 \cdot 10^{-42}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.3 \cdot 10^{+63}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 10
Accuracy26.2%
Cost64
\[U \]

Error

Reproduce?

herbie shell --seed 2023151 
(FPCore (J K U)
  :name "Maksimov and Kolovsky, Equation (3)"
  :precision binary64
  (* (* (* -2.0 J) (cos (/ K 2.0))) (sqrt (+ 1.0 (pow (/ U (* (* 2.0 J) (cos (/ K 2.0)))) 2.0)))))