?

Average Error: 17.8 → 8.9
Time: 20.7s
Precision: binary64
Cost: 80776

?

\[\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 := \left(\left(-2 \cdot J\right) \cdot t_0\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot t_0}\right)}^{2}}\\ \mathbf{if}\;t_1 \leq -\infty:\\ \;\;\;\;U\\ \mathbf{elif}\;t_1 \leq 10^{+308}:\\ \;\;\;\;t_1\\ \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
         (*
          (* (* -2.0 J) t_0)
          (sqrt (+ 1.0 (pow (/ U (* (* 2.0 J) t_0)) 2.0))))))
   (if (<= t_1 (- INFINITY)) U (if (<= t_1 1e+308) 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 = ((-2.0 * J) * t_0) * sqrt((1.0 + pow((U / ((2.0 * J) * t_0)), 2.0)));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = U;
	} else if (t_1 <= 1e+308) {
		tmp = 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 = ((-2.0 * J) * t_0) * Math.sqrt((1.0 + Math.pow((U / ((2.0 * J) * t_0)), 2.0)));
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = U;
	} else if (t_1 <= 1e+308) {
		tmp = 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 = ((-2.0 * J) * t_0) * math.sqrt((1.0 + math.pow((U / ((2.0 * J) * t_0)), 2.0)))
	tmp = 0
	if t_1 <= -math.inf:
		tmp = U
	elif t_1 <= 1e+308:
		tmp = 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 = Float64(Float64(Float64(-2.0 * J) * t_0) * sqrt(Float64(1.0 + (Float64(U / Float64(Float64(2.0 * J) * t_0)) ^ 2.0))))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = U;
	elseif (t_1 <= 1e+308)
		tmp = t_1;
	else
		tmp = Float64(-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 = ((-2.0 * J) * t_0) * sqrt((1.0 + ((U / ((2.0 * J) * t_0)) ^ 2.0)));
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = U;
	elseif (t_1 <= 1e+308)
		tmp = 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[(N[(N[(-2.0 * J), $MachinePrecision] * t$95$0), $MachinePrecision] * N[Sqrt[N[(1.0 + N[Power[N[(U / N[(N[(2.0 * J), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], U, If[LessEqual[t$95$1, 1e+308], t$95$1, (-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 := \left(\left(-2 \cdot J\right) \cdot t_0\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot t_0}\right)}^{2}}\\
\mathbf{if}\;t_1 \leq -\infty:\\
\;\;\;\;U\\

\mathbf{elif}\;t_1 \leq 10^{+308}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;-U\\


\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 (*.f64 (*.f64 (*.f64 -2 J) (cos.f64 (/.f64 K 2))) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2)))) < -inf.0

    1. Initial program 64.0

      \[\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. Simplified64.0

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

      [Start]64.0

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

      rational.json-simplify-2 [=>]64.0

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

      rational.json-simplify-43 [=>]64.0

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

      trig.json-simplify-24 [=>]64.0

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

      trig.json-simplify-24 [=>]64.0

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

      rational.json-simplify-8 [=>]64.0

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

      rational.json-simplify-2 [=>]64.0

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

      rational.json-simplify-10 [=>]64.0

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

      rational.json-simplify-47 [=>]64.0

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

      metadata-eval [=>]64.0

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

      rational.json-simplify-49 [<=]64.0

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

      rational.json-simplify-2 [=>]64.0

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

      rational.json-simplify-49 [=>]64.0

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

      metadata-eval [=>]64.0

      \[ \left(-2 \cdot J\right) \cdot \left(\cos \left(K \cdot \color{blue}{0.5}\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}\right) \]
    3. Taylor expanded in U around -inf 31.9

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

    if -inf.0 < (*.f64 (*.f64 (*.f64 -2 J) (cos.f64 (/.f64 K 2))) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2)))) < 1e308

    1. Initial program 0.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}} \]

    if 1e308 < (*.f64 (*.f64 (*.f64 -2 J) (cos.f64 (/.f64 K 2))) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2))))

    1. Initial program 64.0

      \[\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. Simplified64.0

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

      [Start]64.0

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

      rational.json-simplify-2 [=>]64.0

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

      rational.json-simplify-43 [=>]64.0

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

      trig.json-simplify-24 [=>]64.0

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

      trig.json-simplify-24 [=>]64.0

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

      rational.json-simplify-8 [=>]64.0

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

      rational.json-simplify-2 [=>]64.0

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

      rational.json-simplify-10 [=>]64.0

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

      rational.json-simplify-47 [=>]64.0

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

      metadata-eval [=>]64.0

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

      rational.json-simplify-49 [<=]64.0

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

      rational.json-simplify-2 [=>]64.0

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

      rational.json-simplify-49 [=>]64.0

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

      metadata-eval [=>]64.0

      \[ \left(-2 \cdot J\right) \cdot \left(\cos \left(K \cdot \color{blue}{0.5}\right) \cdot \sqrt{1 + {\left(\frac{U}{\left(2 \cdot J\right) \cdot \cos \left(\frac{K}{2}\right)}\right)}^{2}}\right) \]
    3. Taylor expanded in J around 0 31.8

      \[\leadsto \color{blue}{-1 \cdot U} \]
    4. Simplified31.8

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

      [Start]31.8

      \[ -1 \cdot U \]

      rational.json-simplify-2 [=>]31.8

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

      rational.json-simplify-8 [<=]31.8

      \[ \color{blue}{-U} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification8.9

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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}} \leq -\infty:\\ \;\;\;\;U\\ \mathbf{elif}\;\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}} \leq 10^{+308}:\\ \;\;\;\;\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}}\\ \mathbf{else}:\\ \;\;\;\;-U\\ \end{array} \]

