Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 86.6% → 99.9%
Time: 14.4s
Alternatives: 22
Speedup: 2.4×

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 22 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.6% 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 \left(2 \cdot \sinh \ell\right)\right) \cdot J + U \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (+ (* (* (cos (/ K 2.0)) (* 2.0 (sinh l))) J) U))
double code(double J, double l, double K, double U) {
	return ((cos((K / 2.0)) * (2.0 * sinh(l))) * 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)) * (2.0d0 * sinh(l))) * j) + u
end function
public static double code(double J, double l, double K, double U) {
	return ((Math.cos((K / 2.0)) * (2.0 * Math.sinh(l))) * J) + U;
}
def code(J, l, K, U):
	return ((math.cos((K / 2.0)) * (2.0 * math.sinh(l))) * J) + U
function code(J, l, K, U)
	return Float64(Float64(Float64(cos(Float64(K / 2.0)) * Float64(2.0 * sinh(l))) * J) + U)
end
function tmp = code(J, l, K, U)
	tmp = ((cos((K / 2.0)) * (2.0 * sinh(l))) * J) + U;
end
code[J_, l_, K_, U_] := N[(N[(N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}

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

    \[\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. associate-*l*N/A

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
    6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
    7. /-lowering-/.f64N/A

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
    10. sinh-lowering-sinh.f6499.9%

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

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

Alternative 2: 87.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;t\_0 \leq -0.75:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{elif}\;t\_0 \leq 0.01:\\ \;\;\;\;U + t\_0 \cdot \frac{J}{\frac{0.5}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \end{array} \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (let* ((t_0 (cos (/ K 2.0))))
   (if (<= t_0 -0.75)
     (+
      U
      (*
       (* J (* l (+ 2.0 (* l (* l (* (* l l) 0.016666666666666666))))))
       (+ 1.0 (* -0.125 (* K K)))))
     (if (<= t_0 0.01)
       (+ U (* t_0 (/ J (/ 0.5 l))))
       (+ U (* (* 2.0 (sinh l)) J))))))
double code(double J, double l, double K, double U) {
	double t_0 = cos((K / 2.0));
	double tmp;
	if (t_0 <= -0.75) {
		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
	} else if (t_0 <= 0.01) {
		tmp = U + (t_0 * (J / (0.5 / l)));
	} else {
		tmp = U + ((2.0 * sinh(l)) * 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) :: t_0
    real(8) :: tmp
    t_0 = cos((k / 2.0d0))
    if (t_0 <= (-0.75d0)) then
        tmp = u + ((j * (l * (2.0d0 + (l * (l * ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
    else if (t_0 <= 0.01d0) then
        tmp = u + (t_0 * (j / (0.5d0 / l)))
    else
        tmp = u + ((2.0d0 * sinh(l)) * j)
    end if
    code = tmp
end function
public static double code(double J, double l, double K, double U) {
	double t_0 = Math.cos((K / 2.0));
	double tmp;
	if (t_0 <= -0.75) {
		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
	} else if (t_0 <= 0.01) {
		tmp = U + (t_0 * (J / (0.5 / l)));
	} else {
		tmp = U + ((2.0 * Math.sinh(l)) * J);
	}
	return tmp;
}
def code(J, l, K, U):
	t_0 = math.cos((K / 2.0))
	tmp = 0
	if t_0 <= -0.75:
		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))))
	elif t_0 <= 0.01:
		tmp = U + (t_0 * (J / (0.5 / l)))
	else:
		tmp = U + ((2.0 * math.sinh(l)) * J)
	return tmp
function code(J, l, K, U)
	t_0 = cos(Float64(K / 2.0))
	tmp = 0.0
	if (t_0 <= -0.75)
		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K)))));
	elseif (t_0 <= 0.01)
		tmp = Float64(U + Float64(t_0 * Float64(J / Float64(0.5 / l))));
	else
		tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J));
	end
	return tmp
end
function tmp_2 = code(J, l, K, U)
	t_0 = cos((K / 2.0));
	tmp = 0.0;
	if (t_0 <= -0.75)
		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
	elseif (t_0 <= 0.01)
		tmp = U + (t_0 * (J / (0.5 / l)));
	else
		tmp = U + ((2.0 * sinh(l)) * J);
	end
	tmp_2 = tmp;
end
code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.75], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * 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], If[LessEqual[t$95$0, 0.01], N[(U + N[(t$95$0 * N[(J / N[(0.5 / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq -0.75:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\

\mathbf{elif}\;t\_0 \leq 0.01:\\
\;\;\;\;U + t\_0 \cdot \frac{J}{\frac{0.5}{\ell}}\\

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


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

    1. Initial program 84.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(\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. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \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) \]
      4. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \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) \]
      5. *-commutativeN/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\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(\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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
      12. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
      13. *-lowering-*.f6477.7%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
    5. Simplified77.7%

      \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\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(\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)\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(\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)\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(\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)\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(\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)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right)\right), U\right) \]
      4. *-lowering-*.f6473.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
    8. Simplified73.6%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{60} \cdot {\ell}^{3}\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) \]
    10. Step-by-step derivation
      1. unpow3N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} \cdot \left(\left(\ell \cdot \ell\right) \cdot \ell\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) \]
      2. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} \cdot \left({\ell}^{2} \cdot \ell\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) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{60} \cdot {\ell}^{2}\right) \cdot \ell\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) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{60} \cdot {\ell}^{2}\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) \]
      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(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} \cdot {\ell}^{2}\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) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left({\ell}^{2} \cdot \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) \]
      7. *-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(\ell, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left({\ell}^{2}\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. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left(\ell \cdot \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) \]
      9. *-lowering-*.f6473.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \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) \]
    11. Simplified73.6%

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

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

    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. Step-by-step derivation
      1. flip--N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(J, \mathsf{/.f64}\left(1, \left(2 \cdot \sinh \ell\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(1, \mathsf{*.f64}\left(2, \sinh \ell\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
      10. sinh-lowering-sinh.f6499.9%

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

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

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

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

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

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

    1. Initial program 89.1%

      \[\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. associate-*l*N/A

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
      6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
      7. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
      10. sinh-lowering-sinh.f64100.0%

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

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

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

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

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

    Alternative 3: 87.7% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;t\_0 \leq -0.75:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{elif}\;t\_0 \leq 0.01:\\ \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot J\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \end{array} \end{array} \]
    (FPCore (J l K U)
     :precision binary64
     (let* ((t_0 (cos (/ K 2.0))))
       (if (<= t_0 -0.75)
         (+
          U
          (*
           (* J (* l (+ 2.0 (* l (* l (* (* l l) 0.016666666666666666))))))
           (+ 1.0 (* -0.125 (* K K)))))
         (if (<= t_0 0.01)
           (+ U (* l (* (cos (* K 0.5)) (* 2.0 J))))
           (+ U (* (* 2.0 (sinh l)) J))))))
    double code(double J, double l, double K, double U) {
    	double t_0 = cos((K / 2.0));
    	double tmp;
    	if (t_0 <= -0.75) {
    		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
    	} else if (t_0 <= 0.01) {
    		tmp = U + (l * (cos((K * 0.5)) * (2.0 * J)));
    	} else {
    		tmp = U + ((2.0 * sinh(l)) * 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) :: t_0
        real(8) :: tmp
        t_0 = cos((k / 2.0d0))
        if (t_0 <= (-0.75d0)) then
            tmp = u + ((j * (l * (2.0d0 + (l * (l * ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
        else if (t_0 <= 0.01d0) then
            tmp = u + (l * (cos((k * 0.5d0)) * (2.0d0 * j)))
        else
            tmp = u + ((2.0d0 * sinh(l)) * j)
        end if
        code = tmp
    end function
    
    public static double code(double J, double l, double K, double U) {
    	double t_0 = Math.cos((K / 2.0));
    	double tmp;
    	if (t_0 <= -0.75) {
    		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
    	} else if (t_0 <= 0.01) {
    		tmp = U + (l * (Math.cos((K * 0.5)) * (2.0 * J)));
    	} else {
    		tmp = U + ((2.0 * Math.sinh(l)) * J);
    	}
    	return tmp;
    }
    
    def code(J, l, K, U):
    	t_0 = math.cos((K / 2.0))
    	tmp = 0
    	if t_0 <= -0.75:
    		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))))
    	elif t_0 <= 0.01:
    		tmp = U + (l * (math.cos((K * 0.5)) * (2.0 * J)))
    	else:
    		tmp = U + ((2.0 * math.sinh(l)) * J)
    	return tmp
    
    function code(J, l, K, U)
    	t_0 = cos(Float64(K / 2.0))
    	tmp = 0.0
    	if (t_0 <= -0.75)
    		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K)))));
    	elseif (t_0 <= 0.01)
    		tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(2.0 * J))));
    	else
    		tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J));
    	end
    	return tmp
    end
    
    function tmp_2 = code(J, l, K, U)
    	t_0 = cos((K / 2.0));
    	tmp = 0.0;
    	if (t_0 <= -0.75)
    		tmp = U + ((J * (l * (2.0 + (l * (l * ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
    	elseif (t_0 <= 0.01)
    		tmp = U + (l * (cos((K * 0.5)) * (2.0 * J)));
    	else
    		tmp = U + ((2.0 * sinh(l)) * J);
    	end
    	tmp_2 = tmp;
    end
    
    code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$0, -0.75], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(l * N[(l * 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], If[LessEqual[t$95$0, 0.01], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \cos \left(\frac{K}{2}\right)\\
    \mathbf{if}\;t\_0 \leq -0.75:\\
    \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
    
    \mathbf{elif}\;t\_0 \leq 0.01:\\
    \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot J\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (cos.f64 (/.f64 K #s(literal 2 binary64))) < -0.75

      1. Initial program 84.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(\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. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \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) \]
        4. associate-*l*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \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) \]
        5. *-commutativeN/A

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\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(\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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
        12. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
        13. *-lowering-*.f6477.7%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
      5. Simplified77.7%

        \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\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(\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)\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(\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)\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(\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)\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(\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)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right)\right), U\right) \]
        4. *-lowering-*.f6473.6%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
      8. Simplified73.6%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{1}{60} \cdot {\ell}^{3}\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) \]
      10. Step-by-step derivation
        1. unpow3N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} \cdot \left(\left(\ell \cdot \ell\right) \cdot \ell\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) \]
        2. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} \cdot \left({\ell}^{2} \cdot \ell\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) \]
        3. associate-*r*N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\left(\frac{1}{60} \cdot {\ell}^{2}\right) \cdot \ell\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) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \left(\ell \cdot \left(\frac{1}{60} \cdot {\ell}^{2}\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) \]
        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(\ell, \mathsf{*.f64}\left(\ell, \left(\frac{1}{60} \cdot {\ell}^{2}\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) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \left({\ell}^{2} \cdot \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) \]
        7. *-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(\ell, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left({\ell}^{2}\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. unpow2N/A

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left(\ell \cdot \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) \]
        9. *-lowering-*.f6473.6%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \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) \]
      11. Simplified73.6%

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

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

      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. distribute-rgt-inN/A

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
        7. distribute-rgt-inN/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) \]
        8. *-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) \]
      5. Simplified96.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 l around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 89.1%

        \[\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. associate-*l*N/A

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
        6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
        7. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
        10. sinh-lowering-sinh.f64100.0%

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

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

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

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

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

      Alternative 4: 94.0% accurate, 1.4× speedup?

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

        1. Initial program 82.2%

          \[\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-*.f6486.5%

            \[\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. Simplified86.5%

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

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

        1. Initial program 91.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. associate-*l*N/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
          6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
          7. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
          10. sinh-lowering-sinh.f64100.0%

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.995:\\ \;\;\;\;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)\\ \mathbf{else}:\\ \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 93.5% accurate, 1.4× speedup?

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

          1. Initial program 79.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. distribute-rgt-inN/A

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

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
            7. distribute-rgt-inN/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) \]
            8. *-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) \]
          5. Simplified86.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 \]

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

          1. Initial program 89.1%

            \[\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. associate-*l*N/A

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

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
            6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
            7. /-lowering-/.f64N/A

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
            10. sinh-lowering-sinh.f64100.0%

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

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

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

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

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

          Alternative 6: 89.2% accurate, 2.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-59}:\\ \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \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 \left(0.016666666666666666 + \ell \cdot \left(\ell \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-59)
             (+ U (* (* 2.0 (sinh l)) 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-59) {
          		tmp = U + ((2.0 * sinh(l)) * 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-59) then
                  tmp = u + ((2.0d0 * sinh(l)) * 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-59) {
          		tmp = U + ((2.0 * Math.sinh(l)) * 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-59:
          		tmp = U + ((2.0 * math.sinh(l)) * 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-59)
          		tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * 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) * 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 ((K / 2.0) <= 5e-59)
          		tmp = U + ((2.0 * sinh(l)) * 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-59], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $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] * N[(0.016666666666666666 + N[(l * N[(l * 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^{-59}:\\
          \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
          
          \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 \left(0.016666666666666666 + \ell \cdot \left(\ell \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)) < 5.0000000000000001e-59

            1. Initial program 90.5%

              \[\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. associate-*l*N/A

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
              6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
              7. /-lowering-/.f64N/A

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
              10. sinh-lowering-sinh.f64100.0%

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

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

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

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

              if 5.0000000000000001e-59 < (/.f64 K #s(literal 2 binary64))

              1. Initial program 78.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(\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. *-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), \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. 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), \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) \]
                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(\mathsf{*.f64}\left(\ell, \ell\right), \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) \]
                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(\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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                11. *-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(\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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                12. 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), \mathsf{+.f64}\left(\frac{1}{60}, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                13. 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}, \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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                14. *-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), \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\ell, \left(\ell \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) \]
                15. *-lowering-*.f6495.9%

                  \[\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), \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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
              5. Simplified95.9%

                \[\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 \left(0.016666666666666666 + \ell \cdot \left(\ell \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 simplification90.3%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 5 \cdot 10^{-59}:\\ \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \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 \left(0.016666666666666666 + \ell \cdot \left(\ell \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 7: 93.4% accurate, 2.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\ t_1 := U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \mathbf{if}\;\ell \leq -4 \cdot 10^{+155}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq -0.0024:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\ell \leq 240:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\ \mathbf{elif}\;\ell \leq 10^{+138}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (J l K U)
             :precision binary64
             (let* ((t_0
                     (*
                      (* l (cos (* K 0.5)))
                      (* J (+ 2.0 (* l (* l 0.3333333333333333))))))
                    (t_1 (+ U (* (* 2.0 (sinh l)) J))))
               (if (<= l -4e+155)
                 t_0
                 (if (<= l -0.0024)
                   t_1
                   (if (<= l 240.0)
                     (+ U (* (cos (/ K 2.0)) (* J (* 2.0 l))))
                     (if (<= l 1e+138) t_1 t_0))))))
            double code(double J, double l, double K, double U) {
            	double t_0 = (l * cos((K * 0.5))) * (J * (2.0 + (l * (l * 0.3333333333333333))));
            	double t_1 = U + ((2.0 * sinh(l)) * J);
            	double tmp;
            	if (l <= -4e+155) {
            		tmp = t_0;
            	} else if (l <= -0.0024) {
            		tmp = t_1;
            	} else if (l <= 240.0) {
            		tmp = U + (cos((K / 2.0)) * (J * (2.0 * l)));
            	} else if (l <= 1e+138) {
            		tmp = t_1;
            	} 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) :: t_1
                real(8) :: tmp
                t_0 = (l * cos((k * 0.5d0))) * (j * (2.0d0 + (l * (l * 0.3333333333333333d0))))
                t_1 = u + ((2.0d0 * sinh(l)) * j)
                if (l <= (-4d+155)) then
                    tmp = t_0
                else if (l <= (-0.0024d0)) then
                    tmp = t_1
                else if (l <= 240.0d0) then
                    tmp = u + (cos((k / 2.0d0)) * (j * (2.0d0 * l)))
                else if (l <= 1d+138) then
                    tmp = t_1
                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 = (l * Math.cos((K * 0.5))) * (J * (2.0 + (l * (l * 0.3333333333333333))));
            	double t_1 = U + ((2.0 * Math.sinh(l)) * J);
            	double tmp;
            	if (l <= -4e+155) {
            		tmp = t_0;
            	} else if (l <= -0.0024) {
            		tmp = t_1;
            	} else if (l <= 240.0) {
            		tmp = U + (Math.cos((K / 2.0)) * (J * (2.0 * l)));
            	} else if (l <= 1e+138) {
            		tmp = t_1;
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(J, l, K, U):
            	t_0 = (l * math.cos((K * 0.5))) * (J * (2.0 + (l * (l * 0.3333333333333333))))
            	t_1 = U + ((2.0 * math.sinh(l)) * J)
            	tmp = 0
            	if l <= -4e+155:
            		tmp = t_0
            	elif l <= -0.0024:
            		tmp = t_1
            	elif l <= 240.0:
            		tmp = U + (math.cos((K / 2.0)) * (J * (2.0 * l)))
            	elif l <= 1e+138:
            		tmp = t_1
            	else:
            		tmp = t_0
            	return tmp
            
            function code(J, l, K, U)
            	t_0 = Float64(Float64(l * cos(Float64(K * 0.5))) * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))
            	t_1 = Float64(U + Float64(Float64(2.0 * sinh(l)) * J))
            	tmp = 0.0
            	if (l <= -4e+155)
            		tmp = t_0;
            	elseif (l <= -0.0024)
            		tmp = t_1;
            	elseif (l <= 240.0)
            		tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(2.0 * l))));
            	elseif (l <= 1e+138)
            		tmp = t_1;
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(J, l, K, U)
            	t_0 = (l * cos((K * 0.5))) * (J * (2.0 + (l * (l * 0.3333333333333333))));
            	t_1 = U + ((2.0 * sinh(l)) * J);
            	tmp = 0.0;
            	if (l <= -4e+155)
            		tmp = t_0;
            	elseif (l <= -0.0024)
            		tmp = t_1;
            	elseif (l <= 240.0)
            		tmp = U + (cos((K / 2.0)) * (J * (2.0 * l)));
            	elseif (l <= 1e+138)
            		tmp = t_1;
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(l * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4e+155], t$95$0, If[LessEqual[l, -0.0024], t$95$1, If[LessEqual[l, 240.0], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 1e+138], t$95$1, t$95$0]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(\ell \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
            t_1 := U + \left(2 \cdot \sinh \ell\right) \cdot J\\
            \mathbf{if}\;\ell \leq -4 \cdot 10^{+155}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;\ell \leq -0.0024:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;\ell \leq 240:\\
            \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
            
            \mathbf{elif}\;\ell \leq 10^{+138}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if l < -4.00000000000000003e155 or 1e138 < 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. distribute-rgt-inN/A

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                7. distribute-rgt-inN/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) \]
                8. *-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) \]
              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 J around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{cos.f64}\left(\mathsf{*.f64}\left(K, \frac{1}{2}\right)\right)\right), \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \color{blue}{\frac{1}{3}}\right)\right)\right)\right)\right) \]
              8. Simplified100.0%

                \[\leadsto \color{blue}{\left(\ell \cdot \cos \left(K \cdot 0.5\right)\right) \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)} \]

              if -4.00000000000000003e155 < l < -0.00239999999999999979 or 240 < l < 1e138

              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. Step-by-step derivation
                1. associate-*l*N/A

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
                6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
                7. /-lowering-/.f64N/A

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
                10. sinh-lowering-sinh.f64100.0%

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

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

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

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

                if -0.00239999999999999979 < l < 240

                1. Initial program 71.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(2 \cdot \ell\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

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

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

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

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

              Alternative 8: 88.9% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 2 \cdot 10^{-26}:\\ \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (if (<= (/ K 2.0) 2e-26)
                 (+ U (* (* 2.0 (sinh l)) 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) <= 2e-26) {
              		tmp = U + ((2.0 * sinh(l)) * 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) <= 2d-26) then
                      tmp = u + ((2.0d0 * sinh(l)) * 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) <= 2e-26) {
              		tmp = U + ((2.0 * Math.sinh(l)) * 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) <= 2e-26:
              		tmp = U + ((2.0 * math.sinh(l)) * 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) <= 2e-26)
              		tmp = Float64(U + Float64(Float64(2.0 * sinh(l)) * J));
              	else
              		tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(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) <= 2e-26)
              		tmp = U + ((2.0 * sinh(l)) * 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], 2e-26], N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\frac{K}{2} \leq 2 \cdot 10^{-26}:\\
              \;\;\;\;U + \left(2 \cdot \sinh \ell\right) \cdot J\\
              
              \mathbf{else}:\\
              \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 K #s(literal 2 binary64)) < 2.0000000000000001e-26

                1. Initial program 90.3%

                  \[\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. associate-*l*N/A

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
                  6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
                  7. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
                  10. sinh-lowering-sinh.f64100.0%

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

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

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

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

                  if 2.0000000000000001e-26 < (/.f64 K #s(literal 2 binary64))

                  1. Initial program 77.2%

                    \[\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. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \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) \]
                    4. associate-*l*N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \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) \]
                    5. *-commutativeN/A

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

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\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(\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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    12. unpow2N/A

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    13. *-lowering-*.f6492.4%

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  5. Simplified92.4%

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

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

                Alternative 9: 80.9% accurate, 2.9× speedup?

                \[\begin{array}{l} \\ U + \left(2 \cdot \sinh \ell\right) \cdot J \end{array} \]
                (FPCore (J l K U) :precision binary64 (+ U (* (* 2.0 (sinh l)) J)))
                double code(double J, double l, double K, double U) {
                	return U + ((2.0 * sinh(l)) * 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 + ((2.0d0 * sinh(l)) * j)
                end function
                
                public static double code(double J, double l, double K, double U) {
                	return U + ((2.0 * Math.sinh(l)) * J);
                }
                
                def code(J, l, K, U):
                	return U + ((2.0 * math.sinh(l)) * J)
                
                function code(J, l, K, U)
                	return Float64(U + Float64(Float64(2.0 * sinh(l)) * J))
                end
                
                function tmp = code(J, l, K, U)
                	tmp = U + ((2.0 * sinh(l)) * J);
                end
                
                code[J_, l_, K_, U_] := N[(U + N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                U + \left(2 \cdot \sinh \ell\right) \cdot J
                \end{array}
                
                Derivation
                1. Initial program 87.1%

                  \[\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. associate-*l*N/A

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\cos \left(\frac{K}{2}\right), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
                  6. 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), \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), J\right), U\right) \]
                  7. /-lowering-/.f64N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right), \left(2 \cdot \sinh \ell\right)\right), J\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), \mathsf{*.f64}\left(2, \sinh \ell\right)\right), J\right), U\right) \]
                  10. sinh-lowering-sinh.f6499.9%

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

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

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

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

                    \[\leadsto U + \left(2 \cdot \sinh \ell\right) \cdot J \]
                  3. Add Preprocessing

                  Alternative 10: 75.7% accurate, 10.4× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\ \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + 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)\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (if (<= J -8e+156)
                     (+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125)))))
                     (+
                      U
                      (*
                       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 (J <= -8e+156) {
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                  	} else {
                  		tmp = U + (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 (j <= (-8d+156)) then
                          tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
                      else
                          tmp = u + (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 (J <= -8e+156) {
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                  	} else {
                  		tmp = U + (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 J <= -8e+156:
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))))
                  	else:
                  		tmp = U + (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 (J <= -8e+156)
                  		tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125)))));
                  	else
                  		tmp = Float64(U + 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 (J <= -8e+156)
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                  	else
                  		tmp = U + (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[J, -8e+156], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + 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]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\
                  \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;U + 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)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if J < -7.9999999999999999e156

                    1. Initial program 62.2%

                      \[\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. distribute-rgt-inN/A

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

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

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

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

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

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                      7. distribute-rgt-inN/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) \]
                      8. *-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) \]
                    5. Simplified96.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-*.f6477.4%

                        \[\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. Simplified77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -7.9999999999999999e156 < J

                    1. Initial program 89.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. *-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), \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. 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), \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) \]
                      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(\mathsf{*.f64}\left(\ell, \ell\right), \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) \]
                      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(\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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      11. *-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(\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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      12. 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), \mathsf{+.f64}\left(\frac{1}{60}, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{2520}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      13. 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}, \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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      14. *-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), \mathsf{+.f64}\left(\frac{1}{60}, \mathsf{*.f64}\left(\ell, \left(\ell \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) \]
                      15. *-lowering-*.f6493.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), \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)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    5. Simplified93.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 \left(0.016666666666666666 + \ell \cdot \left(\ell \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. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \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) \]
                      2. *-lowering-*.f64N/A

                        \[\leadsto \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), U\right) \]
                      3. +-lowering-+.f64N/A

                        \[\leadsto \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), U\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \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), U\right) \]
                      5. unpow2N/A

                        \[\leadsto \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), U\right) \]
                      6. *-lowering-*.f64N/A

                        \[\leadsto \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), U\right) \]
                      7. +-lowering-+.f64N/A

                        \[\leadsto \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), U\right) \]
                      8. unpow2N/A

                        \[\leadsto \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), U\right) \]
                      9. associate-*l*N/A

                        \[\leadsto \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), U\right) \]
                      10. *-lowering-*.f64N/A

                        \[\leadsto \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), U\right) \]
                      11. *-lowering-*.f64N/A

                        \[\leadsto \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), U\right) \]
                      12. +-lowering-+.f64N/A

                        \[\leadsto \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), U\right) \]
                      13. *-commutativeN/A

                        \[\leadsto \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), U\right) \]
                      14. *-lowering-*.f64N/A

                        \[\leadsto \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), U\right) \]
                      15. unpow2N/A

                        \[\leadsto \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), U\right) \]
                      16. *-lowering-*.f6479.4%

                        \[\leadsto \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), U\right) \]
                    8. Simplified79.4%

                      \[\leadsto \color{blue}{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)} + U \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification79.2%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\ \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + 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)\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 11: 74.4% accurate, 13.0× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\ \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \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 (<= J -8e+156)
                     (+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125)))))
                     (+
                      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 (J <= -8e+156) {
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                  	} 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 (j <= (-8d+156)) then
                          tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
                      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 (J <= -8e+156) {
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                  	} 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 J <= -8e+156:
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))))
                  	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 (J <= -8e+156)
                  		tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125)))));
                  	else
                  		tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(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 (J <= -8e+156)
                  		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                  	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[J, -8e+156], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 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}\;J \leq -8 \cdot 10^{+156}:\\
                  \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \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 J < -7.9999999999999999e156

                    1. Initial program 62.2%

                      \[\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. distribute-rgt-inN/A

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

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

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

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

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

                        \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                      7. distribute-rgt-inN/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) \]
                      8. *-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) \]
                    5. Simplified96.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-*.f6477.4%

                        \[\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. Simplified77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -7.9999999999999999e156 < J

                    1. Initial program 89.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. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \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) \]
                      4. associate-*l*N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \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) \]
                      5. *-commutativeN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\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(\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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      12. unpow2N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      13. *-lowering-*.f6491.3%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    5. Simplified91.3%

                      \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\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(\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)\right)\right), \color{blue}{1}\right), U\right) \]
                    7. Step-by-step derivation
                      1. Simplified77.9%

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

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

                    Alternative 12: 73.6% accurate, 13.0× speedup?

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

                      1. Initial program 62.2%

                        \[\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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified96.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-*.f6477.4%

                          \[\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. Simplified77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -7.9999999999999999e156 < J

                      1. Initial program 89.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. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\left(\ell \cdot \ell\right) \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) \]
                        4. associate-*l*N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \left(\ell \cdot \left(\ell \cdot \left(\frac{1}{3} + \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) \]
                        5. *-commutativeN/A

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

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\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(\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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                        12. unpow2N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                        13. *-lowering-*.f6491.3%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      5. Simplified91.3%

                        \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\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(\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)\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(\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)\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(\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)\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(\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)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \left(K \cdot K\right)\right)\right)\right), U\right) \]
                        4. *-lowering-*.f6467.8%

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \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)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                      8. Simplified67.8%

                        \[\leadsto \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\right) \cdot \color{blue}{\left(1 + -0.125 \cdot \left(K \cdot K\right)\right)} + U \]
                      9. 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) \]
                      10. 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. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(J \cdot \ell\right), \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\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} + \frac{1}{60} \cdot {\ell}^{2}\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} + \frac{1}{60} \cdot {\ell}^{2}\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} + \frac{1}{60} \cdot {\ell}^{2}\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} + \frac{1}{60} \cdot {\ell}^{2}\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} + \frac{1}{60} \cdot {\ell}^{2}\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(\frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                        9. *-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}, \left({\ell}^{2} \cdot \frac{1}{60}\right)\right)\right)\right)\right), U\right) \]
                        10. *-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), \frac{1}{60}\right)\right)\right)\right)\right), U\right) \]
                        11. 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), \frac{1}{60}\right)\right)\right)\right)\right), U\right) \]
                        12. *-lowering-*.f6476.6%

                          \[\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), \frac{1}{60}\right)\right)\right)\right)\right), U\right) \]
                      11. Simplified76.6%

                        \[\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 0.016666666666666666\right)\right)} + U \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification76.7%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\ \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\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 0.016666666666666666\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 13: 73.8% accurate, 13.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := U \cdot \left(J \cdot \frac{\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)}{U}\right)\\ \mathbf{if}\;\ell \leq -1.05 \cdot 10^{+61}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+22}:\\ \;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* U (* J (/ (* l (* (* l l) 0.3333333333333333)) U)))))
                       (if (<= l -1.05e+61)
                         t_0
                         (if (<= l 3.05e+22)
                           (+ U (* l (* J (+ 2.0 (* l (* l 0.3333333333333333))))))
                           t_0))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
                    	double tmp;
                    	if (l <= -1.05e+61) {
                    		tmp = t_0;
                    	} else if (l <= 3.05e+22) {
                    		tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
                    	} 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 = u * (j * ((l * ((l * l) * 0.3333333333333333d0)) / u))
                        if (l <= (-1.05d+61)) then
                            tmp = t_0
                        else if (l <= 3.05d+22) then
                            tmp = u + (l * (j * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
                        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 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
                    	double tmp;
                    	if (l <= -1.05e+61) {
                    		tmp = t_0;
                    	} else if (l <= 3.05e+22) {
                    		tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U))
                    	tmp = 0
                    	if l <= -1.05e+61:
                    		tmp = t_0
                    	elif l <= 3.05e+22:
                    		tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(U * Float64(J * Float64(Float64(l * Float64(Float64(l * l) * 0.3333333333333333)) / U)))
                    	tmp = 0.0
                    	if (l <= -1.05e+61)
                    		tmp = t_0;
                    	elseif (l <= 3.05e+22)
                    		tmp = Float64(U + Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
                    	tmp = 0.0;
                    	if (l <= -1.05e+61)
                    		tmp = t_0;
                    	elseif (l <= 3.05e+22)
                    		tmp = U + (l * (J * (2.0 + (l * (l * 0.3333333333333333)))));
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U * N[(J * N[(N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.05e+61], t$95$0, If[LessEqual[l, 3.05e+22], N[(U + N[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := U \cdot \left(J \cdot \frac{\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)}{U}\right)\\
                    \mathbf{if}\;\ell \leq -1.05 \cdot 10^{+61}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 3.05 \cdot 10^{+22}:\\
                    \;\;\;\;U + \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -1.0500000000000001e61 or 3.0499999999999999e22 < 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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified82.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -1.0500000000000001e61 < l < 3.0499999999999999e22

                      1. Initial program 76.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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

                    Alternative 14: 74.1% accurate, 13.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := U \cdot \left(J \cdot \frac{\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)}{U}\right)\\ \mathbf{if}\;\ell \leq -5.4 \cdot 10^{+19}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+22}:\\ \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* U (* J (/ (* l (* (* l l) 0.3333333333333333)) U)))))
                       (if (<= l -5.4e+19) t_0 (if (<= l 2.9e+22) (+ U (* J (* 2.0 l))) t_0))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
                    	double tmp;
                    	if (l <= -5.4e+19) {
                    		tmp = t_0;
                    	} else if (l <= 2.9e+22) {
                    		tmp = U + (J * (2.0 * l));
                    	} 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 = u * (j * ((l * ((l * l) * 0.3333333333333333d0)) / u))
                        if (l <= (-5.4d+19)) then
                            tmp = t_0
                        else if (l <= 2.9d+22) then
                            tmp = u + (j * (2.0d0 * l))
                        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 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
                    	double tmp;
                    	if (l <= -5.4e+19) {
                    		tmp = t_0;
                    	} else if (l <= 2.9e+22) {
                    		tmp = U + (J * (2.0 * l));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U))
                    	tmp = 0
                    	if l <= -5.4e+19:
                    		tmp = t_0
                    	elif l <= 2.9e+22:
                    		tmp = U + (J * (2.0 * l))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(U * Float64(J * Float64(Float64(l * Float64(Float64(l * l) * 0.3333333333333333)) / U)))
                    	tmp = 0.0
                    	if (l <= -5.4e+19)
                    		tmp = t_0;
                    	elseif (l <= 2.9e+22)
                    		tmp = Float64(U + Float64(J * Float64(2.0 * l)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = U * (J * ((l * ((l * l) * 0.3333333333333333)) / U));
                    	tmp = 0.0;
                    	if (l <= -5.4e+19)
                    		tmp = t_0;
                    	elseif (l <= 2.9e+22)
                    		tmp = U + (J * (2.0 * l));
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U * N[(J * N[(N[(l * N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -5.4e+19], t$95$0, If[LessEqual[l, 2.9e+22], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := U \cdot \left(J \cdot \frac{\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)}{U}\right)\\
                    \mathbf{if}\;\ell \leq -5.4 \cdot 10^{+19}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 2.9 \cdot 10^{+22}:\\
                    \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -5.4e19 or 2.9e22 < 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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified77.7%

                        \[\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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(U, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right), \left(\frac{\ell}{U}\right)\right)\right)\right)\right) \]
                        12. /-lowering-/.f6468.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(U, \mathsf{*.f64}\left(J, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right), U\right)\right)\right) \]
                        18. *-lowering-*.f6471.8%

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

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

                      if -5.4e19 < l < 2.9e22

                      1. Initial program 73.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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      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(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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 15: 70.7% accurate, 15.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq -2.7 \cdot 10^{+155}:\\ \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (if (<= J -2.7e+155)
                       (+ U (* (* J (* 2.0 l)) (+ 1.0 (* K (* K -0.125)))))
                       (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))))))
                    double code(double J, double l, double K, double U) {
                    	double tmp;
                    	if (J <= -2.7e+155) {
                    		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                    	} else {
                    		tmp = U + (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 (j <= (-2.7d+155)) then
                            tmp = u + ((j * (2.0d0 * l)) * (1.0d0 + (k * (k * (-0.125d0)))))
                        else
                            tmp = u + (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 (J <= -2.7e+155) {
                    		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                    	} else {
                    		tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	tmp = 0
                    	if J <= -2.7e+155:
                    		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))))
                    	else:
                    		tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))
                    	return tmp
                    
                    function code(J, l, K, U)
                    	tmp = 0.0
                    	if (J <= -2.7e+155)
                    		tmp = Float64(U + Float64(Float64(J * Float64(2.0 * l)) * Float64(1.0 + Float64(K * Float64(K * -0.125)))));
                    	else
                    		tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	tmp = 0.0;
                    	if (J <= -2.7e+155)
                    		tmp = U + ((J * (2.0 * l)) * (1.0 + (K * (K * -0.125))));
                    	else
                    		tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := If[LessEqual[J, -2.7e+155], N[(U + N[(N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(K * N[(K * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;J \leq -2.7 \cdot 10^{+155}:\\
                    \;\;\;\;U + \left(J \cdot \left(2 \cdot \ell\right)\right) \cdot \left(1 + K \cdot \left(K \cdot -0.125\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if J < -2.69999999999999994e155

                      1. Initial program 62.2%

                        \[\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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified96.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-*.f6477.4%

                          \[\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. Simplified77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -2.69999999999999994e155 < J

                      1. Initial program 89.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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified84.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\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), J\right), U\right) \]
                        11. *-lowering-*.f6475.3%

                          \[\leadsto \mathsf{+.f64}\left(\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), J\right), U\right) \]
                      10. Applied egg-rr75.3%

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

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

                    Alternative 16: 70.7% accurate, 15.6× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\ \;\;\;\;U + \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(2 \cdot J\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (if (<= J -8e+156)
                       (+ U (* l (* (+ 1.0 (* -0.125 (* K K))) (* 2.0 J))))
                       (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333))))))))
                    double code(double J, double l, double K, double U) {
                    	double tmp;
                    	if (J <= -8e+156) {
                    		tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J)));
                    	} else {
                    		tmp = U + (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 (j <= (-8d+156)) then
                            tmp = u + (l * ((1.0d0 + ((-0.125d0) * (k * k))) * (2.0d0 * j)))
                        else
                            tmp = u + (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 (J <= -8e+156) {
                    		tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J)));
                    	} else {
                    		tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	tmp = 0
                    	if J <= -8e+156:
                    		tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J)))
                    	else:
                    		tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))
                    	return tmp
                    
                    function code(J, l, K, U)
                    	tmp = 0.0
                    	if (J <= -8e+156)
                    		tmp = Float64(U + Float64(l * Float64(Float64(1.0 + Float64(-0.125 * Float64(K * K))) * Float64(2.0 * J))));
                    	else
                    		tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	tmp = 0.0;
                    	if (J <= -8e+156)
                    		tmp = U + (l * ((1.0 + (-0.125 * (K * K))) * (2.0 * J)));
                    	else
                    		tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := If[LessEqual[J, -8e+156], N[(U + N[(l * N[(N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;J \leq -8 \cdot 10^{+156}:\\
                    \;\;\;\;U + \ell \cdot \left(\left(1 + -0.125 \cdot \left(K \cdot K\right)\right) \cdot \left(2 \cdot J\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if J < -7.9999999999999999e156

                      1. Initial program 62.2%

                        \[\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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified96.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-*.f6477.4%

                          \[\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. Simplified77.4%

                        \[\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 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), \color{blue}{\left(2 \cdot J\right)}\right)\right), U\right) \]
                      10. Step-by-step derivation
                        1. *-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(J \cdot 2\right)\right)\right), U\right) \]
                        2. *-lowering-*.f6477.4%

                          \[\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, 2\right)\right)\right), U\right) \]
                      11. Simplified77.4%

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

                      if -7.9999999999999999e156 < J

                      1. Initial program 89.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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified84.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\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), J\right), U\right) \]
                        11. *-lowering-*.f6475.3%

                          \[\leadsto \mathsf{+.f64}\left(\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), J\right), U\right) \]
                      10. Applied egg-rr75.3%

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

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

                    Alternative 17: 71.5% 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 -5.4 \cdot 10^{+19}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\ \;\;\;\;U + J \cdot \left(2 \cdot \ell\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 -5.4e+19) t_0 (if (<= l 1.4e+62) (+ U (* J (* 2.0 l))) 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 <= -5.4e+19) {
                    		tmp = t_0;
                    	} else if (l <= 1.4e+62) {
                    		tmp = U + (J * (2.0 * l));
                    	} 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 <= (-5.4d+19)) then
                            tmp = t_0
                        else if (l <= 1.4d+62) then
                            tmp = u + (j * (2.0d0 * l))
                        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 <= -5.4e+19) {
                    		tmp = t_0;
                    	} else if (l <= 1.4e+62) {
                    		tmp = U + (J * (2.0 * l));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = J * (l * ((l * l) * 0.3333333333333333))
                    	tmp = 0
                    	if l <= -5.4e+19:
                    		tmp = t_0
                    	elif l <= 1.4e+62:
                    		tmp = U + (J * (2.0 * l))
                    	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 <= -5.4e+19)
                    		tmp = t_0;
                    	elseif (l <= 1.4e+62)
                    		tmp = Float64(U + Float64(J * Float64(2.0 * l)));
                    	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 <= -5.4e+19)
                    		tmp = t_0;
                    	elseif (l <= 1.4e+62)
                    		tmp = U + (J * (2.0 * l));
                    	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, -5.4e+19], t$95$0, If[LessEqual[l, 1.4e+62], N[(U + N[(J * N[(2.0 * l), $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 -5.4 \cdot 10^{+19}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\
                    \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -5.4e19 or 1.40000000000000007e62 < 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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified81.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                      13. 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-*r*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-*.f6473.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) \]
                      14. Simplified73.3%

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

                      if -5.4e19 < l < 1.40000000000000007e62

                      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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified88.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -5.4 \cdot 10^{+19}:\\ \;\;\;\;J \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\ \;\;\;\;U + J \cdot \left(2 \cdot \ell\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: 69.2% accurate, 16.4× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.3333333333333333 \cdot \left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{if}\;\ell \leq -9 \cdot 10^{+19}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\ \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* 0.3333333333333333 (* l (* J (* l l))))))
                       (if (<= l -9e+19) t_0 (if (<= l 1.4e+62) (+ U (* J (* 2.0 l))) t_0))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = 0.3333333333333333 * (l * (J * (l * l)));
                    	double tmp;
                    	if (l <= -9e+19) {
                    		tmp = t_0;
                    	} else if (l <= 1.4e+62) {
                    		tmp = U + (J * (2.0 * l));
                    	} 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 = 0.3333333333333333d0 * (l * (j * (l * l)))
                        if (l <= (-9d+19)) then
                            tmp = t_0
                        else if (l <= 1.4d+62) then
                            tmp = u + (j * (2.0d0 * l))
                        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 = 0.3333333333333333 * (l * (J * (l * l)));
                    	double tmp;
                    	if (l <= -9e+19) {
                    		tmp = t_0;
                    	} else if (l <= 1.4e+62) {
                    		tmp = U + (J * (2.0 * l));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = 0.3333333333333333 * (l * (J * (l * l)))
                    	tmp = 0
                    	if l <= -9e+19:
                    		tmp = t_0
                    	elif l <= 1.4e+62:
                    		tmp = U + (J * (2.0 * l))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(0.3333333333333333 * Float64(l * Float64(J * Float64(l * l))))
                    	tmp = 0.0
                    	if (l <= -9e+19)
                    		tmp = t_0;
                    	elseif (l <= 1.4e+62)
                    		tmp = Float64(U + Float64(J * Float64(2.0 * l)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = 0.3333333333333333 * (l * (J * (l * l)));
                    	tmp = 0.0;
                    	if (l <= -9e+19)
                    		tmp = t_0;
                    	elseif (l <= 1.4e+62)
                    		tmp = U + (J * (2.0 * l));
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(l * N[(J * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9e+19], t$95$0, If[LessEqual[l, 1.4e+62], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := 0.3333333333333333 \cdot \left(\ell \cdot \left(J \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                    \mathbf{if}\;\ell \leq -9 \cdot 10^{+19}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 1.4 \cdot 10^{+62}:\\
                    \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -9e19 or 1.40000000000000007e62 < 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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified81.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

                        \[\leadsto \ell \cdot \color{blue}{\left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                      if -9e19 < l < 1.40000000000000007e62

                      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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified88.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 19: 46.7% accurate, 20.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \ell \cdot \left(2 \cdot J\right)\\ \mathbf{if}\;\ell \leq -1020:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 0.00013:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* l (* 2.0 J))))
                       (if (<= l -1020.0) t_0 (if (<= l 0.00013) U t_0))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = l * (2.0 * J);
                    	double tmp;
                    	if (l <= -1020.0) {
                    		tmp = t_0;
                    	} else if (l <= 0.00013) {
                    		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 = l * (2.0d0 * j)
                        if (l <= (-1020.0d0)) then
                            tmp = t_0
                        else if (l <= 0.00013d0) 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 = l * (2.0 * J);
                    	double tmp;
                    	if (l <= -1020.0) {
                    		tmp = t_0;
                    	} else if (l <= 0.00013) {
                    		tmp = U;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(J, l, K, U):
                    	t_0 = l * (2.0 * J)
                    	tmp = 0
                    	if l <= -1020.0:
                    		tmp = t_0
                    	elif l <= 0.00013:
                    		tmp = U
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(l * Float64(2.0 * J))
                    	tmp = 0.0
                    	if (l <= -1020.0)
                    		tmp = t_0;
                    	elseif (l <= 0.00013)
                    		tmp = U;
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(J, l, K, U)
                    	t_0 = l * (2.0 * J);
                    	tmp = 0.0;
                    	if (l <= -1020.0)
                    		tmp = t_0;
                    	elseif (l <= 0.00013)
                    		tmp = U;
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1020.0], t$95$0, If[LessEqual[l, 0.00013], U, t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \ell \cdot \left(2 \cdot J\right)\\
                    \mathbf{if}\;\ell \leq -1020:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 0.00013:\\
                    \;\;\;\;U\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if l < -1020 or 1.29999999999999989e-4 < l

                      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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified73.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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\ell, \left(J \cdot \color{blue}{2}\right)\right) \]
                        5. *-lowering-*.f6417.6%

                          \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \color{blue}{2}\right)\right) \]
                      14. Simplified17.6%

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

                      if -1020 < l < 1.29999999999999989e-4

                      1. Initial program 71.6%

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

                          \[\leadsto \color{blue}{U} \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification42.1%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1020:\\ \;\;\;\;\ell \cdot \left(2 \cdot J\right)\\ \mathbf{elif}\;\ell \leq 0.00013:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(2 \cdot J\right)\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 20: 72.0% accurate, 24.0× speedup?

                      \[\begin{array}{l} \\ U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \end{array} \]
                      (FPCore (J l K U)
                       :precision binary64
                       (+ U (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))
                      double code(double J, double l, double K, double U) {
                      	return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                      }
                      
                      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 * (l * (2.0d0 + (l * (l * 0.3333333333333333d0)))))
                      end function
                      
                      public static double code(double J, double l, double K, double U) {
                      	return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                      }
                      
                      def code(J, l, K, U):
                      	return U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))))
                      
                      function code(J, l, K, U)
                      	return Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))))))
                      end
                      
                      function tmp = code(J, l, K, U)
                      	tmp = U + (J * (l * (2.0 + (l * (l * 0.3333333333333333)))));
                      end
                      
                      code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 87.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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified85.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, \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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\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), J\right), U\right) \]
                        11. *-lowering-*.f6473.8%

                          \[\leadsto \mathsf{+.f64}\left(\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), J\right), U\right) \]
                      10. Applied egg-rr73.8%

                        \[\leadsto \color{blue}{\left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \cdot J} + U \]
                      11. Final simplification73.8%

                        \[\leadsto U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) \]
                      12. Add Preprocessing

                      Alternative 21: 54.5% accurate, 44.6× speedup?

                      \[\begin{array}{l} \\ U + J \cdot \left(2 \cdot \ell\right) \end{array} \]
                      (FPCore (J l K U) :precision binary64 (+ U (* J (* 2.0 l))))
                      double code(double J, double l, double K, double U) {
                      	return U + (J * (2.0 * 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 * (2.0d0 * l))
                      end function
                      
                      public static double code(double J, double l, double K, double U) {
                      	return U + (J * (2.0 * l));
                      }
                      
                      def code(J, l, K, U):
                      	return U + (J * (2.0 * l))
                      
                      function code(J, l, K, U)
                      	return Float64(U + Float64(J * Float64(2.0 * l)))
                      end
                      
                      function tmp = code(J, l, K, U)
                      	tmp = U + (J * (2.0 * l));
                      end
                      
                      code[J_, l_, K_, U_] := N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      U + J \cdot \left(2 \cdot \ell\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 87.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. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{+.f64}\left(\left(\left(\left(\frac{1}{3} \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot {\ell}^{2}\right) \cdot \ell + \left(2 \cdot \left(J \cdot \cos \left(\frac{1}{2} \cdot K\right)\right)\right) \cdot \ell\right), U\right) \]
                        7. distribute-rgt-inN/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) \]
                        8. *-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) \]
                      5. Simplified85.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, \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. *-commutativeN/A

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \left({\ell}^{2} \cdot \frac{1}{3}\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, \left(\left(\ell \cdot \ell\right) \cdot \frac{1}{3}\right)\right)\right)\right), U\right) \]
                        5. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{J \cdot \left(\ell \cdot 2\right)} + U \]
                      12. Final simplification48.1%

                        \[\leadsto U + J \cdot \left(2 \cdot \ell\right) \]
                      13. Add Preprocessing

                      Alternative 22: 37.4% 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 87.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 J around 0

                        \[\leadsto \color{blue}{U} \]
                      4. Step-by-step derivation
                        1. Simplified33.7%

                          \[\leadsto \color{blue}{U} \]
                        2. Add Preprocessing

                        Reproduce

                        ?
                        herbie shell --seed 2024145 
                        (FPCore (J l K U)
                          :name "Maksimov and Kolovsky, Equation (4)"
                          :precision binary64
                          (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))