Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 85.8% → 99.9%
Time: 13.6s
Alternatives: 24
Speedup: 2.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 24 alternatives:

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

Initial Program: 85.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ 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 84.8%

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

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

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

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

      \[\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-rr100.0%

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

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

Alternative 2: 96.1% accurate, 1.4× speedup?

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

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 84.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.f64100.0%

        \[\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-rr100.0%

      \[\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. Simplified100.0%

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

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

    Alternative 3: 93.7% accurate, 1.4× speedup?

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

      1. Initial program 79.9%

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

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 86.2%

        \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
      2. Add Preprocessing
      3. 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.f64100.0%

          \[\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-rr100.0%

        \[\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. Simplified97.2%

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

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

      Alternative 4: 93.1% accurate, 1.4× speedup?

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

        1. Initial program 79.9%

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

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

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

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

        1. Initial program 86.2%

          \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        2. Add Preprocessing
        3. 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.f64100.0%

            \[\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-rr100.0%

          \[\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. Simplified97.2%

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

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

        Alternative 5: 86.3% accurate, 1.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.02:\\ \;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right) \cdot \left(J + J \cdot \left(-0.125 \cdot \left(K \cdot K\right)\right)\right)\right)\\ \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.02)
           (+
            U
            (*
             l
             (*
              (+ 2.0 (* l (* l 0.3333333333333333)))
              (+ J (* J (* -0.125 (* K K)))))))
           (+ U (* 2.0 (* J (sinh l))))))
        double code(double J, double l, double K, double U) {
        	double tmp;
        	if (cos((K / 2.0)) <= -0.02) {
        		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K))))));
        	} 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.02d0)) then
                tmp = u + (l * ((2.0d0 + (l * (l * 0.3333333333333333d0))) * (j + (j * ((-0.125d0) * (k * k))))))
            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.02) {
        		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K))))));
        	} 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.02:
        		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K))))))
        	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.02)
        		tmp = Float64(U + Float64(l * Float64(Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333))) * Float64(J + Float64(J * Float64(-0.125 * Float64(K * K)))))));
        	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.02)
        		tmp = U + (l * ((2.0 + (l * (l * 0.3333333333333333))) * (J + (J * (-0.125 * (K * K))))));
        	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.02], N[(U + N[(l * N[(N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(J + N[(J * N[(-0.125 * N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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.02:\\
        \;\;\;\;U + \ell \cdot \left(\left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right) \cdot \left(J + J \cdot \left(-0.125 \cdot \left(K \cdot K\right)\right)\right)\right)\\
        
        \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.0200000000000000004

          1. Initial program 79.9%

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

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

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

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

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

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

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

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

          1. Initial program 86.2%

            \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
          2. Add Preprocessing
          3. 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.f64100.0%

              \[\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-rr100.0%

            \[\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. Simplified97.2%

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

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

          Alternative 6: 88.5% accurate, 2.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 4.1 \cdot 10^{-79}:\\ \;\;\;\;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) 4.1e-79)
             (+ 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) <= 4.1e-79) {
          		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) <= 4.1d-79) 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) <= 4.1e-79) {
          		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) <= 4.1e-79:
          		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) <= 4.1e-79)
          		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) <= 4.1e-79)
          		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], 4.1e-79], 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 4.1 \cdot 10^{-79}:\\
          \;\;\;\;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)) < 4.09999999999999994e-79

            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.f64100.0%

                \[\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-rr100.0%

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

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

              if 4.09999999999999994e-79 < (/.f64 K #s(literal 2 binary64))

              1. Initial program 82.2%

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \color{blue}{\left(\ell \cdot \left(2 + {\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-*.f6498.8%

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 4.1 \cdot 10^{-79}:\\ \;\;\;\;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: 76.4% accurate, 10.4× speedup?

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

              1. Initial program 82.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.f6471.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. Simplified71.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 + {\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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto 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)} + U \]

              if 4e129 < 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. Simplified100.0%

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(J, \mathsf{*.f64}\left(J, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
                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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
                8. *-lowering-*.f6489.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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
              8. Simplified89.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 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) + U \]
            3. Recombined 2 regimes into one program.
            4. Final simplification81.0%

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

            Alternative 8: 75.1% accurate, 11.1× speedup?

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

              1. Initial program 82.1%

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

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

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

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

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

                \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
              6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              if 5.4000000000000002e129 < 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. Simplified100.0%

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(J, \mathsf{*.f64}\left(J, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
                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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
                8. *-lowering-*.f6489.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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
              8. Simplified89.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 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) + U \]
            3. Recombined 2 regimes into one program.
            4. Final simplification78.6%

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

            Alternative 9: 74.8% accurate, 12.0× speedup?

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

              1. Initial program 82.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.f6471.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. Simplified71.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 + {\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, \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) \]
                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} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                3. *-lowering-*.f64N/A

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

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

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

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

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

                \[\leadsto 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)} + U \]

              if 2.1999999999999999e129 < 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. Simplified100.0%

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

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{+.f64}\left(J, \mathsf{*.f64}\left(J, \left(\frac{-1}{8} \cdot {K}^{2}\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
                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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
                8. *-lowering-*.f6489.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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{3}\right)\right)\right)\right)\right), U\right) \]
              8. Simplified89.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 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right) + U \]
            3. Recombined 2 regimes into one program.
            4. Final simplification78.0%

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

            Alternative 10: 71.8% accurate, 13.0× speedup?

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

              1. Initial program 84.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.f6477.2%

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

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

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

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

              if 7.00000000000000003e38 < K

              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.f6454.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. Simplified54.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, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \color{blue}{-1}\right)\right), U\right) \]
              7. Step-by-step derivation
                1. Simplified42.6%

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;K \leq 7 \cdot 10^{+38}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot 0.3333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \left(\ell \cdot \left(1 + \ell \cdot \left(0.5 + \ell \cdot \left(0.16666666666666666 + \ell \cdot 0.041666666666666664\right)\right)\right)\right)\\ \end{array} \]
              10. Add Preprocessing

              Alternative 11: 74.3% accurate, 13.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(J \cdot \ell\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\\ \mathbf{if}\;\ell \leq -7.2 \cdot 10^{+15}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 1.25 \cdot 10^{+14}:\\ \;\;\;\;U + J \cdot \left(2 \cdot \ell\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (let* ((t_0 (* (* J l) (* (* l l) (* (* l l) 0.016666666666666666)))))
                 (if (<= l -7.2e+15) t_0 (if (<= l 1.25e+14) (+ U (* J (* 2.0 l))) t_0))))
              double code(double J, double l, double K, double U) {
              	double t_0 = (J * l) * ((l * l) * ((l * l) * 0.016666666666666666));
              	double tmp;
              	if (l <= -7.2e+15) {
              		tmp = t_0;
              	} else if (l <= 1.25e+14) {
              		tmp = U + (J * (2.0 * l));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(j, l, k, u)
                  real(8), intent (in) :: j
                  real(8), intent (in) :: l
                  real(8), intent (in) :: k
                  real(8), intent (in) :: u
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = (j * l) * ((l * l) * ((l * l) * 0.016666666666666666d0))
                  if (l <= (-7.2d+15)) then
                      tmp = t_0
                  else if (l <= 1.25d+14) then
                      tmp = u + (j * (2.0d0 * l))
                  else
                      tmp = t_0
                  end if
                  code = tmp
              end function
              
              public static double code(double J, double l, double K, double U) {
              	double t_0 = (J * l) * ((l * l) * ((l * l) * 0.016666666666666666));
              	double tmp;
              	if (l <= -7.2e+15) {
              		tmp = t_0;
              	} else if (l <= 1.25e+14) {
              		tmp = U + (J * (2.0 * l));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(J, l, K, U):
              	t_0 = (J * l) * ((l * l) * ((l * l) * 0.016666666666666666))
              	tmp = 0
              	if l <= -7.2e+15:
              		tmp = t_0
              	elif l <= 1.25e+14:
              		tmp = U + (J * (2.0 * l))
              	else:
              		tmp = t_0
              	return tmp
              
              function code(J, l, K, U)
              	t_0 = Float64(Float64(J * l) * Float64(Float64(l * l) * Float64(Float64(l * l) * 0.016666666666666666)))
              	tmp = 0.0
              	if (l <= -7.2e+15)
              		tmp = t_0;
              	elseif (l <= 1.25e+14)
              		tmp = Float64(U + Float64(J * Float64(2.0 * l)));
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              function tmp_2 = code(J, l, K, U)
              	t_0 = (J * l) * ((l * l) * ((l * l) * 0.016666666666666666));
              	tmp = 0.0;
              	if (l <= -7.2e+15)
              		tmp = t_0;
              	elseif (l <= 1.25e+14)
              		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[(N[(J * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -7.2e+15], t$95$0, If[LessEqual[l, 1.25e+14], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \left(J \cdot \ell\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot \left(\left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\\
              \mathbf{if}\;\ell \leq -7.2 \cdot 10^{+15}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;\ell \leq 1.25 \cdot 10^{+14}:\\
              \;\;\;\;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 < -7.2e15 or 1.25e14 < 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. 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 \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. 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 \frac{1}{60}\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(\ell \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. *-lowering-*.f6489.5%

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

                  \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\left(\ell \cdot \ell\right), \frac{1}{60}\right)\right)\right) \]
                  11. *-lowering-*.f6464.9%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(J, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(\ell, \ell\right), \frac{1}{60}\right)\right)\right) \]
                14. Simplified64.9%

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

                if -7.2e15 < l < 1.25e14

                1. Initial program 70.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 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.f6468.1%

                    \[\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. Simplified68.1%

                  \[\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-*.f6483.2%

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

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

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

              Alternative 12: 72.6% accurate, 14.2× speedup?

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

                1. Initial program 79.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.f6470.4%

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

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

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

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

                if 0.0359999999999999973 < 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. 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 \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. 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 \frac{1}{60}\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(\ell \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. *-lowering-*.f6486.0%

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

                  \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 13: 73.0% accurate, 14.2× speedup?

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

                1. Initial program 79.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.f6470.4%

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

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

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

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

                if 0.0359999999999999973 < 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. 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 \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. 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 \frac{1}{60}\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(\ell \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. *-lowering-*.f6486.0%

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

                  \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\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)} \]
                13. Step-by-step derivation
                  1. associate-*r*N/A

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

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

                    \[\leadsto 2 \cdot \left(J \cdot \ell\right) + \left({\ell}^{2} \cdot \left(\frac{1}{60} \cdot {\ell}^{2} + \frac{1}{3}\right)\right) \cdot \left(J \cdot \ell\right) \]
                  4. distribute-rgt-inN/A

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

                    \[\leadsto 2 \cdot \left(J \cdot \ell\right) + \left(\frac{1}{60} \cdot \left({\ell}^{2} \cdot {\ell}^{2}\right) + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot \left(J \cdot \ell\right) \]
                  6. pow-sqrN/A

                    \[\leadsto 2 \cdot \left(J \cdot \ell\right) + \left(\frac{1}{60} \cdot {\ell}^{\left(2 \cdot 2\right)} + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot \left(J \cdot \ell\right) \]
                  7. metadata-evalN/A

                    \[\leadsto 2 \cdot \left(J \cdot \ell\right) + \left(\frac{1}{60} \cdot {\ell}^{4} + \frac{1}{3} \cdot {\ell}^{2}\right) \cdot \left(J \cdot \ell\right) \]
                  8. distribute-rgt-inN/A

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

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

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

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

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

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

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

              Alternative 14: 68.6% accurate, 14.8× speedup?

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

                1. Initial program 99.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. 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 \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. 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 \frac{1}{60}\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(\ell \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. *-lowering-*.f6488.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(\ell, \mathsf{*.f64}\left(\ell, \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                5. Simplified88.6%

                  \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.85000000000000002e-7 < l < 0.0359999999999999973

                1. Initial program 68.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.f6468.3%

                    \[\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. Simplified68.3%

                  \[\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-*.f6485.9%

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

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

                if 0.0359999999999999973 < 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. 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 \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. 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 \frac{1}{60}\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(\ell \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. *-lowering-*.f6486.0%

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

                  \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 15: 68.6% accurate, 14.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\ \mathbf{if}\;\ell \leq -1.85 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 0.036:\\ \;\;\;\;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 (* l (* J (+ 2.0 (* l (* l 0.3333333333333333)))))))
                 (if (<= l -1.85e-7) t_0 (if (<= l 0.036) (+ U (* J (* 2.0 l))) t_0))))
              double code(double J, double l, double K, double U) {
              	double t_0 = l * (J * (2.0 + (l * (l * 0.3333333333333333))));
              	double tmp;
              	if (l <= -1.85e-7) {
              		tmp = t_0;
              	} else if (l <= 0.036) {
              		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 = l * (j * (2.0d0 + (l * (l * 0.3333333333333333d0))))
                  if (l <= (-1.85d-7)) then
                      tmp = t_0
                  else if (l <= 0.036d0) 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 = l * (J * (2.0 + (l * (l * 0.3333333333333333))));
              	double tmp;
              	if (l <= -1.85e-7) {
              		tmp = t_0;
              	} else if (l <= 0.036) {
              		tmp = U + (J * (2.0 * l));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(J, l, K, U):
              	t_0 = l * (J * (2.0 + (l * (l * 0.3333333333333333))))
              	tmp = 0
              	if l <= -1.85e-7:
              		tmp = t_0
              	elif l <= 0.036:
              		tmp = U + (J * (2.0 * l))
              	else:
              		tmp = t_0
              	return tmp
              
              function code(J, l, K, U)
              	t_0 = Float64(l * Float64(J * Float64(2.0 + Float64(l * Float64(l * 0.3333333333333333)))))
              	tmp = 0.0
              	if (l <= -1.85e-7)
              		tmp = t_0;
              	elseif (l <= 0.036)
              		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 = l * (J * (2.0 + (l * (l * 0.3333333333333333))));
              	tmp = 0.0;
              	if (l <= -1.85e-7)
              		tmp = t_0;
              	elseif (l <= 0.036)
              		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[(l * N[(J * N[(2.0 + N[(l * N[(l * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.85e-7], t$95$0, If[LessEqual[l, 0.036], N[(U + N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \ell \cdot \left(J \cdot \left(2 + \ell \cdot \left(\ell \cdot 0.3333333333333333\right)\right)\right)\\
              \mathbf{if}\;\ell \leq -1.85 \cdot 10^{-7}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;\ell \leq 0.036:\\
              \;\;\;\;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 < -1.85000000000000002e-7 or 0.0359999999999999973 < 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. 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 \frac{1}{60}\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  9. 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 \frac{1}{60}\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(\ell \cdot \frac{1}{60}\right)\right)\right)\right)\right)\right)\right), \mathsf{cos.f64}\left(\mathsf{/.f64}\left(K, 2\right)\right)\right), U\right) \]
                  11. *-lowering-*.f6487.2%

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

                  \[\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 0.016666666666666666\right)\right)\right)\right)}\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                if -1.85000000000000002e-7 < l < 0.0359999999999999973

                1. Initial program 68.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.f6468.3%

                    \[\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. Simplified68.3%

                  \[\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-*.f6485.9%

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

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

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

              Alternative 16: 75.2% accurate, 16.4× speedup?

              \[\begin{array}{l} \\ U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right) \end{array} \]
              (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(Float64(l * 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[(N[(l * l), $MachinePrecision] * N[(0.3333333333333333 + N[(N[(l * l), $MachinePrecision] * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              U + J \cdot \left(\ell \cdot \left(2 + \left(\ell \cdot \ell\right) \cdot \left(0.3333333333333333 + \left(\ell \cdot \ell\right) \cdot 0.016666666666666666\right)\right)\right)
              \end{array}
              
              Derivation
              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 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.f6471.7%

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

                \[\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} + \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, \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) \]
                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} + \frac{1}{60} \cdot {\ell}^{2}\right)\right)\right)\right)\right), U\right) \]
                3. *-lowering-*.f64N/A

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

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

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

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

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

                \[\leadsto 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)} + U \]
              9. Final simplification75.2%

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

              Alternative 17: 42.2% accurate, 20.8× speedup?

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

                1. Initial program 72.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.f6461.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. Simplified61.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-*.f6454.4%

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

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

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

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

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

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

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

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

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

                if -1.9599999999999999e80 < J < 3.59999999999999984e39

                1. Initial program 93.1%

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

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

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

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

                Alternative 18: 54.9% accurate, 22.3× speedup?

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

                  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 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.f6473.2%

                      \[\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. Simplified73.2%

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

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

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

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

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

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

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

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

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

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

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

                  if -1.7000000000000001e26 < l

                  1. Initial program 80.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.f6471.3%

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

                    \[\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-*.f6462.0%

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

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

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

                Alternative 19: 71.2% 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 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 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.f6471.7%

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

                  \[\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-*.f6472.1%

                    \[\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. Simplified72.1%

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

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

                Alternative 20: 54.9% accurate, 26.0× speedup?

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

                  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 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.2%

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

                    \[\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, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \color{blue}{-1}\right)\right), U\right) \]
                  7. Step-by-step derivation
                    1. Simplified3.1%

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \left(\color{blue}{e^{\ell}} - 1\right)\right)\right) \]
                      8. expm1-defineN/A

                        \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \left(\mathsf{expm1}\left(\ell\right)\right)\right)\right) \]
                      9. expm1-lowering-expm1.f6411.8%

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

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

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

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

                      if -2.8000000000000001e44 < l

                      1. Initial program 80.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 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.f6471.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. Simplified71.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(\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-*.f6461.5%

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

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

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

                    Alternative 21: 48.6% accurate, 26.0× speedup?

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

                      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 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.2%

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

                        \[\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, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \color{blue}{-1}\right)\right), U\right) \]
                      7. Step-by-step derivation
                        1. Simplified3.1%

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \left(\color{blue}{e^{\ell}} - 1\right)\right)\right) \]
                          8. expm1-defineN/A

                            \[\leadsto \mathsf{*.f64}\left(J, \mathsf{+.f64}\left(\mathsf{/.f64}\left(U, J\right), \left(\mathsf{expm1}\left(\ell\right)\right)\right)\right) \]
                          9. expm1-lowering-expm1.f6411.8%

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

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

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

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

                          if -3.9999999999999997e45 < l

                          1. Initial program 80.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 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.f6471.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. Simplified71.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, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \color{blue}{-1}\right)\right), U\right) \]
                          7. Step-by-step derivation
                            1. Simplified67.3%

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

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

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

                              \[\leadsto \color{blue}{J \cdot \ell} + U \]
                          8. Recombined 2 regimes into one program.
                          9. Final simplification47.5%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4 \cdot 10^{+45}:\\ \;\;\;\;J \cdot \left(\ell + \frac{U}{J}\right)\\ \mathbf{else}:\\ \;\;\;\;U + J \cdot \ell\\ \end{array} \]
                          10. Add Preprocessing

                          Alternative 22: 56.8% accurate, 28.4× speedup?

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

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

                            \[\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-*.f6452.9%

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

                            \[\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(\left(J \cdot 2\right) \cdot \ell\right), U\right)\right)\right) \]
                            7. associate-*r*N/A

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

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

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

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

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

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

                          Alternative 23: 47.2% accurate, 62.4× speedup?

                          \[\begin{array}{l} \\ U + J \cdot \ell \end{array} \]
                          (FPCore (J l K U) :precision binary64 (+ U (* J l)))
                          double code(double J, double l, double K, double U) {
                          	return U + (J * 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 * l)
                          end function
                          
                          public static double code(double J, double l, double K, double U) {
                          	return U + (J * l);
                          }
                          
                          def code(J, l, K, U):
                          	return U + (J * l)
                          
                          function code(J, l, K, U)
                          	return Float64(U + Float64(J * l))
                          end
                          
                          function tmp = code(J, l, K, U)
                          	tmp = U + (J * l);
                          end
                          
                          code[J_, l_, K_, U_] := N[(U + N[(J * l), $MachinePrecision]), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          U + J \cdot \ell
                          \end{array}
                          
                          Derivation
                          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 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.f6471.7%

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

                            \[\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, \mathsf{+.f64}\left(\mathsf{exp.f64}\left(\ell\right), \color{blue}{-1}\right)\right), U\right) \]
                          7. Step-by-step derivation
                            1. Simplified53.7%

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

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

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

                              \[\leadsto \color{blue}{J \cdot \ell} + U \]
                            5. Final simplification45.6%

                              \[\leadsto U + J \cdot \ell \]
                            6. Add Preprocessing

                            Alternative 24: 36.5% 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 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 J around 0

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

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

                              Reproduce

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