Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 86.2% → 99.9%
Time: 15.4s
Alternatives: 21
Speedup: 2.5×

Specification

?
\[\begin{array}{l} \\ \left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
	return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
    real(8), intent (in) :: j
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8), intent (in) :: u
    code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
	return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U):
	return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U)
	return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U)
end
function tmp = code(J, l, K, U)
	tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}

\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 21 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 86.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))
double code(double J, double l, double K, double U) {
	return ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
}
real(8) function code(j, l, k, u)
    real(8), intent (in) :: j
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8), intent (in) :: u
    code = ((j * (exp(l) - exp(-l))) * cos((k / 2.0d0))) + u
end function
public static double code(double J, double l, double K, double U) {
	return ((J * (Math.exp(l) - Math.exp(-l))) * Math.cos((K / 2.0))) + U;
}
def code(J, l, K, U):
	return ((J * (math.exp(l) - math.exp(-l))) * math.cos((K / 2.0))) + U
function code(J, l, K, U)
	return Float64(Float64(Float64(J * Float64(exp(l) - exp(Float64(-l)))) * cos(Float64(K / 2.0))) + U)
end
function tmp = code(J, l, K, U)
	tmp = ((J * (exp(l) - exp(-l))) * cos((K / 2.0))) + U;
end
code[J_, l_, K_, U_] := N[(N[(N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}

\\
\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U
\end{array}

Alternative 1: 99.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(2 \cdot J\right) + U \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (+ (* (* (cos (/ K 2.0)) (sinh l)) (* 2.0 J)) U))
double code(double J, double l, double K, double U) {
	return ((cos((K / 2.0)) * sinh(l)) * (2.0 * J)) + U;
}
real(8) function code(j, l, k, u)
    real(8), intent (in) :: j
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8), intent (in) :: u
    code = ((cos((k / 2.0d0)) * sinh(l)) * (2.0d0 * j)) + u
end function
public static double code(double J, double l, double K, double U) {
	return ((Math.cos((K / 2.0)) * Math.sinh(l)) * (2.0 * J)) + U;
}
def code(J, l, K, U):
	return ((math.cos((K / 2.0)) * math.sinh(l)) * (2.0 * J)) + U
function code(J, l, K, U)
	return Float64(Float64(Float64(cos(Float64(K / 2.0)) * sinh(l)) * Float64(2.0 * J)) + U)
end
function tmp = code(J, l, K, U)
	tmp = ((cos((K / 2.0)) * sinh(l)) * (2.0 * J)) + U;
end
code[J_, l_, K_, U_] := N[(N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}

\\
\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(2 \cdot J\right) + U
\end{array}
Derivation
  1. Initial program 85.8%

    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. sinh-undefN/A

      \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
    2. associate-*r*N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(J \cdot 2\right) \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
    3. associate-*l*N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot 2\right) \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right), U\right) \]
    4. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(J \cdot 2\right)\right), U\right) \]
    5. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right), \left(J \cdot 2\right)\right), U\right) \]
    6. *-commutativeN/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
    7. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
    8. cos-lowering-cos.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
    9. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
    10. sinh-lowering-sinh.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \left(J \cdot 2\right)\right), U\right) \]
    11. *-lowering-*.f64100.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right)} + U \]
  5. Final simplification100.0%

    \[\leadsto \left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(2 \cdot J\right) + U \]
  6. Add Preprocessing

Alternative 2: 87.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\ \;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\left(\ell \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)}{U}\right)\\ \mathbf{else}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \end{array} \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (if (<= (cos (/ K 2.0)) -0.04)
   (*
    U
    (+
     1.0
     (/
      (* J (* (* l (* l (* l 0.3333333333333333))) (+ 1.0 (* -0.125 (* K K)))))
      U)))
   (+ U (* (sinh l) (* 2.0 J)))))
double code(double J, double l, double K, double U) {
	double tmp;
	if (cos((K / 2.0)) <= -0.04) {
		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U));
	} else {
		tmp = U + (sinh(l) * (2.0 * J));
	}
	return tmp;
}
real(8) function code(j, l, k, u)
    real(8), intent (in) :: j
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8), intent (in) :: u
    real(8) :: tmp
    if (cos((k / 2.0d0)) <= (-0.04d0)) then
        tmp = u * (1.0d0 + ((j * ((l * (l * (l * 0.3333333333333333d0))) * (1.0d0 + ((-0.125d0) * (k * k))))) / u))
    else
        tmp = u + (sinh(l) * (2.0d0 * j))
    end if
    code = tmp
end function
public static double code(double J, double l, double K, double U) {
	double tmp;
	if (Math.cos((K / 2.0)) <= -0.04) {
		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U));
	} else {
		tmp = U + (Math.sinh(l) * (2.0 * J));
	}
	return tmp;
}
def code(J, l, K, U):
	tmp = 0
	if math.cos((K / 2.0)) <= -0.04:
		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U))
	else:
		tmp = U + (math.sinh(l) * (2.0 * J))
	return tmp
function code(J, l, K, U)
	tmp = 0.0
	if (cos(Float64(K / 2.0)) <= -0.04)
		tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(Float64(l * Float64(l * Float64(l * 0.3333333333333333))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))) / U)));
	else
		tmp = Float64(U + Float64(sinh(l) * Float64(2.0 * J)));
	end
	return tmp
end
function tmp_2 = code(J, l, K, U)
	tmp = 0.0;
	if (cos((K / 2.0)) <= -0.04)
		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U));
	else
		tmp = U + (sinh(l) * (2.0 * J));
	end
	tmp_2 = tmp;
