Average Error: 18.2 → 11.3
Time: 24.5s
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(K \cdot 0.5\right)\\ t_1 := \cos \left(\frac{K}{2}\right)\\ t_2 := J \cdot \left(\mathsf{hypot}\left(1, \frac{U}{t_1 \cdot \left(J \cdot 2\right)}\right) \cdot \left(-2 \cdot t_1\right)\right)\\ \mathbf{if}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;\left(\left(J \cdot -2\right) \cdot t_1\right) \cdot \mathsf{hypot}\left(1, U \cdot \frac{0.5}{J \cdot t_0}\right)\\ \mathbf{elif}\;J \leq -1.5110225112256388 \cdot 10^{-202}:\\ \;\;\;\;\mathsf{fma}\left(2, \frac{J}{\frac{U}{J}} \cdot {t_0}^{2}, U\right)\\ \mathbf{elif}\;J \leq 1.8809044213424615 \cdot 10^{-271}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \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 0.5)))
        (t_1 (cos (/ K 2.0)))
        (t_2 (* J (* (hypot 1.0 (/ U (* t_1 (* J 2.0)))) (* -2.0 t_1)))))
   (if (<= J -4.4204213601496506e-120)
     (* (* (* J -2.0) t_1) (hypot 1.0 (* U (/ 0.5 (* J t_0)))))
     (if (<= J -1.5110225112256388e-202)
       (fma 2.0 (* (/ J (/ U J)) (pow t_0 2.0)) U)
       (if (<= J 1.8809044213424615e-271)
         t_2
         (if (<= J 3.658807514656197e-134) U t_2))))))
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 * 0.5));
	double t_1 = cos((K / 2.0));
	double t_2 = J * (hypot(1.0, (U / (t_1 * (J * 2.0)))) * (-2.0 * t_1));
	double tmp;
	if (J <= -4.4204213601496506e-120) {
		tmp = ((J * -2.0) * t_1) * hypot(1.0, (U * (0.5 / (J * t_0))));
	} else if (J <= -1.5110225112256388e-202) {
		tmp = fma(2.0, ((J / (U / J)) * pow(t_0, 2.0)), U);
	} else if (J <= 1.8809044213424615e-271) {
		tmp = t_2;
	} else if (J <= 3.658807514656197e-134) {
		tmp = U;
	} else {
		tmp = t_2;
	}
	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 * 0.5))
	t_1 = cos(Float64(K / 2.0))
	t_2 = Float64(J * Float64(hypot(1.0, Float64(U / Float64(t_1 * Float64(J * 2.0)))) * Float64(-2.0 * t_1)))
	tmp = 0.0
	if (J <= -4.4204213601496506e-120)
		tmp = Float64(Float64(Float64(J * -2.0) * t_1) * hypot(1.0, Float64(U * Float64(0.5 / Float64(J * t_0)))));
	elseif (J <= -1.5110225112256388e-202)
		tmp = fma(2.0, Float64(Float64(J / Float64(U / J)) * (t_0 ^ 2.0)), U);
	elseif (J <= 1.8809044213424615e-271)
		tmp = t_2;
	elseif (J <= 3.658807514656197e-134)
		tmp = U;
	else
		tmp = t_2;
	end
	return 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 * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(J * N[(N[Sqrt[1.0 ^ 2 + N[(U / N[(t$95$1 * N[(J * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] * N[(-2.0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[J, -4.4204213601496506e-120], N[(N[(N[(J * -2.0), $MachinePrecision] * t$95$1), $MachinePrecision] * N[Sqrt[1.0 ^ 2 + N[(U * N[(0.5 / N[(J * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[J, -1.5110225112256388e-202], N[(2.0 * N[(N[(J / N[(U / J), $MachinePrecision]), $MachinePrecision] * N[Power[t$95$0, 2.0], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], If[LessEqual[J, 1.8809044213424615e-271], t$95$2, If[LessEqual[J, 3.658807514656197e-134], U, t$95$2]]]]]]]
\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(K \cdot 0.5\right)\\
t_1 := \cos \left(\frac{K}{2}\right)\\
t_2 := J \cdot \left(\mathsf{hypot}\left(1, \frac{U}{t_1 \cdot \left(J \cdot 2\right)}\right) \cdot \left(-2 \cdot t_1\right)\right)\\
\mathbf{if}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\
\;\;\;\;\left(\left(J \cdot -2\right) \cdot t_1\right) \cdot \mathsf{hypot}\left(1, U \cdot \frac{0.5}{J \cdot t_0}\right)\\

\mathbf{elif}\;J \leq -1.5110225112256388 \cdot 10^{-202}:\\
\;\;\;\;\mathsf{fma}\left(2, \frac{J}{\frac{U}{J}} \cdot {t_0}^{2}, U\right)\\

\mathbf{elif}\;J \leq 1.8809044213424615 \cdot 10^{-271}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\
\;\;\;\;U\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}

Error

Derivation

  1. Split input into 4 regimes
  2. if J < -4.42042136014965059e-120

    1. Initial program 8.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. Applied egg-rr2.0

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

    if -4.42042136014965059e-120 < J < -1.5110225112256388e-202

    1. Initial program 32.5

      \[\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. Taylor expanded in U around -inf 39.1

      \[\leadsto \color{blue}{2 \cdot \frac{{\cos \left(0.5 \cdot K\right)}^{2} \cdot {J}^{2}}{U} + U} \]
    3. Simplified39.0

      \[\leadsto \color{blue}{\mathsf{fma}\left(2, \frac{J}{\frac{U}{J}} \cdot {\cos \left(0.5 \cdot K\right)}^{2}, U\right)} \]
      Proof
      (fma.f64 2 (*.f64 (/.f64 J (/.f64 U J)) (pow.f64 (cos.f64 (*.f64 1/2 K)) 2)) U): 0 points increase in error, 0 points decrease in error
      (fma.f64 2 (*.f64 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 J J) U)) (pow.f64 (cos.f64 (*.f64 1/2 K)) 2)) U): 22 points increase in error, 10 points decrease in error
      (fma.f64 2 (*.f64 (/.f64 (Rewrite<= unpow2_binary64 (pow.f64 J 2)) U) (pow.f64 (cos.f64 (*.f64 1/2 K)) 2)) U): 0 points increase in error, 0 points decrease in error
      (fma.f64 2 (Rewrite<= associate-/r/_binary64 (/.f64 (pow.f64 J 2) (/.f64 U (pow.f64 (cos.f64 (*.f64 1/2 K)) 2)))) U): 6 points increase in error, 4 points decrease in error
      (fma.f64 2 (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (pow.f64 J 2) (pow.f64 (cos.f64 (*.f64 1/2 K)) 2)) U)) U): 2 points increase in error, 9 points decrease in error
      (fma.f64 2 (/.f64 (Rewrite<= *-commutative_binary64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/2 K)) 2) (pow.f64 J 2))) U) U): 0 points increase in error, 0 points decrease in error
      (Rewrite<= fma-def_binary64 (+.f64 (*.f64 2 (/.f64 (*.f64 (pow.f64 (cos.f64 (*.f64 1/2 K)) 2) (pow.f64 J 2)) U)) U)): 0 points increase in error, 0 points decrease in error

    if -1.5110225112256388e-202 < J < 1.88090442134246147e-271 or 3.658807514656197e-134 < J

    1. Initial program 18.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. Simplified8.2

      \[\leadsto \color{blue}{J \cdot \left(\mathsf{hypot}\left(1, \frac{U}{\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot 2\right)}\right) \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right)} \]
      Proof
      (*.f64 J (*.f64 (hypot.f64 1 (/.f64 U (*.f64 (cos.f64 (/.f64 K 2)) (*.f64 J 2)))) (*.f64 -2 (cos.f64 (/.f64 K 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 J (*.f64 (hypot.f64 1 (/.f64 U (*.f64 (cos.f64 (/.f64 K 2)) (Rewrite<= *-commutative_binary64 (*.f64 2 J))))) (*.f64 -2 (cos.f64 (/.f64 K 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 J (*.f64 (hypot.f64 1 (/.f64 U (Rewrite<= *-commutative_binary64 (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))))) (*.f64 -2 (cos.f64 (/.f64 K 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 J (*.f64 (Rewrite<= hypot-1-def_binary64 (sqrt.f64 (+.f64 1 (*.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))))))) (*.f64 -2 (cos.f64 (/.f64 K 2))))): 37 points increase in error, 0 points decrease in error
      (*.f64 J (*.f64 (sqrt.f64 (+.f64 1 (Rewrite<= unpow2_binary64 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2)))) (*.f64 -2 (cos.f64 (/.f64 K 2))))): 0 points increase in error, 0 points decrease in error
      (*.f64 J (Rewrite=> *-commutative_binary64 (*.f64 (*.f64 -2 (cos.f64 (/.f64 K 2))) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 J (Rewrite<= associate-*r*_binary64 (*.f64 -2 (*.f64 (cos.f64 (/.f64 K 2)) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2))))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.f64 (*.f64 J -2) (*.f64 (cos.f64 (/.f64 K 2)) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2)))))): 0 points increase in error, 0 points decrease in error
      (*.f64 (Rewrite<= *-commutative_binary64 (*.f64 -2 J)) (*.f64 (cos.f64 (/.f64 K 2)) (sqrt.f64 (+.f64 1 (pow.f64 (/.f64 U (*.f64 (*.f64 2 J) (cos.f64 (/.f64 K 2)))) 2))))): 0 points increase in error, 0 points decrease in error
      (Rewrite<= associate-*l*_binary64 (*.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))))): 0 points increase in error, 9 points decrease in error

    if 1.88090442134246147e-271 < J < 3.658807514656197e-134

    1. Initial program 37.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. Applied egg-rr21.7

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

      \[\leadsto \color{blue}{U} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification11.3

    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;\left(\left(J \cdot -2\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \mathsf{hypot}\left(1, U \cdot \frac{0.5}{J \cdot \cos \left(K \cdot 0.5\right)}\right)\\ \mathbf{elif}\;J \leq -1.5110225112256388 \cdot 10^{-202}:\\ \;\;\;\;\mathsf{fma}\left(2, \frac{J}{\frac{U}{J}} \cdot {\cos \left(K \cdot 0.5\right)}^{2}, U\right)\\ \mathbf{elif}\;J \leq 1.8809044213424615 \cdot 10^{-271}:\\ \;\;\;\;J \cdot \left(\mathsf{hypot}\left(1, \frac{U}{\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot 2\right)}\right) \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right)\\ \mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\mathsf{hypot}\left(1, \frac{U}{\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot 2\right)}\right) \cdot \left(-2 \cdot \cos \left(\frac{K}{2}\right)\right)\right)\\ \end{array} \]

Alternatives

Alternative 1
Error11.3
Cost20880
\[\begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ t_1 := J \cdot \left(\mathsf{hypot}\left(1, \frac{U}{t_0 \cdot \left(J \cdot 2\right)}\right) \cdot \left(-2 \cdot t_0\right)\right)\\ \mathbf{if}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq -1.5110225112256388 \cdot 10^{-202}:\\ \;\;\;\;\mathsf{fma}\left(2, \frac{J}{\frac{U}{J}} \cdot {\cos \left(K \cdot 0.5\right)}^{2}, U\right)\\ \mathbf{elif}\;J \leq 1.8809044213424615 \cdot 10^{-271}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 2
Error19.4
Cost20496
\[\begin{array}{l} t_0 := J \cdot \left(\left(-2 \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot 2}\right)\right)\\ \mathbf{if}\;J \leq -1.8602863584529868 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -5.4363531978953455 \cdot 10^{-86}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;\left(J \cdot -2\right) \cdot \mathsf{hypot}\left(1, 0.5 \cdot \frac{U}{J}\right)\\ \mathbf{elif}\;J \leq -3.656248730538405 \cdot 10^{-280}:\\ \;\;\;\;\mathsf{fma}\left(2, \frac{J}{\frac{U}{J}} \cdot {\cos \left(K \cdot 0.5\right)}^{2}, U\right)\\ \mathbf{elif}\;J \leq 1.917675983881228 \cdot 10^{-288}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error19.4
Cost14488
\[\begin{array}{l} t_0 := J \cdot \left(\left(-2 \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \mathsf{hypot}\left(1, \frac{U}{J \cdot 2}\right)\right)\\ \mathbf{if}\;J \leq -1.8602863584529868 \cdot 10^{-20}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -5.4363531978953455 \cdot 10^{-86}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;\left(J \cdot -2\right) \cdot \mathsf{hypot}\left(1, 0.5 \cdot \frac{U}{J}\right)\\ \mathbf{elif}\;J \leq -3.656248730538405 \cdot 10^{-280}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.917675983881228 \cdot 10^{-288}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error23.8
Cost7832
\[\begin{array}{l} t_0 := \left(J \cdot -2\right) \cdot \mathsf{hypot}\left(1, 0.5 \cdot \frac{U}{J}\right)\\ t_1 := J \cdot \left(-2 \cdot \cos \left(K \cdot 0.5\right)\right)\\ \mathbf{if}\;J \leq -1.0864034378443976 \cdot 10^{+99}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -3.656248730538405 \cdot 10^{-280}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.917675983881228 \cdot 10^{-288}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 3.658807514656197 \cdot 10^{-134}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.987921510197407 \cdot 10^{-31}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 5
Error27.0
Cost7508
\[\begin{array}{l} t_0 := J \cdot \left(-2 \cdot \cos \left(K \cdot 0.5\right)\right)\\ \mathbf{if}\;J \leq -0.003729070806538715:\\ \;\;\;\;t_0\\ \mathbf{elif}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq -3.656248730538405 \cdot 10^{-280}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.917675983881228 \cdot 10^{-288}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 1.04184648514503 \cdot 10^{-40}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 6
Error38.2
Cost852
\[\begin{array}{l} \mathbf{if}\;J \leq -0.003729070806538715:\\ \;\;\;\;J \cdot -2\\ \mathbf{elif}\;J \leq -4.4204213601496506 \cdot 10^{-120}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq -3.656248730538405 \cdot 10^{-280}:\\ \;\;\;\;U\\ \mathbf{elif}\;J \leq 1.917675983881228 \cdot 10^{-288}:\\ \;\;\;\;-U\\ \mathbf{elif}\;J \leq 1.04184648514503 \cdot 10^{-40}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot -2\\ \end{array} \]
Alternative 7
Error46.7
Cost788
\[\begin{array}{l} \mathbf{if}\;K \leq -2.2161119449861688 \cdot 10^{-91}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 3.610607624623963 \cdot 10^{-209}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 7.830442541908064 \cdot 10^{-74}:\\ \;\;\;\;U\\ \mathbf{elif}\;K \leq 4.036781484411508 \cdot 10^{+125}:\\ \;\;\;\;-U\\ \mathbf{elif}\;K \leq 2.3291981366242153 \cdot 10^{+246}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;-U\\ \end{array} \]
Alternative 8
Error47.3
Cost64
\[U \]

Error

Reproduce

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