Alternatives

Alternative 1
Error16.8
Cost27144
\[\begin{array}{l} t_0 := \cos \left(K \cdot 0.5\right)\\ \mathbf{if}\;U \leq -2.7 \cdot 10^{+228}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq 1.4 \cdot 10^{+170}:\\ \;\;\;\;\left(-2 \cdot J\right) \cdot \left(t_0 \cdot \sqrt{1 + {\left(\frac{U}{J \cdot \left(2 \cdot t_0\right)}\right)}^{2}}\right)\\ \mathbf{else}:\\ \;\;\;\;U\\ \end{array} \]
Alternative 2
Error22.8
Cost21016
\[\begin{array}{l} t_0 := \left(-2 \cdot J\right) \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \sqrt{1 + {\left(\frac{U}{J + J}\right)}^{2}}\right)\\ \mathbf{if}\;J \leq -2 \cdot 10^{+32}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -1.45 \cdot 10^{-42}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq -4.8 \cdot 10^{-99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -8 \cdot 10^{-143}:\\ \;\;\;\;U + 2 \cdot \frac{{\left(J \cdot \cos \left(0.5 \cdot K\right)\right)}^{2}}{U}\\ \mathbf{elif}\;J \leq -1.2 \cdot 10^{-249}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq 8 \cdot 10^{-127}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error26.5
Cost14096
\[\begin{array}{l} t_0 := \cos \left(0.5 \cdot K\right)\\ t_1 := U + 2 \cdot \frac{{\left(J \cdot t_0\right)}^{2}}{U}\\ t_2 := t_0 \cdot \left(J \cdot -2\right)\\ \mathbf{if}\;J \leq -1.95 \cdot 10^{+31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;J \leq -4.7 \cdot 10^{-43}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq -4.8 \cdot 10^{-99}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;J \leq -1.85 \cdot 10^{-249}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq 2.35 \cdot 10^{-126}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 4
Error26.4
Cost7508
\[\begin{array}{l} t_0 := \cos \left(0.5 \cdot K\right) \cdot \left(J \cdot -2\right)\\ \mathbf{if}\;J \leq -6.4 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -3.7 \cdot 10^{-43}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq -3 \cdot 10^{-97}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -1.8 \cdot 10^{-249}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.05 \cdot 10^{-126}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 5
Error38.8
Cost1236
\[\begin{array}{l} \mathbf{if}\;J \leq -1.75 \cdot 10^{+68}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;J \leq -3.4 \cdot 10^{-250}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 4.8 \cdot 10^{-63}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 3.3 \cdot 10^{+37}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.05 \cdot 10^{+89}:\\ \;\;\;\;\left(0.5 \cdot \frac{U}{J}\right) \cdot \left(J \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot -2\\ \end{array} \]
Alternative 6
Error47.0
Cost920
\[\begin{array}{l} \mathbf{if}\;K \leq -1.15 \cdot 10^{-58}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq -2.8 \cdot 10^{-250}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq -7.8 \cdot 10^{-289}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 1.8 \cdot 10^{-238}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 4.4 \cdot 10^{-184}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 3.8 \cdot 10^{+124}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;-U\\ \end{array} \]
Alternative 7
Error38.7
Cost852
\[\begin{array}{l} \mathbf{if}\;J \leq -4.3 \cdot 10^{+70}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;J \leq -3.5 \cdot 10^{-250}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 5.1 \cdot 10^{-67}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 3.3 \cdot 10^{+37}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.05 \cdot 10^{+90}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;J \cdot -2\\ \end{array} \]
Alternative 8
Error47.0
Cost64
\[U \]

Error

Reproduce?

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