Maksimov and Kolovsky, Equation (4)

Percentage Accurate: 85.9% → 99.9%
Time: 15.0s
Alternatives: 22
Speedup: 2.1×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 85.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 83.4%

    \[\left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. 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: 45.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 2 \cdot \left(\ell \cdot J\right)\\ t_1 := \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-59}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-158}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (J l K U)
 :precision binary64
 (let* ((t_0 (* 2.0 (* l J)))
        (t_1 (* (cos (/ K 2.0)) (* J (- (exp l) (exp (- l)))))))
   (if (<= t_1 -1e-59) t_0 (if (<= t_1 4e-158) U t_0))))
double code(double J, double l, double K, double U) {
	double t_0 = 2.0 * (l * J);
	double t_1 = cos((K / 2.0)) * (J * (exp(l) - exp(-l)));
	double tmp;
	if (t_1 <= -1e-59) {
		tmp = t_0;
	} else if (t_1 <= 4e-158) {
		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) :: t_1
    real(8) :: tmp
    t_0 = 2.0d0 * (l * j)
    t_1 = cos((k / 2.0d0)) * (j * (exp(l) - exp(-l)))
    if (t_1 <= (-1d-59)) then
        tmp = t_0
    else if (t_1 <= 4d-158) 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 t_1 = Math.cos((K / 2.0)) * (J * (Math.exp(l) - Math.exp(-l)));
	double tmp;
	if (t_1 <= -1e-59) {
		tmp = t_0;
	} else if (t_1 <= 4e-158) {
		tmp = U;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(J, l, K, U):
	t_0 = 2.0 * (l * J)
	t_1 = math.cos((K / 2.0)) * (J * (math.exp(l) - math.exp(-l)))
	tmp = 0
	if t_1 <= -1e-59:
		tmp = t_0
	elif t_1 <= 4e-158:
		tmp = U
	else:
		tmp = t_0
	return tmp
function code(J, l, K, U)
	t_0 = Float64(2.0 * Float64(l * J))
	t_1 = Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(exp(l) - exp(Float64(-l)))))
	tmp = 0.0
	if (t_1 <= -1e-59)
		tmp = t_0;
	elseif (t_1 <= 4e-158)
		tmp = U;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(J, l, K, U)
	t_0 = 2.0 * (l * J);
	t_1 = cos((K / 2.0)) * (J * (exp(l) - exp(-l)));
	tmp = 0.0;
	if (t_1 <= -1e-59)
		tmp = t_0;
	elseif (t_1 <= 4e-158)
		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]}, Block[{t$95$1 = N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-59], t$95$0, If[LessEqual[t$95$1, 4e-158], U, t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 2 \cdot \left(\ell \cdot J\right)\\
t_1 := \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-59}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-158}:\\
\;\;\;\;U\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) (cos.f64 (/.f64 K #s(literal 2 binary64)))) < -1e-59 or 4.00000000000000026e-158 < (*.f64 (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) (cos.f64 (/.f64 K #s(literal 2 binary64))))

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
      12. *-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) \]
      13. *-lowering-*.f6453.5

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, 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-*.f6426.5

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

      \[\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. *-lowering-*.f6426.5

        \[\leadsto 2 \cdot \color{blue}{\left(J \cdot \ell\right)} \]
    14. Simplified26.5%

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

    if -1e-59 < (*.f64 (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) (cos.f64 (/.f64 K #s(literal 2 binary64)))) < 4.00000000000000026e-158

    1. Initial program 70.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 J around 0

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \leq -1 \cdot 10^{-59}:\\ \;\;\;\;2 \cdot \left(\ell \cdot J\right)\\ \mathbf{elif}\;\cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(e^{\ell} - e^{-\ell}\right)\right) \leq 4 \cdot 10^{-158}:\\ \;\;\;\;U\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\ell \cdot J\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 70.7% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := J \cdot \left(e^{\ell} - e^{-\ell}\right)\\ \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-59}:\\ \;\;\;\;J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)\right)\\ \mathbf{elif}\;t\_0 \leq 10^{+186}:\\ \;\;\;\;\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} \end{array} \]
    (FPCore (J l K U)
     :precision binary64
     (let* ((t_0 (* J (- (exp l) (exp (- l))))))
       (if (<= t_0 -1e-59)
         (* J (* l (fma l (* l 0.3333333333333333) 2.0)))
         (if (<= t_0 1e+186)
           (fma 2.0 (* l J) U)
           (* J (* 0.3333333333333333 (* l (* l l))))))))
    double code(double J, double l, double K, double U) {
    	double t_0 = J * (exp(l) - exp(-l));
    	double tmp;
    	if (t_0 <= -1e-59) {
    		tmp = J * (l * fma(l, (l * 0.3333333333333333), 2.0));
    	} else if (t_0 <= 1e+186) {
    		tmp = fma(2.0, (l * J), U);
    	} else {
    		tmp = J * (0.3333333333333333 * (l * (l * l)));
    	}
    	return tmp;
    }
    
    function code(J, l, K, U)
    	t_0 = Float64(J * Float64(exp(l) - exp(Float64(-l))))
    	tmp = 0.0
    	if (t_0 <= -1e-59)
    		tmp = Float64(J * Float64(l * fma(l, Float64(l * 0.3333333333333333), 2.0)));
    	elseif (t_0 <= 1e+186)
    		tmp = fma(2.0, Float64(l * J), U);
    	else
    		tmp = Float64(J * Float64(0.3333333333333333 * Float64(l * Float64(l * l))));
    	end
    	return tmp
    end
    
    code[J_, l_, K_, U_] := Block[{t$95$0 = N[(J * N[(N[Exp[l], $MachinePrecision] - N[Exp[(-l)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1e-59], N[(J * N[(l * N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1e+186], N[(2.0 * N[(l * J), $MachinePrecision] + U), $MachinePrecision], N[(J * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := J \cdot \left(e^{\ell} - e^{-\ell}\right)\\
    \mathbf{if}\;t\_0 \leq -1 \cdot 10^{-59}:\\
    \;\;\;\;J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)\right)\\
    
    \mathbf{elif}\;t\_0 \leq 10^{+186}:\\
    \;\;\;\;\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}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) < -1e-59

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(\ell \cdot \mathsf{fma}\left(\ell, \color{blue}{\ell \cdot 0.3333333333333333}, 2\right)\right)\right) \]
      8. Simplified66.4%

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

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

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

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

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

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

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

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

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

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

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

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

      if -1e-59 < (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 l)))) < 9.9999999999999998e185

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
        12. *-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) \]
        13. *-lowering-*.f6484.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, 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.0

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

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

      if 9.9999999999999998e185 < (*.f64 J (-.f64 (exp.f64 l) (exp.f64 (neg.f64 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 \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. unpow2N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
        12. *-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) \]
        13. *-lowering-*.f6450.5

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, 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-*r*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-*r*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-*.f6457.3

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;J \cdot \left(e^{\ell} - e^{-\ell}\right) \leq -1 \cdot 10^{-59}:\\ \;\;\;\;J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right)\right)\\ \mathbf{elif}\;J \cdot \left(e^{\ell} - e^{-\ell}\right) \leq 10^{+186}:\\ \;\;\;\;\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 4: 93.8% accurate, 1.3× speedup?

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

      1. Initial program 80.8%

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

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

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

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

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

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

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

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

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

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

      1. Initial program 84.6%

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

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

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

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

      Alternative 5: 92.9% accurate, 1.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.12:\\ \;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \end{array} \]
      (FPCore (J l K U)
       :precision binary64
       (if (<= (cos (/ K 2.0)) 0.12)
         (fma l (* (fma l (* l 0.3333333333333333) 2.0) (* J (cos (* K 0.5)))) U)
         (fma (* 2.0 (sinh l)) J U)))
      double code(double J, double l, double K, double U) {
      	double tmp;
      	if (cos((K / 2.0)) <= 0.12) {
      		tmp = fma(l, (fma(l, (l * 0.3333333333333333), 2.0) * (J * cos((K * 0.5)))), U);
      	} else {
      		tmp = fma((2.0 * sinh(l)), J, U);
      	}
      	return tmp;
      }
      
      function code(J, l, K, U)
      	tmp = 0.0
      	if (cos(Float64(K / 2.0)) <= 0.12)
      		tmp = fma(l, Float64(fma(l, Float64(l * 0.3333333333333333), 2.0) * Float64(J * cos(Float64(K * 0.5)))), U);
      	else
      		tmp = fma(Float64(2.0 * sinh(l)), J, U);
      	end
      	return tmp
      end
      
      code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], 0.12], N[(l * N[(N[(l * N[(l * 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(J * N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq 0.12:\\
      \;\;\;\;\mathsf{fma}\left(\ell, \mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right) \cdot \left(J \cdot \cos \left(K \cdot 0.5\right)\right), U\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.12

        1. Initial program 80.8%

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

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

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

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

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

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

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

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

        1. Initial program 84.6%

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

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

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

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

        Alternative 6: 87.7% accurate, 1.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\ \;\;\;\;\mathsf{fma}\left(2, \cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot J\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \end{array} \]
        (FPCore (J l K U)
         :precision binary64
         (if (<= (cos (/ K 2.0)) -0.01)
           (fma 2.0 (* (cos (* K 0.5)) (* l J)) U)
           (fma (* 2.0 (sinh l)) J U)))
        double code(double J, double l, double K, double U) {
        	double tmp;
        	if (cos((K / 2.0)) <= -0.01) {
        		tmp = fma(2.0, (cos((K * 0.5)) * (l * J)), U);
        	} else {
        		tmp = fma((2.0 * sinh(l)), J, U);
        	}
        	return tmp;
        }
        
        function code(J, l, K, U)
        	tmp = 0.0
        	if (cos(Float64(K / 2.0)) <= -0.01)
        		tmp = fma(2.0, Float64(cos(Float64(K * 0.5)) * Float64(l * J)), U);
        	else
        		tmp = fma(Float64(2.0 * sinh(l)), J, U);
        	end
        	return tmp
        end
        
        code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.01], N[(2.0 * N[(N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision] * N[(l * J), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\
        \;\;\;\;\mathsf{fma}\left(2, \cos \left(K \cdot 0.5\right) \cdot \left(\ell \cdot J\right), U\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.0100000000000000002

          1. Initial program 81.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 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)} \]
          6. 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. accelerator-lowering-fma.f64N/A

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

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

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

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

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

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

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

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

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

          1. Initial program 84.3%

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

              \[\leadsto \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. Simplified94.9%

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

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

          Alternative 7: 87.2% accurate, 1.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\ \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), K \cdot \left(K \cdot \mathsf{fma}\left(J, -0.125, \frac{J}{K \cdot K}\right)\right), U\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \end{array} \end{array} \]
          (FPCore (J l K U)
           :precision binary64
           (if (<= (cos (/ K 2.0)) -0.01)
             (fma
              (*
               l
               (fma
                (* l l)
                (fma
                 l
                 (* l (fma l (* l 0.0003968253968253968) 0.016666666666666666))
                 0.3333333333333333)
                2.0))
              (* K (* K (fma J -0.125 (/ J (* K K)))))
              U)
             (fma (* 2.0 (sinh l)) J U)))
          double code(double J, double l, double K, double U) {
          	double tmp;
          	if (cos((K / 2.0)) <= -0.01) {
          		tmp = fma((l * fma((l * l), fma(l, (l * fma(l, (l * 0.0003968253968253968), 0.016666666666666666)), 0.3333333333333333), 2.0)), (K * (K * fma(J, -0.125, (J / (K * K))))), U);
          	} else {
          		tmp = fma((2.0 * sinh(l)), J, U);
          	}
          	return tmp;
          }
          
          function code(J, l, K, U)
          	tmp = 0.0
          	if (cos(Float64(K / 2.0)) <= -0.01)
          		tmp = fma(Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(l, Float64(l * 0.0003968253968253968), 0.016666666666666666)), 0.3333333333333333), 2.0)), Float64(K * Float64(K * fma(J, -0.125, Float64(J / Float64(K * K))))), U);
          	else
          		tmp = fma(Float64(2.0 * sinh(l)), J, U);
          	end
          	return tmp
          end
          
          code[J_, l_, K_, U_] := If[LessEqual[N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision], -0.01], N[(N[(l * N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * N[(l * N[(l * 0.0003968253968253968), $MachinePrecision] + 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] * N[(K * N[(K * N[(J * -0.125 + N[(J / N[(K * K), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\cos \left(\frac{K}{2}\right) \leq -0.01:\\
          \;\;\;\;\mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), K \cdot \left(K \cdot \mathsf{fma}\left(J, -0.125, \frac{J}{K \cdot K}\right)\right), U\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.0100000000000000002

            1. Initial program 81.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 \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-*.f6495.6

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

              \[\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 \]
            6. Taylor expanded in K around 0

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

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

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

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

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

                \[\leadsto \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right) \cdot \color{blue}{\left(J + \left(\frac{-1}{8} \cdot J\right) \cdot {K}^{2}\right)} + U \]
            8. Simplified47.8%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), \left(\mathsf{fma}\left(J, -0.125, \frac{J}{\color{blue}{K \cdot K}}\right) \cdot K\right) \cdot K, U\right) \]
            11. Simplified52.6%

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

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

            1. Initial program 84.3%

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

                \[\leadsto \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. Simplified94.9%

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

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

            Alternative 8: 99.9% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 9: 82.9% accurate, 1.7× speedup?

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

              1. Initial program 81.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 \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-*.f6495.6

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

                \[\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 \]
              6. Taylor expanded in K around 0

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

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

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

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

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

                  \[\leadsto \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right) \cdot \color{blue}{\left(J + \left(\frac{-1}{8} \cdot J\right) \cdot {K}^{2}\right)} + U \]
              8. Simplified47.8%

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{fma}\left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), \left(\mathsf{fma}\left(J, -0.125, \frac{J}{\color{blue}{K \cdot K}}\right) \cdot K\right) \cdot K, U\right) \]
              11. Simplified52.6%

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

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

              1. Initial program 84.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.5

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

                \[\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 \]
              6. Taylor expanded in K around 0

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

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

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

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

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

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

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

            Alternative 10: 88.2% accurate, 1.8× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 10^{-69}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;U + \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) \cdot \cos \left(\frac{K}{2}\right)\\ \end{array} \end{array} \]
            (FPCore (J l K U)
             :precision binary64
             (if (<= (/ K 2.0) 1e-69)
               (fma (* 2.0 (sinh l)) J U)
               (+
                U
                (*
                 (*
                  J
                  (*
                   l
                   (fma
                    (* l l)
                    (fma
                     l
                     (* l (fma (* l l) 0.0003968253968253968 0.016666666666666666))
                     0.3333333333333333)
                    2.0)))
                 (cos (/ K 2.0))))))
            double code(double J, double l, double K, double U) {
            	double tmp;
            	if ((K / 2.0) <= 1e-69) {
            		tmp = fma((2.0 * sinh(l)), J, U);
            	} else {
            		tmp = U + ((J * (l * fma((l * l), fma(l, (l * fma((l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0))) * cos((K / 2.0)));
            	}
            	return tmp;
            }
            
            function code(J, l, K, U)
            	tmp = 0.0
            	if (Float64(K / 2.0) <= 1e-69)
            		tmp = fma(Float64(2.0 * sinh(l)), J, U);
            	else
            		tmp = Float64(U + Float64(Float64(J * Float64(l * fma(Float64(l * l), fma(l, Float64(l * fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666)), 0.3333333333333333), 2.0))) * cos(Float64(K / 2.0))));
            	end
            	return tmp
            end
            
            code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 1e-69], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(U + N[(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] * N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;\frac{K}{2} \leq 10^{-69}:\\
            \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;U + \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) \cdot \cos \left(\frac{K}{2}\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 K #s(literal 2 binary64)) < 9.9999999999999996e-70

              1. Initial program 81.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-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) \]

                if 9.9999999999999996e-70 < (/.f64 K #s(literal 2 binary64))

                1. Initial program 86.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 \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.4

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

                  \[\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 \]
              7. Recombined 2 regimes into one program.
              8. Final simplification90.3%

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

              Alternative 11: 87.4% accurate, 2.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{K}{2} \leq 10^{-69}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right)\right)\right)\\ \end{array} \end{array} \]
              (FPCore (J l K U)
               :precision binary64
               (if (<= (/ K 2.0) 1e-69)
                 (fma (* 2.0 (sinh l)) J U)
                 (+
                  U
                  (*
                   (cos (/ K 2.0))
                   (*
                    J
                    (*
                     l
                     (fma
                      (* l l)
                      (fma (* l l) 0.016666666666666666 0.3333333333333333)
                      2.0)))))))
              double code(double J, double l, double K, double U) {
              	double tmp;
              	if ((K / 2.0) <= 1e-69) {
              		tmp = fma((2.0 * sinh(l)), J, U);
              	} else {
              		tmp = U + (cos((K / 2.0)) * (J * (l * fma((l * l), fma((l * l), 0.016666666666666666, 0.3333333333333333), 2.0))));
              	}
              	return tmp;
              }
              
              function code(J, l, K, U)
              	tmp = 0.0
              	if (Float64(K / 2.0) <= 1e-69)
              		tmp = fma(Float64(2.0 * sinh(l)), J, U);
              	else
              		tmp = Float64(U + Float64(cos(Float64(K / 2.0)) * Float64(J * Float64(l * fma(Float64(l * l), fma(Float64(l * l), 0.016666666666666666, 0.3333333333333333), 2.0)))));
              	end
              	return tmp
              end
              
              code[J_, l_, K_, U_] := If[LessEqual[N[(K / 2.0), $MachinePrecision], 1e-69], N[(N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], N[(U + N[(N[Cos[N[(K / 2.0), $MachinePrecision]], $MachinePrecision] * N[(J * N[(l * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.016666666666666666 + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\frac{K}{2} \leq 10^{-69}:\\
              \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;U + \cos \left(\frac{K}{2}\right) \cdot \left(J \cdot \left(\ell \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.016666666666666666, 0.3333333333333333\right), 2\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (/.f64 K #s(literal 2 binary64)) < 9.9999999999999996e-70

                1. Initial program 81.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-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) \]

                  if 9.9999999999999996e-70 < (/.f64 K #s(literal 2 binary64))

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

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

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

                      \[\leadsto \left(J \cdot \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)\right)\right) \cdot \cos \left(\frac{K}{2}\right) + U \]
                    10. *-lowering-*.f6495.2

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

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

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

                Alternative 12: 95.4% accurate, 2.1× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \cos \left(K \cdot 0.5\right)\\ t_1 := J \cdot \left(t\_0 \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\ t_2 := 2 \cdot \sinh \ell\\ \mathbf{if}\;\ell \leq -1 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;\ell \leq -0.003:\\ \;\;\;\;U + \frac{J}{\frac{1}{t\_2}}\\ \mathbf{elif}\;\ell \leq 0.00043:\\ \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \left(2 \cdot \ell\right), J, U\right)\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;\mathsf{fma}\left(t\_2, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                (FPCore (J l K U)
                 :precision binary64
                 (let* ((t_0 (cos (* K 0.5)))
                        (t_1 (* J (* t_0 (* 0.3333333333333333 (* l (* l l))))))
                        (t_2 (* 2.0 (sinh l))))
                   (if (<= l -1e+113)
                     t_1
                     (if (<= l -0.003)
                       (+ U (/ J (/ 1.0 t_2)))
                       (if (<= l 0.00043)
                         (fma (* t_0 (* 2.0 l)) J U)
                         (if (<= l 5.5e+102) (fma t_2 J U) t_1))))))
                double code(double J, double l, double K, double U) {
                	double t_0 = cos((K * 0.5));
                	double t_1 = J * (t_0 * (0.3333333333333333 * (l * (l * l))));
                	double t_2 = 2.0 * sinh(l);
                	double tmp;
                	if (l <= -1e+113) {
                		tmp = t_1;
                	} else if (l <= -0.003) {
                		tmp = U + (J / (1.0 / t_2));
                	} else if (l <= 0.00043) {
                		tmp = fma((t_0 * (2.0 * l)), J, U);
                	} else if (l <= 5.5e+102) {
                		tmp = fma(t_2, J, U);
                	} else {
                		tmp = t_1;
                	}
                	return tmp;
                }
                
                function code(J, l, K, U)
                	t_0 = cos(Float64(K * 0.5))
                	t_1 = Float64(J * Float64(t_0 * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))))
                	t_2 = Float64(2.0 * sinh(l))
                	tmp = 0.0
                	if (l <= -1e+113)
                		tmp = t_1;
                	elseif (l <= -0.003)
                		tmp = Float64(U + Float64(J / Float64(1.0 / t_2)));
                	elseif (l <= 0.00043)
                		tmp = fma(Float64(t_0 * Float64(2.0 * l)), J, U);
                	elseif (l <= 5.5e+102)
                		tmp = fma(t_2, J, U);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                code[J_, l_, K_, U_] := Block[{t$95$0 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(J * N[(t$95$0 * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[Sinh[l], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -1e+113], t$95$1, If[LessEqual[l, -0.003], N[(U + N[(J / N[(1.0 / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[l, 0.00043], N[(N[(t$95$0 * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, 5.5e+102], N[(t$95$2 * J + U), $MachinePrecision], t$95$1]]]]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \cos \left(K \cdot 0.5\right)\\
                t_1 := J \cdot \left(t\_0 \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
                t_2 := 2 \cdot \sinh \ell\\
                \mathbf{if}\;\ell \leq -1 \cdot 10^{+113}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;\ell \leq -0.003:\\
                \;\;\;\;U + \frac{J}{\frac{1}{t\_2}}\\
                
                \mathbf{elif}\;\ell \leq 0.00043:\\
                \;\;\;\;\mathsf{fma}\left(t\_0 \cdot \left(2 \cdot \ell\right), J, U\right)\\
                
                \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+102}:\\
                \;\;\;\;\mathsf{fma}\left(t\_2, J, U\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 4 regimes
                2. if l < -1e113 or 5.49999999999999981e102 < 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 \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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right)\right) \]
                  11. Simplified100.0%

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

                  if -1e113 < l < -0.0030000000000000001

                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{J \cdot \cos \left(K \cdot \frac{1}{2}\right)}{\color{blue}{\frac{1}{\frac{e^{\ell} \cdot e^{\ell} - e^{\mathsf{neg}\left(\ell\right)} \cdot e^{\mathsf{neg}\left(\ell\right)}}{e^{\ell} + e^{\mathsf{neg}\left(\ell\right)}}}}} + U \]
                  4. Applied egg-rr100.0%

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

                    \[\leadsto \frac{\color{blue}{J}}{\frac{1}{2 \cdot \sinh \ell}} + U \]
                  6. Step-by-step derivation
                    1. Simplified80.8%

                      \[\leadsto \frac{\color{blue}{J}}{\frac{1}{2 \cdot \sinh \ell}} + U \]

                    if -0.0030000000000000001 < l < 4.29999999999999989e-4

                    1. Initial program 70.0%

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

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

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

                    if 4.29999999999999989e-4 < l < 5.49999999999999981e102

                    1. Initial program 99.5%

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

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

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -1 \cdot 10^{+113}:\\ \;\;\;\;J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -0.003:\\ \;\;\;\;U + \frac{J}{\frac{1}{2 \cdot \sinh \ell}}\\ \mathbf{elif}\;\ell \leq 0.00043:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot \ell\right), J, U\right)\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\ \end{array} \]
                    9. Add Preprocessing

                    Alternative 13: 95.4% accurate, 2.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ t_1 := \cos \left(K \cdot 0.5\right)\\ t_2 := J \cdot \left(t\_1 \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\ \mathbf{if}\;\ell \leq -4.8 \cdot 10^{+112}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;\ell \leq -0.00037:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 8.8 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(2 \cdot \ell\right), J, U\right)\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
                    (FPCore (J l K U)
                     :precision binary64
                     (let* ((t_0 (fma (* 2.0 (sinh l)) J U))
                            (t_1 (cos (* K 0.5)))
                            (t_2 (* J (* t_1 (* 0.3333333333333333 (* l (* l l)))))))
                       (if (<= l -4.8e+112)
                         t_2
                         (if (<= l -0.00037)
                           t_0
                           (if (<= l 8.8e-5)
                             (fma (* t_1 (* 2.0 l)) J U)
                             (if (<= l 5.5e+102) t_0 t_2))))))
                    double code(double J, double l, double K, double U) {
                    	double t_0 = fma((2.0 * sinh(l)), J, U);
                    	double t_1 = cos((K * 0.5));
                    	double t_2 = J * (t_1 * (0.3333333333333333 * (l * (l * l))));
                    	double tmp;
                    	if (l <= -4.8e+112) {
                    		tmp = t_2;
                    	} else if (l <= -0.00037) {
                    		tmp = t_0;
                    	} else if (l <= 8.8e-5) {
                    		tmp = fma((t_1 * (2.0 * l)), J, U);
                    	} else if (l <= 5.5e+102) {
                    		tmp = t_0;
                    	} else {
                    		tmp = t_2;
                    	}
                    	return tmp;
                    }
                    
                    function code(J, l, K, U)
                    	t_0 = fma(Float64(2.0 * sinh(l)), J, U)
                    	t_1 = cos(Float64(K * 0.5))
                    	t_2 = Float64(J * Float64(t_1 * Float64(0.3333333333333333 * Float64(l * Float64(l * l)))))
                    	tmp = 0.0
                    	if (l <= -4.8e+112)
                    		tmp = t_2;
                    	elseif (l <= -0.00037)
                    		tmp = t_0;
                    	elseif (l <= 8.8e-5)
                    		tmp = fma(Float64(t_1 * Float64(2.0 * l)), J, U);
                    	elseif (l <= 5.5e+102)
                    		tmp = t_0;
                    	else
                    		tmp = t_2;
                    	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]}, Block[{t$95$1 = N[Cos[N[(K * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(J * N[(t$95$1 * N[(0.3333333333333333 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[l, -4.8e+112], t$95$2, If[LessEqual[l, -0.00037], t$95$0, If[LessEqual[l, 8.8e-5], N[(N[(t$95$1 * N[(2.0 * l), $MachinePrecision]), $MachinePrecision] * J + U), $MachinePrecision], If[LessEqual[l, 5.5e+102], t$95$0, t$95$2]]]]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\
                    t_1 := \cos \left(K \cdot 0.5\right)\\
                    t_2 := J \cdot \left(t\_1 \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\
                    \mathbf{if}\;\ell \leq -4.8 \cdot 10^{+112}:\\
                    \;\;\;\;t\_2\\
                    
                    \mathbf{elif}\;\ell \leq -0.00037:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;\ell \leq 8.8 \cdot 10^{-5}:\\
                    \;\;\;\;\mathsf{fma}\left(t\_1 \cdot \left(2 \cdot \ell\right), J, U\right)\\
                    
                    \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+102}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_2\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if l < -4.8e112 or 5.49999999999999981e102 < 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 \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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \color{blue}{\left(\ell \cdot \ell\right)}\right)\right)\right) \]
                      11. Simplified100.0%

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

                      if -4.8e112 < l < -3.6999999999999999e-4 or 8.7999999999999998e-5 < l < 5.49999999999999981e102

                      1. Initial program 99.7%

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

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

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

                        if -3.6999999999999999e-4 < l < 8.7999999999999998e-5

                        1. Initial program 70.0%

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -4.8 \cdot 10^{+112}:\\ \;\;\;\;J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\ \mathbf{elif}\;\ell \leq -0.00037:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{elif}\;\ell \leq 8.8 \cdot 10^{-5}:\\ \;\;\;\;\mathsf{fma}\left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot \ell\right), J, U\right)\\ \mathbf{elif}\;\ell \leq 5.5 \cdot 10^{+102}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\right)\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 14: 79.5% accurate, 2.6× speedup?

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

                        1. Initial program 87.1%

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

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

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

                          if 1.8500000000000001e148 < J

                          1. Initial program 58.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto J \cdot \left(\cos \left(\frac{1}{2} \cdot K\right) \cdot \left(\ell \cdot \color{blue}{2}\right)\right) \]
                          10. Step-by-step derivation
                            1. Simplified91.3%

                              \[\leadsto J \cdot \left(\cos \left(0.5 \cdot K\right) \cdot \left(\ell \cdot \color{blue}{2}\right)\right) \]
                          11. Recombined 2 regimes into one program.
                          12. Final simplification85.2%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;J \leq 1.85 \cdot 10^{+148}:\\ \;\;\;\;\mathsf{fma}\left(2 \cdot \sinh \ell, J, U\right)\\ \mathbf{else}:\\ \;\;\;\;J \cdot \left(\cos \left(K \cdot 0.5\right) \cdot \left(2 \cdot \ell\right)\right)\\ \end{array} \]
                          13. Add Preprocessing

                          Alternative 15: 75.9% accurate, 7.3× speedup?

                          \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), \ell \cdot J, U\right) \end{array} \]
                          (FPCore (J l K U)
                           :precision binary64
                           (fma
                            (fma
                             (* l l)
                             (fma
                              l
                              (* l (fma l (* l 0.0003968253968253968) 0.016666666666666666))
                              0.3333333333333333)
                             2.0)
                            (* l J)
                            U))
                          double code(double J, double l, double K, double U) {
                          	return fma(fma((l * l), fma(l, (l * fma(l, (l * 0.0003968253968253968), 0.016666666666666666)), 0.3333333333333333), 2.0), (l * J), U);
                          }
                          
                          function code(J, l, K, U)
                          	return fma(fma(Float64(l * l), fma(l, Float64(l * fma(l, Float64(l * 0.0003968253968253968), 0.016666666666666666)), 0.3333333333333333), 2.0), Float64(l * J), U)
                          end
                          
                          code[J_, l_, K_, U_] := N[(N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * N[(l * N[(l * 0.0003968253968253968), $MachinePrecision] + 0.016666666666666666), $MachinePrecision]), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision] + U), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot \mathsf{fma}\left(\ell, \ell \cdot 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), \ell \cdot J, U\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 83.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 \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 \]
                          6. Taylor expanded in K around 0

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

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

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

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

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

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

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

                          Alternative 16: 75.9% accurate, 7.3× speedup?

                          \[\begin{array}{l} \\ \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), U\right) \end{array} \]
                          (FPCore (J l K U)
                           :precision binary64
                           (fma
                            l
                            (*
                             J
                             (fma
                              (* l l)
                              (fma
                               (* l l)
                               (fma (* l l) 0.0003968253968253968 0.016666666666666666)
                               0.3333333333333333)
                              2.0))
                            U))
                          double code(double J, double l, double K, double U) {
                          	return fma(l, (J * fma((l * l), fma((l * l), fma((l * l), 0.0003968253968253968, 0.016666666666666666), 0.3333333333333333), 2.0)), U);
                          }
                          
                          function code(J, l, K, U)
                          	return fma(l, Float64(J * fma(Float64(l * l), fma(Float64(l * l), fma(Float64(l * l), 0.0003968253968253968, 0.016666666666666666), 0.3333333333333333), 2.0)), U)
                          end
                          
                          code[J_, l_, K_, U_] := N[(l * N[(J * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * N[(N[(l * l), $MachinePrecision] * 0.0003968253968253968 + 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision] + U), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          \mathsf{fma}\left(\ell, J \cdot \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell \cdot \ell, 0.0003968253968253968, 0.016666666666666666\right), 0.3333333333333333\right), 2\right), U\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 83.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 \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 \]
                          6. Taylor expanded in K around 0

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

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

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

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

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

                              \[\leadsto \left(\ell \cdot \left(2 + {\ell}^{2} \cdot \left(\frac{1}{3} + {\ell}^{2} \cdot \left(\frac{1}{60} + \frac{1}{2520} \cdot {\ell}^{2}\right)\right)\right)\right) \cdot \color{blue}{\left(J + \left(\frac{-1}{8} \cdot J\right) \cdot {K}^{2}\right)} + U \]
                          8. Simplified59.7%

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

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

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

                              \[\leadsto \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) \cdot J} + U \]
                            3. associate-*l*N/A

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

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

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

                          Alternative 17: 75.8% accurate, 7.7× speedup?

                          \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \ell \cdot \left(0.0003968253968253968 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right), 2\right), \ell \cdot J, U\right) \end{array} \]
                          (FPCore (J l K U)
                           :precision binary64
                           (fma
                            (fma (* l l) (* l (* 0.0003968253968253968 (* l (* l l)))) 2.0)
                            (* l J)
                            U))
                          double code(double J, double l, double K, double U) {
                          	return fma(fma((l * l), (l * (0.0003968253968253968 * (l * (l * l)))), 2.0), (l * J), U);
                          }
                          
                          function code(J, l, K, U)
                          	return fma(fma(Float64(l * l), Float64(l * Float64(0.0003968253968253968 * Float64(l * Float64(l * l)))), 2.0), Float64(l * J), U)
                          end
                          
                          code[J_, l_, K_, U_] := N[(N[(N[(l * l), $MachinePrecision] * N[(l * N[(0.0003968253968253968 * N[(l * N[(l * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision] + U), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \ell \cdot \left(0.0003968253968253968 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right), 2\right), \ell \cdot J, U\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 83.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 \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 \]
                          6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \ell \cdot \left(\frac{1}{2520} \cdot \left(\color{blue}{\left(\ell \cdot \ell\right)} \cdot \ell\right)\right), 2\right), J \cdot \ell, U\right) \]
                            10. unpow3N/A

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \color{blue}{\ell \cdot \left(\left(\ell \cdot \left(\ell \cdot \ell\right)\right) \cdot 0.0003968253968253968\right)}, 2\right), J \cdot \ell, U\right) \]
                          12. Final simplification79.1%

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

                          Alternative 18: 73.9% accurate, 9.7× speedup?

                          \[\begin{array}{l} \\ \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right), \ell \cdot J, U\right) \end{array} \]
                          (FPCore (J l K U)
                           :precision binary64
                           (fma
                            (fma (* l l) (fma l (* l 0.016666666666666666) 0.3333333333333333) 2.0)
                            (* l J)
                            U))
                          double code(double J, double l, double K, double U) {
                          	return fma(fma((l * l), fma(l, (l * 0.016666666666666666), 0.3333333333333333), 2.0), (l * J), U);
                          }
                          
                          function code(J, l, K, U)
                          	return fma(fma(Float64(l * l), fma(l, Float64(l * 0.016666666666666666), 0.3333333333333333), 2.0), Float64(l * J), U)
                          end
                          
                          code[J_, l_, K_, U_] := N[(N[(N[(l * l), $MachinePrecision] * N[(l * N[(l * 0.016666666666666666), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] + 2.0), $MachinePrecision] * N[(l * J), $MachinePrecision] + U), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          \mathsf{fma}\left(\mathsf{fma}\left(\ell \cdot \ell, \mathsf{fma}\left(\ell, \ell \cdot 0.016666666666666666, 0.3333333333333333\right), 2\right), \ell \cdot J, U\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 83.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 \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 \]
                          6. Taylor expanded in K around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 19: 70.5% 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 -2.2 \cdot 10^{+27}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;\ell \leq 3.5 \cdot 10^{+71}:\\ \;\;\;\;\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.2e+27) t_0 (if (<= l 3.5e+71) (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.2e+27) {
                          		tmp = t_0;
                          	} else if (l <= 3.5e+71) {
                          		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.2e+27)
                          		tmp = t_0;
                          	elseif (l <= 3.5e+71)
                          		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.2e+27], t$95$0, If[LessEqual[l, 3.5e+71], 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.2 \cdot 10^{+27}:\\
                          \;\;\;\;t\_0\\
                          
                          \mathbf{elif}\;\ell \leq 3.5 \cdot 10^{+71}:\\
                          \;\;\;\;\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 < -2.1999999999999999e27 or 3.4999999999999999e71 < 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 \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. unpow2N/A

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
                              12. *-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) \]
                              13. *-lowering-*.f6460.9

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, 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-*r*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-*r*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-*.f6465.8

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

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

                            if -2.1999999999999999e27 < l < 3.4999999999999999e71

                            1. Initial program 73.8%

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
                              12. *-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) \]
                              13. *-lowering-*.f6475.8

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, 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-*.f6475.6

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

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq -2.2 \cdot 10^{+27}:\\ \;\;\;\;J \cdot \left(0.3333333333333333 \cdot \left(\ell \cdot \left(\ell \cdot \ell\right)\right)\right)\\ \mathbf{elif}\;\ell \leq 3.5 \cdot 10^{+71}:\\ \;\;\;\;\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 20: 68.8% accurate, 14.3× speedup?

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
                            12. *-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) \]
                            13. *-lowering-*.f6470.3

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, U\right)} \]
                          9. Final simplification70.3%

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

                          Alternative 21: 53.2% 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 83.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 \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. unpow2N/A

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

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

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

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

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

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

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

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

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

                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\ell, \color{blue}{\ell \cdot \frac{1}{3}}, 2\right), J \cdot \ell, U\right) \]
                            12. *-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) \]
                            13. *-lowering-*.f6470.3

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\ell, \ell \cdot 0.3333333333333333, 2\right), J \cdot \ell, 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-*.f6458.1

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left(2, J \cdot \ell, U\right)} \]
                          12. Final simplification58.1%

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

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

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

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

                            Reproduce

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