Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 86.4% → 99.9%
Time: 14.8s
Alternatives: 24
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 24 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.4% 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(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\right)\right) \cdot J + U \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (+ (* (* (* 2.0 (sinh l)) (cos (/ K 2.0))) J) U))
double code(double J, double l, double K, double U) {
	return (((2.0 * sinh(l)) * cos((K / 2.0))) * J) + U;
}
real(8) function code(j, l, k, u)
    real(8), intent (in) :: j
    real(8), intent (in) :: l
    real(8), intent (in) :: k
    real(8), intent (in) :: u
    code = (((2.0d0 * sinh(l)) * cos((k / 2.0d0))) * j) + u
end function
public static double code(double J, double l, double K, double U) {
	return (((2.0 * Math.sinh(l)) * Math.cos((K / 2.0))) * J) + U;
}
def code(J, l, K, U):
	return (((2.0 * math.sinh(l)) * math.cos((K / 2.0))) * J) + U
function code(J, l, K, U)
	return Float64(Float64(Float64(Float64(2.0 * sinh(l)) * cos(Float64(K / 2.0))) * J) + U)
end
function tmp = code(J, l, K, U)
	tmp = (((2.0 * sinh(l)) * cos((K / 2.0))) * J) + U;
end
code[J_, l_, K_, U_] := N[(N[(N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * J), $MachinePrecision] + U), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(\frac{K}{2}\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.7575:\\ \;\;\;\;U + J \cdot \left(t\_0 \cdot \left(2 \cdot \ell\right)\right)\\ \mathbf{elif}\;t\_0 \leq -0.01:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(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.7575)
     (+ U (* J (* t_0 (* 2.0 l))))
     (if (<= t_0 -0.01)
       (+
        U
        (*
         (*
          J
          (*
           l
           (+
            2.0
            (*
             (* l l)
             (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))
         (+ 1.0 (* -0.125 (* K K)))))
       (+ 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.7575) {
		tmp = U + (J * (t_0 * (2.0 * l)));
	} else if (t_0 <= -0.01) {
		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
	} 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.7575d0)) then
        tmp = u + (j * (t_0 * (2.0d0 * l)))
    else if (t_0 <= (-0.01d0)) then
        tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
    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.7575) {
		tmp = U + (J * (t_0 * (2.0 * l)));
	} else if (t_0 <= -0.01) {
		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
	} 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.7575:
		tmp = U + (J * (t_0 * (2.0 * l)))
	elif t_0 <= -0.01:
		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))))
	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.7575)
		tmp = Float64(U + Float64(J * Float64(t_0 * Float64(2.0 * l))));
	elseif (t_0 <= -0.01)
		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K)))));
	else
		tmp = Float64(U + Float64(Float64(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.7575)
		tmp = U + (J * (t_0 * (2.0 * l)));
	elseif (t_0 <= -0.01)
		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
	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.7575], N[(U + N[(J * N[(t$95$0 * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.01], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(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.7575:\\
\;\;\;\;U + J \cdot \left(t\_0 \cdot \left(2 \cdot \ell\right)\right)\\

\mathbf{elif}\;t\_0 \leq -0.01:\\
\;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\

\mathbf{else}:\\
\;\;\;\;U + \left(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.757499999999999951

    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. 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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
      10. *-lowering-*.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), \frac{1}{60}\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 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
    6. Taylor expanded in K around 0

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

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

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

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

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

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

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

    1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.7575:\\ \;\;\;\;U + J \cdot \left(\cos \left(\frac{K}{2}\right) \cdot \left(2 \cdot \ell\right)\right)\\ \mathbf{elif}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(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.7575:\\ \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\ \mathbf{elif}\;t\_0 \leq -0.01:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(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.7575)
         (+ U (* t_0 (* J (* 2.0 l))))
         (if (<= t_0 -0.01)
           (+
            U
            (*
             (*
              J
              (*
               l
               (+
                2.0
                (*
                 (* l l)
                 (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))
             (+ 1.0 (* -0.125 (* K K)))))
           (+ 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.7575) {
    		tmp = U + (t_0 * (J * (2.0 * l)));
    	} else if (t_0 <= -0.01) {
    		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
    	} 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.7575d0)) then
            tmp = u + (t_0 * (j * (2.0d0 * l)))
        else if (t_0 <= (-0.01d0)) then
            tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
        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.7575) {
    		tmp = U + (t_0 * (J * (2.0 * l)));
    	} else if (t_0 <= -0.01) {
    		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
    	} 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.7575:
    		tmp = U + (t_0 * (J * (2.0 * l)))
    	elif t_0 <= -0.01:
    		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))))
    	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.7575)
    		tmp = Float64(U + Float64(t_0 * Float64(J * Float64(2.0 * l))));
    	elseif (t_0 <= -0.01)
    		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K)))));
    	else
    		tmp = Float64(U + Float64(Float64(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.7575)
    		tmp = U + (t_0 * (J * (2.0 * l)));
    	elseif (t_0 <= -0.01)
    		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
    	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.7575], N[(U + N[(t$95$0 * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.01], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(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.7575:\\
    \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\
    
    \mathbf{elif}\;t\_0 \leq -0.01:\\
    \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;U + \left(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.757499999999999951

      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(\color{blue}{\left(2 \cdot \left(J \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(\left(\left(J \cdot \ell\right) \cdot 2\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
        2. associate-*l*N/A

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

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

          \[\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. Simplified80.8%

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

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

      1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
        10. *-lowering-*.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), \frac{1}{60}\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 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
      6. Taylor expanded in K around 0

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

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

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

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

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

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

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

      1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 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.7575:\\ \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot J\right)\right)\\ \mathbf{elif}\;t\_0 \leq -0.01:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(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.7575)
           (+ U (* l (* (cos (* K 0.5)) (* 2.0 J))))
           (if (<= t_0 -0.01)
             (+
              U
              (*
               (*
                J
                (*
                 l
                 (+
                  2.0
                  (*
                   (* l l)
                   (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))
               (+ 1.0 (* -0.125 (* K K)))))
             (+ 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.7575) {
      		tmp = U + (l * (cos((K * 0.5)) * (2.0 * J)));
      	} else if (t_0 <= -0.01) {
      		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
      	} 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.7575d0)) then
              tmp = u + (l * (cos((k * 0.5d0)) * (2.0d0 * j)))
          else if (t_0 <= (-0.01d0)) then
              tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))) * (1.0d0 + ((-0.125d0) * (k * k))))
          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.7575) {
      		tmp = U + (l * (Math.cos((K * 0.5)) * (2.0 * J)));
      	} else if (t_0 <= -0.01) {
      		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
      	} 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.7575:
      		tmp = U + (l * (math.cos((K * 0.5)) * (2.0 * J)))
      	elif t_0 <= -0.01:
      		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))))
      	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.7575)
      		tmp = Float64(U + Float64(l * Float64(cos(Float64(K * 0.5)) * Float64(2.0 * J))));
      	elseif (t_0 <= -0.01)
      		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))) * Float64(1.0 + Float64(-0.125 * Float64(K * K)))));
      	else
      		tmp = Float64(U + Float64(Float64(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.7575)
      		tmp = U + (l * (cos((K * 0.5)) * (2.0 * J)));
      	elseif (t_0 <= -0.01)
      		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * (1.0 + (-0.125 * (K * K))));
      	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.7575], N[(U + N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, -0.01], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(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.7575:\\
      \;\;\;\;U + \ell \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot J\right)\right)\\
      
      \mathbf{elif}\;t\_0 \leq -0.01:\\
      \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \cdot \left(1 + -0.125 \cdot \left(K \cdot K\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;U + \left(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.757499999999999951

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
          10. *-lowering-*.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), \frac{1}{60}\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 0.016666666666666666\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        6. Taylor expanded in K around 0

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

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

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

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

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

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

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

        1. Initial program 87.6%

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

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

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

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

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

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

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

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

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

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

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

        Alternative 5: 93.9% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;t\_0 \leq 0.18:\\ \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\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.18)
             (+ 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.18) {
        		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.18d0) 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.18) {
        		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.18:
        		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.18)
        		tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(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.18)
        		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.18], N[(U + N[(t$95$0 * N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $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.18:\\
        \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\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.17999999999999999

          1. Initial program 86.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. unpow2N/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 \left(\ell \cdot \ell\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
            4. associate-*r*N/A

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

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

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

          1. Initial program 87.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

          Alternative 6: 93.0% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.18:\\ \;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\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
           (if (<= (cos (/ K 2.0)) 0.18)
             (+ U (* l (* (+ 2.0 (* l (* l 0.3333333333333333))) (* J (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.18) {
          		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * 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.18d0) then
                  tmp = u + (l * ((2.0d0 + (l * (l * 0.3333333333333333d0))) * (j * 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.18) {
          		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * 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.18:
          		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * 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.18)
          		tmp = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))) * Float64(J * 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.18)
          		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J * 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.18], N[(U + N[(l * N[(N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J * N[Cos[N[(K * 0.5), $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}
          \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.18:\\
          \;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\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.17999999999999999

            1. Initial program 86.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

            1. Initial program 87.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            Alternative 7: 88.5% accurate, 2.3× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 10000000000:\\ \;\;\;\;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 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \]
            (FPCore (J l K U)
             :precision binary64
             (if (<= (/ K 2.0) 10000000000.0)
               (+ 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) <= 10000000000.0) {
            		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) <= 10000000000.0d0) 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) <= 10000000000.0) {
            		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) <= 10000000000.0:
            		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) <= 10000000000.0)
            		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(l * Float64(l * Float64(0.016666666666666666 + Float64(Float64(l * l) * 0.0003968253968253968)))))))))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(J, l, K, U)
            	tmp = 0.0;
            	if ((K / 2.0) <= 10000000000.0)
            		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], 10000000000.0], 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[(l * N[(l * N[(0.016666666666666666 + N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;\frac{K}{2} \leq 10000000000:\\
            \;\;\;\;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 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 K #s(literal 2 binary64)) < 1e10

              1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

                if 1e10 < (/.f64 K #s(literal 2 binary64))

                1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 8: 88.0% accurate, 2.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 10000000000:\\ \;\;\;\;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 0.016666666666666666\right)\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (if (<= (/ K 2.0) 10000000000.0)
                 (+ 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) <= 10000000000.0) {
              		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) <= 10000000000.0d0) 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) <= 10000000000.0) {
              		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) <= 10000000000.0:
              		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) <= 10000000000.0)
              		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) * 0.016666666666666666))))))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(J, l, K, U)
              	tmp = 0.0;
              	if ((K / 2.0) <= 10000000000.0)
              		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], 10000000000.0], 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] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\frac{K}{2} \leq 10000000000:\\
              \;\;\;\;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 0.016666666666666666\right)\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 K #s(literal 2 binary64)) < 1e10

                1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

                  if 1e10 < (/.f64 K #s(literal 2 binary64))

                  1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 10000000000:\\ \;\;\;\;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 0.016666666666666666\right)\right)\right)\right)\\ \end{array} \]
                9. Add Preprocessing

                Alternative 9: 80.7% accurate, 2.8× speedup?

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

                  1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

                    if 6.2000000000000006e95 < 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    4. Step-by-step derivation
                      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 10: 77.1% accurate, 9.7× speedup?

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

                    1. Initial program 84.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} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                    4. Step-by-step derivation
                      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 2.99999999999999991e95 < 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      4. Step-by-step derivation
                        1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 11: 76.2% accurate, 10.4× speedup?

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

                      1. Initial program 84.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} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                      4. Step-by-step derivation
                        1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        if 6.5e95 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 12: 75.8% accurate, 10.4× speedup?

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

                        1. Initial program 84.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} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                        4. Step-by-step derivation
                          1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left(J \cdot \color{blue}{\left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \ell \cdot \left(\ell \cdot \left(0.016666666666666666 + \left(\ell \cdot \ell\right) \cdot 0.0003968253968253968\right)\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                        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. *-commutativeN/A

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

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

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

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

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

                          \[\leadsto \color{blue}{\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) \cdot \left(J \cdot \ell\right)} + U \]

                        if 6.5e95 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 13: 74.6% accurate, 12.0× speedup?

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

                        1. Initial program 84.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                          if 6.5e95 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 14: 73.9% accurate, 12.0× speedup?

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

                          1. Initial program 84.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 6.5e95 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 15: 72.3% accurate, 14.2× speedup?

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

                            1. Initial program 83.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 1.25e21 < 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                            4. Step-by-step derivation
                              1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, J\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) \]
                                13. *-lowering-*.f6465.6%

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

                                \[\leadsto \color{blue}{\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)} \]
                              5. Taylor expanded in l around inf

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

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

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

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

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

                                \[\leadsto \left(\ell \cdot J\right) \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \color{blue}{\left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)}\right) \]
                            8. Recombined 2 regimes into one program.
                            9. Add Preprocessing

                            Alternative 16: 71.8% accurate, 15.6× speedup?

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

                              1. Initial program 82.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              if 5.2e6 < 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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                              4. Step-by-step derivation
                                1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, J\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) \]
                                  13. *-lowering-*.f6465.7%

                                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, J\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) \]
                                4. Simplified65.7%

                                  \[\leadsto \color{blue}{\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)} \]
                                5. Taylor expanded in l around inf

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

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

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

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

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

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

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

                              Alternative 17: 70.5% accurate, 16.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                if -10200 < l < 10200

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 10200 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right)}^{3} + {U}^{3}\right), \color{blue}{\left(\frac{1}{\left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right) \cdot \left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + \left(U \cdot U - \left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right) \cdot U\right)}\right)}\right) \]
                                  10. Applied egg-rr0.1%

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

                                    \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                                  12. 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. *-lowering-*.f64N/A

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)} \]
                                11. Recombined 3 regimes into one program.
                                12. Final simplification74.6%

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

                                Alternative 18: 71.8% accurate, 16.4× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{if}\;\ell \leq -66000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 1700:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                (FPCore (J l K U)
                                 :precision binary64
                                 (let* ((t_0 (* 0.3333333333333333 (* J (* l (* l l))))))
                                   (if (<= l -66000000.0) t_0 (if (<= l 1700.0) (+ U (* l (* 2.0 J))) t_0))))
                                double code(double J, double l, double K, double U) {
                                	double t_0 = 0.3333333333333333 * (J * (l * (l * l)));
                                	double tmp;
                                	if (l <= -66000000.0) {
                                		tmp = t_0;
                                	} else if (l <= 1700.0) {
                                		tmp = U + (l * (2.0 * J));
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                real(8) function code(j, l, k, u)
                                    real(8), intent (in) :: j
                                    real(8), intent (in) :: l
                                    real(8), intent (in) :: k
                                    real(8), intent (in) :: u
                                    real(8) :: t_0
                                    real(8) :: tmp
                                    t_0 = 0.3333333333333333d0 * (j * (l * (l * l)))
                                    if (l <= (-66000000.0d0)) then
                                        tmp = t_0
                                    else if (l <= 1700.0d0) then
                                        tmp = u + (l * (2.0d0 * j))
                                    else
                                        tmp = t_0
                                    end if
                                    code = tmp
                                end function
                                
                                public static double code(double J, double l, double K, double U) {
                                	double t_0 = 0.3333333333333333 * (J * (l * (l * l)));
                                	double tmp;
                                	if (l <= -66000000.0) {
                                		tmp = t_0;
                                	} else if (l <= 1700.0) {
                                		tmp = U + (l * (2.0 * J));
                                	} else {
                                		tmp = t_0;
                                	}
                                	return tmp;
                                }
                                
                                def code(J, l, K, U):
                                	t_0 = 0.3333333333333333 * (J * (l * (l * l)))
                                	tmp = 0
                                	if l <= -66000000.0:
                                		tmp = t_0
                                	elif l <= 1700.0:
                                		tmp = U + (l * (2.0 * J))
                                	else:
                                		tmp = t_0
                                	return tmp
                                
                                function code(J, l, K, U)
                                	t_0 = Float64(0.3333333333333333 * Float64(J * Float64(l * Float64(l * l))))
                                	tmp = 0.0
                                	if (l <= -66000000.0)
                                		tmp = t_0;
                                	elseif (l <= 1700.0)
                                		tmp = Float64(U + Float64(l * Float64(2.0 * J)));
                                	else
                                		tmp = t_0;
                                	end
                                	return tmp
                                end
                                
                                function tmp_2 = code(J, l, K, U)
                                	t_0 = 0.3333333333333333 * (J * (l * (l * l)));
                                	tmp = 0.0;
                                	if (l <= -66000000.0)
                                		tmp = t_0;
                                	elseif (l <= 1700.0)
                                		tmp = U + (l * (2.0 * J));
                                	else
                                		tmp = t_0;
                                	end
                                	tmp_2 = tmp;
                                end
                                
                                code[J_, l_, K_, U_] := Block[{t$95$0 = N[(0.3333333333333333 * N[(J * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -66000000.0], t$95$0, If[LessEqual[l, 1700.0], N[(U + N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                t_0 := 0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                                \mathbf{if}\;\ell \leq -66000000:\\
                                \;\;\;\;t\_0\\
                                
                                \mathbf{elif}\;\ell \leq 1700:\\
                                \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;t\_0\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if l < -6.6e7 or 1700 < 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\left({\left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right)}^{3} + {U}^{3}\right), \color{blue}{\left(\frac{1}{\left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right) \cdot \left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right) + \left(U \cdot U - \left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot \left(\ell \cdot \ell\right)\right)\right)\right) \cdot U\right)}\right)}\right) \]
                                  10. Applied egg-rr2.6%

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

                                    \[\leadsto \color{blue}{\frac{1}{3} \cdot \left(J \cdot {\ell}^{3}\right)} \]
                                  12. 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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

                                  if -6.6e7 < l < 1700

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -66000000:\\ \;\;\;\;0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 1700:\\ \;\;\;\;U + \ell \cdot \left(2 \cdot J\right)\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 \cdot \left(J \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \end{array} \]
                                  13. Add Preprocessing

                                  Alternative 19: 74.6% accurate, 16.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \color{blue}{\left(J \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right) \cdot \ell} + U \]
                                    4. Final simplification76.5%

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

                                    Alternative 20: 73.6% accurate, 16.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 21: 45.1% accurate, 20.8× speedup?

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

                                        1. Initial program 97.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(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)}\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                                        4. Step-by-step derivation
                                          1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, J\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) \]
                                            13. *-lowering-*.f6471.0%

                                              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, J\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) \]
                                          4. Simplified71.0%

                                            \[\leadsto \color{blue}{\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)} \]
                                          5. Taylor expanded in l around 0

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

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

                                            if -2.19999999999999992e103 < l < 1.24999999999999993e-30

                                            1. Initial program 79.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. Simplified67.1%

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

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.2 \cdot 10^{+103}:\\ \;\;\;\;2 \cdot \left(\ell \cdot J\right)\\ \mathbf{elif}\;\ell \leq 1.25 \cdot 10^{-30}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot J\right)\\ \end{array} \]
                                            7. Add Preprocessing

                                            Alternative 22: 69.3% accurate, 24.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 23: 54.1% accurate, 44.6× speedup?

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{+.f64}\left(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right)}, U\right) \]
                                            7. Step-by-step derivation
                                              1. *-commutativeN/A

                                                \[\leadsto \mathsf{+.f64}\left(\left(\left(\ell \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right) \cdot J\right), U\right) \]
                                              2. associate-*l*N/A

                                                \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(\left(2 + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot J\right)\right), U\right) \]
                                              3. *-commutativeN/A

                                                \[\leadsto \mathsf{+.f64}\left(\left(\ell \cdot \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                                              4. *-lowering-*.f64N/A

                                                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \left(J \cdot \left(2 + \frac{1}{3} \cdot {\ell}^{2}\right)\right)\right), U\right) \]
                                              5. *-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) \]
                                              6. +-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) \]
                                              7. *-lowering-*.f64N/A

                                                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left({\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                                              8. unpow2N/A

                                                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \left(\ell \cdot \ell\right)\right)\right)\right)\right), U\right) \]
                                              9. *-lowering-*.f6473.5%

                                                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
                                            8. Simplified73.5%

                                              \[\leadsto \color{blue}{\ell \cdot \left(J \cdot \left(2 + 0.3333333333333333 \cdot \left(\ell \cdot \ell\right)\right)\right)} + U \]
                                            9. Taylor expanded in l around 0

                                              \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \color{blue}{2}\right)\right), U\right) \]
                                            10. Step-by-step derivation
                                              1. Simplified56.1%

                                                \[\leadsto \ell \cdot \left(J \cdot \color{blue}{2}\right) + U \]
                                              2. Final simplification56.1%

                                                \[\leadsto U + \ell \cdot \left(2 \cdot J\right) \]
                                              3. Add Preprocessing

                                              Alternative 24: 37.3% 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.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 J around 0

                                                \[\leadsto \color{blue}{U} \]
                                              4. Step-by-step derivation
                                                1. Simplified39.9%

                                                  \[\leadsto \color{blue}{U} \]
                                                2. Add Preprocessing

                                                Reproduce

                                                ?
                                                herbie shell --seed 2024161 
                                                (FPCore (J l K U)
                                                  :name "Maksimov and Kolovsky, Equation (4)"
                                                  :precision binary64
                                                  (+ (* (* J (- (exp l) (exp (- l)))) (cos (/ K 2.0))) U))