?

Average Error: 18.6 → 9.6
Time: 19.5s
Precision: binary64
Cost: 20616

?

\[\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}\;U \leq -6.6 \cdot 10^{+249}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 4.5 \cdot 10^{+171}:\\ \;\;\;\;\left(\left(-2 \cdot J\right) \cdot t_0\right) \cdot \mathsf{hypot}\left(1, \frac{U}{2 \cdot \left(J \cdot t_0\right)}\right)\\ \mathbf{elif}\;U \leq 9.5 \cdot 10^{+276}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{\frac{U}{J}}{J \cdot {\cos \left(K \cdot 0.5\right)}^{2}}} - 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 (<= U -6.6e+249)
     (- U)
     (if (<= U 4.5e+171)
       (* (* (* -2.0 J) t_0) (hypot 1.0 (/ U (* 2.0 (* J t_0)))))
       (if (<= U 9.5e+276)
         U
         (- (/ -2.0 (/ (/ U J) (* J (pow (cos (* K 0.5)) 2.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 (U <= -6.6e+249) {
		tmp = -U;
	} else if (U <= 4.5e+171) {
		tmp = ((-2.0 * J) * t_0) * hypot(1.0, (U / (2.0 * (J * t_0))));
	} else if (U <= 9.5e+276) {
		tmp = U;
	} else {
		tmp = (-2.0 / ((U / J) / (J * pow(cos((K * 0.5)), 2.0)))) - 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 (U <= -6.6e+249) {
		tmp = -U;
	} else if (U <= 4.5e+171) {
		tmp = ((-2.0 * J) * t_0) * Math.hypot(1.0, (U / (2.0 * (J * t_0))));
	} else if (U <= 9.5e+276) {
		tmp = U;
	} else {
		tmp = (-2.0 / ((U / J) / (J * Math.pow(Math.cos((K * 0.5)), 2.0)))) - 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 U <= -6.6e+249:
		tmp = -U
	elif U <= 4.5e+171:
		tmp = ((-2.0 * J) * t_0) * math.hypot(1.0, (U / (2.0 * (J * t_0))))
	elif U <= 9.5e+276:
		tmp = U
	else:
		tmp = (-2.0 / ((U / J) / (J * math.pow(math.cos((K * 0.5)), 2.0)))) - 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 (U <= -6.6e+249)
		tmp = Float64(-U);
	elseif (U <= 4.5e+171)
		tmp = Float64(Float64(Float64(-2.0 * J) * t_0) * hypot(1.0, Float64(U / Float64(2.0 * Float64(J * t_0)))));
	elseif (U <= 9.5e+276)
		tmp = U;
	else
		tmp = Float64(Float64(-2.0 / Float64(Float64(U / J) / Float64(J * (cos(Float64(K * 0.5)) ^ 2.0)))) - 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 (U <= -6.6e+249)
		tmp = -U;
	elseif (U <= 4.5e+171)
		tmp = ((-2.0 * J) * t_0) * hypot(1.0, (U / (2.0 * (J * t_0))));
	elseif (U <= 9.5e+276)
		tmp = U;
	else
		tmp = (-2.0 / ((U / J) / (J * (cos((K * 0.5)) ^ 2.0)))) - 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[LessEqual[U, -6.6e+249], (-U), If[LessEqual[U, 4.5e+171], N[(N[(N[(-2.0 * J), $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[1.0 ^ 2 + N[(U / N[(2.0 * N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[U, 9.5e+276], U, N[(N[(-2.0 / N[(N[(U / J), $MachinePrecision] / N[(J * N[Power[N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - U), $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)\\
\mathbf{if}\;U \leq -6.6 \cdot 10^{+249}:\\
\;\;\;\;-U\\

\mathbf{elif}\;U \leq 4.5 \cdot 10^{+171}:\\
\;\;\;\;\left(\left(-2 \cdot J\right) \cdot t_0\right) \cdot \mathsf{hypot}\left(1, \frac{U}{2 \cdot \left(J \cdot t_0\right)}\right)\\

\mathbf{elif}\;U \leq 9.5 \cdot 10^{+276}:\\
\;\;\;\;U\\

\mathbf{else}:\\
\;\;\;\;\frac{-2}{\frac{\frac{U}{J}}{J \cdot {\cos \left(K \cdot 0.5\right)}^{2}}} - U\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 4 regimes
  2. if U < -6.60000000000000027e249

    1. Initial program 45.6

      \[\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. Simplified27.1

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

      [Start]45.6

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

      unpow2 [=>]45.6

      \[ \left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\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 [=>]27.1

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

      associate-*l* [=>]27.1

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

      \[\leadsto \color{blue}{-1 \cdot U} \]
    4. Simplified32.9

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

      [Start]32.9

      \[ -1 \cdot U \]

      mul-1-neg [=>]32.9

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

    if -6.60000000000000027e249 < U < 4.49999999999999969e171

    1. Initial program 13.8

      \[\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. Simplified4.8

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

      [Start]13.8

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

      unpow2 [=>]13.8

      \[ \left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\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 [=>]4.8

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

      associate-*l* [=>]4.8

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

    if 4.49999999999999969e171 < U < 9.50000000000000013e276

    1. Initial program 40.8

      \[\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. Simplified23.8

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

      [Start]40.8

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

      unpow2 [=>]40.8

      \[ \left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\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 [=>]23.8

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

      associate-*l* [=>]23.8

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

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

    if 9.50000000000000013e276 < U

    1. Initial program 48.1

      \[\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. Simplified31.6

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

      [Start]48.1

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

      unpow2 [=>]48.1

      \[ \left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\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 [=>]31.6

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

      associate-*l* [=>]31.6

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

      \[\leadsto \color{blue}{-2 \cdot \frac{{\cos \left(0.5 \cdot K\right)}^{2} \cdot {J}^{2}}{U} + -1 \cdot U} \]
    4. Simplified34.5

      \[\leadsto \color{blue}{\frac{-2}{\frac{\frac{U}{J}}{J \cdot {\cos \left(0.5 \cdot K\right)}^{2}}} - U} \]
      Proof

      [Start]40.4

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

      mul-1-neg [=>]40.4

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

      unsub-neg [=>]40.4

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

      associate-*r/ [=>]40.4

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

      associate-/l* [=>]40.4

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

      *-commutative [=>]40.4

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

      unpow2 [=>]40.4

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

      associate-*l* [=>]40.4

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

      associate-/r* [=>]34.5

      \[ \frac{-2}{\color{blue}{\frac{\frac{U}{J}}{J \cdot {\cos \left(0.5 \cdot K\right)}^{2}}}} - U \]
  3. Recombined 4 regimes into one program.
  4. Final simplification9.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;U \leq -6.6 \cdot 10^{+249}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 4.5 \cdot 10^{+171}:\\ \;\;\;\;\left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{2 \cdot \left(J \cdot \cos \left(\frac{K}{2}\right)\right)}\right)\\ \mathbf{elif}\;U \leq 9.5 \cdot 10^{+276}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{\frac{U}{J}}{J \cdot {\cos \left(K \cdot 0.5\right)}^{2}}} - U\\ \end{array} \]

Alternatives

Alternative 1
Error9.7
Cost20616
\[\begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;U \leq -1.25 \cdot 10^{+248}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 2.4 \cdot 10^{+171}:\\ \;\;\;\;-2 \cdot \left(t_0 \cdot \left(J \cdot \mathsf{hypot}\left(1, \frac{U}{2 \cdot \left(J \cdot t_0\right)}\right)\right)\right)\\ \mathbf{elif}\;U \leq 3.5 \cdot 10^{+276}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;\frac{-2}{\frac{\frac{U}{J}}{J \cdot {\cos \left(K \cdot 0.5\right)}^{2}}} - U\\ \end{array} \]
Alternative 2
Error17.9
Cost14224
\[\begin{array}{l} t_0 := \mathsf{hypot}\left(1, \frac{U}{J \cdot 2}\right)\\ t_1 := \left(-2 \cdot J\right) \cdot t_0\\ \mathbf{if}\;U \leq -4.5 \cdot 10^{+248}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq -5.8 \cdot 10^{+169}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;U \leq -2.1 \cdot 10^{+163}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 4.8 \cdot 10^{+39}:\\ \;\;\;\;\left(\left(-2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot t_0\\ \mathbf{elif}\;U \leq 3.8 \cdot 10^{+171}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 3
Error22.8
Cost7568
\[\begin{array}{l} t_0 := \left(-2 \cdot J\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot 2}\right)\\ \mathbf{if}\;U \leq -1.66 \cdot 10^{+249}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq -4.3 \cdot 10^{-51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;U \leq 5 \cdot 10^{-68}:\\ \;\;\;\;\left(-2 \cdot J\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{elif}\;U \leq 3.2 \cdot 10^{+170}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 4
Error26.2
Cost7376
\[\begin{array}{l} t_0 := \left(-2 \cdot J\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{if}\;J \leq -1.35 \cdot 10^{-73}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq 4.2 \cdot 10^{-246}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 3.2 \cdot 10^{-126}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 5 \cdot 10^{-82}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error46.6
Cost788
\[\begin{array}{l} \mathbf{if}\;K \leq -3.9 \cdot 10^{-44}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq -2.8 \cdot 10^{-301}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 0.72:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 1.25 \cdot 10^{+72}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 1.4 \cdot 10^{+184}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;-U\\ \end{array} \]
Alternative 6
Error39.8
Cost788
\[\begin{array}{l} \mathbf{if}\;K \leq -1.5 \cdot 10^{-7}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 1.35 \cdot 10^{-43}:\\ \;\;\;\;-2 \cdot J\\ \mathbf{elif}\;K \leq 0.14:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 5.5 \cdot 10^{+66}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 4.2 \cdot 10^{+183}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;-U\\ \end{array} \]
Alternative 7
Error46.7
Cost64
\[U \]

Error

Reproduce?

herbie shell --seed 2023038 
(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)))))