?

Average Error: 18.4 → 9.4
Time: 18.1s
Precision: binary64
Cost: 20617

?

\[\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 -1.7 \cdot 10^{-196} \lor \neg \left(J \leq 4.4 \cdot 10^{-261}\right):\\ \;\;\;\;\left(\left(J \cdot -2\right) \cdot t_0\right) \cdot \mathsf{hypot}\left(1, \frac{U}{2 \cdot \left(J \cdot t_0\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \frac{-1 - \cos K}{\frac{U}{J}} - 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 -1.7e-196) (not (<= J 4.4e-261)))
     (* (* (* J -2.0) t_0) (hypot 1.0 (/ U (* 2.0 (* J t_0)))))
     (- (* J (/ (- -1.0 (cos K)) (/ U J))) 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 <= -1.7e-196) || !(J <= 4.4e-261)) {
		tmp = ((J * -2.0) * t_0) * hypot(1.0, (U / (2.0 * (J * t_0))));
	} else {
		tmp = (J * ((-1.0 - cos(K)) / (U / J))) - 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 <= -1.7e-196) || !(J <= 4.4e-261)) {
		tmp = ((J * -2.0) * t_0) * Math.hypot(1.0, (U / (2.0 * (J * t_0))));
	} else {
		tmp = (J * ((-1.0 - Math.cos(K)) / (U / J))) - 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 <= -1.7e-196) or not (J <= 4.4e-261):
		tmp = ((J * -2.0) * t_0) * math.hypot(1.0, (U / (2.0 * (J * t_0))))
	else:
		tmp = (J * ((-1.0 - math.cos(K)) / (U / J))) - 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 <= -1.7e-196) || !(J <= 4.4e-261))
		tmp = Float64(Float64(Float64(J * -2.0) * t_0) * hypot(1.0, Float64(U / Float64(2.0 * Float64(J * t_0)))));
	else
		tmp = Float64(Float64(J * Float64(Float64(-1.0 - cos(K)) / Float64(U / J))) - 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 <= -1.7e-196) || ~((J <= 4.4e-261)))
		tmp = ((J * -2.0) * t_0) * hypot(1.0, (U / (2.0 * (J * t_0))));
	else
		tmp = (J * ((-1.0 - cos(K)) / (U / J))) - 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, -1.7e-196], N[Not[LessEqual[J, 4.4e-261]], $MachinePrecision]], N[(N[(N[(J * -2.0), $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], N[(N[(J * N[(N[(-1.0 - N[Cos[K], $MachinePrecision]), $MachinePrecision] / N[(U / J), $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}\;J \leq -1.7 \cdot 10^{-196} \lor \neg \left(J \leq 4.4 \cdot 10^{-261}\right):\\
\;\;\;\;\left(\left(J \cdot -2\right) \cdot t_0\right) \cdot \mathsf{hypot}\left(1, \frac{U}{2 \cdot \left(J \cdot t_0\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;J \cdot \frac{-1 - \cos K}{\frac{U}{J}} - U\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Split input into 2 regimes
  2. if J < -1.7e-196 or 4.4000000000000003e-261 < J

    1. Initial program 14.4

      \[\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. Simplified5.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]14.4

      \[ \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 [=>]14.4

      \[ \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 [=>]5.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* [=>]5.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) \]

    if -1.7e-196 < J < 4.4000000000000003e-261

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

      unpow2 [=>]43.9

      \[ \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.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* [=>]27.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 34.1

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

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

      [Start]34.1

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

      mul-1-neg [=>]34.1

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

      unsub-neg [=>]34.1

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

      associate-*r/ [=>]34.1

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

      associate-/l* [=>]34.1

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

      *-commutative [=>]34.1

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

      unpow2 [=>]34.1

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

      associate-*l* [=>]34.1

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

      associate-/r* [=>]34.1

      \[ \frac{-2}{\color{blue}{\frac{\frac{U}{J}}{J \cdot {\cos \left(0.5 \cdot K\right)}^{2}}}} - U \]
    5. Applied egg-rr34.1

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

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

      [Start]34.1

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

      distribute-lft-in [<=]34.1

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

      associate-*r* [=>]34.1

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

      *-commutative [<=]34.1

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

      associate-*r* [<=]34.1

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

      *-commutative [=>]34.1

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

      associate-*l* [=>]34.1

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

      distribute-lft-in [=>]34.1

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

      metadata-eval [=>]34.1

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

      associate-*r* [=>]34.1

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

      metadata-eval [=>]34.1

      \[ J \cdot \left(\frac{J}{U} \cdot \left(-1 + \color{blue}{-1} \cdot \cos K\right)\right) - U \]
    7. Taylor expanded in J around 0 34.1

      \[\leadsto J \cdot \color{blue}{\frac{\left(-1 \cdot \cos K - 1\right) \cdot J}{U}} - U \]
    8. Simplified34.1

      \[\leadsto J \cdot \color{blue}{\frac{-1 - \cos K}{\frac{U}{J}}} - U \]
      Proof

      [Start]34.1

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

      associate-/l* [=>]34.1

      \[ J \cdot \color{blue}{\frac{-1 \cdot \cos K - 1}{\frac{U}{J}}} - U \]

      sub-neg [=>]34.1

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

      metadata-eval [=>]34.1

      \[ J \cdot \frac{-1 \cdot \cos K + \color{blue}{-1}}{\frac{U}{J}} - U \]

      +-commutative [=>]34.1

      \[ J \cdot \frac{\color{blue}{-1 + -1 \cdot \cos K}}{\frac{U}{J}} - U \]

      mul-1-neg [=>]34.1

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

      sub-neg [<=]34.1

      \[ J \cdot \frac{\color{blue}{-1 - \cos K}}{\frac{U}{J}} - U \]
  3. Recombined 2 regimes into one program.
  4. Final simplification9.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq -1.7 \cdot 10^{-196} \lor \neg \left(J \leq 4.4 \cdot 10^{-261}\right):\\ \;\;\;\;\left(\left(J \cdot -2\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{else}:\\ \;\;\;\;J \cdot \frac{-1 - \cos K}{\frac{U}{J}} - U\\ \end{array} \]

Alternatives

Alternative 1
Error9.3
Cost20617
\[\begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;J \leq -1.8 \cdot 10^{-196} \lor \neg \left(J \leq 1.85 \cdot 10^{-268}\right):\\ \;\;\;\;-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{else}:\\ \;\;\;\;J \cdot \frac{-1 - \cos K}{\frac{U}{J}} - U\\ \end{array} \]
Alternative 2
Error17.4
Cost14092
\[\begin{array}{l} t_0 := \left(\left(J \cdot -2\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot 2}\right)\\ \mathbf{if}\;J \leq -5.8 \cdot 10^{-196}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq 3.7 \cdot 10^{-270}:\\ \;\;\;\;J \cdot \frac{-1 - \cos K}{\frac{U}{J}} - U\\ \mathbf{elif}\;J \leq 4.1 \cdot 10^{-163}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error25.4
Cost7832
\[\begin{array}{l} t_0 := -2 \cdot \left(J \cdot \mathsf{hypot}\left(1, \frac{U}{J} \cdot 0.5\right)\right)\\ t_1 := \left(J \cdot -2\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{if}\;J \leq -6.5 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq -5800000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -6 \cdot 10^{-196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq 5.2 \cdot 10^{-270}:\\ \;\;\;\;-2 \cdot \left(J \cdot \frac{J}{U}\right) - U\\ \mathbf{elif}\;J \leq 1.36 \cdot 10^{-120}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 3 \cdot 10^{+68}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 4
Error25.3
Cost7832
\[\begin{array}{l} t_0 := -2 \cdot \left(J \cdot \mathsf{hypot}\left(1, \frac{U}{J} \cdot 0.5\right)\right)\\ t_1 := \left(J \cdot -2\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{if}\;J \leq -7.5 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq -6000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -6 \cdot 10^{-196}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq 8 \cdot 10^{-270}:\\ \;\;\;\;J \cdot \frac{-1 - \cos K}{\frac{U}{J}} - U\\ \mathbf{elif}\;J \leq 1.16 \cdot 10^{-122}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.05 \cdot 10^{+68}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error27.2
Cost7508
\[\begin{array}{l} t_0 := \left(J \cdot -2\right) \cdot \cos \left(K \cdot 0.5\right)\\ \mathbf{if}\;U \leq -2.6 \cdot 10^{+187}:\\ \;\;\;\;U\\ \mathbf{elif}\;U \leq -1.1 \cdot 10^{+121}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 8.5 \cdot 10^{+51}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;U \leq 6.2 \cdot 10^{+82}:\\ \;\;\;\;-U\\ \mathbf{elif}\;U \leq 1.36 \cdot 10^{+172}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;U \leq 5.2 \cdot 10^{+235}:\\ \;\;\;\;-U\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(U \cdot -0.5 - J \cdot \frac{J}{U}\right)\\ \end{array} \]
Alternative 6
Error38.9
Cost852
\[\begin{array}{l} \mathbf{if}\;J \leq -9.5 \cdot 10^{-101}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;J \leq 7.4 \cdot 10^{-270}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 4.6 \cdot 10^{-116}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 7.2 \cdot 10^{-28}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 1.7 \cdot 10^{+105}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot -2\\ \end{array} \]
Alternative 7
Error38.9
Cost852
\[\begin{array}{l} \mathbf{if}\;J \leq -5.5 \cdot 10^{-100}:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;J \leq 1.2 \cdot 10^{-269}:\\ \;\;\;\;-2 \cdot \left(J \cdot \frac{J}{U}\right) - U\\ \mathbf{elif}\;J \leq 3.6 \cdot 10^{-115}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 7.5 \cdot 10^{-21}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 1.7 \cdot 10^{+100}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot -2\\ \end{array} \]
Alternative 8
Error46.4
Cost788
\[\begin{array}{l} \mathbf{if}\;K \leq -1.12 \cdot 10^{+238}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq -7.2 \cdot 10^{-110}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq -1.35 \cdot 10^{-279}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 6.2 \cdot 10^{-255}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 6.6 \cdot 10^{-18}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;-U\\ \end{array} \]
Alternative 9
Error46.4
Cost64
\[U \]

Error

Reproduce?

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