Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 85.9% → 99.9%
Time: 13.8s
Alternatives: 19
Speedup: 2.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 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.9% 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} \\ \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot 0.5\right), J, U\right) \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (fma (* (* 2.0 (sinh l)) (cos (* K 0.5))) J U))
double code(double J, double l, double K, double U) {
	return fma(((2.0 * sinh(l)) * cos((K * 0.5))), J, U);
}
function code(J, l, K, U)
	return fma(Float64(Float64(2.0 * sinh(l)) * cos(Float64(K * 0.5))), J, U)
end
code[J_, l_, K_, U_] := N[(N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot 0.5\right), J, U\right)
\end{array}
Derivation
  1. Initial program 87.0%

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
    9. div-invN/A

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

      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
    11. metadata-eval99.9

      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
  4. Applied egg-rr99.9%

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

Alternative 2: 96.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;t\_0 \leq 0.8:\\ \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (let* ((t_0 (cos (/ K 2.0))))
   (if (<= t_0 0.8)
     (+
      U
      (*
       t_0
       (*
        J
        (*
         l
         (fma
          (* l l)
          (fma
           l
           (* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
           0.3333333333333333)
          2.0)))))
     (fma (* 2.0 (sinh l)) J U))))
double code(double J, double l, double K, double U) {
	double t_0 = cos((K / 2.0));
	double tmp;
	if (t_0 <= 0.8) {
		tmp = U + (t_0 * (J * (l * fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0))));
	} else {
		tmp = fma((2.0 * sinh(l)), J, U);
	}
	return tmp;
}
function code(J, l, K, U)
	t_0 = cos(Float64(K / 2.0))
	tmp = 0.0
	if (t_0 <= 0.8)
		tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)))));
	else
		tmp = fma(Float64(2.0 * sinh(l)), J, U);
	end
	return 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.8], N[(U + N[(t$95$0 * N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \cos \left(\frac{K}{2}\right)\\
\mathbf{if}\;t\_0 \leq 0.8:\\
\;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right)\right)\right)\\

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


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

    1. Initial program 85.3%

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

      \[\leadsto \left(J \cdot \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) \cdot \cos \left(\frac{K}{2}\right) + U \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, \frac{1}{2520}, \frac{1}{60}\right), \frac{1}{3}\right), 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
      15. *-lowering-*.f6496.2

        \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
    5. Simplified96.2%

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

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

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
      9. div-invN/A

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

        \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
      11. metadata-eval100.0

        \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
    4. Applied egg-rr100.0%

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
        4. sinh-lowering-sinh.f6499.5

          \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
      3. Applied egg-rr99.5%

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

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

    Alternative 3: 95.5% accurate, 1.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;t\_0 \leq 0.8:\\ \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \end{array} \]
    (FPCore (J l K U)
     :precision binary64
     (let* ((t_0 (cos (/ K 2.0))))
       (if (<= t_0 0.8)
         (+
          U
          (*
           t_0
           (*
            J
            (*
             l
             (fma
              (* l l)
              (fma l (* l 0.016666666666666666) 0.3333333333333333)
              2.0)))))
         (fma (* 2.0 (sinh l)) J U))))
    double code(double J, double l, double K, double U) {
    	double t_0 = cos((K / 2.0));
    	double tmp;
    	if (t_0 <= 0.8) {
    		tmp = U + (t_0 * (J * (l * fma((l * l), fma(l, (l * 0.016666666666666666), 0.3333333333333333), 2.0))));
    	} else {
    		tmp = fma((2.0 * sinh(l)), J, U);
    	}
    	return tmp;
    }
    
    function code(J, l, K, U)
    	t_0 = cos(Float64(K / 2.0))
    	tmp = 0.0
    	if (t_0 <= 0.8)
    		tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(Float64(l * l), fma(l, Float64(l * 0.016666666666666666), 0.3333333333333333), 2.0)))));
    	else
    		tmp = fma(Float64(2.0 * sinh(l)), J, U);
    	end
    	return 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.8], N[(U + N[(t$95$0 * N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \cos \left(\frac{K}{2}\right)\\
    \mathbf{if}\;t\_0 \leq 0.8:\\
    \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right)\right)\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.80000000000000004

      1. Initial program 85.3%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \color{blue}{\ell \cdot \left(\frac{1}{60} \cdot \ell\right)} + \frac{1}{3}, 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        10. accelerator-lowering-fma.f64N/A

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

          \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{60}}, \frac{1}{3}\right), 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        12. *-lowering-*.f6492.6

          \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.016666666666666666}, 0.3333333333333333\right), 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
      5. Simplified92.6%

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

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

      1. Initial program 88.2%

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
        9. div-invN/A

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

          \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
        11. metadata-eval100.0

          \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
      4. Applied egg-rr100.0%

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
          4. sinh-lowering-sinh.f6499.5

            \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
        3. Applied egg-rr99.5%

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

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

      Alternative 4: 93.5% accurate, 1.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(\frac{K}{2}\right)\\ \mathbf{if}\;t\_0 \leq 0.8:\\ \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \end{array} \]
      (FPCore (J l K U)
       :precision binary64
       (let* ((t_0 (cos (/ K 2.0))))
         (if (<= t_0 0.8)
           (+ U (* t_0 (* J (* l (fma 0.3333333333333333 (* l l) 2.0)))))
           (fma (* 2.0 (sinh l)) J U))))
      double code(double J, double l, double K, double U) {
      	double t_0 = cos((K / 2.0));
      	double tmp;
      	if (t_0 <= 0.8) {
      		tmp = U + (t_0 * (J * (l * fma(0.3333333333333333, (l * l), 2.0))));
      	} else {
      		tmp = fma((2.0 * sinh(l)), J, U);
      	}
      	return tmp;
      }
      
      function code(J, l, K, U)
      	t_0 = cos(Float64(K / 2.0))
      	tmp = 0.0
      	if (t_0 <= 0.8)
      		tmp = Float64(U + Float64(t_0 * Float64(J * Float64(l * fma(0.3333333333333333, Float64(l * l), 2.0)))));
      	else
      		tmp = fma(Float64(2.0 * sinh(l)), J, U);
      	end
      	return 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.8], N[(U + N[(t$95$0 * N[(J * N[(l * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \cos \left(\frac{K}{2}\right)\\
      \mathbf{if}\;t\_0 \leq 0.8:\\
      \;\;\;\;U + t\_0 \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (cos.f64 (/.f64 K #s(literal 2 binary64))) < 0.80000000000000004

        1. Initial program 85.3%

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

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

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

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

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

            \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\frac{1}{3}, \color{blue}{\ell \cdot \ell}, 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
          5. *-lowering-*.f6488.7

            \[\leadsto \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(0.3333333333333333, \color{blue}{\ell \cdot \ell}, 2\right)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
        5. Simplified88.7%

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

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

        1. Initial program 88.2%

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
          9. div-invN/A

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

            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
          11. metadata-eval100.0

            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
        4. Applied egg-rr100.0%

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
            4. sinh-lowering-sinh.f6499.5

              \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
          3. Applied egg-rr99.5%

            \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
        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.8:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 87.0% accurate, 2.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \sinh \ell\\ \mathbf{if}\;\ell \leq -1.2 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right)\\ \mathbf{elif}\;\ell \leq -1.6 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \mathsf{fma}\left(-0.125, K \cdot K, 1\right), J, U\right)\\ \mathbf{elif}\;\ell \leq 0.000125:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_0, J, U\right)\\ \end{array} \end{array} \]
        (FPCore (J l K U)
         :precision binary64
         (let* ((t_0 (* 2.0 (sinh l))))
           (if (<= l -1.2e+93)
             (fma
              (*
               l
               (fma (* l l) (fma (* l l) 0.016666666666666666 0.3333333333333333) 2.0))
              J
              U)
             (if (<= l -1.6e-7)
               (fma (* t_0 (fma -0.125 (* K K) 1.0)) J U)
               (if (<= l 0.000125)
                 (fma (cos (* K 0.5)) (* J (* 2.0 l)) U)
                 (fma t_0 J U))))))
        double code(double J, double l, double K, double U) {
        	double t_0 = 2.0 * sinh(l);
        	double tmp;
        	if (l <= -1.2e+93) {
        		tmp = fma((l * fma((l * l), fma((l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U);
        	} else if (l <= -1.6e-7) {
        		tmp = fma((t_0 * fma(-0.125, (K * K), 1.0)), J, U);
        	} else if (l <= 0.000125) {
        		tmp = fma(cos((K * 0.5)), (J * (2.0 * l)), U);
        	} else {
        		tmp = fma(t_0, J, U);
        	}
        	return tmp;
        }
        
        function code(J, l, K, U)
        	t_0 = Float64(2.0 * sinh(l))
        	tmp = 0.0
        	if (l <= -1.2e+93)
        		tmp = fma(Float64(l * fma(Float64(l * l), fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U);
        	elseif (l <= -1.6e-7)
        		tmp = fma(Float64(t_0 * fma(-0.125, Float64(K * K), 1.0)), J, U);
        	elseif (l <= 0.000125)
        		tmp = fma(cos(Float64(K * 0.5)), Float64(J * Float64(2.0 * l)), U);
        	else
        		tmp = fma(t_0, J, U);
        	end
        	return tmp
        end
        
        code[J_, l_, K_, U_] := Block[{t$95$0 = N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1.2e+93], N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, -1.6e-7], N[(N[(t$95$0 * N[(-0.125 * N[(K * K), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, 0.000125], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(t$95$0 * J + U), $MachinePrecision]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := 2 \cdot \sinh \ell\\
        \mathbf{if}\;\ell \leq -1.2 \cdot 10^{+93}:\\
        \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right)\\
        
        \mathbf{elif}\;\ell \leq -1.6 \cdot 10^{-7}:\\
        \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \mathsf{fma}\left(-0.125, K \cdot K, 1\right), J, U\right)\\
        
        \mathbf{elif}\;\ell \leq 0.000125:\\
        \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(t\_0, J, U\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if l < -1.20000000000000005e93

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
            9. div-invN/A

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

              \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
            11. metadata-eval100.0

              \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
          4. Applied egg-rr100.0%

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

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

              \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{1}, J, U\right) \]
            2. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, \frac{1}{60}, \frac{1}{3}\right), 2\right), J, U\right) \]
              10. *-lowering-*.f6486.0

                \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right) \]
            4. Simplified86.0%

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

            if -1.20000000000000005e93 < l < -1.6e-7

            1. Initial program 98.9%

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
              9. div-invN/A

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

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
              11. metadata-eval99.9

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
            4. Applied egg-rr99.9%

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \mathsf{fma}\left(\frac{-1}{8}, \color{blue}{K \cdot K}, 1\right), J, U\right) \]
              4. *-lowering-*.f6480.6

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \mathsf{fma}\left(-0.125, \color{blue}{K \cdot K}, 1\right), J, U\right) \]
            7. Simplified80.6%

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

            if -1.6e-7 < l < 1.25e-4

            1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\cos \left(\frac{1}{2} \cdot K\right), J \cdot \color{blue}{\left(\ell \cdot 2\right)}, U\right) \]
              12. *-lowering-*.f6499.9

                \[\leadsto \mathsf{fma}\left(\cos \left(0.5 \cdot K\right), J \cdot \color{blue}{\left(\ell \cdot 2\right)}, U\right) \]
            5. Simplified99.9%

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
              9. div-invN/A

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

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
              11. metadata-eval100.0

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
            4. Applied egg-rr100.0%

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
                4. sinh-lowering-sinh.f6476.2

                  \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
              3. Applied egg-rr76.2%

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.2 \cdot 10^{+93}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right)\\ \mathbf{elif}\;\ell \leq -1.6 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \mathsf{fma}\left(-0.125, K \cdot K, 1\right), J, U\right)\\ \mathbf{elif}\;\ell \leq 0.000125:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \]
            9. Add Preprocessing

            Alternative 6: 86.2% accurate, 2.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;K \leq 15.6:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\ell, \cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right), U\right)\\ \end{array} \end{array} \]
            (FPCore (J l K U)
             :precision binary64
             (if (<= K 15.6)
               (fma (* 2.0 (sinh l)) J U)
               (fma l (* (cos (* K 0.5)) (* J (fma 0.3333333333333333 (* l l) 2.0))) U)))
            double code(double J, double l, double K, double U) {
            	double tmp;
            	if (K <= 15.6) {
            		tmp = fma((2.0 * sinh(l)), J, U);
            	} else {
            		tmp = fma(l, (cos((K * 0.5)) * (J * fma(0.3333333333333333, (l * l), 2.0))), U);
            	}
            	return tmp;
            }
            
            function code(J, l, K, U)
            	tmp = 0.0
            	if (K <= 15.6)
            		tmp = fma(Float64(2.0 * sinh(l)), J, U);
            	else
            		tmp = fma(l, Float64(cos(Float64(K * 0.5)) * Float64(J * fma(0.3333333333333333, Float64(l * l), 2.0))), U);
            	end
            	return tmp
            end
            
            code[J_, l_, K_, U_] := If[LessEqual[K, 15.6], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(l * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(0.3333333333333333 * N[(l * l), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;K \leq 15.6:\\
            \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\ell, \cos \left(K \cdot 0.5\right) \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right), U\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if K < 15.5999999999999996

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                9. div-invN/A

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

                  \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                11. metadata-eval100.0

                  \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
              4. Applied egg-rr100.0%

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

                \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{1}, J, U\right) \]
              6. Step-by-step derivation
                1. Simplified87.4%

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

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

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

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
                  4. sinh-lowering-sinh.f6487.4

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
                3. Applied egg-rr87.4%

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

                if 15.5999999999999996 < K

                1. Initial program 84.2%

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

                  \[\leadsto \color{blue}{U + \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)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{\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) + U} \]
                  2. associate-*r*N/A

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

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

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

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

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

                    \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                  8. accelerator-lowering-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                5. Simplified86.0%

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

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

              Alternative 7: 87.2% accurate, 2.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{if}\;\ell \leq -1.6 \cdot 10^{-7}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 0.00056:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (let* ((t_0 (fma (* 2.0 (sinh l)) J U)))
                 (if (<= l -1.6e-7)
                   t_0
                   (if (<= l 0.00056) (fma (cos (* K 0.5)) (* J (* 2.0 l)) U) t_0))))
              double code(double J, double l, double K, double U) {
              	double t_0 = fma((2.0 * sinh(l)), J, U);
              	double tmp;
              	if (l <= -1.6e-7) {
              		tmp = t_0;
              	} else if (l <= 0.00056) {
              		tmp = fma(cos((K * 0.5)), (J * (2.0 * l)), U);
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(J, l, K, U)
              	t_0 = fma(Float64(2.0 * sinh(l)), J, U)
              	tmp = 0.0
              	if (l <= -1.6e-7)
              		tmp = t_0;
              	elseif (l <= 0.00056)
              		tmp = fma(cos(Float64(K * 0.5)), Float64(J * Float64(2.0 * l)), U);
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[J_, l_, K_, U_] := Block[{t$95$0 = N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]}, If[LessEqual[l, -1.6e-7], t$95$0, If[LessEqual[l, 0.00056], N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(J * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
              \mathbf{if}\;\ell \leq -1.6 \cdot 10^{-7}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;\ell \leq 0.00056:\\
              \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if l < -1.6e-7 or 5.5999999999999995e-4 < 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. Step-by-step derivation
                  1. associate-*l*N/A

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                  9. div-invN/A

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

                    \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                  11. metadata-eval100.0

                    \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                4. Applied egg-rr100.0%

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
                    4. sinh-lowering-sinh.f6476.1

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
                  3. Applied egg-rr76.1%

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

                  if -1.6e-7 < l < 5.5999999999999995e-4

                  1. Initial program 72.4%

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\cos \left(\frac{1}{2} \cdot K\right), J \cdot \color{blue}{\left(\ell \cdot 2\right)}, U\right) \]
                    12. *-lowering-*.f6499.9

                      \[\leadsto \mathsf{fma}\left(\cos \left(0.5 \cdot K\right), J \cdot \color{blue}{\left(\ell \cdot 2\right)}, U\right) \]
                  5. Simplified99.9%

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.6 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{elif}\;\ell \leq 0.00056:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right), J \cdot \left(2 \cdot \ell\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \]
                9. Add Preprocessing

                Alternative 8: 80.6% accurate, 2.9× speedup?

                \[\begin{array}{l} \\ \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right) \end{array} \]
                (FPCore (J l K U) :precision binary64 (fma (* 2.0 (sinh l)) J U))
                double code(double J, double l, double K, double U) {
                	return fma((2.0 * sinh(l)), J, U);
                }
                
                function code(J, l, K, U)
                	return fma(Float64(2.0 * sinh(l)), J, U)
                end
                
                code[J_, l_, K_, U_] := N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)
                \end{array}
                
                Derivation
                1. Initial program 87.0%

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                  9. div-invN/A

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

                    \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                  11. metadata-eval99.9

                    \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                4. Applied egg-rr99.9%

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
                    4. sinh-lowering-sinh.f6481.6

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell} \cdot 2, J, U\right) \]
                  3. Applied egg-rr81.6%

                    \[\leadsto \mathsf{fma}\left(\color{blue}{\sinh \ell \cdot 2}, J, U\right) \]
                  4. Final simplification81.6%

                    \[\leadsto \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right) \]
                  5. Add Preprocessing

                  Alternative 9: 77.3% accurate, 7.3× speedup?

                  \[\begin{array}{l} \\ \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), J, U\right) \end{array} \]
                  (FPCore (J l K U)
                   :precision binary64
                   (fma
                    (*
                     l
                     (fma
                      (* l l)
                      (fma
                       l
                       (* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
                       0.3333333333333333)
                      2.0))
                    J
                    U))
                  double code(double J, double l, double K, double U) {
                  	return fma((l * fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)), J, U);
                  }
                  
                  function code(J, l, K, U)
                  	return fma(Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0)), J, U)
                  end
                  
                  code[J_, l_, K_, U_] := N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), J, U\right)
                  \end{array}
                  
                  Derivation
                  1. Initial program 87.0%

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                    9. div-invN/A

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

                      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                    11. metadata-eval99.9

                      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                  4. Applied egg-rr99.9%

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

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

                      \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{1}, J, U\right) \]
                    2. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, \frac{1}{2520}, \frac{1}{60}\right), \frac{1}{3}\right), 2\right), J, U\right) \]
                      15. *-lowering-*.f6477.4

                        \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), J, U\right) \]
                    4. Simplified77.4%

                      \[\leadsto \mathsf{fma}\left(\color{blue}{\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right)}, J, U\right) \]
                    5. Add Preprocessing

                    Alternative 10: 71.5% accurate, 8.2× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -8 \cdot 10^{+61}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -2.1 \cdot 10^{+17}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell \cdot \ell, J \cdot 0.3333333333333333, 2 \cdot J\right), U\right)\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (if (<= l -8e+61)
                       (* J (* 0.3333333333333333 (* l (* l l))))
                       (if (<= l -2.1e+17)
                         (fma (* l (fma -0.25 (* K K) 2.0)) J U)
                         (fma l (fma (* l l) (* J 0.3333333333333333) (* 2.0 J)) U))))
                    double code(double J, double l, double K, double U) {
                    	double tmp;
                    	if (l <= -8e+61) {
                    		tmp = J * (0.3333333333333333 * (l * (l * l)));
                    	} else if (l <= -2.1e+17) {
                    		tmp = fma((l * fma(-0.25, (K * K), 2.0)), J, U);
                    	} else {
                    		tmp = fma(l, fma((l * l), (J * 0.3333333333333333), (2.0 * J)), U);
                    	}
                    	return tmp;
                    }
                    
                    function code(J, l, K, U)
                    	tmp = 0.0
                    	if (l <= -8e+61)
                    		tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))));
                    	elseif (l <= -2.1e+17)
                    		tmp = fma(Float64(l * fma(-0.25, Float64(K * K), 2.0)), J, U);
                    	else
                    		tmp = fma(l, fma(Float64(l * l), Float64(J * 0.3333333333333333), Float64(2.0 * J)), U);
                    	end
                    	return tmp
                    end
                    
                    code[J_, l_, K_, U_] := If[LessEqual[l, -8e+61], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -2.1e+17], N[(N[(l * N[(-0.25 * N[(K * K), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(l * N[(N[(l * l), $MachinePrecision] * N[(J * 0.3333333333333333), $MachinePrecision] + N[(2.0 * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;\ell \leq -8 \cdot 10^{+61}:\\
                    \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                    
                    \mathbf{elif}\;\ell \leq -2.1 \cdot 10^{+17}:\\
                    \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell \cdot \ell, J \cdot 0.3333333333333333, 2 \cdot J\right), U\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if l < -7.9999999999999996e61

                      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 \color{blue}{U + \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)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\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) + U} \]
                        2. associate-*r*N/A

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

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

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

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

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

                          \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                        8. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                      5. Simplified74.1%

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                        7. *-lowering-*.f6464.0

                          \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                      8. Simplified64.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                        16. *-lowering-*.f6473.1

                          \[\leadsto J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                      11. Simplified73.1%

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

                      if -7.9999999999999996e61 < l < -2.1e17

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                        9. div-invN/A

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

                          \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                        11. metadata-eval100.0

                          \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                      4. Applied egg-rr100.0%

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

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

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(2 \cdot \ell\right)} \cdot \cos \left(K \cdot 0.5\right), J, U\right) \]
                      7. Simplified15.3%

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\left(2 \cdot \ell\right)} \cdot \cos \left(K \cdot 0.5\right), J, U\right) \]
                      8. Taylor expanded in K around 0

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

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {K}^{2}\right) \cdot \ell} + 2 \cdot \ell, J, U\right) \]
                        2. distribute-rgt-outN/A

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

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

                          \[\leadsto \mathsf{fma}\left(\ell \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, {K}^{2}, 2\right)}, J, U\right) \]
                        5. unpow2N/A

                          \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{K \cdot K}, 2\right), J, U\right) \]
                        6. *-lowering-*.f6448.9

                          \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, \color{blue}{K \cdot K}, 2\right), J, U\right) \]
                      10. Simplified48.9%

                        \[\leadsto \mathsf{fma}\left(\color{blue}{\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right)}, J, U\right) \]

                      if -2.1e17 < l

                      1. Initial program 82.3%

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

                        \[\leadsto \color{blue}{U + \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)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\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) + U} \]
                        2. associate-*r*N/A

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

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

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

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

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

                          \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                        8. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                      5. Simplified88.2%

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                        7. *-lowering-*.f6474.1

                          \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                      8. Simplified74.1%

                        \[\leadsto \mathsf{fma}\left(\ell, \color{blue}{J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)}, U\right) \]
                      9. Step-by-step derivation
                        1. distribute-rgt-inN/A

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell \cdot \ell, \color{blue}{\frac{1}{3} \cdot J}, 2 \cdot J\right), U\right) \]
                        7. *-lowering-*.f6474.1

                          \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell \cdot \ell, 0.3333333333333333 \cdot J, \color{blue}{2 \cdot J}\right), U\right) \]
                      10. Applied egg-rr74.1%

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -8 \cdot 10^{+61}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -2.1 \cdot 10^{+17}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell \cdot \ell, J \cdot 0.3333333333333333, 2 \cdot J\right), U\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 11: 72.1% accurate, 8.5× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{if}\;\ell \leq -2.6 \cdot 10^{+29}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\ \;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\ \mathbf{elif}\;\ell \leq 2600000:\\ \;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (* J (* 0.3333333333333333 (* l (* l l))))))
                       (if (<= l -2.6e+29)
                         t_0
                         (if (<= l -3.7e+16)
                           (* (* l J) (* (* K K) -0.25))
                           (if (<= l 2600000.0) (fma 2.0 (* l J) U) t_0)))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = J * (0.3333333333333333 * (l * (l * l)));
                    	double tmp;
                    	if (l <= -2.6e+29) {
                    		tmp = t_0;
                    	} else if (l <= -3.7e+16) {
                    		tmp = (l * J) * ((K * K) * -0.25);
                    	} else if (l <= 2600000.0) {
                    		tmp = fma(2.0, (l * J), U);
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    function code(J, l, K, U)
                    	t_0 = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))))
                    	tmp = 0.0
                    	if (l <= -2.6e+29)
                    		tmp = t_0;
                    	elseif (l <= -3.7e+16)
                    		tmp = Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25));
                    	elseif (l <= 2600000.0)
                    		tmp = fma(2.0, Float64(l * J), U);
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -2.6e+29], t$95$0, If[LessEqual[l, -3.7e+16], N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 2600000.0], N[(2.0 * N[(l * J), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                    \mathbf{if}\;\ell \leq -2.6 \cdot 10^{+29}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\
                    \;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
                    
                    \mathbf{elif}\;\ell \leq 2600000:\\
                    \;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if l < -2.6e29 or 2.6e6 < 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 \color{blue}{U + \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)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\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) + U} \]
                        2. associate-*r*N/A

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

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

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

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

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

                          \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                        8. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                      5. Simplified70.3%

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                        7. *-lowering-*.f6454.7

                          \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                      8. Simplified54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                        16. *-lowering-*.f6459.3

                          \[\leadsto J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                      11. Simplified59.3%

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

                      if -2.6e29 < l < -3.7e16

                      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 \color{blue}{U + \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)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{\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) + U} \]
                        2. associate-*r*N/A

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

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

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

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

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

                          \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                        8. accelerator-lowering-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                      5. Simplified22.6%

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(\frac{-1}{8}, \color{blue}{K \cdot K}, 1\right) \cdot \left(J \cdot \mathsf{fma}\left(\frac{1}{3}, \ell \cdot \ell, 2\right)\right), U\right) \]
                        4. *-lowering-*.f64100.0

                          \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(-0.125, \color{blue}{K \cdot K}, 1\right) \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right), U\right) \]
                      8. Simplified100.0%

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

                        \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(\frac{-1}{8}, K \cdot K, 1\right) \cdot \left(J \cdot \color{blue}{2}\right), U\right) \]
                      10. Step-by-step derivation
                        1. Simplified100.0%

                          \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(-0.125, K \cdot K, 1\right) \cdot \left(J \cdot \color{blue}{2}\right), U\right) \]
                        2. Taylor expanded in K around inf

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \left(\ell \cdot J\right) \cdot \left(\frac{-1}{4} \cdot \color{blue}{\left(K \cdot K\right)}\right) \]
                          11. *-lowering-*.f64100.0

                            \[\leadsto \left(\ell \cdot J\right) \cdot \left(-0.25 \cdot \color{blue}{\left(K \cdot K\right)}\right) \]
                        4. Simplified100.0%

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

                        if -3.7e16 < l < 2.6e6

                        1. Initial program 73.7%

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

                          \[\leadsto \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified96.1%

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                          7. *-lowering-*.f6484.8

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                        8. Simplified84.8%

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

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

                            \[\leadsto \color{blue}{2 \cdot \left(J \cdot \ell\right) + U} \]
                          2. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, J \cdot \ell, U\right)} \]
                          3. *-lowering-*.f6484.7

                            \[\leadsto \mathsf{fma}\left(2, \color{blue}{J \cdot \ell}, U\right) \]
                        11. Simplified84.7%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.6 \cdot 10^{+29}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\ \;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\ \mathbf{elif}\;\ell \leq 2600000:\\ \;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \end{array} \]
                      13. Add Preprocessing

                      Alternative 12: 71.5% accurate, 9.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -1.28 \cdot 10^{+67}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), \ell \cdot J, U\right)\\ \end{array} \end{array} \]
                      (FPCore (J l K U)
                       :precision binary64
                       (if (<= l -1.28e+67)
                         (* J (* 0.3333333333333333 (* l (* l l))))
                         (if (<= l -3.7e+16)
                           (fma (* l (fma -0.25 (* K K) 2.0)) J U)
                           (fma (fma l (* l 0.3333333333333333) 2.0) (* l J) U))))
                      double code(double J, double l, double K, double U) {
                      	double tmp;
                      	if (l <= -1.28e+67) {
                      		tmp = J * (0.3333333333333333 * (l * (l * l)));
                      	} else if (l <= -3.7e+16) {
                      		tmp = fma((l * fma(-0.25, (K * K), 2.0)), J, U);
                      	} else {
                      		tmp = fma(fma(l, (l * 0.3333333333333333), 2.0), (l * J), U);
                      	}
                      	return tmp;
                      }
                      
                      function code(J, l, K, U)
                      	tmp = 0.0
                      	if (l <= -1.28e+67)
                      		tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))));
                      	elseif (l <= -3.7e+16)
                      		tmp = fma(Float64(l * fma(-0.25, Float64(K * K), 2.0)), J, U);
                      	else
                      		tmp = fma(fma(l, Float64(l * 0.3333333333333333), 2.0), Float64(l * J), U);
                      	end
                      	return tmp
                      end
                      
                      code[J_, l_, K_, U_] := If[LessEqual[l, -1.28e+67], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.7e+16], N[(N[(l * N[(-0.25 * N[(K * K), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision] + U), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\ell \leq -1.28 \cdot 10^{+67}:\\
                      \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                      
                      \mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\
                      \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), \ell \cdot J, U\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if l < -1.28e67

                        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 \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified74.1%

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                          7. *-lowering-*.f6464.0

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                        8. Simplified64.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                          16. *-lowering-*.f6473.1

                            \[\leadsto J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                        11. Simplified73.1%

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

                        if -1.28e67 < l < -3.7e16

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                          9. div-invN/A

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                          11. metadata-eval100.0

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                        4. Applied egg-rr100.0%

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

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(2 \cdot \ell\right)} \cdot \cos \left(K \cdot 0.5\right), J, U\right) \]
                        7. Simplified15.3%

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(2 \cdot \ell\right)} \cdot \cos \left(K \cdot 0.5\right), J, U\right) \]
                        8. Taylor expanded in K around 0

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {K}^{2}\right) \cdot \ell} + 2 \cdot \ell, J, U\right) \]
                          2. distribute-rgt-outN/A

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

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

                            \[\leadsto \mathsf{fma}\left(\ell \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, {K}^{2}, 2\right)}, J, U\right) \]
                          5. unpow2N/A

                            \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{K \cdot K}, 2\right), J, U\right) \]
                          6. *-lowering-*.f6448.9

                            \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, \color{blue}{K \cdot K}, 2\right), J, U\right) \]
                        10. Simplified48.9%

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right)}, J, U\right) \]

                        if -3.7e16 < l

                        1. Initial program 82.3%

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

                          \[\leadsto \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified88.2%

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
                          11. *-lowering-*.f6474.1

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), \color{blue}{J \cdot \ell}, U\right) \]
                        8. Simplified74.1%

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1.28 \cdot 10^{+67}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -3.7 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), \ell \cdot J, U\right)\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 13: 71.5% accurate, 9.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -7.2 \cdot 10^{+64}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -3.8 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\ \end{array} \end{array} \]
                      (FPCore (J l K U)
                       :precision binary64
                       (if (<= l -7.2e+64)
                         (* J (* 0.3333333333333333 (* l (* l l))))
                         (if (<= l -3.8e+16)
                           (fma (* l (fma -0.25 (* K K) 2.0)) J U)
                           (fma l (* J (fma l (* l 0.3333333333333333) 2.0)) U))))
                      double code(double J, double l, double K, double U) {
                      	double tmp;
                      	if (l <= -7.2e+64) {
                      		tmp = J * (0.3333333333333333 * (l * (l * l)));
                      	} else if (l <= -3.8e+16) {
                      		tmp = fma((l * fma(-0.25, (K * K), 2.0)), J, U);
                      	} else {
                      		tmp = fma(l, (J * fma(l, (l * 0.3333333333333333), 2.0)), U);
                      	}
                      	return tmp;
                      }
                      
                      function code(J, l, K, U)
                      	tmp = 0.0
                      	if (l <= -7.2e+64)
                      		tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))));
                      	elseif (l <= -3.8e+16)
                      		tmp = fma(Float64(l * fma(-0.25, Float64(K * K), 2.0)), J, U);
                      	else
                      		tmp = fma(l, Float64(J * fma(l, Float64(l * 0.3333333333333333), 2.0)), U);
                      	end
                      	return tmp
                      end
                      
                      code[J_, l_, K_, U_] := If[LessEqual[l, -7.2e+64], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -3.8e+16], N[(N[(l * N[(-0.25 * N[(K * K), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(l * N[(J * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\ell \leq -7.2 \cdot 10^{+64}:\\
                      \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                      
                      \mathbf{elif}\;\ell \leq -3.8 \cdot 10^{+16}:\\
                      \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right), J, U\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if l < -7.20000000000000027e64

                        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 \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified74.1%

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                          7. *-lowering-*.f6464.0

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                        8. Simplified64.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                          16. *-lowering-*.f6473.1

                            \[\leadsto J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                        11. Simplified73.1%

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

                        if -7.20000000000000027e64 < l < -3.8e16

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                          9. div-invN/A

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                          11. metadata-eval100.0

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                        4. Applied egg-rr100.0%

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

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(2 \cdot \ell\right)} \cdot \cos \left(K \cdot 0.5\right), J, U\right) \]
                        7. Simplified15.3%

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\left(2 \cdot \ell\right)} \cdot \cos \left(K \cdot 0.5\right), J, U\right) \]
                        8. Taylor expanded in K around 0

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

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{4} \cdot {K}^{2}\right) \cdot \ell} + 2 \cdot \ell, J, U\right) \]
                          2. distribute-rgt-outN/A

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

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

                            \[\leadsto \mathsf{fma}\left(\ell \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, {K}^{2}, 2\right)}, J, U\right) \]
                          5. unpow2N/A

                            \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\frac{-1}{4}, \color{blue}{K \cdot K}, 2\right), J, U\right) \]
                          6. *-lowering-*.f6448.9

                            \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(-0.25, \color{blue}{K \cdot K}, 2\right), J, U\right) \]
                        10. Simplified48.9%

                          \[\leadsto \mathsf{fma}\left(\color{blue}{\ell \cdot \mathsf{fma}\left(-0.25, K \cdot K, 2\right)}, J, U\right) \]

                        if -3.8e16 < l

                        1. Initial program 82.3%

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

                          \[\leadsto \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified88.2%

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                          7. *-lowering-*.f6474.1

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                        8. Simplified74.1%

                          \[\leadsto \mathsf{fma}\left(\ell, \color{blue}{J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)}, U\right) \]
                      3. Recombined 3 regimes into one program.
                      4. Add Preprocessing

                      Alternative 14: 71.2% accurate, 9.4× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{+29}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -5.2 \cdot 10^{+16}:\\ \;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\ \end{array} \end{array} \]
                      (FPCore (J l K U)
                       :precision binary64
                       (if (<= l -2e+29)
                         (* J (* 0.3333333333333333 (* l (* l l))))
                         (if (<= l -5.2e+16)
                           (* (* l J) (* (* K K) -0.25))
                           (fma l (* J (fma l (* l 0.3333333333333333) 2.0)) U))))
                      double code(double J, double l, double K, double U) {
                      	double tmp;
                      	if (l <= -2e+29) {
                      		tmp = J * (0.3333333333333333 * (l * (l * l)));
                      	} else if (l <= -5.2e+16) {
                      		tmp = (l * J) * ((K * K) * -0.25);
                      	} else {
                      		tmp = fma(l, (J * fma(l, (l * 0.3333333333333333), 2.0)), U);
                      	}
                      	return tmp;
                      }
                      
                      function code(J, l, K, U)
                      	tmp = 0.0
                      	if (l <= -2e+29)
                      		tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))));
                      	elseif (l <= -5.2e+16)
                      		tmp = Float64(Float64(l * J) * Float64(Float64(K * K) * -0.25));
                      	else
                      		tmp = fma(l, Float64(J * fma(l, Float64(l * 0.3333333333333333), 2.0)), U);
                      	end
                      	return tmp
                      end
                      
                      code[J_, l_, K_, U_] := If[LessEqual[l, -2e+29], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, -5.2e+16], N[(N[(l * J), $MachinePrecision] * N[(N[(K * K), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision], N[(l * N[(J * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\ell \leq -2 \cdot 10^{+29}:\\
                      \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                      
                      \mathbf{elif}\;\ell \leq -5.2 \cdot 10^{+16}:\\
                      \;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if l < -1.99999999999999983e29

                        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 \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified68.4%

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                          7. *-lowering-*.f6457.0

                            \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                        8. Simplified57.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                          16. *-lowering-*.f6464.4

                            \[\leadsto J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                        11. Simplified64.4%

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

                        if -1.99999999999999983e29 < l < -5.2e16

                        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 \color{blue}{U + \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)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{\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) + U} \]
                          2. associate-*r*N/A

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

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

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

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

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

                            \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                          8. accelerator-lowering-fma.f64N/A

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                        5. Simplified22.6%

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(\frac{-1}{8}, \color{blue}{K \cdot K}, 1\right) \cdot \left(J \cdot \mathsf{fma}\left(\frac{1}{3}, \ell \cdot \ell, 2\right)\right), U\right) \]
                          4. *-lowering-*.f64100.0

                            \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(-0.125, \color{blue}{K \cdot K}, 1\right) \cdot \left(J \cdot \mathsf{fma}\left(0.3333333333333333, \ell \cdot \ell, 2\right)\right), U\right) \]
                        8. Simplified100.0%

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

                          \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(\frac{-1}{8}, K \cdot K, 1\right) \cdot \left(J \cdot \color{blue}{2}\right), U\right) \]
                        10. Step-by-step derivation
                          1. Simplified100.0%

                            \[\leadsto \mathsf{fma}\left(\ell, \mathsf{fma}\left(-0.125, K \cdot K, 1\right) \cdot \left(J \cdot \color{blue}{2}\right), U\right) \]
                          2. Taylor expanded in K around inf

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \left(\ell \cdot J\right) \cdot \left(\frac{-1}{4} \cdot \color{blue}{\left(K \cdot K\right)}\right) \]
                            11. *-lowering-*.f64100.0

                              \[\leadsto \left(\ell \cdot J\right) \cdot \left(-0.25 \cdot \color{blue}{\left(K \cdot K\right)}\right) \]
                          4. Simplified100.0%

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

                          if -5.2e16 < l

                          1. Initial program 82.3%

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

                            \[\leadsto \color{blue}{U + \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)} \]
                          4. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \color{blue}{\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) + U} \]
                            2. associate-*r*N/A

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

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

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

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

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

                              \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                            8. accelerator-lowering-fma.f64N/A

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                          5. Simplified88.2%

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                            7. *-lowering-*.f6474.1

                              \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                          8. Simplified74.1%

                            \[\leadsto \mathsf{fma}\left(\ell, \color{blue}{J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)}, U\right) \]
                        11. Recombined 3 regimes into one program.
                        12. Final simplification72.2%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2 \cdot 10^{+29}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -5.2 \cdot 10^{+16}:\\ \;\;\;\;\left(\ell \cdot J\right) \cdot \left(\left(K \cdot K\right) \cdot -0.25\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), U\right)\\ \end{array} \]
                        13. Add Preprocessing

                        Alternative 15: 76.1% accurate, 9.7× speedup?

                        \[\begin{array}{l} \\ \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right) \end{array} \]
                        (FPCore (J l K U)
                         :precision binary64
                         (fma
                          (* l (fma (* l l) (fma (* l l) 0.016666666666666666 0.3333333333333333) 2.0))
                          J
                          U))
                        double code(double J, double l, double K, double U) {
                        	return fma((l * fma((l * l), fma((l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U);
                        }
                        
                        function code(J, l, K, U)
                        	return fma(Float64(l * fma(Float64(l * l), fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333), 2.0)), J, U)
                        end
                        
                        code[J_, l_, K_, U_] := N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 87.0%

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{\cos \left(\frac{K}{2}\right)}, J, U\right) \]
                          9. div-invN/A

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \color{blue}{\left(K \cdot \frac{1}{2}\right)}, J, U\right) \]
                          11. metadata-eval99.9

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \cos \left(K \cdot \color{blue}{0.5}\right), J, U\right) \]
                        4. Applied egg-rr99.9%

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

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

                            \[\leadsto \mathsf{fma}\left(\left(2 \cdot \sinh \ell\right) \cdot \color{blue}{1}, J, U\right) \]
                          2. Taylor expanded in l around 0

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\color{blue}{\ell \cdot \ell}, 0.016666666666666666, 0.3333333333333333\right), 2\right), J, U\right) \]
                          4. Simplified75.2%

                            \[\leadsto \mathsf{fma}\left(\color{blue}{\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right)}, J, U\right) \]
                          5. Add Preprocessing

                          Alternative 16: 72.1% accurate, 10.0× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{if}\;\ell \leq -9 \cdot 10^{+28}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 470000000:\\ \;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                          (FPCore (J l K U)
                           :precision binary64
                           (let* ((t_0 (* J (* 0.3333333333333333 (* l (* l l))))))
                             (if (<= l -9e+28) t_0 (if (<= l 470000000.0) (fma 2.0 (* l J) U) t_0))))
                          double code(double J, double l, double K, double U) {
                          	double t_0 = J * (0.3333333333333333 * (l * (l * l)));
                          	double tmp;
                          	if (l <= -9e+28) {
                          		tmp = t_0;
                          	} else if (l <= 470000000.0) {
                          		tmp = fma(2.0, (l * J), U);
                          	} else {
                          		tmp = t_0;
                          	}
                          	return tmp;
                          }
                          
                          function code(J, l, K, U)
                          	t_0 = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))))
                          	tmp = 0.0
                          	if (l <= -9e+28)
                          		tmp = t_0;
                          	elseif (l <= 470000000.0)
                          		tmp = fma(2.0, Float64(l * J), U);
                          	else
                          		tmp = t_0;
                          	end
                          	return tmp
                          end
                          
                          code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -9e+28], t$95$0, If[LessEqual[l, 470000000.0], N[(2.0 * N[(l * J), $MachinePrecision] + U), $MachinePrecision], t$95$0]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\
                          \mathbf{if}\;\ell \leq -9 \cdot 10^{+28}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;\ell \leq 470000000:\\
                          \;\;\;\;\mathsf{fma}\left(2, \ell \cdot J, U\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_0\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if l < -8.9999999999999994e28 or 4.7e8 < 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 \color{blue}{U + \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)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{\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) + U} \]
                              2. associate-*r*N/A

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

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

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

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

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

                                \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                              8. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                            5. Simplified70.3%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                              7. *-lowering-*.f6454.7

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                            8. Simplified54.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto J \cdot \left(\frac{1}{3} \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                              16. *-lowering-*.f6459.3

                                \[\leadsto J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right) \]
                            11. Simplified59.3%

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

                            if -8.9999999999999994e28 < l < 4.7e8

                            1. Initial program 74.7%

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

                              \[\leadsto \color{blue}{U + \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)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{\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) + U} \]
                              2. associate-*r*N/A

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

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

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

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

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

                                \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                              8. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                            5. Simplified93.3%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                              7. *-lowering-*.f6481.6

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                            8. Simplified81.6%

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

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

                                \[\leadsto \color{blue}{2 \cdot \left(J \cdot \ell\right) + U} \]
                              2. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, J \cdot \ell, U\right)} \]
                              3. *-lowering-*.f6481.5

                                \[\leadsto \mathsf{fma}\left(2, \color{blue}{J \cdot \ell}, U\right) \]
                            11. Simplified81.5%

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

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

                          Alternative 17: 44.6% accurate, 14.3× speedup?

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

                            1. Initial program 96.6%

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

                              \[\leadsto \color{blue}{U + \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)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{\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) + U} \]
                              2. associate-*r*N/A

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

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

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

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

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

                                \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                              8. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                            5. Simplified67.9%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                              7. *-lowering-*.f6451.7

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                            8. Simplified51.7%

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

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

                                \[\leadsto \color{blue}{2 \cdot \left(J \cdot \ell\right) + U} \]
                              2. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, J \cdot \ell, U\right)} \]
                              3. *-lowering-*.f6420.9

                                \[\leadsto \mathsf{fma}\left(2, \color{blue}{J \cdot \ell}, U\right) \]
                            11. Simplified20.9%

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

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

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

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

                                \[\leadsto 2 \cdot \color{blue}{\left(\ell \cdot J\right)} \]
                            14. Simplified19.7%

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

                            if -1.6e-7 < l < 6.2000000000000005e-42

                            1. Initial program 75.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 J around 0

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

                                \[\leadsto \color{blue}{U} \]
                            5. Recombined 2 regimes into one program.
                            6. Add Preprocessing

                            Alternative 18: 53.5% accurate, 27.5× speedup?

                            \[\begin{array}{l} \\ \mathsf{fma}\left(2, \ell \cdot J, U\right) \end{array} \]
                            (FPCore (J l K U) :precision binary64 (fma 2.0 (* l J) U))
                            double code(double J, double l, double K, double U) {
                            	return fma(2.0, (l * J), U);
                            }
                            
                            function code(J, l, K, U)
                            	return fma(2.0, Float64(l * J), U)
                            end
                            
                            code[J_, l_, K_, U_] := N[(2.0 * N[(l * J), $MachinePrecision] + U), $MachinePrecision]
                            
                            \begin{array}{l}
                            
                            \\
                            \mathsf{fma}\left(2, \ell \cdot J, U\right)
                            \end{array}
                            
                            Derivation
                            1. Initial program 87.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 \color{blue}{U + \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)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{\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) + U} \]
                              2. associate-*r*N/A

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

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

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

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

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

                                \[\leadsto \ell \cdot \left({\ell}^{2} \cdot \color{blue}{\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) + U \]
                              8. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(\ell, {\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), U\right)} \]
                            5. Simplified82.0%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \color{blue}{\mathsf{fma}\left(\ell, \ell \cdot \frac{1}{3}, 2\right)}, U\right) \]
                              7. *-lowering-*.f6468.5

                                \[\leadsto \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right), U\right) \]
                            8. Simplified68.5%

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

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

                                \[\leadsto \color{blue}{2 \cdot \left(J \cdot \ell\right) + U} \]
                              2. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(2, J \cdot \ell, U\right)} \]
                              3. *-lowering-*.f6451.2

                                \[\leadsto \mathsf{fma}\left(2, \color{blue}{J \cdot \ell}, U\right) \]
                            11. Simplified51.2%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(2, J \cdot \ell, U\right)} \]
                            12. Final simplification51.2%

                              \[\leadsto \mathsf{fma}\left(2, \ell \cdot J, U\right) \]
                            13. Add Preprocessing

                            Alternative 19: 36.3% accurate, 330.0× speedup?

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

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

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

                              Reproduce

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