end
code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.04], N[(U * N[(1.0 + N[(N[(J * N[(N[(l * N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Sinh[l], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\
\;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\left(\ell \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)}{U}\right)\\

\mathbf{else}:\\
\;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.0400000000000000008

    1. Initial program 88.3%

      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
    2. Add Preprocessing
    3. Taylor expanded in l around 0

      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      4. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      7. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
    5. Simplified87.5%

      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
    6. Taylor expanded in K around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
      4. *-lowering-*.f6455.5%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
    8. Simplified55.5%

      \[\leadsto \ell \cdot \left(\color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + U \]
    9. Taylor expanded in l around inf

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \color{blue}{\left(\frac{1}{3} \cdot \left(J \cdot {\ell}^{2}\right)\right)}\right)\right), U\right) \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(\left(\frac{1}{3} \cdot J\right) \cdot {\ell}^{2}\right)\right)\right), U\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(\left(J \cdot \frac{1}{3}\right) \cdot {\ell}^{2}\right)\right)\right), U\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(J \cdot \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
      6. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
      7. *-lowering-*.f6460.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
    11. Simplified60.0%

      \[\leadsto \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \color{blue}{\left(J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)}\right) + U \]
    12. Taylor expanded in U around inf

      \[\leadsto \color{blue}{U \cdot \left(1 + \frac{1}{3} \cdot \frac{J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)}{U}\right)} \]
    13. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(U, \color{blue}{\left(1 + \frac{1}{3} \cdot \frac{J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)}{U}\right)}\right) \]
      2. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \frac{J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)}{U}\right)}\right)\right) \]
      3. associate-*r/N/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{\color{blue}{U}}\right)\right)\right) \]
      4. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \left(J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{U}\right)\right)\right) \]
      5. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(\frac{-1}{3} \cdot \left(J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)\right)}{U}\right)\right)\right) \]
      6. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(\frac{-1}{3} \cdot J\right) \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{U}\right)\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(J \cdot \frac{-1}{3}\right) \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{U}\right)\right)\right) \]
      8. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(J \cdot \left(\frac{-1}{3} \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)\right)}{U}\right)\right)\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(J \cdot \left(\frac{-1}{3} \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)\right)\right), \color{blue}{U}\right)\right)\right) \]
    14. Simplified64.5%

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

    if -0.0400000000000000008 < (cos.f64 (/.f64 K #s(literal 2 binary64)))

    1. Initial program 85.0%

      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sinh-undefN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
      2. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(J \cdot 2\right) \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot 2\right) \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right), U\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(J \cdot 2\right)\right), U\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right), \left(J \cdot 2\right)\right), U\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
      8. cos-lowering-cos.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
      9. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
      10. sinh-lowering-sinh.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \left(J \cdot 2\right)\right), U\right) \]
      11. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right)} + U \]
    5. Taylor expanded in K around 0

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{1}, \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
    6. Step-by-step derivation
      1. Simplified94.2%

        \[\leadsto \left(\color{blue}{1} \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right) + U \]
    7. Recombined 2 regimes into one program.
    8. Final simplification87.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.04:\\ \;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\left(\ell \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)}{U}\right)\\ \mathbf{else}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 88.8% accurate, 2.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (J l K U)
     :precision binary64
     (if (<= (/ K 2.0) 5e-7)
       (+ U (* (sinh l) (* 2.0 J)))
       (+
        U
        (*
         (cos (/ K 2.0))
         (*
          J
          (*
           l
           (+
            2.0
            (*
             (* l l)
             (+
              0.3333333333333333
              (*
               l
               (*
                l
                (+
                 0.016666666666666666
                 (* (* l l) 0.0003968253968253968)))))))))))))
    double code(double J, double l, double K, double U) {
    	double tmp;
    	if ((K / 2.0) <= 5e-7) {
    		tmp = U + (sinh(l) * (2.0 * J));
    	} else {
    		tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
    	}
    	return tmp;
    }
    
    real(8) function code(j, l, k, u)
        real(8), intent (in) :: j
        real(8), intent (in) :: l
        real(8), intent (in) :: k
        real(8), intent (in) :: u
        real(8) :: tmp
        if ((k / 2.0d0) <= 5d-7) then
            tmp = u + (sinh(l) * (2.0d0 * j))
        else
            tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + (l * (l * (0.016666666666666666d0 + ((l * l) * 0.0003968253968253968d0))))))))))
        end if
        code = tmp
    end function
    
    public static double code(double J, double l, double K, double U) {
    	double tmp;
    	if ((K / 2.0) <= 5e-7) {
    		tmp = U + (Math.sinh(l) * (2.0 * J));
    	} else {
    		tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
    	}
    	return tmp;
    }
    
    def code(J, l, K, U):
    	tmp = 0
    	if (K / 2.0) <= 5e-7:
    		tmp = U + (math.sinh(l) * (2.0 * J))
    	else:
    		tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))))
    	return tmp
    
    function code(J, l, K, U)
    	tmp = 0.0
    	if (Float64(K / 2.0) <= 5e-7)
    		tmp = Float64(U + Float64(sinh(l) * Float64(2.0 * J)));
    	else
    		tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(J, l, K, U)
    	tmp = 0.0;
    	if ((K / 2.0) <= 5e-7)
    		tmp = U + (sinh(l) * (2.0 * J));
    	else
    		tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + (l * (l * (0.016666666666666666 + ((l * l) * 0.0003968253968253968))))))))));
    	end
    	tmp_2 = tmp;
    end
    
    code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 5e-7], N[(U + N[(N[Sinh[l], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\
    \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (/.f64 K #s(literal 2 binary64)) < 4.99999999999999977e-7

      1. Initial program 84.9%

        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. sinh-undefN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
        2. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(J \cdot 2\right) \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
        3. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot 2\right) \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right), U\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(J \cdot 2\right)\right), U\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right), \left(J \cdot 2\right)\right), U\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
        7. *-lowering-*.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
        8. cos-lowering-cos.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
        10. sinh-lowering-sinh.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \left(J \cdot 2\right)\right), U\right) \]
        11. *-lowering-*.f64100.0%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
      4. Applied egg-rr100.0%

        \[\leadsto \color{blue}{\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right)} + U \]
      5. Taylor expanded in K around 0

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{1}, \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
      6. Step-by-step derivation
        1. Simplified85.0%

          \[\leadsto \left(\color{blue}{1} \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right) + U \]

        if 4.99999999999999977e-7 < (/.f64 K #s(literal 2 binary64))

        1. Initial program 89.5%

          \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        2. Add Preprocessing
        3. Taylor expanded in l around 0

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          2. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          3. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          4. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          7. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\left(\ell \cdot \ell\right) \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          8. associate-*l*N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          9. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          11. +-lowering-+.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \left(\frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          12. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \left({\ell}^{2} \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          13. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          14. unpow2N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          15. *-lowering-*.f6494.4%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
        5. Simplified94.4%

          \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
      7. Recombined 2 regimes into one program.
      8. Final simplification86.9%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 88.3% accurate, 2.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\ \end{array} \end{array} \]
      (FPCore (J l K U)
       :precision binary64
       (if (<= (/ K 2.0) 5e-7)
         (+ U (* (sinh l) (* 2.0 J)))
         (+
          U
          (*
           (cos (/ K 2.0))
           (*
            J
            (*
             l
             (+
              2.0
              (*
               (* l l)
               (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))))
      double code(double J, double l, double K, double U) {
      	double tmp;
      	if ((K / 2.0) <= 5e-7) {
      		tmp = U + (sinh(l) * (2.0 * J));
      	} else {
      		tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
      	}
      	return tmp;
      }
      
      real(8) function code(j, l, k, u)
          real(8), intent (in) :: j
          real(8), intent (in) :: l
          real(8), intent (in) :: k
          real(8), intent (in) :: u
          real(8) :: tmp
          if ((k / 2.0d0) <= 5d-7) then
              tmp = u + (sinh(l) * (2.0d0 * j))
          else
              tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
          end if
          code = tmp
      end function
      
      public static double code(double J, double l, double K, double U) {
      	double tmp;
      	if ((K / 2.0) <= 5e-7) {
      		tmp = U + (Math.sinh(l) * (2.0 * J));
      	} else {
      		tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
      	}
      	return tmp;
      }
      
      def code(J, l, K, U):
      	tmp = 0
      	if (K / 2.0) <= 5e-7:
      		tmp = U + (math.sinh(l) * (2.0 * J))
      	else:
      		tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))
      	return tmp
      
      function code(J, l, K, U)
      	tmp = 0.0
      	if (Float64(K / 2.0) <= 5e-7)
      		tmp = Float64(U + Float64(sinh(l) * Float64(2.0 * J)));
      	else
      		tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))));
      	end
      	return tmp
      end
      
      function tmp_2 = code(J, l, K, U)
      	tmp = 0.0;
      	if ((K / 2.0) <= 5e-7)
      		tmp = U + (sinh(l) * (2.0 * J));
      	else
      		tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
      	end
      	tmp_2 = tmp;
      end
      
      code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 5e-7], N[(U + N[(N[Sinh[l], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\
      \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 K #s(literal 2 binary64)) < 4.99999999999999977e-7

        1. Initial program 84.9%

          \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. sinh-undefN/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
          2. associate-*r*N/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(J \cdot 2\right) \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
          3. associate-*l*N/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot 2\right) \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right), U\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(J \cdot 2\right)\right), U\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right), \left(J \cdot 2\right)\right), U\right) \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
          8. cos-lowering-cos.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
          9. /-lowering-/.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
          10. sinh-lowering-sinh.f64N/A

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \left(J \cdot 2\right)\right), U\right) \]
          11. *-lowering-*.f64100.0%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
        4. Applied egg-rr100.0%

          \[\leadsto \color{blue}{\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right)} + U \]
        5. Taylor expanded in K around 0

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{1}, \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
        6. Step-by-step derivation
          1. Simplified85.0%

            \[\leadsto \left(\color{blue}{1} \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right) + U \]

          if 4.99999999999999977e-7 < (/.f64 K #s(literal 2 binary64))

          1. Initial program 89.5%

            \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
          2. Add Preprocessing
          3. Taylor expanded in l around 0

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            3. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            4. unpow2N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            7. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            8. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            9. unpow2N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            10. *-lowering-*.f6492.7%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          5. Simplified92.7%

            \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        7. Recombined 2 regimes into one program.
        8. Final simplification86.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 86.9% accurate, 2.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
        (FPCore (J l K U)
         :precision binary64
         (if (<= (/ K 2.0) 5e-7)
           (+ U (* (sinh l) (* 2.0 J)))
           (+
            U
            (* (cos (/ K 2.0)) (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333))))))))
        double code(double J, double l, double K, double U) {
        	double tmp;
        	if ((K / 2.0) <= 5e-7) {
        		tmp = U + (sinh(l) * (2.0 * J));
        	} else {
        		tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
        	}
        	return tmp;
        }
        
        real(8) function code(j, l, k, u)
            real(8), intent (in) :: j
            real(8), intent (in) :: l
            real(8), intent (in) :: k
            real(8), intent (in) :: u
            real(8) :: tmp
            if ((k / 2.0d0) <= 5d-7) then
                tmp = u + (sinh(l) * (2.0d0 * j))
            else
                tmp = u + (cos((k / 2.0d0)) * (j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
            end if
            code = tmp
        end function
        
        public static double code(double J, double l, double K, double U) {
        	double tmp;
        	if ((K / 2.0) <= 5e-7) {
        		tmp = U + (Math.sinh(l) * (2.0 * J));
        	} else {
        		tmp = U + (Math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
        	}
        	return tmp;
        }
        
        def code(J, l, K, U):
        	tmp = 0
        	if (K / 2.0) <= 5e-7:
        		tmp = U + (math.sinh(l) * (2.0 * J))
        	else:
        		tmp = U + (math.cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))))
        	return tmp
        
        function code(J, l, K, U)
        	tmp = 0.0
        	if (Float64(K / 2.0) <= 5e-7)
        		tmp = Float64(U + Float64(sinh(l) * Float64(2.0 * J)));
        	else
        		tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(J, l, K, U)
        	tmp = 0.0;
        	if ((K / 2.0) <= 5e-7)
        		tmp = U + (sinh(l) * (2.0 * J));
        	else
        		tmp = U + (cos((K / 2.0)) * (J * (l * (2.0 + ((l * l) * 0.3333333333333333)))));
        	end
        	tmp_2 = tmp;
        end
        
        code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 5e-7], N[(U + N[(N[Sinh[l], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\
        \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (/.f64 K #s(literal 2 binary64)) < 4.99999999999999977e-7

          1. Initial program 84.9%

            \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. sinh-undefN/A

              \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
            2. associate-*r*N/A

              \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(J \cdot 2\right) \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
            3. associate-*l*N/A

              \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot 2\right) \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right), U\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(J \cdot 2\right)\right), U\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right), \left(J \cdot 2\right)\right), U\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
            7. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
            8. cos-lowering-cos.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
            9. /-lowering-/.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
            10. sinh-lowering-sinh.f64N/A

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \left(J \cdot 2\right)\right), U\right) \]
            11. *-lowering-*.f64100.0%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
          4. Applied egg-rr100.0%

            \[\leadsto \color{blue}{\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right)} + U \]
          5. Taylor expanded in K around 0

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{1}, \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
          6. Step-by-step derivation
            1. Simplified85.0%

              \[\leadsto \left(\color{blue}{1} \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right) + U \]

            if 4.99999999999999977e-7 < (/.f64 K #s(literal 2 binary64))

            1. Initial program 89.5%

              \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
            2. Add Preprocessing
            3. Taylor expanded in l around 0

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
              2. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
              3. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
              4. unpow2N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
              5. *-lowering-*.f6487.2%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            5. Simplified87.2%

              \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
          7. Recombined 2 regimes into one program.
          8. Final simplification85.4%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\ \end{array} \]
          9. Add Preprocessing

          Alternative 6: 86.0% accurate, 2.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (J l K U)
           :precision binary64
           (if (<= (/ K 2.0) 5e-7)
             (+ U (* (sinh l) (* 2.0 J)))
             (+
              U
              (* l (* (cos (* K 0.5)) (* J (+ 2.0 (* (* l l) 0.3333333333333333))))))))
          double code(double J, double l, double K, double U) {
          	double tmp;
          	if ((K / 2.0) <= 5e-7) {
          		tmp = U + (sinh(l) * (2.0 * J));
          	} else {
          		tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
          	}
          	return tmp;
          }
          
          real(8) function code(j, l, k, u)
              real(8), intent (in) :: j
              real(8), intent (in) :: l
              real(8), intent (in) :: k
              real(8), intent (in) :: u
              real(8) :: tmp
              if ((k / 2.0d0) <= 5d-7) then
                  tmp = u + (sinh(l) * (2.0d0 * j))
              else
                  tmp = u + (l * (cos((k * 0.5d0)) * (j * (2.0d0 + ((l * l) * 0.3333333333333333d0)))))
              end if
              code = tmp
          end function
          
          public static double code(double J, double l, double K, double U) {
          	double tmp;
          	if ((K / 2.0) <= 5e-7) {
          		tmp = U + (Math.sinh(l) * (2.0 * J));
          	} else {
          		tmp = U + (l * (Math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
          	}
          	return tmp;
          }
          
          def code(J, l, K, U):
          	tmp = 0
          	if (K / 2.0) <= 5e-7:
          		tmp = U + (math.sinh(l) * (2.0 * J))
          	else:
          		tmp = U + (l * (math.cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))))
          	return tmp
          
          function code(J, l, K, U)
          	tmp = 0.0
          	if (Float64(K / 2.0) <= 5e-7)
          		tmp = Float64(U + Float64(sinh(l) * Float64(2.0 * J)));
          	else
          		tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(J, l, K, U)
          	tmp = 0.0;
          	if ((K / 2.0) <= 5e-7)
          		tmp = U + (sinh(l) * (2.0 * J));
          	else
          		tmp = U + (l * (cos((K * 0.5)) * (J * (2.0 + ((l * l) * 0.3333333333333333)))));
          	end
          	tmp_2 = tmp;
          end
          
          code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 5e-7], N[(U + N[(N[Sinh[l], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\
          \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (/.f64 K #s(literal 2 binary64)) < 4.99999999999999977e-7

            1. Initial program 84.9%

              \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. sinh-undefN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \left(2 \cdot \sinh \ell\right)\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
              2. associate-*r*N/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(J \cdot 2\right) \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right), U\right) \]
              3. associate-*l*N/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot 2\right) \cdot \left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right)\right), U\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right) \cdot \left(J \cdot 2\right)\right), U\right) \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\sinh \ell \cdot \cos \left(\frac{K}{2}\right)\right), \left(J \cdot 2\right)\right), U\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
              7. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
              8. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
              9. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \sinh \ell\right), \left(J \cdot 2\right)\right), U\right) \]
              10. sinh-lowering-sinh.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \left(J \cdot 2\right)\right), U\right) \]
              11. *-lowering-*.f64100.0%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
            4. Applied egg-rr100.0%

              \[\leadsto \color{blue}{\left(\cos \left(\frac{K}{2}\right) \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right)} + U \]
            5. Taylor expanded in K around 0

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\color{blue}{1}, \mathsf{sinh.f64}\left(\ell\right)\right), \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
            6. Step-by-step derivation
              1. Simplified85.0%

                \[\leadsto \left(\color{blue}{1} \cdot \sinh \ell\right) \cdot \left(J \cdot 2\right) + U \]

              if 4.99999999999999977e-7 < (/.f64 K #s(literal 2 binary64))

              1. Initial program 89.5%

                \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
              2. Add Preprocessing
              3. Taylor expanded in l around 0

                \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
              4. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                2. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                3. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                4. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                6. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                7. associate-*r*N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
              5. Simplified83.6%

                \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
            7. Recombined 2 regimes into one program.
            8. Final simplification84.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-7}:\\ \;\;\;\;U + \sinh \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 7: 80.6% accurate, 2.9× speedup?

            \[\begin{array}{l} \\ U + \frac{J}{\frac{0.5}{\sinh \ell}} \end{array} \]
            (FPCore (J l K U) :precision binary64 (+ U (/ J (/ 0.5 (sinh l)))))
            double code(double J, double l, double K, double U) {
            	return U + (J / (0.5 / sinh(l)));
            }
            
            real(8) function code(j, l, k, u)
                real(8), intent (in) :: j
                real(8), intent (in) :: l
                real(8), intent (in) :: k
                real(8), intent (in) :: u
                code = u + (j / (0.5d0 / sinh(l)))
            end function
            
            public static double code(double J, double l, double K, double U) {
            	return U + (J / (0.5 / Math.sinh(l)));
            }
            
            def code(J, l, K, U):
            	return U + (J / (0.5 / math.sinh(l)))
            
            function code(J, l, K, U)
            	return Float64(U + Float64(J / Float64(0.5 / sinh(l))))
            end
            
            function tmp = code(J, l, K, U)
            	tmp = U + (J / (0.5 / sinh(l)));
            end
            
            code[J_, l_, K_, U_] := N[(U + N[(J / N[(0.5 / N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            U + \frac{J}{\frac{0.5}{\sinh \ell}}
            \end{array}
            
            Derivation
            1. Initial program 85.8%

              \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right), U\right) \]
              2. associate-*r*N/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
              3. sinh-undefN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \left(2 \cdot \sinh \ell\right)\right), U\right) \]
              4. sinh-defN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \left(2 \cdot \frac{e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}}{2}\right)\right), U\right) \]
              5. associate-*r/N/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \frac{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}{2}\right), U\right) \]
              6. clear-numN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \frac{1}{\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}}\right), U\right) \]
              7. un-div-invN/A

                \[\leadsto \mathsf{+.f64}\left(\left(\frac{\cos \left(\frac{K}{2}\right) \cdot J}{\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}}\right), U\right) \]
              8. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
              9. *-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(J \cdot \cos \left(\frac{K}{2}\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
              10. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \cos \left(\frac{K}{2}\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
              11. cos-lowering-cos.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
              12. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
              13. clear-numN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{1}{\frac{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}{2}}\right)\right), U\right) \]
              14. associate-*r/N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{1}{2 \cdot \frac{e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}}{2}}\right)\right), U\right) \]
              15. sinh-defN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{1}{2 \cdot \sinh \ell}\right)\right), U\right) \]
              16. associate-/r*N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{\frac{1}{2}}{\sinh \ell}\right)\right), U\right) \]
              17. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \mathsf{/.f64}\left(\left(\frac{1}{2}\right), \sinh \ell\right)\right), U\right) \]
              18. metadata-evalN/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, \sinh \ell\right)\right), U\right) \]
              19. sinh-lowering-sinh.f6499.9%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{sinh.f64}\left(\ell\right)\right)\right), U\right) \]
            4. Applied egg-rr99.9%

              \[\leadsto \color{blue}{\frac{J \cdot \cos \left(\frac{K}{2}\right)}{\frac{0.5}{\sinh \ell}}} + U \]
            5. Taylor expanded in K around 0

              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\color{blue}{J}, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{sinh.f64}\left(\ell\right)\right)\right), U\right) \]
            6. Step-by-step derivation
              1. Simplified81.3%

                \[\leadsto \frac{\color{blue}{J}}{\frac{0.5}{\sinh \ell}} + U \]
              2. Final simplification81.3%

                \[\leadsto U + \frac{J}{\frac{0.5}{\sinh \ell}} \]
              3. Add Preprocessing

              Alternative 8: 77.3% accurate, 8.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -6 \cdot 10^{+219}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq -106000000:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (if (<= l -6e+219)
                 (* J (* l (* (* l l) 0.3333333333333333)))
                 (if (<= l -106000000.0)
                   (+
                    U
                    (*
                     (*
                      J
                      (*
                       l
                       (+
                        2.0
                        (*
                         (* l l)
                         (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))
                     (+ 1.0 (* -0.125 (* K K)))))
                   (+
                    U
                    (*
                     (* l J)
                     (+
                      2.0
                      (*
                       (* l l)
                       (+
                        0.3333333333333333
                        (*
                         (* l l)
                         (+ 0.016666666666666666 (* l (* l 0.0003968253968253968))))))))))))
              double code(double J, double l, double K, double U) {
              	double tmp;
              	if (l <= -6e+219) {
              		tmp = J * (l * ((l * l) * 0.3333333333333333));
              	} else if (l <= -106000000.0) {
              		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
              	} else {
              		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))));
              	}
              	return tmp;
              }
              
              real(8) function code(j, l, k, u)
                  real(8), intent (in) :: j
                  real(8), intent (in) :: l
                  real(8), intent (in) :: k
                  real(8), intent (in) :: u
                  real(8) :: tmp
                  if (l <= (-6d+219)) then
                      tmp = j * (l * ((l * l) * 0.3333333333333333d0))
                  else if (l <= (-106000000.0d0)) then
                      tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
                  else
                      tmp = u + ((l * j) * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + (l * (l * 0.0003968253968253968d0))))))))
                  end if
                  code = tmp
              end function
              
              public static double code(double J, double l, double K, double U) {
              	double tmp;
              	if (l <= -6e+219) {
              		tmp = J * (l * ((l * l) * 0.3333333333333333));
              	} else if (l <= -106000000.0) {
              		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
              	} else {
              		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))));
              	}
              	return tmp;
              }
              
              def code(J, l, K, U):
              	tmp = 0
              	if l <= -6e+219:
              		tmp = J * (l * ((l * l) * 0.3333333333333333))
              	elif l <= -106000000.0:
              		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))))
              	else:
              		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))))
              	return tmp
              
              function code(J, l, K, U)
              	tmp = 0.0
              	if (l <= -6e+219)
              		tmp = Float64(J * Float64(l * Float64(Float64(l * l) * 0.3333333333333333)));
              	elseif (l <= -106000000.0)
              		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K)))));
              	else
              		tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(l * Float64(l * 0.0003968253968253968)))))))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(J, l, K, U)
              	tmp = 0.0;
              	if (l <= -6e+219)
              		tmp = J * (l * ((l * l) * 0.3333333333333333));
              	elseif (l <= -106000000.0)
              		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
              	else
              		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))));
              	end
              	tmp_2 = tmp;
              end
              
              code[J_, l_, K_, U_] := If[LessEqual[l, -6e+219], N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -106000000.0], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(l * N[(l * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\ell \leq -6 \cdot 10^{+219}:\\
              \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
              
              \mathbf{elif}\;\ell \leq -106000000:\\
              \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if l < -5.9999999999999995e219

                1. Initial program 100.0%

                  \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                2. Add Preprocessing
                3. Taylor expanded in l around 0

                  \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  2. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  3. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  7. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                5. Simplified100.0%

                  \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                6. Taylor expanded in K around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                7. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f6488.9%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                8. Simplified88.9%

                  \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                9. Taylor expanded in l around inf

                  \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                10. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{3} \cdot J\right) \cdot \color{blue}{{\ell}^{3}} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(J \cdot \frac{1}{3}\right) \cdot {\color{blue}{\ell}}^{3} \]
                  3. associate-*l*N/A

                    \[\leadsto J \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{3}\right)} \]
                  4. unpow3N/A

                    \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\left(\ell \cdot \ell\right) \cdot \color{blue}{\ell}\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left({\ell}^{2} \cdot \ell\right)\right) \]
                  6. associate-*l*N/A

                    \[\leadsto J \cdot \left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \color{blue}{\ell}\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \ell\right)}\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(J, \left(\ell \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
                  11. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
                  12. *-lowering-*.f6488.9%

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
                11. Simplified88.9%

                  \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} \]

                if -5.9999999999999995e219 < l < -1.06e8

                1. Initial program 100.0%

                  \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                2. Add Preprocessing
                3. Taylor expanded in l around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                4. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  10. *-lowering-*.f6472.2%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                5. Simplified72.2%

                  \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}\right), U\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right)\right), U\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right)\right), U\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right)\right), U\right) \]
                  4. *-lowering-*.f6469.6%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                8. Simplified69.6%

                  \[\leadsto \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} + U \]

                if -1.06e8 < l

                1. Initial program 80.9%

                  \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                2. Add Preprocessing
                3. Taylor expanded in l around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                4. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\left(\ell \cdot \ell\right) \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  8. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \left(\frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \left({\ell}^{2} \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  13. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  14. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  15. *-lowering-*.f6495.8%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                5. Simplified95.8%

                  \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

                  \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)}, U\right) \]
                7. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \ell\right) \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(J \cdot \ell\right), \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  4. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  8. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                  10. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                  12. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left(\frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), U\right) \]
                  13. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left({\ell}^{2} \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right), U\right) \]
                  14. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right), U\right) \]
                  15. associate-*l*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left(\ell \cdot \left(\ell \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), U\right) \]
                  16. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), U\right) \]
                  17. *-lowering-*.f6481.3%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), U\right) \]
                8. Simplified81.3%

                  \[\leadsto \color{blue}{\left(J \cdot \ell\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)} + U \]
              3. Recombined 3 regimes into one program.
              4. Final simplification79.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6 \cdot 10^{+219}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq -106000000:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 9: 76.0% accurate, 9.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{+218}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq -250000000:\\ \;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\left(\ell \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)}{U}\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (if (<= l -5e+218)
                 (* J (* l (* (* l l) 0.3333333333333333)))
                 (if (<= l -250000000.0)
                   (*
                    U
                    (+
                     1.0
                     (/
                      (*
                       J
                       (* (* l (* l (* l 0.3333333333333333))) (+ 1.0 (* -0.125 (* K K)))))
                      U)))
                   (+
                    U
                    (*
                     J
                     (*
                      l
                      (+
                       2.0
                       (*
                        (* l l)
                        (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))))
              double code(double J, double l, double K, double U) {
              	double tmp;
              	if (l <= -5e+218) {
              		tmp = J * (l * ((l * l) * 0.3333333333333333));
              	} else if (l <= -250000000.0) {
              		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U));
              	} else {
              		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
              	}
              	return tmp;
              }
              
              real(8) function code(j, l, k, u)
                  real(8), intent (in) :: j
                  real(8), intent (in) :: l
                  real(8), intent (in) :: k
                  real(8), intent (in) :: u
                  real(8) :: tmp
                  if (l <= (-5d+218)) then
                      tmp = j * (l * ((l * l) * 0.3333333333333333d0))
                  else if (l <= (-250000000.0d0)) then
                      tmp = u * (1.0d0 + ((j * ((l * (l * (l * 0.3333333333333333d0))) * (1.0d0 + ((-0.125d0) * (k * k))))) / u))
                  else
                      tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))
                  end if
                  code = tmp
              end function
              
              public static double code(double J, double l, double K, double U) {
              	double tmp;
              	if (l <= -5e+218) {
              		tmp = J * (l * ((l * l) * 0.3333333333333333));
              	} else if (l <= -250000000.0) {
              		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U));
              	} else {
              		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
              	}
              	return tmp;
              }
              
              def code(J, l, K, U):
              	tmp = 0
              	if l <= -5e+218:
              		tmp = J * (l * ((l * l) * 0.3333333333333333))
              	elif l <= -250000000.0:
              		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U))
              	else:
              		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))
              	return tmp
              
              function code(J, l, K, U)
              	tmp = 0.0
              	if (l <= -5e+218)
              		tmp = Float64(J * Float64(l * Float64(Float64(l * l) * 0.3333333333333333)));
              	elseif (l <= -250000000.0)
              		tmp = Float64(U * Float64(1.0 + Float64(Float64(J * Float64(Float64(l * Float64(l * Float64(l * 0.3333333333333333))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))) / U)));
              	else
              		tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(J, l, K, U)
              	tmp = 0.0;
              	if (l <= -5e+218)
              		tmp = J * (l * ((l * l) * 0.3333333333333333));
              	elseif (l <= -250000000.0)
              		tmp = U * (1.0 + ((J * ((l * (l * (l * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K))))) / U));
              	else
              		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
              	end
              	tmp_2 = tmp;
              end
              
              code[J_, l_, K_, U_] := If[LessEqual[l, -5e+218], N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -250000000.0], N[(U * N[(1.0 + N[(N[(J * N[(N[(l * N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\ell \leq -5 \cdot 10^{+218}:\\
              \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
              
              \mathbf{elif}\;\ell \leq -250000000:\\
              \;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\left(\ell \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)}{U}\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if l < -4.99999999999999983e218

                1. Initial program 100.0%

                  \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                2. Add Preprocessing
                3. Taylor expanded in l around 0

                  \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  2. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  3. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  7. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                5. Simplified100.0%

                  \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                6. Taylor expanded in K around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                7. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f6488.9%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                8. Simplified88.9%

                  \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                9. Taylor expanded in l around inf

                  \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                10. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{3} \cdot J\right) \cdot \color{blue}{{\ell}^{3}} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(J \cdot \frac{1}{3}\right) \cdot {\color{blue}{\ell}}^{3} \]
                  3. associate-*l*N/A

                    \[\leadsto J \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{3}\right)} \]
                  4. unpow3N/A

                    \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\left(\ell \cdot \ell\right) \cdot \color{blue}{\ell}\right)\right) \]
                  5. unpow2N/A

                    \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left({\ell}^{2} \cdot \ell\right)\right) \]
                  6. associate-*l*N/A

                    \[\leadsto J \cdot \left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \color{blue}{\ell}\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \ell\right)}\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(J, \left(\ell \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                  10. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
                  11. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
                  12. *-lowering-*.f6488.9%

                    \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
                11. Simplified88.9%

                  \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} \]

                if -4.99999999999999983e218 < l < -2.5e8

                1. Initial program 100.0%

                  \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                2. Add Preprocessing
                3. Taylor expanded in l around 0

                  \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  2. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  3. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  7. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                5. Simplified54.2%

                  \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                6. Taylor expanded in K around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                7. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                  4. *-lowering-*.f6453.6%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                8. Simplified53.6%

                  \[\leadsto \ell \cdot \left(\color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + U \]
                9. Taylor expanded in l around inf

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \color{blue}{\left(\frac{1}{3} \cdot \left(J \cdot {\ell}^{2}\right)\right)}\right)\right), U\right) \]
                10. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(\left(\frac{1}{3} \cdot J\right) \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                  2. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(\left(J \cdot \frac{1}{3}\right) \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                  3. associate-*r*N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(J \cdot \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  4. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                  7. *-lowering-*.f6453.6%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                11. Simplified53.6%

                  \[\leadsto \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \color{blue}{\left(J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)}\right) + U \]
                12. Taylor expanded in U around inf

                  \[\leadsto \color{blue}{U \cdot \left(1 + \frac{1}{3} \cdot \frac{J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)}{U}\right)} \]
                13. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(U, \color{blue}{\left(1 + \frac{1}{3} \cdot \frac{J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)}{U}\right)}\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{3} \cdot \frac{J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)}{U}\right)}\right)\right) \]
                  3. associate-*r/N/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{\color{blue}{U}}\right)\right)\right) \]
                  4. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\left(\mathsf{neg}\left(\frac{-1}{3}\right)\right) \cdot \left(J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{U}\right)\right)\right) \]
                  5. distribute-lft-neg-inN/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(\frac{-1}{3} \cdot \left(J \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)\right)}{U}\right)\right)\right) \]
                  6. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(\frac{-1}{3} \cdot J\right) \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{U}\right)\right)\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(\left(J \cdot \frac{-1}{3}\right) \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)}{U}\right)\right)\right) \]
                  8. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \left(\frac{\mathsf{neg}\left(J \cdot \left(\frac{-1}{3} \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)\right)}{U}\right)\right)\right) \]
                  9. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\mathsf{neg}\left(J \cdot \left(\frac{-1}{3} \cdot \left({\ell}^{3} \cdot \left(1 + \frac{-1}{8} \cdot {K}^{2}\right)\right)\right)\right)\right), \color{blue}{U}\right)\right)\right) \]
                14. Simplified65.4%

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

                if -2.5e8 < l

                1. Initial program 80.9%

                  \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                2. Add Preprocessing
                3. Taylor expanded in l around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                4. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  7. *-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  8. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. unpow2N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  10. *-lowering-*.f6494.8%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                5. Simplified94.8%

                  \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \color{blue}{1}\right), U\right) \]
                7. Step-by-step derivation
                  1. Simplified80.3%

                    \[\leadsto \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \color{blue}{1} + U \]
                8. Recombined 3 regimes into one program.
                9. Final simplification78.1%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5 \cdot 10^{+218}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq -250000000:\\ \;\;\;\;U \cdot \left(1 + \frac{J \cdot \left(\left(\ell \cdot \left(\ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)}{U}\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \end{array} \]
                10. Add Preprocessing

                Alternative 10: 75.2% accurate, 10.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq 8 \cdot 10^{+140}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\ \end{array} \end{array} \]
                (FPCore (J l K U)
                 :precision binary64
                 (if (<= J 8e+140)
                   (+
                    U
                    (*
                     (* l J)
                     (+
                      2.0
                      (*
                       (* l l)
                       (+
                        0.3333333333333333
                        (*
                         (* l l)
                         (+ 0.016666666666666666 (* l (* l 0.0003968253968253968)))))))))
                   (+
                    U
                    (*
                     l
                     (*
                      (* J (+ 2.0 (* (* l l) 0.3333333333333333)))
                      (+ 1.0 (* -0.125 (* K K))))))))
                double code(double J, double l, double K, double U) {
                	double tmp;
                	if (J <= 8e+140) {
                		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))));
                	} else {
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                	}
                	return tmp;
                }
                
                real(8) function code(j, l, k, u)
                    real(8), intent (in) :: j
                    real(8), intent (in) :: l
                    real(8), intent (in) :: k
                    real(8), intent (in) :: u
                    real(8) :: tmp
                    if (j <= 8d+140) then
                        tmp = u + ((l * j) * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * (0.016666666666666666d0 + (l * (l * 0.0003968253968253968d0))))))))
                    else
                        tmp = u + (l * ((j * (2.0d0 + ((l * l) * 0.3333333333333333d0))) * (1.0d0 + ((-0.125d0) * (k * k)))))
                    end if
                    code = tmp
                end function
                
                public static double code(double J, double l, double K, double U) {
                	double tmp;
                	if (J <= 8e+140) {
                		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))));
                	} else {
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                	}
                	return tmp;
                }
                
                def code(J, l, K, U):
                	tmp = 0
                	if J <= 8e+140:
                		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))))
                	else:
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))))
                	return tmp
                
                function code(J, l, K, U)
                	tmp = 0.0
                	if (J <= 8e+140)
                		tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * Float64(0.016666666666666666 + Float64(l * Float64(l * 0.0003968253968253968)))))))));
                	else
                		tmp = Float64(U + Float64(l * Float64(Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))));
                	end
                	return tmp
                end
                
                function tmp_2 = code(J, l, K, U)
                	tmp = 0.0;
                	if (J <= 8e+140)
                		tmp = U + ((l * J) * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * (0.016666666666666666 + (l * (l * 0.0003968253968253968))))))));
                	else
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                	end
                	tmp_2 = tmp;
                end
                
                code[J_, l_, K_, U_] := If[LessEqual[J, 8e+140], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * N[(0.016666666666666666 + N[(l * N[(l * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;J \leq 8 \cdot 10^{+140}:\\
                \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if J < 8.00000000000000047e140

                  1. Initial program 88.9%

                    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  2. Add Preprocessing
                  3. Taylor expanded in l around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    6. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    7. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\left(\ell \cdot \ell\right) \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    8. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    9. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    11. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \left(\frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \left({\ell}^{2} \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    13. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    14. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    15. *-lowering-*.f6492.3%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  5. Simplified92.3%

                    \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  6. Taylor expanded in K around 0

                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)}, U\right) \]
                  7. Step-by-step derivation
                    1. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \ell\right) \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(J \cdot \ell\right), \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                    4. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    6. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    8. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                    9. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                    10. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                    11. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), U\right) \]
                    12. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left(\frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right)\right), U\right) \]
                    13. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left({\ell}^{2} \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right), U\right) \]
                    14. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right), U\right) \]
                    15. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \left(\ell \cdot \left(\ell \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), U\right) \]
                    16. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), U\right) \]
                    17. *-lowering-*.f6478.4%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), U\right) \]
                  8. Simplified78.4%

                    \[\leadsto \color{blue}{\left(J \cdot \ell\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)} + U \]

                  if 8.00000000000000047e140 < J

                  1. Initial program 70.3%

                    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  2. Add Preprocessing
                  3. Taylor expanded in l around 0

                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                  4. Step-by-step derivation
                    1. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    2. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    3. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    4. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    6. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    7. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  5. Simplified93.3%

                    \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                  6. Taylor expanded in K around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                  7. Step-by-step derivation
                    1. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    2. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    3. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    4. *-lowering-*.f6474.0%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                  8. Simplified74.0%

                    \[\leadsto \ell \cdot \left(\color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + U \]
                3. Recombined 2 regimes into one program.
                4. Final simplification77.7%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq 8 \cdot 10^{+140}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\ \end{array} \]
                5. Add Preprocessing

                Alternative 11: 74.7% accurate, 10.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(U \cdot \left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)}{U}\right)\right)\\ \mathbf{if}\;\ell \leq -6.2 \cdot 10^{+18}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 1200:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (J l K U)
                 :precision binary64
                 (let* ((t_0
                         (*
                          J
                          (*
                           U
                           (+ (/ 1.0 J) (/ (* l (+ 2.0 (* l (* l 0.3333333333333333)))) U))))))
                   (if (<= l -6.2e+18) t_0 (if (<= l 1200.0) (+ U (* l (* 2.0 J))) t_0))))
                double code(double J, double l, double K, double U) {
                	double t_0 = J * (U * ((1.0 / J) + ((l * (2.0 + (l * (l * 0.3333333333333333)))) / U)));
                	double tmp;
                	if (l <= -6.2e+18) {
                		tmp = t_0;
                	} else if (l <= 1200.0) {
                		tmp = U + (l * (2.0 * J));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                real(8) function code(j, l, k, u)
                    real(8), intent (in) :: j
                    real(8), intent (in) :: l
                    real(8), intent (in) :: k
                    real(8), intent (in) :: u
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = j * (u * ((1.0d0 / j) + ((l * (2.0d0 + (l * (l * 0.3333333333333333d0)))) / u)))
                    if (l <= (-6.2d+18)) then
                        tmp = t_0
                    else if (l <= 1200.0d0) then
                        tmp = u + (l * (2.0d0 * j))
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double J, double l, double K, double U) {
                	double t_0 = J * (U * ((1.0 / J) + ((l * (2.0 + (l * (l * 0.3333333333333333)))) / U)));
                	double tmp;
                	if (l <= -6.2e+18) {
                		tmp = t_0;
                	} else if (l <= 1200.0) {
                		tmp = U + (l * (2.0 * J));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(J, l, K, U):
                	t_0 = J * (U * ((1.0 / J) + ((l * (2.0 + (l * (l * 0.3333333333333333)))) / U)))
                	tmp = 0
                	if l <= -6.2e+18:
                		tmp = t_0
                	elif l <= 1200.0:
                		tmp = U + (l * (2.0 * J))
                	else:
                		tmp = t_0
                	return tmp
                
                function code(J, l, K, U)
                	t_0 = Float64(J * Float64(U * Float64(Float64(1.0 / J) + Float64(Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))) / U))))
                	tmp = 0.0
                	if (l <= -6.2e+18)
                		tmp = t_0;
                	elseif (l <= 1200.0)
                		tmp = Float64(U + Float64(l * Float64(2.0 * J)));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(J, l, K, U)
                	t_0 = J * (U * ((1.0 / J) + ((l * (2.0 + (l * (l * 0.3333333333333333)))) / U)));
                	tmp = 0.0;
                	if (l <= -6.2e+18)
                		tmp = t_0;
                	elseif (l <= 1200.0)
                		tmp = U + (l * (2.0 * J));
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(U * N[(N[(1.0 / J), $MachinePrecision] + N[(N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -6.2e+18], t$95$0, If[LessEqual[l, 1200.0], N[(U + N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := J \cdot \left(U \cdot \left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)}{U}\right)\right)\\
                \mathbf{if}\;\ell \leq -6.2 \cdot 10^{+18}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;\ell \leq 1200:\\
                \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if l < -6.2e18 or 1200 < l

                  1. Initial program 100.0%

                    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  2. Add Preprocessing
                  3. Taylor expanded in l around 0

                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                  4. Step-by-step derivation
                    1. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    2. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    3. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    4. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    6. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    7. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  5. Simplified69.0%

                    \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                  6. Taylor expanded in K around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                    5. *-lowering-*.f6451.3%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                  8. Simplified51.3%

                    \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                  9. Taylor expanded in J around inf

                    \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{U}{J}\right)} \]
                  10. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{U}{J}\right)}\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(J, \left(\frac{U}{J} + \color{blue}{\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                    3. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\left(\frac{U}{J}\right), \color{blue}{\left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right)\right) \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \left(\color{blue}{\ell} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \mathsf{*.f64}\left(\ell, \color{blue}{\left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right)\right) \]
                    6. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right)\right)\right) \]
                    7. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right)\right)\right) \]
                    8. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right)\right)\right) \]
                    9. *-lowering-*.f6454.2%

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right)\right)\right) \]
                  11. Simplified54.2%

                    \[\leadsto \color{blue}{J \cdot \left(\frac{U}{J} + \ell \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} \]
                  12. Taylor expanded in U around inf

                    \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(U \cdot \left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)}{U}\right)\right)}\right) \]
                  13. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \color{blue}{\left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)}{U}\right)}\right)\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\left(\frac{1}{J}\right), \color{blue}{\left(\frac{\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)}{U}\right)}\right)\right)\right) \]
                    3. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \left(\frac{\color{blue}{\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)}}{U}\right)\right)\right)\right) \]
                    4. /-lowering-/.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right), \color{blue}{U}\right)\right)\right)\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right), U\right)\right)\right)\right) \]
                    6. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right)\right)\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\right)\right)\right), U\right)\right)\right)\right) \]
                    8. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right), U\right)\right)\right)\right) \]
                    9. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \frac{1}{3}\right)\right)\right)\right), U\right)\right)\right)\right) \]
                    10. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \frac{1}{3}\right)\right)\right)\right), U\right)\right)\right)\right) \]
                    11. *-lowering-*.f6466.4%

                      \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, J\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right), U\right)\right)\right)\right) \]
                  14. Simplified66.4%

                    \[\leadsto J \cdot \color{blue}{\left(U \cdot \left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)}{U}\right)\right)} \]

                  if -6.2e18 < l < 1200

                  1. Initial program 73.3%

                    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  2. Add Preprocessing
                  3. Taylor expanded in l around 0

                    \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                  4. Step-by-step derivation
                    1. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    2. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    3. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    4. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    6. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    7. associate-*r*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                  5. Simplified95.6%

                    \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                  6. Taylor expanded in K around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                    5. *-lowering-*.f6481.9%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                  8. Simplified81.9%

                    \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                  9. Taylor expanded in l around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(2 \cdot J\right)}\right), U\right) \]
                  10. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot 2\right)\right), U\right) \]
                    2. *-lowering-*.f6481.9%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
                  11. Simplified81.9%

                    \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2\right)} + U \]
                3. Recombined 2 regimes into one program.
                4. Final simplification74.6%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -6.2 \cdot 10^{+18}:\\ \;\;\;\;J \cdot \left(U \cdot \left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)}{U}\right)\right)\\ \mathbf{elif}\;\ell \leq 1200:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(U \cdot \left(\frac{1}{J} + \frac{\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)}{U}\right)\right)\\ \end{array} \]
                5. Add Preprocessing

                Alternative 12: 74.3% accurate, 12.0× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq 8.2 \cdot 10^{+140}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\ \end{array} \end{array} \]
                (FPCore (J l K U)
                 :precision binary64
                 (if (<= J 8.2e+140)
                   (+
                    U
                    (*
                     J
                     (*
                      l
                      (+
                       2.0
                       (* (* l l) (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
                   (+
                    U
                    (*
                     l
                     (*
                      (* J (+ 2.0 (* (* l l) 0.3333333333333333)))
                      (+ 1.0 (* -0.125 (* K K))))))))
                double code(double J, double l, double K, double U) {
                	double tmp;
                	if (J <= 8.2e+140) {
                		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                	} else {
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                	}
                	return tmp;
                }
                
                real(8) function code(j, l, k, u)
                    real(8), intent (in) :: j
                    real(8), intent (in) :: l
                    real(8), intent (in) :: k
                    real(8), intent (in) :: u
                    real(8) :: tmp
                    if (j <= 8.2d+140) then
                        tmp = u + (j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))
                    else
                        tmp = u + (l * ((j * (2.0d0 + ((l * l) * 0.3333333333333333d0))) * (1.0d0 + ((-0.125d0) * (k * k)))))
                    end if
                    code = tmp
                end function
                
                public static double code(double J, double l, double K, double U) {
                	double tmp;
                	if (J <= 8.2e+140) {
                		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                	} else {
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                	}
                	return tmp;
                }
                
                def code(J, l, K, U):
                	tmp = 0
                	if J <= 8.2e+140:
                		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))
                	else:
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))))
                	return tmp
                
                function code(J, l, K, U)
                	tmp = 0.0
                	if (J <= 8.2e+140)
                		tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))));
                	else
                		tmp = Float64(U + Float64(l * Float64(Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))));
                	end
                	return tmp
                end
                
                function tmp_2 = code(J, l, K, U)
                	tmp = 0.0;
                	if (J <= 8.2e+140)
                		tmp = U + (J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                	else
                		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                	end
                	tmp_2 = tmp;
                end
                
                code[J_, l_, K_, U_] := If[LessEqual[J, 8.2e+140], N[(U + N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;J \leq 8.2 \cdot 10^{+140}:\\
                \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if J < 8.1999999999999998e140

                  1. Initial program 88.9%

                    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  2. Add Preprocessing
                  3. Taylor expanded in l around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  4. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    6. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    8. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    9. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    10. *-lowering-*.f6490.0%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  5. Simplified90.0%

                    \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                  6. Taylor expanded in K around 0

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \color{blue}{1}\right), U\right) \]
                  7. Step-by-step derivation
                    1. Simplified76.6%

                      \[\leadsto \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \color{blue}{1} + U \]

                    if 8.1999999999999998e140 < J

                    1. Initial program 70.3%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      4. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      7. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. Simplified93.3%

                      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      3. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      4. *-lowering-*.f6474.0%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    8. Simplified74.0%

                      \[\leadsto \ell \cdot \left(\color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + U \]
                  8. Recombined 2 regimes into one program.
                  9. Final simplification76.2%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq 8.2 \cdot 10^{+140}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 13: 73.5% accurate, 12.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq 2.05 \cdot 10^{+139}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (if (<= J 2.05e+139)
                     (+
                      U
                      (*
                       (* l J)
                       (+
                        2.0
                        (* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
                     (+
                      U
                      (*
                       l
                       (*
                        (* J (+ 2.0 (* (* l l) 0.3333333333333333)))
                        (+ 1.0 (* -0.125 (* K K))))))))
                  double code(double J, double l, double K, double U) {
                  	double tmp;
                  	if (J <= 2.05e+139) {
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                  	} else {
                  		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: tmp
                      if (j <= 2.05d+139) then
                          tmp = u + ((l * j) * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))
                      else
                          tmp = u + (l * ((j * (2.0d0 + ((l * l) * 0.3333333333333333d0))) * (1.0d0 + ((-0.125d0) * (k * k)))))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double tmp;
                  	if (J <= 2.05e+139) {
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                  	} else {
                  		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	tmp = 0
                  	if J <= 2.05e+139:
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))
                  	else:
                  		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))))
                  	return tmp
                  
                  function code(J, l, K, U)
                  	tmp = 0.0
                  	if (J <= 2.05e+139)
                  		tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))));
                  	else
                  		tmp = Float64(U + Float64(l * Float64(Float64(J * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333))) * Float64(1.0 + Float64(-0.125 * Float64(K * K))))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	tmp = 0.0;
                  	if (J <= 2.05e+139)
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                  	else
                  		tmp = U + (l * ((J * (2.0 + ((l * l) * 0.3333333333333333))) * (1.0 + (-0.125 * (K * K)))));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := If[LessEqual[J, 2.05e+139], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[(J * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;J \leq 2.05 \cdot 10^{+139}:\\
                  \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if J < 2.0500000000000001e139

                    1. Initial program 88.9%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    4. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      4. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      6. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      7. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      10. *-lowering-*.f6490.0%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    5. Simplified90.0%

                      \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)}, U\right) \]
                    7. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \ell\right) \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right) \cdot \left(J \cdot \ell\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      4. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      5. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      6. associate-*l*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      9. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      10. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      11. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      12. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      14. *-lowering-*.f6475.7%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(J, \ell\right)\right), U\right) \]
                    8. Simplified75.7%

                      \[\leadsto \color{blue}{\left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right) \cdot \left(J \cdot \ell\right)} + U \]

                    if 2.0500000000000001e139 < J

                    1. Initial program 70.3%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      4. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      7. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. Simplified93.3%

                      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      3. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      4. *-lowering-*.f6474.0%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    8. Simplified74.0%

                      \[\leadsto \ell \cdot \left(\color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + U \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification75.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq 2.05 \cdot 10^{+139}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\right)\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 14: 72.1% accurate, 13.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{if}\;\ell \leq -7.7 \cdot 10^{+68}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq -400:\\ \;\;\;\;\left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \left(\left(K \cdot K\right) \cdot -0.041666666666666664\right)\\ \mathbf{elif}\;\ell \leq 60000:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (let* ((t_0 (* J (* l (* (* l l) 0.3333333333333333)))))
                     (if (<= l -7.7e+68)
                       t_0
                       (if (<= l -400.0)
                         (* (* l (* J (* l l))) (* (* K K) -0.041666666666666664))
                         (if (<= l 60000.0) (+ U (* l (* 2.0 J))) t_0)))))
                  double code(double J, double l, double K, double U) {
                  	double t_0 = J * (l * ((l * l) * 0.3333333333333333));
                  	double tmp;
                  	if (l <= -7.7e+68) {
                  		tmp = t_0;
                  	} else if (l <= -400.0) {
                  		tmp = (l * (J * (l * l))) * ((K * K) * -0.041666666666666664);
                  	} else if (l <= 60000.0) {
                  		tmp = U + (l * (2.0 * J));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = j * (l * ((l * l) * 0.3333333333333333d0))
                      if (l <= (-7.7d+68)) then
                          tmp = t_0
                      else if (l <= (-400.0d0)) then
                          tmp = (l * (j * (l * l))) * ((k * k) * (-0.041666666666666664d0))
                      else if (l <= 60000.0d0) then
                          tmp = u + (l * (2.0d0 * j))
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double t_0 = J * (l * ((l * l) * 0.3333333333333333));
                  	double tmp;
                  	if (l <= -7.7e+68) {
                  		tmp = t_0;
                  	} else if (l <= -400.0) {
                  		tmp = (l * (J * (l * l))) * ((K * K) * -0.041666666666666664);
                  	} else if (l <= 60000.0) {
                  		tmp = U + (l * (2.0 * J));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	t_0 = J * (l * ((l * l) * 0.3333333333333333))
                  	tmp = 0
                  	if l <= -7.7e+68:
                  		tmp = t_0
                  	elif l <= -400.0:
                  		tmp = (l * (J * (l * l))) * ((K * K) * -0.041666666666666664)
                  	elif l <= 60000.0:
                  		tmp = U + (l * (2.0 * J))
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(J, l, K, U)
                  	t_0 = Float64(J * Float64(l * Float64(Float64(l * l) * 0.3333333333333333)))
                  	tmp = 0.0
                  	if (l <= -7.7e+68)
                  		tmp = t_0;
                  	elseif (l <= -400.0)
                  		tmp = Float64(Float64(l * Float64(J * Float64(l * l))) * Float64(Float64(K * K) * -0.041666666666666664));
                  	elseif (l <= 60000.0)
                  		tmp = Float64(U + Float64(l * Float64(2.0 * J)));
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	t_0 = J * (l * ((l * l) * 0.3333333333333333));
                  	tmp = 0.0;
                  	if (l <= -7.7e+68)
                  		tmp = t_0;
                  	elseif (l <= -400.0)
                  		tmp = (l * (J * (l * l))) * ((K * K) * -0.041666666666666664);
                  	elseif (l <= 60000.0)
                  		tmp = U + (l * (2.0 * J));
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7.7e+68], t$95$0, If[LessEqual[l, -400.0], N[(N[(l * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 60000.0], N[(U + N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
                  \mathbf{if}\;\ell \leq -7.7 \cdot 10^{+68}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;\ell \leq -400:\\
                  \;\;\;\;\left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \left(\left(K \cdot K\right) \cdot -0.041666666666666664\right)\\
                  
                  \mathbf{elif}\;\ell \leq 60000:\\
                  \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if l < -7.6999999999999998e68 or 6e4 < l

                    1. Initial program 100.0%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      4. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      7. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. Simplified76.2%

                      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                      4. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f6457.8%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                    8. Simplified57.8%

                      \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                    9. Taylor expanded in l around inf

                      \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                    10. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \left(\frac{1}{3} \cdot J\right) \cdot \color{blue}{{\ell}^{3}} \]
                      2. *-commutativeN/A

                        \[\leadsto \left(J \cdot \frac{1}{3}\right) \cdot {\color{blue}{\ell}}^{3} \]
                      3. associate-*l*N/A

                        \[\leadsto J \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{3}\right)} \]
                      4. unpow3N/A

                        \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\left(\ell \cdot \ell\right) \cdot \color{blue}{\ell}\right)\right) \]
                      5. unpow2N/A

                        \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left({\ell}^{2} \cdot \ell\right)\right) \]
                      6. associate-*l*N/A

                        \[\leadsto J \cdot \left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \color{blue}{\ell}\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \ell\right)}\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(J, \left(\ell \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                      9. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
                      11. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
                      12. *-lowering-*.f6464.2%

                        \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
                    11. Simplified64.2%

                      \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} \]

                    if -7.6999999999999998e68 < l < -400

                    1. Initial program 99.9%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      4. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      7. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. Simplified16.8%

                      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\color{blue}{\left(1 + \frac{-1}{8} \cdot {K}^{2}\right)}, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    7. Step-by-step derivation
                      1. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left({K}^{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      3. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                      4. *-lowering-*.f6433.9%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right)\right), U\right) \]
                    8. Simplified33.9%

                      \[\leadsto \ell \cdot \left(\color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + U \]
                    9. Taylor expanded in l around inf

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \color{blue}{\left(\frac{1}{3} \cdot \left(J \cdot {\ell}^{2}\right)\right)}\right)\right), U\right) \]
                    10. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(\left(\frac{1}{3} \cdot J\right) \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(\left(J \cdot \frac{1}{3}\right) \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \left(J \cdot \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                      6. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                      7. *-lowering-*.f6433.9%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                    11. Simplified33.9%

                      \[\leadsto \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \color{blue}{\left(J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)}\right) + U \]
                    12. Taylor expanded in K around inf

                      \[\leadsto \color{blue}{\frac{-1}{24} \cdot \left(J \cdot \left({K}^{2} \cdot {\ell}^{3}\right)\right)} \]
                    13. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \frac{-1}{24} \cdot \left(J \cdot \left({\ell}^{3} \cdot \color{blue}{{K}^{2}}\right)\right) \]
                      2. associate-*r*N/A

                        \[\leadsto \frac{-1}{24} \cdot \left(\left(J \cdot {\ell}^{3}\right) \cdot \color{blue}{{K}^{2}}\right) \]
                      3. associate-*l*N/A

                        \[\leadsto \left(\frac{-1}{24} \cdot \left(J \cdot {\ell}^{3}\right)\right) \cdot \color{blue}{{K}^{2}} \]
                      4. *-commutativeN/A

                        \[\leadsto \left(\left(J \cdot {\ell}^{3}\right) \cdot \frac{-1}{24}\right) \cdot {\color{blue}{K}}^{2} \]
                      5. associate-*l*N/A

                        \[\leadsto \left(J \cdot {\ell}^{3}\right) \cdot \color{blue}{\left(\frac{-1}{24} \cdot {K}^{2}\right)} \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(J \cdot {\ell}^{3}\right), \color{blue}{\left(\frac{-1}{24} \cdot {K}^{2}\right)}\right) \]
                      7. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\left({\ell}^{3} \cdot J\right), \left(\color{blue}{\frac{-1}{24}} \cdot {K}^{2}\right)\right) \]
                      8. cube-multN/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot J\right), \left(\frac{-1}{24} \cdot {K}^{2}\right)\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\left(\ell \cdot {\ell}^{2}\right) \cdot J\right), \left(\frac{-1}{24} \cdot {K}^{2}\right)\right) \]
                      10. associate-*l*N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\ell \cdot \left({\ell}^{2} \cdot J\right)\right), \left(\color{blue}{\frac{-1}{24}} \cdot {K}^{2}\right)\right) \]
                      11. *-commutativeN/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\ell \cdot \left(J \cdot {\ell}^{2}\right)\right), \left(\frac{-1}{24} \cdot {K}^{2}\right)\right) \]
                      12. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot {\ell}^{2}\right)\right), \left(\color{blue}{\frac{-1}{24}} \cdot {K}^{2}\right)\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left({\ell}^{2}\right)\right)\right), \left(\frac{-1}{24} \cdot {K}^{2}\right)\right) \]
                      14. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(\ell \cdot \ell\right)\right)\right), \left(\frac{-1}{24} \cdot {K}^{2}\right)\right) \]
                      15. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\frac{-1}{24} \cdot {K}^{2}\right)\right) \]
                      16. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{24}, \color{blue}{\left({K}^{2}\right)}\right)\right) \]
                      17. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{24}, \left(K \cdot \color{blue}{K}\right)\right)\right) \]
                      18. *-lowering-*.f6433.0%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \mathsf{*.f64}\left(\frac{-1}{24}, \mathsf{*.f64}\left(K, \color{blue}{K}\right)\right)\right) \]
                    14. Simplified33.0%

                      \[\leadsto \color{blue}{\left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \left(-0.041666666666666664 \cdot \left(K \cdot K\right)\right)} \]

                    if -400 < l < 6e4

                    1. Initial program 72.1%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      4. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      7. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. Simplified99.9%

                      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                      4. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f6485.6%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                    8. Simplified85.6%

                      \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                    9. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(2 \cdot J\right)}\right), U\right) \]
                    10. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot 2\right)\right), U\right) \]
                      2. *-lowering-*.f6485.6%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
                    11. Simplified85.6%

                      \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2\right)} + U \]
                  3. Recombined 3 regimes into one program.
                  4. Final simplification72.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -7.7 \cdot 10^{+68}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq -400:\\ \;\;\;\;\left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \left(\left(K \cdot K\right) \cdot -0.041666666666666664\right)\\ \mathbf{elif}\;\ell \leq 60000:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 15: 72.9% accurate, 13.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq 1.4 \cdot 10^{+143}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (if (<= J 1.4e+143)
                     (+
                      U
                      (*
                       (* l J)
                       (+
                        2.0
                        (* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))
                     (+ U (* l (+ (* 2.0 J) (* (* J (* K K)) -0.25))))))
                  double code(double J, double l, double K, double U) {
                  	double tmp;
                  	if (J <= 1.4e+143) {
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                  	} else {
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: tmp
                      if (j <= 1.4d+143) then
                          tmp = u + ((l * j) * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0))))))
                      else
                          tmp = u + (l * ((2.0d0 * j) + ((j * (k * k)) * (-0.25d0))))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double tmp;
                  	if (J <= 1.4e+143) {
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                  	} else {
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)));
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	tmp = 0
                  	if J <= 1.4e+143:
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))))
                  	else:
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)))
                  	return tmp
                  
                  function code(J, l, K, U)
                  	tmp = 0.0
                  	if (J <= 1.4e+143)
                  		tmp = Float64(U + Float64(Float64(l * J) * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))));
                  	else
                  		tmp = Float64(U + Float64(l * Float64(Float64(2.0 * J) + Float64(Float64(J * Float64(K * K)) * -0.25))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	tmp = 0.0;
                  	if (J <= 1.4e+143)
                  		tmp = U + ((l * J) * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666))))));
                  	else
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := If[LessEqual[J, 1.4e+143], N[(U + N[(N[(l * J), $MachinePrecision] * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[(2.0 * J), $MachinePrecision] + N[(N[(J * N[(K * K), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;J \leq 1.4 \cdot 10^{+143}:\\
                  \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;U + \ell \cdot \left(2 \cdot J + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if J < 1.39999999999999999e143

                    1. Initial program 89.0%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    4. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      4. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      6. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      7. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      10. *-lowering-*.f6490.1%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    5. Simplified90.1%

                      \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)}, U\right) \]
                    7. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(J \cdot \ell\right) \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right) \cdot \left(J \cdot \ell\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      4. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      5. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      6. associate-*l*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      9. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \left(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      10. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      11. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      12. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      13. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right), \left(J \cdot \ell\right)\right), U\right) \]
                      14. *-lowering-*.f6475.9%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(J, \ell\right)\right), U\right) \]
                    8. Simplified75.9%

                      \[\leadsto \color{blue}{\left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right) \cdot \left(J \cdot \ell\right)} + U \]

                    if 1.39999999999999999e143 < J

                    1. Initial program 68.8%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                    4. Step-by-step derivation
                      1. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      4. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      6. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      7. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      8. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                    5. Simplified93.0%

                      \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                    6. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{-1}{8} \cdot \left(J \cdot \left({K}^{2} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) + J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                    7. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{-1}{8} \cdot \left(J \cdot \left({K}^{2} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{-1}{8} \cdot \left(J \cdot \left(\left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                      3. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{-1}{8} \cdot \left(\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      4. associate-*l*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right), U\right) \]
                      5. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      7. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      8. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      11. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\left(\frac{-1}{8} \cdot J\right) \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                      12. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot J\right) \cdot \left(\left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                      13. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot J\right) \cdot \left({K}^{2} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                    8. Simplified42.7%

                      \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right) + \left(\left(K \cdot K\right) \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \left(J \cdot -0.125\right)\right)} + U \]
                    9. Taylor expanded in l around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right) + 2 \cdot J\right)}\right), U\right) \]
                    10. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(2 \cdot J + \frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right), U\right) \]
                      2. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\left(2 \cdot J\right), \left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                      3. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\left(J \cdot 2\right), \left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                      5. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \left(\left(J \cdot {K}^{2}\right) \cdot \frac{-1}{4}\right)\right)\right), U\right) \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\left(J \cdot {K}^{2}\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                      7. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \left({K}^{2}\right)\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                      8. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \left(K \cdot K\right)\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                      9. *-lowering-*.f6472.7%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(K, K\right)\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                    11. Simplified72.7%

                      \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2 + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)} + U \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification75.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq 1.4 \cdot 10^{+143}:\\ \;\;\;\;U + \left(\ell \cdot J\right) \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 16: 69.9% accurate, 15.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq 1.4 \cdot 10^{+143}:\\ \;\;\;\;U + \frac{J}{\frac{0.5}{\ell \cdot \left(1 + \left(\ell \cdot \ell\right) \cdot 0.16666666666666666\right)}}\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (if (<= J 1.4e+143)
                     (+ U (/ J (/ 0.5 (* l (+ 1.0 (* (* l l) 0.16666666666666666))))))
                     (+ U (* l (+ (* 2.0 J) (* (* J (* K K)) -0.25))))))
                  double code(double J, double l, double K, double U) {
                  	double tmp;
                  	if (J <= 1.4e+143) {
                  		tmp = U + (J / (0.5 / (l * (1.0 + ((l * l) * 0.16666666666666666)))));
                  	} else {
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)));
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: tmp
                      if (j <= 1.4d+143) then
                          tmp = u + (j / (0.5d0 / (l * (1.0d0 + ((l * l) * 0.16666666666666666d0)))))
                      else
                          tmp = u + (l * ((2.0d0 * j) + ((j * (k * k)) * (-0.25d0))))
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double tmp;
                  	if (J <= 1.4e+143) {
                  		tmp = U + (J / (0.5 / (l * (1.0 + ((l * l) * 0.16666666666666666)))));
                  	} else {
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)));
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	tmp = 0
                  	if J <= 1.4e+143:
                  		tmp = U + (J / (0.5 / (l * (1.0 + ((l * l) * 0.16666666666666666)))))
                  	else:
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)))
                  	return tmp
                  
                  function code(J, l, K, U)
                  	tmp = 0.0
                  	if (J <= 1.4e+143)
                  		tmp = Float64(U + Float64(J / Float64(0.5 / Float64(l * Float64(1.0 + Float64(Float64(l * l) * 0.16666666666666666))))));
                  	else
                  		tmp = Float64(U + Float64(l * Float64(Float64(2.0 * J) + Float64(Float64(J * Float64(K * K)) * -0.25))));
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	tmp = 0.0;
                  	if (J <= 1.4e+143)
                  		tmp = U + (J / (0.5 / (l * (1.0 + ((l * l) * 0.16666666666666666)))));
                  	else
                  		tmp = U + (l * ((2.0 * J) + ((J * (K * K)) * -0.25)));
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := If[LessEqual[J, 1.4e+143], N[(U + N[(J / N[(0.5 / N[(l * N[(1.0 + N[(N[(l * l), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(l * N[(N[(2.0 * J), $MachinePrecision] + N[(N[(J * N[(K * K), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;J \leq 1.4 \cdot 10^{+143}:\\
                  \;\;\;\;U + \frac{J}{\frac{0.5}{\ell \cdot \left(1 + \left(\ell \cdot \ell\right) \cdot 0.16666666666666666\right)}}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;U + \ell \cdot \left(2 \cdot J + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if J < 1.39999999999999999e143

                    1. Initial program 89.0%

                      \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    2. Add Preprocessing
                    3. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right), U\right) \]
                      2. associate-*r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      3. sinh-undefN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \left(2 \cdot \sinh \ell\right)\right), U\right) \]
                      4. sinh-defN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \left(2 \cdot \frac{e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}}{2}\right)\right), U\right) \]
                      5. associate-*r/N/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \frac{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}{2}\right), U\right) \]
                      6. clear-numN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \frac{1}{\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}}\right), U\right) \]
                      7. un-div-invN/A

                        \[\leadsto \mathsf{+.f64}\left(\left(\frac{\cos \left(\frac{K}{2}\right) \cdot J}{\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}}\right), U\right) \]
                      8. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
                      9. *-commutativeN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(J \cdot \cos \left(\frac{K}{2}\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \cos \left(\frac{K}{2}\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
                      11. cos-lowering-cos.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\left(\frac{K}{2}\right)\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
                      12. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{2}{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}\right)\right), U\right) \]
                      13. clear-numN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{1}{\frac{2 \cdot \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)}{2}}\right)\right), U\right) \]
                      14. associate-*r/N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{1}{2 \cdot \frac{e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}}{2}}\right)\right), U\right) \]
                      15. sinh-defN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{1}{2 \cdot \sinh \ell}\right)\right), U\right) \]
                      16. associate-/r*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \left(\frac{\frac{1}{2}}{\sinh \ell}\right)\right), U\right) \]
                      17. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \mathsf{/.f64}\left(\left(\frac{1}{2}\right), \sinh \ell\right)\right), U\right) \]
                      18. metadata-evalN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, \sinh \ell\right)\right), U\right) \]
                      19. sinh-lowering-sinh.f6499.9%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(J, \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{sinh.f64}\left(\ell\right)\right)\right), U\right) \]
                    4. Applied egg-rr99.9%

                      \[\leadsto \color{blue}{\frac{J \cdot \cos \left(\frac{K}{2}\right)}{\frac{0.5}{\sinh \ell}}} + U \]
                    5. Taylor expanded in K around 0

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(\color{blue}{J}, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{sinh.f64}\left(\ell\right)\right)\right), U\right) \]
                    6. Step-by-step derivation
                      1. Simplified84.4%

                        \[\leadsto \frac{\color{blue}{J}}{\frac{0.5}{\sinh \ell}} + U \]
                      2. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \color{blue}{\left(\ell \cdot \left(1 + \frac{1}{6} \cdot {\ell}^{2}\right)\right)}\right)\right), U\right) \]
                      3. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \left(1 + \frac{1}{6} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \left(\frac{1}{6} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        3. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \left({\ell}^{2} \cdot \frac{1}{6}\right)\right)\right)\right)\right), U\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({\ell}^{2}\right), \frac{1}{6}\right)\right)\right)\right)\right), U\right) \]
                        5. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{6}\right)\right)\right)\right)\right), U\right) \]
                        6. *-lowering-*.f6471.5%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{6}\right)\right)\right)\right)\right), U\right) \]
                      4. Simplified71.5%

                        \[\leadsto \frac{J}{\frac{0.5}{\color{blue}{\ell \cdot \left(1 + \left(\ell \cdot \ell\right) \cdot 0.16666666666666666\right)}}} + U \]

                      if 1.39999999999999999e143 < J

                      1. Initial program 68.8%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified93.0%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{-1}{8} \cdot \left(J \cdot \left({K}^{2} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) + J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{-1}{8} \cdot \left(J \cdot \left({K}^{2} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{-1}{8} \cdot \left(J \cdot \left(\left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \frac{-1}{8} \cdot \left(\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        4. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) + \left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right), U\right) \]
                        5. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        7. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        9. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        11. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\left(\frac{-1}{8} \cdot J\right) \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right) \cdot {K}^{2}\right)\right)\right), U\right) \]
                        12. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot J\right) \cdot \left(\left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                        13. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right), \left(\left(\frac{-1}{8} \cdot J\right) \cdot \left({K}^{2} \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified42.7%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right) + \left(\left(K \cdot K\right) \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right) \cdot \left(J \cdot -0.125\right)\right)} + U \]
                      9. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right) + 2 \cdot J\right)}\right), U\right) \]
                      10. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(2 \cdot J + \frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\left(2 \cdot J\right), \left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\left(J \cdot 2\right), \left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \left(\frac{-1}{4} \cdot \left(J \cdot {K}^{2}\right)\right)\right)\right), U\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \left(\left(J \cdot {K}^{2}\right) \cdot \frac{-1}{4}\right)\right)\right), U\right) \]
                        6. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\left(J \cdot {K}^{2}\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \left({K}^{2}\right)\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                        8. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \left(K \cdot K\right)\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                        9. *-lowering-*.f6472.7%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, 2\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(K, K\right)\right), \frac{-1}{4}\right)\right)\right), U\right) \]
                      11. Simplified72.7%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2 + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)} + U \]
                    7. Recombined 2 regimes into one program.
                    8. Final simplification71.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq 1.4 \cdot 10^{+143}:\\ \;\;\;\;U + \frac{J}{\frac{0.5}{\ell \cdot \left(1 + \left(\ell \cdot \ell\right) \cdot 0.16666666666666666\right)}}\\ \mathbf{else}:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J + \left(J \cdot \left(K \cdot K\right)\right) \cdot -0.25\right)\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 17: 71.4% accurate, 16.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+52}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 5200:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* J (* l (* (* l l) 0.3333333333333333)))))
                       (if (<= l -3.4e+52) t_0 (if (<= l 5200.0) (+ U (* l (* 2.0 J))) t_0))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = J * (l * ((l * l) * 0.3333333333333333));
                    	double tmp;
                    	if (l <= -3.4e+52) {
                    		tmp = t_0;
                    	} else if (l <= 5200.0) {
                    		tmp = U + (l * (2.0 * J));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(j, l, k, u)
                        real(8), intent (in) :: j
                        real(8), intent (in) :: l
                        real(8), intent (in) :: k
                        real(8), intent (in) :: u
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = j * (l * ((l * l) * 0.3333333333333333d0))
                        if (l <= (-3.4d+52)) then
                            tmp = t_0
                        else if (l <= 5200.0d0) then
                            tmp = u + (l * (2.0d0 * j))
                        else
                            tmp = t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double J, double l, double K, double U) {
                    	double t_0 = J * (l * ((l * l) * 0.3333333333333333));
                    	double tmp;
                    	if (l <= -3.4e+52) {
                    		tmp = t_0;
                    	} else if (l <= 5200.0) {
                    		tmp = U + (l * (2.0 * J));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = J * (l * ((l * l) * 0.3333333333333333))
                    	tmp = 0
                    	if l <= -3.4e+52:
                    		tmp = t_0
                    	elif l <= 5200.0:
                    		tmp = U + (l * (2.0 * J))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(J * Float64(l * Float64(Float64(l * l) * 0.3333333333333333)))
                    	tmp = 0.0
                    	if (l <= -3.4e+52)
                    		tmp = t_0;
                    	elseif (l <= 5200.0)
                    		tmp = Float64(U + Float64(l * Float64(2.0 * J)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = J * (l * ((l * l) * 0.3333333333333333));
                    	tmp = 0.0;
                    	if (l <= -3.4e+52)
                    		tmp = t_0;
                    	elseif (l <= 5200.0)
                    		tmp = U + (l * (2.0 * J));
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.4e+52], t$95$0, If[LessEqual[l, 5200.0], N[(U + N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\
                    \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+52}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 5200:\\
                    \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -3.4e52 or 5200 < l

                      1. Initial program 100.0%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified75.5%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f6456.2%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified56.2%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                      9. Taylor expanded in l around inf

                        \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{3} \cdot J\right) \cdot \color{blue}{{\ell}^{3}} \]
                        2. *-commutativeN/A

                          \[\leadsto \left(J \cdot \frac{1}{3}\right) \cdot {\color{blue}{\ell}}^{3} \]
                        3. associate-*l*N/A

                          \[\leadsto J \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{3}\right)} \]
                        4. unpow3N/A

                          \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\left(\ell \cdot \ell\right) \cdot \color{blue}{\ell}\right)\right) \]
                        5. unpow2N/A

                          \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left({\ell}^{2} \cdot \ell\right)\right) \]
                        6. associate-*l*N/A

                          \[\leadsto J \cdot \left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \color{blue}{\ell}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \ell\right)}\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(J, \left(\ell \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
                        12. *-lowering-*.f6462.3%

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
                      11. Simplified62.3%

                        \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} \]

                      if -3.4e52 < l < 5200

                      1. Initial program 75.3%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified88.8%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f6476.0%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified76.0%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                      9. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(2 \cdot J\right)}\right), U\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot 2\right)\right), U\right) \]
                        2. *-lowering-*.f6476.0%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
                      11. Simplified76.0%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2\right)} + U \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification70.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+52}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq 5200:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 18: 70.9% accurate, 17.3× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\\ \mathbf{if}\;\ell \leq 950:\\ \;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + t\_0\right)\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\ell \cdot t\_0\right)\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* (* l l) 0.3333333333333333)))
                       (if (<= l 950.0) (+ U (* l (* J (+ 2.0 t_0)))) (* J (* l t_0)))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = (l * l) * 0.3333333333333333;
                    	double tmp;
                    	if (l <= 950.0) {
                    		tmp = U + (l * (J * (2.0 + t_0)));
                    	} else {
                    		tmp = J * (l * t_0);
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(j, l, k, u)
                        real(8), intent (in) :: j
                        real(8), intent (in) :: l
                        real(8), intent (in) :: k
                        real(8), intent (in) :: u
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = (l * l) * 0.3333333333333333d0
                        if (l <= 950.0d0) then
                            tmp = u + (l * (j * (2.0d0 + t_0)))
                        else
                            tmp = j * (l * t_0)
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double J, double l, double K, double U) {
                    	double t_0 = (l * l) * 0.3333333333333333;
                    	double tmp;
                    	if (l <= 950.0) {
                    		tmp = U + (l * (J * (2.0 + t_0)));
                    	} else {
                    		tmp = J * (l * t_0);
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = (l * l) * 0.3333333333333333
                    	tmp = 0
                    	if l <= 950.0:
                    		tmp = U + (l * (J * (2.0 + t_0)))
                    	else:
                    		tmp = J * (l * t_0)
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(Float64(l * l) * 0.3333333333333333)
                    	tmp = 0.0
                    	if (l <= 950.0)
                    		tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + t_0))));
                    	else
                    		tmp = Float64(J * Float64(l * t_0));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = (l * l) * 0.3333333333333333;
                    	tmp = 0.0;
                    	if (l <= 950.0)
                    		tmp = U + (l * (J * (2.0 + t_0)));
                    	else
                    		tmp = J * (l * t_0);
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]}, If[LessEqual[l, 950.0], N[(U + N[(l * N[(J * N[(2.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(J * N[(l * t$95$0), $MachinePrecision]), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\\
                    \mathbf{if}\;\ell \leq 950:\\
                    \;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + t\_0\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;J \cdot \left(\ell \cdot t\_0\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < 950

                      1. Initial program 81.7%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified87.4%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f6471.5%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified71.5%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]

                      if 950 < l

                      1. Initial program 100.0%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified68.1%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f6454.0%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified54.0%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                      9. Taylor expanded in l around inf

                        \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                      10. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \left(\frac{1}{3} \cdot J\right) \cdot \color{blue}{{\ell}^{3}} \]
                        2. *-commutativeN/A

                          \[\leadsto \left(J \cdot \frac{1}{3}\right) \cdot {\color{blue}{\ell}}^{3} \]
                        3. associate-*l*N/A

                          \[\leadsto J \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{3}\right)} \]
                        4. unpow3N/A

                          \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\left(\ell \cdot \ell\right) \cdot \color{blue}{\ell}\right)\right) \]
                        5. unpow2N/A

                          \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left({\ell}^{2} \cdot \ell\right)\right) \]
                        6. associate-*l*N/A

                          \[\leadsto J \cdot \left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \color{blue}{\ell}\right) \]
                        7. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(\left(\frac{1}{3} \cdot {\ell}^{2}\right) \cdot \ell\right)}\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(J, \left(\ell \cdot \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                        9. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{3} \cdot {\ell}^{2}\right)}\right)\right) \]
                        10. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \color{blue}{\left({\ell}^{2}\right)}\right)\right)\right) \]
                        11. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \color{blue}{\ell}\right)\right)\right)\right) \]
                        12. *-lowering-*.f6464.1%

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \color{blue}{\ell}\right)\right)\right)\right) \]
                      11. Simplified64.1%

                        \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification69.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 950:\\ \;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 19: 46.5% accurate, 20.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(2 \cdot \ell\right)\\ \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+52}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 950:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* J (* 2.0 l))))
                       (if (<= l -3.4e+52) t_0 (if (<= l 950.0) U t_0))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = J * (2.0 * l);
                    	double tmp;
                    	if (l <= -3.4e+52) {
                    		tmp = t_0;
                    	} else if (l <= 950.0) {
                    		tmp = U;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(j, l, k, u)
                        real(8), intent (in) :: j
                        real(8), intent (in) :: l
                        real(8), intent (in) :: k
                        real(8), intent (in) :: u
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = j * (2.0d0 * l)
                        if (l <= (-3.4d+52)) then
                            tmp = t_0
                        else if (l <= 950.0d0) then
                            tmp = u
                        else
                            tmp = t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double J, double l, double K, double U) {
                    	double t_0 = J * (2.0 * l);
                    	double tmp;
                    	if (l <= -3.4e+52) {
                    		tmp = t_0;
                    	} else if (l <= 950.0) {
                    		tmp = U;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = J * (2.0 * l)
                    	tmp = 0
                    	if l <= -3.4e+52:
                    		tmp = t_0
                    	elif l <= 950.0:
                    		tmp = U
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(J * Float64(2.0 * l))
                    	tmp = 0.0
                    	if (l <= -3.4e+52)
                    		tmp = t_0;
                    	elseif (l <= 950.0)
                    		tmp = U;
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = J * (2.0 * l);
                    	tmp = 0.0;
                    	if (l <= -3.4e+52)
                    		tmp = t_0;
                    	elseif (l <= 950.0)
                    		tmp = U;
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.4e+52], t$95$0, If[LessEqual[l, 950.0], U, t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := J \cdot \left(2 \cdot \ell\right)\\
                    \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+52}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 950:\\
                    \;\;\;\;U\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -3.4e52 or 950 < l

                      1. Initial program 100.0%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified75.5%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f6456.2%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified56.2%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                      9. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(2 \cdot J\right)}\right), U\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot 2\right)\right), U\right) \]
                        2. *-lowering-*.f6423.5%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
                      11. Simplified23.5%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2\right)} + U \]
                      12. Taylor expanded in l around inf

                        \[\leadsto \color{blue}{2 \cdot \left(J \cdot \ell\right)} \]
                      13. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \left(J \cdot \ell\right) \cdot \color{blue}{2} \]
                        2. associate-*r*N/A

                          \[\leadsto J \cdot \color{blue}{\left(\ell \cdot 2\right)} \]
                        3. *-commutativeN/A

                          \[\leadsto J \cdot \left(2 \cdot \color{blue}{\ell}\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(J, \color{blue}{\left(2 \cdot \ell\right)}\right) \]
                        5. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(J, \left(\ell \cdot \color{blue}{2}\right)\right) \]
                        6. *-lowering-*.f6423.6%

                          \[\leadsto \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \color{blue}{2}\right)\right) \]
                      14. Simplified23.6%

                        \[\leadsto \color{blue}{J \cdot \left(\ell \cdot 2\right)} \]

                      if -3.4e52 < l < 950

                      1. Initial program 75.3%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in J around 0

                        \[\leadsto \color{blue}{U} \]
                      4. Step-by-step derivation
                        1. Simplified63.4%

                          \[\leadsto \color{blue}{U} \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification46.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+52}:\\ \;\;\;\;J \cdot \left(2 \cdot \ell\right)\\ \mathbf{elif}\;\ell \leq 950:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(2 \cdot \ell\right)\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 20: 54.2% accurate, 44.6× speedup?

                      \[\begin{array}{l} \\ U + \ell \cdot \left(2 \cdot J\right) \end{array} \]
                      (FPCore (J l K U) :precision binary64 (+ U (* l (* 2.0 J))))
                      double code(double J, double l, double K, double U) {
                      	return U + (l * (2.0 * J));
                      }
                      
                      real(8) function code(j, l, k, u)
                          real(8), intent (in) :: j
                          real(8), intent (in) :: l
                          real(8), intent (in) :: k
                          real(8), intent (in) :: u
                          code = u + (l * (2.0d0 * j))
                      end function
                      
                      public static double code(double J, double l, double K, double U) {
                      	return U + (l * (2.0 * J));
                      }
                      
                      def code(J, l, K, U):
                      	return U + (l * (2.0 * J))
                      
                      function code(J, l, K, U)
                      	return Float64(U + Float64(l * Float64(2.0 * J)))
                      end
                      
                      function tmp = code(J, l, K, U)
                      	tmp = U + (l * (2.0 * J));
                      end
                      
                      code[J_, l_, K_, U_] := N[(U + N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      U + \ell \cdot \left(2 \cdot J\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 85.8%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(\ell \cdot \left(\frac{1}{3} \cdot \left(J \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right)}, U\right) \]
                      4. Step-by-step derivation
                        1. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        3. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        4. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        6. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\left(\frac{1}{3} \cdot J\right) \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) \cdot {\ell}^{2} + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot {\ell}^{2}\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{3} \cdot J\right) \cdot \left({\ell}^{2} \cdot \cos \left(\frac{1}{2} \cdot K\right)\right) + 2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right)\right), U\right) \]
                      5. Simplified83.1%

                        \[\leadsto \color{blue}{\ell \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)\right)} + U \]
                      6. Taylor expanded in K around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)}\right), U\right) \]
                      7. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left(\frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)\right), U\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                        5. *-lowering-*.f6467.6%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                      8. Simplified67.6%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                      9. Taylor expanded in l around 0

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \color{blue}{\left(2 \cdot J\right)}\right), U\right) \]
                      10. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot 2\right)\right), U\right) \]
                        2. *-lowering-*.f6453.6%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, 2\right)\right), U\right) \]
                      11. Simplified53.6%

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot 2\right)} + U \]
                      12. Final simplification53.6%

                        \[\leadsto U + \ell \cdot \left(2 \cdot J\right) \]
                      13. Add Preprocessing

                      Alternative 21: 36.9% accurate, 312.0× speedup?

                      \[\begin{array}{l} \\ U \end{array} \]
                      (FPCore (J l K U) :precision binary64 U)
                      double code(double J, double l, double K, double U) {
                      	return U;
                      }
                      
                      real(8) function code(j, l, k, u)
                          real(8), intent (in) :: j
                          real(8), intent (in) :: l
                          real(8), intent (in) :: k
                          real(8), intent (in) :: u
                          code = u
                      end function
                      
                      public static double code(double J, double l, double K, double U) {
                      	return U;
                      }
                      
                      def code(J, l, K, U):
                      	return U
                      
                      function code(J, l, K, U)
                      	return U
                      end
                      
                      function tmp = code(J, l, K, U)
                      	tmp = U;
                      end
                      
                      code[J_, l_, K_, U_] := U
                      
                      \begin{array}{l}
                      
                      \\
                      U
                      \end{array}
                      
                      Derivation
                      1. Initial program 85.8%

                        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                      2. Add Preprocessing
                      3. Taylor expanded in J around 0

                        \[\leadsto \color{blue}{U} \]
                      4. Step-by-step derivation
                        1. Simplified37.3%

                          \[\leadsto \color{blue}{U} \]
                        2. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2024164 
                        (FPCore (J l K U)
                          :name "Maksimov and Kolovsky, Equation (4)"
                          :precision binary64
                          (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))