Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 85.4% → 100.0%
Time: 14.6s
Alternatives: 22
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 85.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: 100.0% accurate, 1.5× speedup?

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

\\
2 \cdot \left(\left(\cos \left(\frac{K}{2}\right) \cdot J\right) \cdot \sinh \ell\right) + U
\end{array}
Derivation
  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. Step-by-step derivation
    1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 87.2% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t\_0 \leq -0.05:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(2 \cdot \ell\right)\right)\\

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


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

    1. Initial program 81.5%

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

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

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

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

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

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

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

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

        \[\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(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
    8. Simplified79.5%

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

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

    1. Initial program 82.9%

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

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

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

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

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

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

    1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 3: 87.2% accurate, 1.0× speedup?

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

      1. Initial program 81.5%

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

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

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

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

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

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

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

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

          \[\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(\frac{1}{3}, \mathsf{*.f64}\left(\ell, \ell\right)\right)\right)\right)\right), U\right) \]
      8. Simplified79.5%

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

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

      1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 4: 92.5% accurate, 1.4× speedup?

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

          1. Initial program 82.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 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({\ell}^{2} \cdot \left(\frac{1}{3} \cdot \left(J \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) \]
            6. associate-*r*N/A

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

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

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

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

          1. Initial program 86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 99.9% accurate, 1.5× speedup?

          \[\begin{array}{l} \\ U + J \cdot \frac{\cos \left(\frac{K}{2}\right)}{\frac{0.5}{\sinh \ell}} \end{array} \]
          (FPCore (J l K U)
           :precision binary64
           (+ U (* J (/ (cos (/ K 2.0)) (/ 0.5 (sinh l))))))
          double code(double J, double l, double K, double U) {
          	return U + (J * (cos((K / 2.0)) / (0.5 / sinh(l))));
          }
          
          real(8) function code(j, l, k, u)
              real(8), intent (in) :: j
              real(8), intent (in) :: l
              real(8), intent (in) :: k
              real(8), intent (in) :: u
              code = u + (j * (cos((k / 2.0d0)) / (0.5d0 / sinh(l))))
          end function
          
          public static double code(double J, double l, double K, double U) {
          	return U + (J * (Math.cos((K / 2.0)) / (0.5 / Math.sinh(l))));
          }
          
          def code(J, l, K, U):
          	return U + (J * (math.cos((K / 2.0)) / (0.5 / math.sinh(l))))
          
          function code(J, l, K, U)
          	return Float64(U + Float64(J * Float64(cos(Float64(K / 2.0)) / Float64(0.5 / sinh(l)))))
          end
          
          function tmp = code(J, l, K, U)
          	tmp = U + (J * (cos((K / 2.0)) / (0.5 / sinh(l))));
          end
          
          code[J_, l_, K_, U_] := N[(U + N[(J * N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] / N[(0.5 / N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          U + J \cdot \frac{\cos \left(\frac{K}{2}\right)}{\frac{0.5}{\sinh \ell}}
          \end{array}
          
          Derivation
          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. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{J \cdot \frac{\cos \left(\frac{K}{2}\right)}{\frac{0.5}{\sinh \ell}}} + U \]
          7. Final simplification99.9%

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

          Alternative 6: 89.0% accurate, 2.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 2.00000000000000002e-50 < (/.f64 K #s(literal 2 binary64))

              1. Initial program 83.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(\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. *-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 \cdot \left(\left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right) \cdot \ell\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, \left(\left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right) \cdot \ell\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                11. *-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{+.f64}\left(\frac{1}{3}, \mathsf{*.f64}\left(\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) \]
                12. *-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) \]
                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}, \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) \]
                14. *-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) \]
                15. *-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) \]
                16. 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) \]
                17. *-lowering-*.f6495.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. Simplified95.4%

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

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

            Alternative 7: 88.5% accurate, 2.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if 2.00000000000000002e-50 < (/.f64 K #s(literal 2 binary64))

                1. Initial program 83.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(\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.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. Simplified92.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 \]
              7. Recombined 2 regimes into one program.
              8. Final simplification85.8%

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

              Alternative 8: 87.4% accurate, 2.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 4.9999999999999999e-20 < (/.f64 K #s(literal 2 binary64))

                  1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

                Alternative 9: 80.4% accurate, 2.7× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.125 \cdot \left(K \cdot K\right) + 1\\ \mathbf{if}\;\ell \leq -5 \cdot 10^{+80}:\\ \;\;\;\;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 t\_0\\ \mathbf{elif}\;\ell \leq 2 \cdot 10^{+138}:\\ \;\;\;\;U + 2 \cdot \left(J \cdot \sinh \ell\right)\\ \mathbf{else}:\\ \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot t\_0\\ \end{array} \end{array} \]
                (FPCore (J l K U)
                 :precision binary64
                 (let* ((t_0 (+ (* -0.125 (* K K)) 1.0)))
                   (if (<= l -5e+80)
                     (+
                      U
                      (*
                       (*
                        J
                        (*
                         l
                         (+
                          2.0
                          (*
                           (* l l)
                           (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))
                       t_0))
                     (if (<= l 2e+138)
                       (+ U (* 2.0 (* J (sinh l))))
                       (+ U (* (* J (* l (+ 2.0 (* (* l l) 0.3333333333333333)))) t_0))))))
                double code(double J, double l, double K, double U) {
                	double t_0 = (-0.125 * (K * K)) + 1.0;
                	double tmp;
                	if (l <= -5e+80) {
                		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * t_0);
                	} else if (l <= 2e+138) {
                		tmp = U + (2.0 * (J * sinh(l)));
                	} else {
                		tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * 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.125d0) * (k * k)) + 1.0d0
                    if (l <= (-5d+80)) then
                        tmp = u + ((j * (l * (2.0d0 + ((l * l) * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))) * t_0)
                    else if (l <= 2d+138) then
                        tmp = u + (2.0d0 * (j * sinh(l)))
                    else
                        tmp = u + ((j * (l * (2.0d0 + ((l * l) * 0.3333333333333333d0)))) * t_0)
                    end if
                    code = tmp
                end function
                
                public static double code(double J, double l, double K, double U) {
                	double t_0 = (-0.125 * (K * K)) + 1.0;
                	double tmp;
                	if (l <= -5e+80) {
                		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * t_0);
                	} else if (l <= 2e+138) {
                		tmp = U + (2.0 * (J * Math.sinh(l)));
                	} else {
                		tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * t_0);
                	}
                	return tmp;
                }
                
                def code(J, l, K, U):
                	t_0 = (-0.125 * (K * K)) + 1.0
                	tmp = 0
                	if l <= -5e+80:
                		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * t_0)
                	elif l <= 2e+138:
                		tmp = U + (2.0 * (J * math.sinh(l)))
                	else:
                		tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * t_0)
                	return tmp
                
                function code(J, l, K, U)
                	t_0 = Float64(Float64(-0.125 * Float64(K * K)) + 1.0)
                	tmp = 0.0
                	if (l <= -5e+80)
                		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666)))))) * t_0));
                	elseif (l <= 2e+138)
                		tmp = Float64(U + Float64(2.0 * Float64(J * sinh(l))));
                	else
                		tmp = Float64(U + Float64(Float64(J * Float64(l * Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)))) * t_0));
                	end
                	return tmp
                end
                
                function tmp_2 = code(J, l, K, U)
                	t_0 = (-0.125 * (K * K)) + 1.0;
                	tmp = 0.0;
                	if (l <= -5e+80)
                		tmp = U + ((J * (l * (2.0 + ((l * l) * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))) * t_0);
                	elseif (l <= 2e+138)
                		tmp = U + (2.0 * (J * sinh(l)));
                	else
                		tmp = U + ((J * (l * (2.0 + ((l * l) * 0.3333333333333333)))) * t_0);
                	end
                	tmp_2 = tmp;
                end
                
                code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[l, -5e+80], 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] * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2e+138], N[(U + N[(2.0 * N[(J * N[Sinh[l], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(U + N[(N[(J * N[(l * N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := -0.125 \cdot \left(K \cdot K\right) + 1\\
                \mathbf{if}\;\ell \leq -5 \cdot 10^{+80}:\\
                \;\;\;\;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 t\_0\\
                
                \mathbf{elif}\;\ell \leq 2 \cdot 10^{+138}:\\
                \;\;\;\;U + 2 \cdot \left(J \cdot \sinh \ell\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;U + \left(J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\right) \cdot t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if l < -4.99999999999999961e80

                  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-*.f6481.8%

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

                    \[\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 -4.99999999999999961e80 < l < 2.0000000000000001e138

                  1. Initial program 78.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2.0000000000000001e138 < 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-*.f6492.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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    8. Simplified92.0%

                      \[\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 \]
                    9. 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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    10. Step-by-step derivation
                      1. *-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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

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

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

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

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

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

                  Alternative 10: 76.9% accurate, 8.9× speedup?

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

                    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-*.f6481.8%

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

                      \[\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 -5.99999999999999995e81 < l < 1.39999999999999991e140

                    1. Initial program 78.9%

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6474.6%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified74.6%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

                      \[\leadsto \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), U\right) \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 1.39999999999999991e140 < 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-*.f6492.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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    8. Simplified92.0%

                      \[\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 \]
                    9. 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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    10. Step-by-step derivation
                      1. *-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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

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

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

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

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

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

                  Alternative 11: 76.6% accurate, 8.9× speedup?

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

                    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({\ell}^{2} \cdot \left(\frac{1}{3} \cdot \left(J \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) \]
                      6. associate-*r*N/A

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

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

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

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

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

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

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

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

                    if -1.00000000000000005e248 < l < 2.0000000000000001e138

                    1. Initial program 82.8%

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6474.6%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified74.6%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

                      \[\leadsto \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), U\right) \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2.0000000000000001e138 < 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-*.f6492.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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    8. Simplified92.0%

                      \[\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 \]
                    9. 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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    10. Step-by-step derivation
                      1. *-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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

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

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

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

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

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

                  Alternative 12: 74.8% accurate, 9.4× speedup?

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

                    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({\ell}^{2} \cdot \left(\frac{1}{3} \cdot \left(J \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) \]
                      6. associate-*r*N/A

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

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

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

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

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

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

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

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

                    if -9.9999999999999992e248 < l < 2.0000000000000001e138

                    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2.0000000000000001e138 < 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-*.f6492.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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    8. Simplified92.0%

                      \[\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 \]
                    9. 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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    10. Step-by-step derivation
                      1. *-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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

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

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

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

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

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

                  Alternative 13: 74.9% accurate, 10.1× speedup?

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

                    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({\ell}^{2} \cdot \left(\frac{1}{3} \cdot \left(J \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) \]
                      6. associate-*r*N/A

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

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

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

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

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

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

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

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

                    if -4.3999999999999999e248 < l < 2.0000000000000001e138

                    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if 2.0000000000000001e138 < 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-*.f6492.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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    8. Simplified92.0%

                      \[\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 \]
                    9. 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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                    10. Step-by-step derivation
                      1. *-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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\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{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{8}, \mathsf{*.f64}\left(K, K\right)\right)\right)\right), U\right) \]
                      3. *-lowering-*.f64N/A

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

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

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

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

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

                  Alternative 14: 74.8% accurate, 10.1× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := U + \ell \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right) \cdot \left(J + J \cdot \left(-0.125 \cdot \left(K \cdot K\right)\right)\right)\right)\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{+249}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 10^{+143}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (let* ((t_0
                           (+
                            U
                            (*
                             l
                             (*
                              (+ 2.0 (* (* l l) 0.3333333333333333))
                              (+ J (* J (* -0.125 (* K K)))))))))
                     (if (<= l -1e+249)
                       t_0
                       (if (<= l 1e+143)
                         (+
                          U
                          (*
                           J
                           (*
                            l
                            (+
                             2.0
                             (*
                              l
                              (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666))))))))
                         t_0))))
                  double code(double J, double l, double K, double U) {
                  	double t_0 = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J + (J * (-0.125 * (K * K))))));
                  	double tmp;
                  	if (l <= -1e+249) {
                  		tmp = t_0;
                  	} else if (l <= 1e+143) {
                  		tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = u + (l * ((2.0d0 + ((l * l) * 0.3333333333333333d0)) * (j + (j * ((-0.125d0) * (k * k))))))
                      if (l <= (-1d+249)) then
                          tmp = t_0
                      else if (l <= 1d+143) then
                          tmp = u + (j * (l * (2.0d0 + (l * (l * (0.3333333333333333d0 + ((l * l) * 0.016666666666666666d0)))))))
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double t_0 = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J + (J * (-0.125 * (K * K))))));
                  	double tmp;
                  	if (l <= -1e+249) {
                  		tmp = t_0;
                  	} else if (l <= 1e+143) {
                  		tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	t_0 = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J + (J * (-0.125 * (K * K))))))
                  	tmp = 0
                  	if l <= -1e+249:
                  		tmp = t_0
                  	elif l <= 1e+143:
                  		tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(J, l, K, U)
                  	t_0 = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(Float64(l * l) * 0.3333333333333333)) * Float64(J + Float64(J * Float64(-0.125 * Float64(K * K)))))))
                  	tmp = 0.0
                  	if (l <= -1e+249)
                  		tmp = t_0;
                  	elseif (l <= 1e+143)
                  		tmp = Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))));
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	t_0 = U + (l * ((2.0 + ((l * l) * 0.3333333333333333)) * (J + (J * (-0.125 * (K * K))))));
                  	tmp = 0.0;
                  	if (l <= -1e+249)
                  		tmp = t_0;
                  	elseif (l <= 1e+143)
                  		tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(l * N[(N[(2.0 + N[(N[(l * l), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] * N[(J + N[(J * N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e+249], t$95$0, If[LessEqual[l, 1e+143], N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := U + \ell \cdot \left(\left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right) \cdot \left(J + J \cdot \left(-0.125 \cdot \left(K \cdot K\right)\right)\right)\right)\\
                  \mathbf{if}\;\ell \leq -1 \cdot 10^{+249}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;\ell \leq 10^{+143}:\\
                  \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if l < -9.9999999999999992e248 or 1e143 < 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({\ell}^{2} \cdot \left(\frac{1}{3} \cdot \left(J \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) \]
                      6. associate-*r*N/A

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

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

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

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

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

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

                    if -9.9999999999999992e248 < l < 1e143

                    1. Initial program 82.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 15: 74.9% accurate, 12.5× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := U + J \cdot \left(\ell \cdot \left(\ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\ \mathbf{if}\;\ell \leq -250000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 3.4:\\ \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (let* ((t_0 (+ U (* J (* l (* l (* l (* (* l l) 0.016666666666666666))))))))
                     (if (<= l -250000.0) t_0 (if (<= l 3.4) (+ U (* J (* 2.0 l))) t_0))))
                  double code(double J, double l, double K, double U) {
                  	double t_0 = U + (J * (l * (l * (l * ((l * l) * 0.016666666666666666)))));
                  	double tmp;
                  	if (l <= -250000.0) {
                  		tmp = t_0;
                  	} else if (l <= 3.4) {
                  		tmp = U + (J * (2.0 * l));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = u + (j * (l * (l * (l * ((l * l) * 0.016666666666666666d0)))))
                      if (l <= (-250000.0d0)) then
                          tmp = t_0
                      else if (l <= 3.4d0) then
                          tmp = u + (j * (2.0d0 * l))
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double t_0 = U + (J * (l * (l * (l * ((l * l) * 0.016666666666666666)))));
                  	double tmp;
                  	if (l <= -250000.0) {
                  		tmp = t_0;
                  	} else if (l <= 3.4) {
                  		tmp = U + (J * (2.0 * l));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	t_0 = U + (J * (l * (l * (l * ((l * l) * 0.016666666666666666)))))
                  	tmp = 0
                  	if l <= -250000.0:
                  		tmp = t_0
                  	elif l <= 3.4:
                  		tmp = U + (J * (2.0 * l))
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(J, l, K, U)
                  	t_0 = Float64(U + Float64(J * Float64(l * Float64(l * Float64(l * Float64(Float64(l * l) * 0.016666666666666666))))))
                  	tmp = 0.0
                  	if (l <= -250000.0)
                  		tmp = t_0;
                  	elseif (l <= 3.4)
                  		tmp = Float64(U + Float64(J * Float64(2.0 * l)));
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	t_0 = U + (J * (l * (l * (l * ((l * l) * 0.016666666666666666)))));
                  	tmp = 0.0;
                  	if (l <= -250000.0)
                  		tmp = t_0;
                  	elseif (l <= 3.4)
                  		tmp = U + (J * (2.0 * l));
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := Block[{t$95$0 = N[(U + N[(J * N[(l * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -250000.0], t$95$0, If[LessEqual[l, 3.4], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := U + J \cdot \left(\ell \cdot \left(\ell \cdot \left(\ell \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)\\
                  \mathbf{if}\;\ell \leq -250000:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;\ell \leq 3.4:\\
                  \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if l < -2.5e5 or 3.39999999999999991 < 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-*.f6491.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. Simplified91.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(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)}, U\right) \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -2.5e5 < l < 3.39999999999999991

                    1. Initial program 69.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 K around 0

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6467.0%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified67.0%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

                  Alternative 16: 70.5% accurate, 14.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\ \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+67}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{+98}:\\ \;\;\;\;U \cdot \left(1 + \frac{\ell \cdot \left(2 \cdot J\right)}{U}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (let* ((t_0 (* J (* l (+ 2.0 (* l (* l 0.3333333333333333)))))))
                     (if (<= l -3.4e+67)
                       t_0
                       (if (<= l 2.3e+98) (* U (+ 1.0 (/ (* l (* 2.0 J)) U))) t_0))))
                  double code(double J, double l, double K, double U) {
                  	double t_0 = J * (l * (2.0 + (l * (l * 0.3333333333333333))));
                  	double tmp;
                  	if (l <= -3.4e+67) {
                  		tmp = t_0;
                  	} else if (l <= 2.3e+98) {
                  		tmp = U * (1.0 + ((l * (2.0 * J)) / U));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(j, l, k, u)
                      real(8), intent (in) :: j
                      real(8), intent (in) :: l
                      real(8), intent (in) :: k
                      real(8), intent (in) :: u
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = j * (l * (2.0d0 + (l * (l * 0.3333333333333333d0))))
                      if (l <= (-3.4d+67)) then
                          tmp = t_0
                      else if (l <= 2.3d+98) then
                          tmp = u * (1.0d0 + ((l * (2.0d0 * j)) / u))
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double J, double l, double K, double U) {
                  	double t_0 = J * (l * (2.0 + (l * (l * 0.3333333333333333))));
                  	double tmp;
                  	if (l <= -3.4e+67) {
                  		tmp = t_0;
                  	} else if (l <= 2.3e+98) {
                  		tmp = U * (1.0 + ((l * (2.0 * J)) / U));
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(J, l, K, U):
                  	t_0 = J * (l * (2.0 + (l * (l * 0.3333333333333333))))
                  	tmp = 0
                  	if l <= -3.4e+67:
                  		tmp = t_0
                  	elif l <= 2.3e+98:
                  		tmp = U * (1.0 + ((l * (2.0 * J)) / U))
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(J, l, K, U)
                  	t_0 = Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))
                  	tmp = 0.0
                  	if (l <= -3.4e+67)
                  		tmp = t_0;
                  	elseif (l <= 2.3e+98)
                  		tmp = Float64(U * Float64(1.0 + Float64(Float64(l * Float64(2.0 * J)) / U)));
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(J, l, K, U)
                  	t_0 = J * (l * (2.0 + (l * (l * 0.3333333333333333))));
                  	tmp = 0.0;
                  	if (l <= -3.4e+67)
                  		tmp = t_0;
                  	elseif (l <= 2.3e+98)
                  		tmp = U * (1.0 + ((l * (2.0 * J)) / U));
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(l * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -3.4e+67], t$95$0, If[LessEqual[l, 2.3e+98], N[(U * N[(1.0 + N[(N[(l * N[(2.0 * J), $MachinePrecision]), $MachinePrecision] / U), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
                  \mathbf{if}\;\ell \leq -3.4 \cdot 10^{+67}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;\ell \leq 2.3 \cdot 10^{+98}:\\
                  \;\;\;\;U \cdot \left(1 + \frac{\ell \cdot \left(2 \cdot J\right)}{U}\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if l < -3.4000000000000002e67 or 2.30000000000000013e98 < 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(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)}, U\right) \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -3.4000000000000002e67 < l < 2.30000000000000013e98

                    1. Initial program 76.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 K around 0

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6472.8%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified72.8%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 17: 71.4% accurate, 14.8× speedup?

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

                    1. Initial program 99.8%

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

                      \[\leadsto \mathsf{+.f64}\left(\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-*.f6491.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. Simplified91.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -185000 < l < 1.4e-8

                    1. Initial program 68.8%

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6467.9%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified67.9%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

                  Alternative 18: 75.1% accurate, 16.4× speedup?

                  \[\begin{array}{l} \\ U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right) \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (+
                    U
                    (*
                     J
                     (*
                      l
                      (+
                       2.0
                       (* l (* l (+ 0.3333333333333333 (* (* l l) 0.016666666666666666)))))))))
                  double code(double J, double l, double K, double U) {
                  	return U + (J * (l * (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 + (j * (l * (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 + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
                  }
                  
                  def code(J, l, K, U):
                  	return U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))))
                  
                  function code(J, l, K, U)
                  	return Float64(U + Float64(J * Float64(l * Float64(2.0 + Float64(l * Float64(l * Float64(0.3333333333333333 + Float64(Float64(l * l) * 0.016666666666666666))))))))
                  end
                  
                  function tmp = code(J, l, K, U)
                  	tmp = U + (J * (l * (2.0 + (l * (l * (0.3333333333333333 + ((l * l) * 0.016666666666666666)))))));
                  end
                  
                  code[J_, l_, K_, U_] := N[(U + N[(J * N[(l * N[(2.0 + N[(l * N[(l * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  U + J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)
                  \end{array}
                  
                  Derivation
                  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-*.f6494.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. Simplified94.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(\color{blue}{\left(J \cdot \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)}, U\right) \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{J \cdot \left(\ell \cdot \left(2 + \ell \cdot \left(\ell \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)\right)} + U \]
                  9. Final simplification74.0%

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

                  Alternative 19: 45.4% accurate, 20.8× speedup?

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

                    1. Initial program 99.8%

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6477.0%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified77.0%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(J, \color{blue}{2}\right)\right) \]
                    11. Simplified21.0%

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

                    if -192000 < l < 8.5e-9

                    1. Initial program 68.8%

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

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

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

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

                    Alternative 20: 71.8% accurate, 24.0× speedup?

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6472.8%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified72.8%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

                    Alternative 21: 53.9% accurate, 44.6× speedup?

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \left(e^{\ell} - e^{\mathsf{neg}\left(\ell\right)}\right)\right), U\right) \]
                      2. sub-negN/A

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(e^{\mathsf{neg}\left(\ell\right)}\right)\right)\right)\right), U\right) \]
                      5. exp-negN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\mathsf{neg}\left(\frac{1}{e^{\ell}}\right)\right)\right)\right), U\right) \]
                      6. distribute-neg-fracN/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \left(\frac{\mathsf{neg}\left(1\right)}{e^{\ell}}\right)\right)\right), U\right) \]
                      7. metadata-evalN/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \left(e^{\ell}\right)\right)\right)\right), U\right) \]
                      9. exp-lowering-exp.f6472.8%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \mathsf{/.f64}\left(-1, \mathsf{exp.f64}\left(\ell\right)\right)\right)\right), U\right) \]
                    5. Simplified72.8%

                      \[\leadsto \color{blue}{J \cdot \left(e^{\ell} + \frac{-1}{e^{\ell}}\right)} + U \]
                    6. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

                    Alternative 22: 36.4% accurate, 312.0× speedup?

                    \[\begin{array}{l} \\ U \end{array} \]
                    (FPCore (J l K U) :precision binary64 U)
                    double code(double J, double l, double K, double U) {
                    	return U;
                    }
                    
                    real(8) function code(j, l, k, u)
                        real(8), intent (in) :: j
                        real(8), intent (in) :: l
                        real(8), intent (in) :: k
                        real(8), intent (in) :: u
                        code = u
                    end function
                    
                    public static double code(double J, double l, double K, double U) {
                    	return U;
                    }
                    
                    def code(J, l, K, U):
                    	return U
                    
                    function code(J, l, K, U)
                    	return U
                    end
                    
                    function tmp = code(J, l, K, U)
                    	tmp = U;
                    end
                    
                    code[J_, l_, K_, U_] := U
                    
                    \begin{array}{l}
                    
                    \\
                    U
                    \end{array}
                    
                    Derivation
                    1. Initial program 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 J around 0

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

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

                      Reproduce

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