math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 12.5s
Alternatives: 29
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\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 29 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: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = (0.5d0 * sin(re)) * (exp((0.0d0 - im)) + exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp((0.0 - im)) + Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp((0.0 - im)) + math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(0.0 - im)) + exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp((0.0 - im)) + exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right)
\end{array}

Alternative 1: 100.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \cosh im \cdot \sin re \end{array} \]
(FPCore (re im) :precision binary64 (* (cosh im) (sin re)))
double code(double re, double im) {
	return cosh(im) * sin(re);
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = cosh(im) * sin(re)
end function
public static double code(double re, double im) {
	return Math.cosh(im) * Math.sin(re);
}
def code(re, im):
	return math.cosh(im) * math.sin(re)
function code(re, im)
	return Float64(cosh(im) * sin(re))
end
function tmp = code(re, im)
	tmp = cosh(im) * sin(re);
end
code[re_, im_] := N[(N[Cosh[im], $MachinePrecision] * N[Sin[re], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cosh im \cdot \sin re
\end{array}
Derivation
  1. Initial program 100.0%

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
    2. associate-*r*N/A

      \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
    3. *-lowering-*.f64N/A

      \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
    4. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
    5. +-commutativeN/A

      \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
    6. sub0-negN/A

      \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
    7. cosh-undefN/A

      \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
    8. associate-*r*N/A

      \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
    9. metadata-evalN/A

      \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
    10. exp-0N/A

      \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
    11. *-lowering-*.f64N/A

      \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
    12. exp-0N/A

      \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
    13. cosh-lowering-cosh.f64N/A

      \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
    14. sin-lowering-sin.f64100.0

      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
  4. Applied egg-rr100.0%

    \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
  5. Final simplification100.0%

    \[\leadsto \cosh im \cdot \sin re \]
  6. Add Preprocessing

Alternative 2: 86.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin re \cdot 0.5\\ t_1 := t\_0 \cdot \left(e^{0 - im} + e^{im}\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (sin re) 0.5)) (t_1 (* t_0 (+ (exp (- 0.0 im)) (exp im)))))
   (if (<= t_1 (- INFINITY))
     (* (cosh im) (* re (fma re (* re -0.16666666666666666) 1.0)))
     (if (<= t_1 1.0) (* t_0 (fma im im 2.0)) (* (cosh im) re)))))
double code(double re, double im) {
	double t_0 = sin(re) * 0.5;
	double t_1 = t_0 * (exp((0.0 - im)) + exp(im));
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = cosh(im) * (re * fma(re, (re * -0.16666666666666666), 1.0));
	} else if (t_1 <= 1.0) {
		tmp = t_0 * fma(im, im, 2.0);
	} else {
		tmp = cosh(im) * re;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(sin(re) * 0.5)
	t_1 = Float64(t_0 * Float64(exp(Float64(0.0 - im)) + exp(im)))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(cosh(im) * Float64(re * fma(re, Float64(re * -0.16666666666666666), 1.0)));
	elseif (t_1 <= 1.0)
		tmp = Float64(t_0 * fma(im, im, 2.0));
	else
		tmp = Float64(cosh(im) * re);
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(t$95$0 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin re \cdot 0.5\\
t_1 := t\_0 \cdot \left(e^{0 - im} + e^{im}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)\\

\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\

\mathbf{else}:\\
\;\;\;\;\cosh im \cdot re\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
      5. +-commutativeN/A

        \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
      6. sub0-negN/A

        \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
      7. cosh-undefN/A

        \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
      8. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
      9. metadata-evalN/A

        \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
      10. exp-0N/A

        \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
      11. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
      12. exp-0N/A

        \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
      13. cosh-lowering-cosh.f64N/A

        \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
      14. sin-lowering-sin.f64100.0

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
    5. Taylor expanded in re around 0

      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \]
    6. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \]
      2. +-commutativeN/A

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

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \]
      4. unpow2N/A

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \left(re \cdot \left(\color{blue}{re \cdot \left(re \cdot \frac{-1}{6}\right)} + 1\right)\right) \]
      6. accelerator-lowering-fma.f64N/A

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \]
      7. *-lowering-*.f6468.4

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \]
    7. Simplified68.4%

      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \]

    if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in im around 0

      \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left({im}^{2} + 2\right)} \]
      2. unpow2N/A

        \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(\color{blue}{im \cdot im} + 2\right) \]
      3. accelerator-lowering-fma.f6498.8

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \]
    5. Simplified98.8%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \]

    if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
      2. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
      3. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
      4. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
      5. +-commutativeN/A

        \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
      6. sub0-negN/A

        \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
      7. cosh-undefN/A

        \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
      8. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
      9. metadata-evalN/A

        \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
      10. exp-0N/A

        \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
      11. *-lowering-*.f64N/A

        \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
      12. exp-0N/A

        \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
      13. cosh-lowering-cosh.f64N/A

        \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
      14. sin-lowering-sin.f64100.0

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
    4. Applied egg-rr100.0%

      \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
    5. Taylor expanded in re around 0

      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
    6. Step-by-step derivation
      1. Simplified87.9%

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
      2. Step-by-step derivation
        1. *-lft-identityN/A

          \[\leadsto \color{blue}{\cosh im} \cdot re \]
        2. cosh-lowering-cosh.f6487.9

          \[\leadsto \color{blue}{\cosh im} \cdot re \]
      3. Applied egg-rr87.9%

        \[\leadsto \color{blue}{\cosh im} \cdot re \]
    7. Recombined 3 regimes into one program.
    8. Final simplification89.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -\infty:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)\\ \mathbf{elif}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \mathsf{fma}\left(im, im, 2\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 85.0% accurate, 0.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin re \cdot 0.5\\ t_1 := t\_0 \cdot \left(e^{0 - im} + e^{im}\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (let* ((t_0 (* (sin re) 0.5)) (t_1 (* t_0 (+ (exp (- 0.0 im)) (exp im)))))
       (if (<= t_1 (- INFINITY))
         (*
          (fma
           (fma (* im im) 0.001388888888888889 0.041666666666666664)
           (* im (* im (* im im)))
           (fma 0.5 (* im im) 1.0))
          (*
           re
           (fma
            (* re re)
            (fma
             (* re re)
             (fma re (* re -0.0001984126984126984) 0.008333333333333333)
             -0.16666666666666666)
            1.0)))
         (if (<= t_1 1.0) (* t_0 (fma im im 2.0)) (* (cosh im) re)))))
    double code(double re, double im) {
    	double t_0 = sin(re) * 0.5;
    	double t_1 = t_0 * (exp((0.0 - im)) + exp(im));
    	double tmp;
    	if (t_1 <= -((double) INFINITY)) {
    		tmp = fma(fma((im * im), 0.001388888888888889, 0.041666666666666664), (im * (im * (im * im))), fma(0.5, (im * im), 1.0)) * (re * fma((re * re), fma((re * re), fma(re, (re * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0));
    	} else if (t_1 <= 1.0) {
    		tmp = t_0 * fma(im, im, 2.0);
    	} else {
    		tmp = cosh(im) * re;
    	}
    	return tmp;
    }
    
    function code(re, im)
    	t_0 = Float64(sin(re) * 0.5)
    	t_1 = Float64(t_0 * Float64(exp(Float64(0.0 - im)) + exp(im)))
    	tmp = 0.0
    	if (t_1 <= Float64(-Inf))
    		tmp = Float64(fma(fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), Float64(im * Float64(im * Float64(im * im))), fma(0.5, Float64(im * im), 1.0)) * Float64(re * fma(Float64(re * re), fma(Float64(re * re), fma(re, Float64(re * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0)));
    	elseif (t_1 <= 1.0)
    		tmp = Float64(t_0 * fma(im, im, 2.0));
    	else
    		tmp = Float64(cosh(im) * re);
    	end
    	return tmp
    end
    
    code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(re * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[(t$95$0 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \sin re \cdot 0.5\\
    t_1 := t\_0 \cdot \left(e^{0 - im} + e^{im}\right)\\
    \mathbf{if}\;t\_1 \leq -\infty:\\
    \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\
    
    \mathbf{elif}\;t\_1 \leq 1:\\
    \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, im, 2\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;\cosh im \cdot re\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0

      1. Initial program 100.0%

        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
        2. +-commutativeN/A

          \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
        3. distribute-rgt-inN/A

          \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
        4. *-commutativeN/A

          \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
        5. associate-+l+N/A

          \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
      5. Simplified83.4%

        \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
      6. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        2. +-commutativeN/A

          \[\leadsto \left(re \cdot \color{blue}{\left({re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right) + 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        3. accelerator-lowering-fma.f64N/A

          \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left({re}^{2}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        4. unpow2N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        6. sub-negN/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        7. metadata-evalN/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \color{blue}{\frac{-1}{6}}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        8. accelerator-lowering-fma.f64N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        9. unpow2N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        11. +-commutativeN/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\frac{-1}{5040} \cdot {re}^{2} + \frac{1}{120}}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        12. *-commutativeN/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \frac{-1}{5040}} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        13. unpow2N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{5040} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        14. associate-*l*N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{re \cdot \left(re \cdot \frac{-1}{5040}\right)} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        15. accelerator-lowering-fma.f64N/A

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{5040}, \frac{1}{120}\right)}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        16. *-lowering-*.f6458.6

          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, \color{blue}{re \cdot -0.0001984126984126984}, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
      8. Simplified58.6%

        \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]

      if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

      1. Initial program 100.0%

        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
      2. Add Preprocessing
      3. Taylor expanded in im around 0

        \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)} \]
      4. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left({im}^{2} + 2\right)} \]
        2. unpow2N/A

          \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(\color{blue}{im \cdot im} + 2\right) \]
        3. accelerator-lowering-fma.f6498.8

          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \]
      5. Simplified98.8%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \]

      if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

      1. Initial program 100.0%

        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
        2. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
        3. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
        5. +-commutativeN/A

          \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
        6. sub0-negN/A

          \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
        7. cosh-undefN/A

          \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
        8. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
        9. metadata-evalN/A

          \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
        10. exp-0N/A

          \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
        11. *-lowering-*.f64N/A

          \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
        12. exp-0N/A

          \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
        13. cosh-lowering-cosh.f64N/A

          \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
        14. sin-lowering-sin.f64100.0

          \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
      4. Applied egg-rr100.0%

        \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
      5. Taylor expanded in re around 0

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
      6. Step-by-step derivation
        1. Simplified87.9%

          \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
        2. Step-by-step derivation
          1. *-lft-identityN/A

            \[\leadsto \color{blue}{\cosh im} \cdot re \]
          2. cosh-lowering-cosh.f6487.9

            \[\leadsto \color{blue}{\cosh im} \cdot re \]
        3. Applied egg-rr87.9%

          \[\leadsto \color{blue}{\cosh im} \cdot re \]
      7. Recombined 3 regimes into one program.
      8. Final simplification87.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\ \mathbf{elif}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \mathsf{fma}\left(im, im, 2\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \]
      9. Add Preprocessing

      Alternative 4: 84.8% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right)\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\ \mathbf{elif}\;t\_0 \leq 1:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (let* ((t_0 (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im)))))
         (if (<= t_0 (- INFINITY))
           (*
            (fma
             (fma (* im im) 0.001388888888888889 0.041666666666666664)
             (* im (* im (* im im)))
             (fma 0.5 (* im im) 1.0))
            (*
             re
             (fma
              (* re re)
              (fma
               (* re re)
               (fma re (* re -0.0001984126984126984) 0.008333333333333333)
               -0.16666666666666666)
              1.0)))
           (if (<= t_0 1.0) (sin re) (* (cosh im) re)))))
      double code(double re, double im) {
      	double t_0 = (sin(re) * 0.5) * (exp((0.0 - im)) + exp(im));
      	double tmp;
      	if (t_0 <= -((double) INFINITY)) {
      		tmp = fma(fma((im * im), 0.001388888888888889, 0.041666666666666664), (im * (im * (im * im))), fma(0.5, (im * im), 1.0)) * (re * fma((re * re), fma((re * re), fma(re, (re * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0));
      	} else if (t_0 <= 1.0) {
      		tmp = sin(re);
      	} else {
      		tmp = cosh(im) * re;
      	}
      	return tmp;
      }
      
      function code(re, im)
      	t_0 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im)))
      	tmp = 0.0
      	if (t_0 <= Float64(-Inf))
      		tmp = Float64(fma(fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), Float64(im * Float64(im * Float64(im * im))), fma(0.5, Float64(im * im), 1.0)) * Float64(re * fma(Float64(re * re), fma(Float64(re * re), fma(re, Float64(re * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0)));
      	elseif (t_0 <= 1.0)
      		tmp = sin(re);
      	else
      		tmp = Float64(cosh(im) * re);
      	end
      	return tmp
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(re * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 1.0], N[Sin[re], $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right)\\
      \mathbf{if}\;t\_0 \leq -\infty:\\
      \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\
      
      \mathbf{elif}\;t\_0 \leq 1:\\
      \;\;\;\;\sin re\\
      
      \mathbf{else}:\\
      \;\;\;\;\cosh im \cdot re\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0

        1. Initial program 100.0%

          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in im around 0

          \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
          2. +-commutativeN/A

            \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
          3. distribute-rgt-inN/A

            \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
          4. *-commutativeN/A

            \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
          5. associate-+l+N/A

            \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
        5. Simplified83.4%

          \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
        6. Taylor expanded in re around 0

          \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
        7. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          2. +-commutativeN/A

            \[\leadsto \left(re \cdot \color{blue}{\left({re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right) + 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          3. accelerator-lowering-fma.f64N/A

            \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left({re}^{2}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          4. unpow2N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          5. *-lowering-*.f64N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          6. sub-negN/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \color{blue}{\frac{-1}{6}}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          8. accelerator-lowering-fma.f64N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          9. unpow2N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          10. *-lowering-*.f64N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          11. +-commutativeN/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\frac{-1}{5040} \cdot {re}^{2} + \frac{1}{120}}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          12. *-commutativeN/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \frac{-1}{5040}} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          13. unpow2N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{5040} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          14. associate-*l*N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{re \cdot \left(re \cdot \frac{-1}{5040}\right)} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          15. accelerator-lowering-fma.f64N/A

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{5040}, \frac{1}{120}\right)}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          16. *-lowering-*.f6458.6

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, \color{blue}{re \cdot -0.0001984126984126984}, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
        8. Simplified58.6%

          \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]

        if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

        1. Initial program 100.0%

          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in im around 0

          \[\leadsto \color{blue}{\sin re} \]
        4. Step-by-step derivation
          1. sin-lowering-sin.f6498.1

            \[\leadsto \color{blue}{\sin re} \]
        5. Simplified98.1%

          \[\leadsto \color{blue}{\sin re} \]

        if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

        1. Initial program 100.0%

          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
          2. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
          3. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
          5. +-commutativeN/A

            \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
          6. sub0-negN/A

            \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
          7. cosh-undefN/A

            \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
          8. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
          9. metadata-evalN/A

            \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
          10. exp-0N/A

            \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
          11. *-lowering-*.f64N/A

            \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
          12. exp-0N/A

            \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
          13. cosh-lowering-cosh.f64N/A

            \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
          14. sin-lowering-sin.f64100.0

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
        4. Applied egg-rr100.0%

          \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
        5. Taylor expanded in re around 0

          \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
        6. Step-by-step derivation
          1. Simplified87.9%

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
          2. Step-by-step derivation
            1. *-lft-identityN/A

              \[\leadsto \color{blue}{\cosh im} \cdot re \]
            2. cosh-lowering-cosh.f6487.9

              \[\leadsto \color{blue}{\cosh im} \cdot re \]
          3. Applied egg-rr87.9%

            \[\leadsto \color{blue}{\cosh im} \cdot re \]
        7. Recombined 3 regimes into one program.
        8. Final simplification86.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\ \mathbf{elif}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 82.8% accurate, 0.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right)\\ t_1 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right)\\ t_2 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\ \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(t\_0, t\_2, \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(t\_0, t\_2, 1\right)\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (let* ((t_0 (fma (* im im) 0.001388888888888889 0.041666666666666664))
                (t_1 (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))))
                (t_2 (* im (* im (* im im)))))
           (if (<= t_1 (- INFINITY))
             (*
              (fma t_0 t_2 (fma 0.5 (* im im) 1.0))
              (*
               re
               (fma
                (* re re)
                (fma
                 (* re re)
                 (fma re (* re -0.0001984126984126984) 0.008333333333333333)
                 -0.16666666666666666)
                1.0)))
             (if (<= t_1 1.0)
               (sin re)
               (*
                (*
                 re
                 (fma
                  (* re re)
                  (fma (* re re) 0.008333333333333333 -0.16666666666666666)
                  1.0))
                (fma t_0 t_2 1.0))))))
        double code(double re, double im) {
        	double t_0 = fma((im * im), 0.001388888888888889, 0.041666666666666664);
        	double t_1 = (sin(re) * 0.5) * (exp((0.0 - im)) + exp(im));
        	double t_2 = im * (im * (im * im));
        	double tmp;
        	if (t_1 <= -((double) INFINITY)) {
        		tmp = fma(t_0, t_2, fma(0.5, (im * im), 1.0)) * (re * fma((re * re), fma((re * re), fma(re, (re * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0));
        	} else if (t_1 <= 1.0) {
        		tmp = sin(re);
        	} else {
        		tmp = (re * fma((re * re), fma((re * re), 0.008333333333333333, -0.16666666666666666), 1.0)) * fma(t_0, t_2, 1.0);
        	}
        	return tmp;
        }
        
        function code(re, im)
        	t_0 = fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664)
        	t_1 = Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im)))
        	t_2 = Float64(im * Float64(im * Float64(im * im)))
        	tmp = 0.0
        	if (t_1 <= Float64(-Inf))
        		tmp = Float64(fma(t_0, t_2, fma(0.5, Float64(im * im), 1.0)) * Float64(re * fma(Float64(re * re), fma(Float64(re * re), fma(re, Float64(re * -0.0001984126984126984), 0.008333333333333333), -0.16666666666666666), 1.0)));
        	elseif (t_1 <= 1.0)
        		tmp = sin(re);
        	else
        		tmp = Float64(Float64(re * fma(Float64(re * re), fma(Float64(re * re), 0.008333333333333333, -0.16666666666666666), 1.0)) * fma(t_0, t_2, 1.0));
        	end
        	return tmp
        end
        
        code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(t$95$0 * t$95$2 + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * N[(re * N[(re * -0.0001984126984126984), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], N[Sin[re], $MachinePrecision], N[(N[(re * N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * t$95$2 + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right)\\
        t_1 := \left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right)\\
        t_2 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
        \mathbf{if}\;t\_1 \leq -\infty:\\
        \;\;\;\;\mathsf{fma}\left(t\_0, t\_2, \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\
        
        \mathbf{elif}\;t\_1 \leq 1:\\
        \;\;\;\;\sin re\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(t\_0, t\_2, 1\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -inf.0

          1. Initial program 100.0%

            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in im around 0

            \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
            2. +-commutativeN/A

              \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
            3. distribute-rgt-inN/A

              \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
            4. *-commutativeN/A

              \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
            5. associate-+l+N/A

              \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
          5. Simplified83.4%

            \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
          6. Taylor expanded in re around 0

            \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          7. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            2. +-commutativeN/A

              \[\leadsto \left(re \cdot \color{blue}{\left({re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}\right) + 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            3. accelerator-lowering-fma.f64N/A

              \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left({re}^{2}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            4. unpow2N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            6. sub-negN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            7. metadata-evalN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, {re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \color{blue}{\frac{-1}{6}}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            8. accelerator-lowering-fma.f64N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            9. unpow2N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            10. *-lowering-*.f64N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            11. +-commutativeN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\frac{-1}{5040} \cdot {re}^{2} + \frac{1}{120}}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            12. *-commutativeN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \frac{-1}{5040}} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            13. unpow2N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{5040} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            14. associate-*l*N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{re \cdot \left(re \cdot \frac{-1}{5040}\right)} + \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            15. accelerator-lowering-fma.f64N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{5040}, \frac{1}{120}\right)}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            16. *-lowering-*.f6458.6

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, \color{blue}{re \cdot -0.0001984126984126984}, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
          8. Simplified58.6%

            \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]

          if -inf.0 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

          1. Initial program 100.0%

            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in im around 0

            \[\leadsto \color{blue}{\sin re} \]
          4. Step-by-step derivation
            1. sin-lowering-sin.f6498.1

              \[\leadsto \color{blue}{\sin re} \]
          5. Simplified98.1%

            \[\leadsto \color{blue}{\sin re} \]

          if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

          1. Initial program 100.0%

            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in im around 0

            \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
            2. +-commutativeN/A

              \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
            3. distribute-rgt-inN/A

              \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
            4. *-commutativeN/A

              \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
            5. associate-+l+N/A

              \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
          5. Simplified88.3%

            \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
          6. Taylor expanded in re around 0

            \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
          7. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            2. +-commutativeN/A

              \[\leadsto \left(re \cdot \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right) + 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            3. accelerator-lowering-fma.f64N/A

              \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            4. unpow2N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            6. sub-negN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\frac{1}{120} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            7. *-commutativeN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            8. metadata-evalN/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, {re}^{2} \cdot \frac{1}{120} + \color{blue}{\frac{-1}{6}}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            9. accelerator-lowering-fma.f64N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120}, \frac{-1}{6}\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            10. unpow2N/A

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
            11. *-lowering-*.f6480.5

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
          8. Simplified80.5%

            \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
          9. Taylor expanded in im around 0

            \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \color{blue}{1}\right) \]
          10. Step-by-step derivation
            1. Simplified80.5%

              \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \color{blue}{1}\right) \]
          11. Recombined 3 regimes into one program.
          12. Final simplification84.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re, re \cdot -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\\ \mathbf{elif}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), 1\right)\\ \end{array} \]
          13. Add Preprocessing

          Alternative 6: 89.6% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 1.0)
             (*
              (sin re)
              (fma
               (fma (* im im) 0.001388888888888889 0.041666666666666664)
               (* im (* im (* im im)))
               (fma 0.5 (* im im) 1.0)))
             (* (cosh im) re)))
          double code(double re, double im) {
          	double tmp;
          	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 1.0) {
          		tmp = sin(re) * fma(fma((im * im), 0.001388888888888889, 0.041666666666666664), (im * (im * (im * im))), fma(0.5, (im * im), 1.0));
          	} else {
          		tmp = cosh(im) * re;
          	}
          	return tmp;
          }
          
          function code(re, im)
          	tmp = 0.0
          	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 1.0)
          		tmp = Float64(sin(re) * fma(fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), Float64(im * Float64(im * Float64(im * im))), fma(0.5, Float64(im * im), 1.0)));
          	else
          		tmp = Float64(cosh(im) * re);
          	end
          	return tmp
          end
          
          code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\
          \;\;\;\;\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\cosh im \cdot re\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

            1. Initial program 100.0%

              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
            2. Add Preprocessing
            3. Taylor expanded in im around 0

              \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
              2. +-commutativeN/A

                \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
              3. distribute-rgt-inN/A

                \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
              4. *-commutativeN/A

                \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
              5. associate-+l+N/A

                \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
            5. Simplified94.3%

              \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]

            if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

            1. Initial program 100.0%

              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
              3. *-lowering-*.f64N/A

                \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
              4. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
              5. +-commutativeN/A

                \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
              6. sub0-negN/A

                \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
              7. cosh-undefN/A

                \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
              8. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
              9. metadata-evalN/A

                \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
              10. exp-0N/A

                \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
              11. *-lowering-*.f64N/A

                \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
              12. exp-0N/A

                \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
              13. cosh-lowering-cosh.f64N/A

                \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
              14. sin-lowering-sin.f64100.0

                \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
            4. Applied egg-rr100.0%

              \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
            5. Taylor expanded in re around 0

              \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
            6. Step-by-step derivation
              1. Simplified87.9%

                \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
              2. Step-by-step derivation
                1. *-lft-identityN/A

                  \[\leadsto \color{blue}{\cosh im} \cdot re \]
                2. cosh-lowering-cosh.f6487.9

                  \[\leadsto \color{blue}{\cosh im} \cdot re \]
              3. Applied egg-rr87.9%

                \[\leadsto \color{blue}{\cosh im} \cdot re \]
            7. Recombined 2 regimes into one program.
            8. Final simplification92.6%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \]
            9. Add Preprocessing

            Alternative 7: 89.6% accurate, 0.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin re \cdot 0.5\\ \mathbf{if}\;t\_0 \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right), 1\right), 0\right), 2\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (let* ((t_0 (* (sin re) 0.5)))
               (if (<= (* t_0 (+ (exp (- 0.0 im)) (exp im))) 1.0)
                 (*
                  t_0
                  (fma
                   im
                   (fma
                    im
                    (fma
                     im
                     (* im (fma (* im im) 0.002777777777777778 0.08333333333333333))
                     1.0)
                    0.0)
                   2.0))
                 (* (cosh im) re))))
            double code(double re, double im) {
            	double t_0 = sin(re) * 0.5;
            	double tmp;
            	if ((t_0 * (exp((0.0 - im)) + exp(im))) <= 1.0) {
            		tmp = t_0 * fma(im, fma(im, fma(im, (im * fma((im * im), 0.002777777777777778, 0.08333333333333333)), 1.0), 0.0), 2.0);
            	} else {
            		tmp = cosh(im) * re;
            	}
            	return tmp;
            }
            
            function code(re, im)
            	t_0 = Float64(sin(re) * 0.5)
            	tmp = 0.0
            	if (Float64(t_0 * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 1.0)
            		tmp = Float64(t_0 * fma(im, fma(im, fma(im, Float64(im * fma(Float64(im * im), 0.002777777777777778, 0.08333333333333333)), 1.0), 0.0), 2.0));
            	else
            		tmp = Float64(cosh(im) * re);
            	end
            	return tmp
            end
            
            code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(t$95$0 * N[(im * N[(im * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.002777777777777778 + 0.08333333333333333), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision] + 0.0), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \sin re \cdot 0.5\\
            \mathbf{if}\;t\_0 \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\
            \;\;\;\;t\_0 \cdot \mathsf{fma}\left(im, \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right), 1\right), 0\right), 2\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\cosh im \cdot re\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

              1. Initial program 100.0%

                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in im around 0

                \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right)} \]
              4. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right) + 2\right)} \]
                2. unpow2N/A

                  \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right) + 2\right) \]
                3. associate-*l*N/A

                  \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right)} + 2\right) \]
                4. accelerator-lowering-fma.f64N/A

                  \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \color{blue}{\mathsf{fma}\left(im, im \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right), 2\right)} \]
              5. Simplified94.3%

                \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\mathsf{fma}\left(im, \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right), 1\right), 0\right), 2\right)} \]

              if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

              1. Initial program 100.0%

                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
                2. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                4. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
                5. +-commutativeN/A

                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
                6. sub0-negN/A

                  \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
                7. cosh-undefN/A

                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
                8. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
                9. metadata-evalN/A

                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                10. exp-0N/A

                  \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
                11. *-lowering-*.f64N/A

                  \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
                12. exp-0N/A

                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                13. cosh-lowering-cosh.f64N/A

                  \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                14. sin-lowering-sin.f64100.0

                  \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
              4. Applied egg-rr100.0%

                \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
              5. Taylor expanded in re around 0

                \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
              6. Step-by-step derivation
                1. Simplified87.9%

                  \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
                2. Step-by-step derivation
                  1. *-lft-identityN/A

                    \[\leadsto \color{blue}{\cosh im} \cdot re \]
                  2. cosh-lowering-cosh.f6487.9

                    \[\leadsto \color{blue}{\cosh im} \cdot re \]
                3. Applied egg-rr87.9%

                  \[\leadsto \color{blue}{\cosh im} \cdot re \]
              7. Recombined 2 regimes into one program.
              8. Final simplification92.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \mathsf{fma}\left(im, \mathsf{fma}\left(im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.002777777777777778, 0.08333333333333333\right), 1\right), 0\right), 2\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \]
              9. Add Preprocessing

              Alternative 8: 87.7% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 1.0)
                 (* (sin re) (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))
                 (* (cosh im) re)))
              double code(double re, double im) {
              	double tmp;
              	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 1.0) {
              		tmp = sin(re) * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
              	} else {
              		tmp = cosh(im) * re;
              	}
              	return tmp;
              }
              
              function code(re, im)
              	tmp = 0.0
              	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 1.0)
              		tmp = Float64(sin(re) * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0));
              	else
              		tmp = Float64(cosh(im) * re);
              	end
              	return tmp
              end
              
              code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[Cosh[im], $MachinePrecision] * re), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\
              \;\;\;\;\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\cosh im \cdot re\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                  2. distribute-lft-inN/A

                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                  3. associate-+l+N/A

                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                  4. associate-*r*N/A

                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                  5. associate-*r*N/A

                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                  7. associate-*r*N/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                  9. associate-*r*N/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                  10. distribute-lft1-inN/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                  11. unpow2N/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                  12. associate-*r*N/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                  13. *-commutativeN/A

                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                5. Simplified93.1%

                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]

                if 1 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
                  2. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                  4. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
                  5. +-commutativeN/A

                    \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
                  6. sub0-negN/A

                    \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
                  7. cosh-undefN/A

                    \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
                  8. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
                  9. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                  10. exp-0N/A

                    \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
                  11. *-lowering-*.f64N/A

                    \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
                  12. exp-0N/A

                    \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                  13. cosh-lowering-cosh.f64N/A

                    \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                  14. sin-lowering-sin.f64100.0

                    \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
                4. Applied egg-rr100.0%

                  \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
                5. Taylor expanded in re around 0

                  \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
                6. Step-by-step derivation
                  1. Simplified87.9%

                    \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
                  2. Step-by-step derivation
                    1. *-lft-identityN/A

                      \[\leadsto \color{blue}{\cosh im} \cdot re \]
                    2. cosh-lowering-cosh.f6487.9

                      \[\leadsto \color{blue}{\cosh im} \cdot re \]
                  3. Applied egg-rr87.9%

                    \[\leadsto \color{blue}{\cosh im} \cdot re \]
                7. Recombined 2 regimes into one program.
                8. Final simplification91.8%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 1:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\cosh im \cdot re\\ \end{array} \]
                9. Add Preprocessing

                Alternative 9: 58.5% accurate, 0.8× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right)\\ \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 2 \cdot 10^{-141}:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, t\_0, 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(t\_0, im \cdot \left(im \cdot \left(im \cdot im\right)\right), 1\right)\\ \end{array} \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (let* ((t_0 (fma (* im im) 0.001388888888888889 0.041666666666666664)))
                   (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 2e-141)
                     (*
                      re
                      (*
                       (fma re (* re -0.16666666666666666) 1.0)
                       (fma (* im im) (fma (* im im) t_0 0.5) 1.0)))
                     (*
                      (*
                       re
                       (fma
                        (* re re)
                        (fma (* re re) 0.008333333333333333 -0.16666666666666666)
                        1.0))
                      (fma t_0 (* im (* im (* im im))) 1.0)))))
                double code(double re, double im) {
                	double t_0 = fma((im * im), 0.001388888888888889, 0.041666666666666664);
                	double tmp;
                	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 2e-141) {
                		tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma((im * im), fma((im * im), t_0, 0.5), 1.0));
                	} else {
                		tmp = (re * fma((re * re), fma((re * re), 0.008333333333333333, -0.16666666666666666), 1.0)) * fma(t_0, (im * (im * (im * im))), 1.0);
                	}
                	return tmp;
                }
                
                function code(re, im)
                	t_0 = fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664)
                	tmp = 0.0
                	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 2e-141)
                		tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(Float64(im * im), fma(Float64(im * im), t_0, 0.5), 1.0)));
                	else
                		tmp = Float64(Float64(re * fma(Float64(re * re), fma(Float64(re * re), 0.008333333333333333, -0.16666666666666666), 1.0)) * fma(t_0, Float64(im * Float64(im * Float64(im * im))), 1.0));
                	end
                	return tmp
                end
                
                code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e-141], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * t$95$0 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right)\\
                \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 2 \cdot 10^{-141}:\\
                \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, t\_0, 0.5\right), 1\right)\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(t\_0, im \cdot \left(im \cdot \left(im \cdot im\right)\right), 1\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 2.0000000000000001e-141

                  1. Initial program 100.0%

                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                    2. +-commutativeN/A

                      \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                    3. distribute-rgt-inN/A

                      \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                    4. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                    5. associate-+l+N/A

                      \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                  5. Simplified91.7%

                    \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                  6. Taylor expanded in re around 0

                    \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                    2. +-commutativeN/A

                      \[\leadsto re \cdot \left(1 + \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)}\right) \]
                    3. associate-+r+N/A

                      \[\leadsto re \cdot \color{blue}{\left(\left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)} \]
                    4. associate-*r*N/A

                      \[\leadsto re \cdot \left(\left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)}\right) \]
                    5. distribute-rgt1-inN/A

                      \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                  8. Simplified62.5%

                    \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)} \]

                  if 2.0000000000000001e-141 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                  1. Initial program 100.0%

                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                    2. +-commutativeN/A

                      \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                    3. distribute-rgt-inN/A

                      \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                    4. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                    5. associate-+l+N/A

                      \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                  5. Simplified93.8%

                    \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                  6. Taylor expanded in re around 0

                    \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    2. +-commutativeN/A

                      \[\leadsto \left(re \cdot \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right) + 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    3. accelerator-lowering-fma.f64N/A

                      \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    4. unpow2N/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    5. *-lowering-*.f64N/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    6. sub-negN/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\frac{1}{120} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    7. *-commutativeN/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    8. metadata-evalN/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, {re}^{2} \cdot \frac{1}{120} + \color{blue}{\frac{-1}{6}}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    9. accelerator-lowering-fma.f64N/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120}, \frac{-1}{6}\right)}, 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    10. unpow2N/A

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    11. *-lowering-*.f6460.3

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
                  8. Simplified60.3%

                    \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
                  9. Taylor expanded in im around 0

                    \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \color{blue}{1}\right) \]
                  10. Step-by-step derivation
                    1. Simplified60.3%

                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \color{blue}{1}\right) \]
                  11. Recombined 2 regimes into one program.
                  12. Final simplification61.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 2 \cdot 10^{-141}:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), 1\right)\\ \end{array} \]
                  13. Add Preprocessing

                  Alternative 10: 58.2% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right)\\ \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, t\_0, 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(t\_0, im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \end{array} \end{array} \]
                  (FPCore (re im)
                   :precision binary64
                   (let* ((t_0 (fma (* im im) 0.001388888888888889 0.041666666666666664)))
                     (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                       (*
                        re
                        (*
                         (fma re (* re -0.16666666666666666) 1.0)
                         (fma (* im im) (fma (* im im) t_0 0.5) 1.0)))
                       (* re (fma t_0 (* im (* im (* im im))) (fma 0.5 (* im im) 1.0))))))
                  double code(double re, double im) {
                  	double t_0 = fma((im * im), 0.001388888888888889, 0.041666666666666664);
                  	double tmp;
                  	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                  		tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma((im * im), fma((im * im), t_0, 0.5), 1.0));
                  	} else {
                  		tmp = re * fma(t_0, (im * (im * (im * im))), fma(0.5, (im * im), 1.0));
                  	}
                  	return tmp;
                  }
                  
                  function code(re, im)
                  	t_0 = fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664)
                  	tmp = 0.0
                  	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                  		tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(Float64(im * im), fma(Float64(im * im), t_0, 0.5), 1.0)));
                  	else
                  		tmp = Float64(re * fma(t_0, Float64(im * Float64(im * Float64(im * im))), fma(0.5, Float64(im * im), 1.0)));
                  	end
                  	return tmp
                  end
                  
                  code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]}, If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * t$95$0 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right)\\
                  \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                  \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, t\_0, 0.5\right), 1\right)\right)\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;re \cdot \mathsf{fma}\left(t\_0, im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                    1. Initial program 100.0%

                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in im around 0

                      \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                      2. +-commutativeN/A

                        \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                      3. distribute-rgt-inN/A

                        \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                      4. *-commutativeN/A

                        \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                      5. associate-+l+N/A

                        \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                    5. Simplified92.9%

                      \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                    6. Taylor expanded in re around 0

                      \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                    7. Step-by-step derivation
                      1. *-lowering-*.f64N/A

                        \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                      2. +-commutativeN/A

                        \[\leadsto re \cdot \left(1 + \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)}\right) \]
                      3. associate-+r+N/A

                        \[\leadsto re \cdot \color{blue}{\left(\left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)} \]
                      4. associate-*r*N/A

                        \[\leadsto re \cdot \left(\left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)}\right) \]
                      5. distribute-rgt1-inN/A

                        \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                    8. Simplified67.7%

                      \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)} \]

                    if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                    1. Initial program 100.0%

                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in im around 0

                      \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                      2. +-commutativeN/A

                        \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                      3. distribute-rgt-inN/A

                        \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                      4. *-commutativeN/A

                        \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                      5. associate-+l+N/A

                        \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                    5. Simplified92.5%

                      \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                    6. Taylor expanded in re around 0

                      \[\leadsto \color{blue}{re} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                    7. Step-by-step derivation
                      1. Simplified51.5%

                        \[\leadsto \color{blue}{re} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification61.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 11: 57.1% accurate, 0.9× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                       (*
                        (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0)
                        (fma (* re (* re re)) -0.16666666666666666 re))
                       (*
                        re
                        (fma
                         (fma (* im im) 0.001388888888888889 0.041666666666666664)
                         (* im (* im (* im im)))
                         (fma 0.5 (* im im) 1.0)))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                    		tmp = fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0) * fma((re * (re * re)), -0.16666666666666666, re);
                    	} else {
                    		tmp = re * fma(fma((im * im), 0.001388888888888889, 0.041666666666666664), (im * (im * (im * im))), fma(0.5, (im * im), 1.0));
                    	}
                    	return tmp;
                    }
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                    		tmp = Float64(fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0) * fma(Float64(re * Float64(re * re)), -0.16666666666666666, re));
                    	else
                    		tmp = Float64(re * fma(fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), Float64(im * Float64(im * Float64(im * im))), fma(0.5, Float64(im * im), 1.0)));
                    	end
                    	return tmp
                    end
                    
                    code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + re), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                    \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                        2. distribute-lft-inN/A

                          \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                        3. associate-+l+N/A

                          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                        4. associate-*r*N/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                        5. associate-*r*N/A

                          \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                        7. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                        8. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                        9. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                        10. distribute-lft1-inN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                        11. unpow2N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                        12. associate-*r*N/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                        13. *-commutativeN/A

                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                      5. Simplified91.5%

                        \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                      6. Taylor expanded in re around 0

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

                          \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        2. +-commutativeN/A

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

                          \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        4. unpow2N/A

                          \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        5. associate-*l*N/A

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

                          \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        7. *-lowering-*.f6466.9

                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                      8. Simplified66.9%

                        \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                      9. Step-by-step derivation
                        1. distribute-lft-inN/A

                          \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right) + re \cdot 1\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        2. associate-*r*N/A

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

                          \[\leadsto \left(\color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \frac{-1}{6}} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        4. cube-unmultN/A

                          \[\leadsto \left(\color{blue}{{re}^{3}} \cdot \frac{-1}{6} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        5. *-rgt-identityN/A

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

                          \[\leadsto \color{blue}{\mathsf{fma}\left({re}^{3}, \frac{-1}{6}, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        7. cube-unmultN/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        8. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                        9. *-lowering-*.f6466.9

                          \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot re\right)}, -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                      10. Applied egg-rr66.9%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]

                      if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                      1. Initial program 100.0%

                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                      4. Step-by-step derivation
                        1. +-commutativeN/A

                          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                        2. +-commutativeN/A

                          \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                        3. distribute-rgt-inN/A

                          \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                        4. *-commutativeN/A

                          \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                        5. associate-+l+N/A

                          \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                      5. Simplified92.5%

                        \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \color{blue}{re} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, \frac{1}{720}, \frac{1}{24}\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)\right) \]
                      7. Step-by-step derivation
                        1. Simplified51.5%

                          \[\leadsto \color{blue}{re} \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right) \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification60.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 12: 57.1% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \end{array} \end{array} \]
                      (FPCore (re im)
                       :precision binary64
                       (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                         (*
                          (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0)
                          (fma (* re (* re re)) -0.16666666666666666 re))
                         (*
                          re
                          (fma
                           (* im im)
                           (fma
                            (* im im)
                            (fma (* im im) 0.001388888888888889 0.041666666666666664)
                            0.5)
                           1.0))))
                      double code(double re, double im) {
                      	double tmp;
                      	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                      		tmp = fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0) * fma((re * (re * re)), -0.16666666666666666, re);
                      	} else {
                      		tmp = re * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
                      	}
                      	return tmp;
                      }
                      
                      function code(re, im)
                      	tmp = 0.0
                      	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                      		tmp = Float64(fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0) * fma(Float64(re * Float64(re * re)), -0.16666666666666666, re));
                      	else
                      		tmp = Float64(re * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0));
                      	end
                      	return tmp
                      end
                      
                      code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + re), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                      \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                          2. distribute-lft-inN/A

                            \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                          3. associate-+l+N/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                          4. associate-*r*N/A

                            \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                          5. associate-*r*N/A

                            \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                          7. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                          8. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                          9. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                          10. distribute-lft1-inN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                          11. unpow2N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                          12. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                          13. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                        5. Simplified91.5%

                          \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                        6. Taylor expanded in re around 0

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

                            \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          2. +-commutativeN/A

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

                            \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          4. unpow2N/A

                            \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          5. associate-*l*N/A

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

                            \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          7. *-lowering-*.f6466.9

                            \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        8. Simplified66.9%

                          \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        9. Step-by-step derivation
                          1. distribute-lft-inN/A

                            \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right) + re \cdot 1\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          2. associate-*r*N/A

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

                            \[\leadsto \left(\color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \frac{-1}{6}} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          4. cube-unmultN/A

                            \[\leadsto \left(\color{blue}{{re}^{3}} \cdot \frac{-1}{6} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          5. *-rgt-identityN/A

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left({re}^{3}, \frac{-1}{6}, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          7. cube-unmultN/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          8. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          9. *-lowering-*.f6466.9

                            \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot re\right)}, -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        10. Applied egg-rr66.9%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]

                        if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                          2. +-commutativeN/A

                            \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                          3. distribute-rgt-inN/A

                            \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                          4. *-commutativeN/A

                            \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                          5. associate-+l+N/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                        5. Simplified92.5%

                          \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                        7. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                          2. +-commutativeN/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) + 1\right)} \]
                          3. associate-+l+N/A

                            \[\leadsto re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right)} \]
                          4. metadata-evalN/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right) \]
                          5. pow-sqrN/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right) \]
                          6. associate-*r*N/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} + 1\right)\right) \]
                          7. *-commutativeN/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) \cdot {im}^{2}} + 1\right)\right) \]
                          8. associate-+l+N/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) \cdot {im}^{2}\right) + 1\right)} \]
                          9. distribute-rgt-inN/A

                            \[\leadsto re \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} + 1\right) \]
                          10. accelerator-lowering-fma.f64N/A

                            \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right), 1\right)} \]
                        8. Simplified51.5%

                          \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification60.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 13: 57.1% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \end{array} \end{array} \]
                      (FPCore (re im)
                       :precision binary64
                       (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                         (*
                          re
                          (*
                           (fma re (* re -0.16666666666666666) 1.0)
                           (fma (* im im) (fma (* im im) 0.041666666666666664 0.5) 1.0)))
                         (*
                          re
                          (fma
                           (* im im)
                           (fma
                            (* im im)
                            (fma (* im im) 0.001388888888888889 0.041666666666666664)
                            0.5)
                           1.0))))
                      double code(double re, double im) {
                      	double tmp;
                      	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                      		tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma((im * im), fma((im * im), 0.041666666666666664, 0.5), 1.0));
                      	} else {
                      		tmp = re * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
                      	}
                      	return tmp;
                      }
                      
                      function code(re, im)
                      	tmp = 0.0
                      	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                      		tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(Float64(im * im), fma(Float64(im * im), 0.041666666666666664, 0.5), 1.0)));
                      	else
                      		tmp = Float64(re * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0));
                      	end
                      	return tmp
                      end
                      
                      code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                      \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                          2. distribute-lft-inN/A

                            \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                          3. associate-+l+N/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                          4. associate-*r*N/A

                            \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                          5. associate-*r*N/A

                            \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                          7. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                          8. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                          9. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                          10. distribute-lft1-inN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                          11. unpow2N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                          12. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                          13. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                        5. Simplified91.5%

                          \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                        7. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                          2. +-commutativeN/A

                            \[\leadsto re \cdot \left(1 + \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right)}\right) \]
                          3. associate-+r+N/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)\right)} \]
                          4. associate-*r*N/A

                            \[\leadsto re \cdot \left(\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \]
                          5. distribute-rgt1-inN/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                          6. +-commutativeN/A

                            \[\leadsto re \cdot \left(\color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right) \]
                          7. *-lowering-*.f64N/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                        8. Simplified66.9%

                          \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right)\right)} \]

                        if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                          2. +-commutativeN/A

                            \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                          3. distribute-rgt-inN/A

                            \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                          4. *-commutativeN/A

                            \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                          5. associate-+l+N/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                        5. Simplified92.5%

                          \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                        7. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                          2. +-commutativeN/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) + 1\right)} \]
                          3. associate-+l+N/A

                            \[\leadsto re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right)} \]
                          4. metadata-evalN/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right) \]
                          5. pow-sqrN/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right) \]
                          6. associate-*r*N/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} + 1\right)\right) \]
                          7. *-commutativeN/A

                            \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) \cdot {im}^{2}} + 1\right)\right) \]
                          8. associate-+l+N/A

                            \[\leadsto re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) \cdot {im}^{2}\right) + 1\right)} \]
                          9. distribute-rgt-inN/A

                            \[\leadsto re \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} + 1\right) \]
                          10. accelerator-lowering-fma.f64N/A

                            \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right), 1\right)} \]
                        8. Simplified51.5%

                          \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification60.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 14: 53.7% accurate, 0.9× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \end{array} \end{array} \]
                      (FPCore (re im)
                       :precision binary64
                       (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                         (* (fma (* re (* re re)) -0.16666666666666666 re) (fma (* im im) 0.5 1.0))
                         (*
                          re
                          (fma
                           (* im im)
                           (fma
                            (* im im)
                            (fma (* im im) 0.001388888888888889 0.041666666666666664)
                            0.5)
                           1.0))))
                      double code(double re, double im) {
                      	double tmp;
                      	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                      		tmp = fma((re * (re * re)), -0.16666666666666666, re) * fma((im * im), 0.5, 1.0);
                      	} else {
                      		tmp = re * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
                      	}
                      	return tmp;
                      }
                      
                      function code(re, im)
                      	tmp = 0.0
                      	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                      		tmp = Float64(fma(Float64(re * Float64(re * re)), -0.16666666666666666, re) * fma(Float64(im * im), 0.5, 1.0));
                      	else
                      		tmp = Float64(re * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0));
                      	end
                      	return tmp
                      end
                      
                      code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                      \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                        1. Initial program 100.0%

                          \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in im around 0

                          \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                        4. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                          2. distribute-lft-inN/A

                            \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                          3. associate-+l+N/A

                            \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                          4. associate-*r*N/A

                            \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                          5. associate-*r*N/A

                            \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                          6. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                          7. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                          8. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                          9. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                          10. distribute-lft1-inN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                          11. unpow2N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                          12. associate-*r*N/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                          13. *-commutativeN/A

                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                        5. Simplified91.5%

                          \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                        6. Taylor expanded in re around 0

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

                            \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          2. +-commutativeN/A

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

                            \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          4. unpow2N/A

                            \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          5. associate-*l*N/A

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

                            \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          7. *-lowering-*.f6466.9

                            \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        8. Simplified66.9%

                          \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        9. Step-by-step derivation
                          1. distribute-lft-inN/A

                            \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right) + re \cdot 1\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          2. associate-*r*N/A

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

                            \[\leadsto \left(\color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \frac{-1}{6}} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          4. cube-unmultN/A

                            \[\leadsto \left(\color{blue}{{re}^{3}} \cdot \frac{-1}{6} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          5. *-rgt-identityN/A

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

                            \[\leadsto \color{blue}{\mathsf{fma}\left({re}^{3}, \frac{-1}{6}, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          7. cube-unmultN/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          8. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                          9. *-lowering-*.f6466.9

                            \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot re\right)}, -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        10. Applied egg-rr66.9%

                          \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                        11. Taylor expanded in im around 0

                          \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{2}}, 1\right) \]
                        12. Step-by-step derivation
                          1. Simplified61.2%

                            \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{0.5}, 1\right) \]

                          if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                          1. Initial program 100.0%

                            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                          2. Add Preprocessing
                          3. Taylor expanded in im around 0

                            \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                          4. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                            2. +-commutativeN/A

                              \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                            3. distribute-rgt-inN/A

                              \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                            4. *-commutativeN/A

                              \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                            5. associate-+l+N/A

                              \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                          5. Simplified92.5%

                            \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                          6. Taylor expanded in re around 0

                            \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                          7. Step-by-step derivation
                            1. *-lowering-*.f64N/A

                              \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \]
                            2. +-commutativeN/A

                              \[\leadsto re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) + 1\right)} \]
                            3. associate-+l+N/A

                              \[\leadsto re \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right)} \]
                            4. metadata-evalN/A

                              \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right) \]
                            5. pow-sqrN/A

                              \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) + 1\right)\right) \]
                            6. associate-*r*N/A

                              \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} + 1\right)\right) \]
                            7. *-commutativeN/A

                              \[\leadsto re \cdot \left(\frac{1}{2} \cdot {im}^{2} + \left(\color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) \cdot {im}^{2}} + 1\right)\right) \]
                            8. associate-+l+N/A

                              \[\leadsto re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + \left({im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) \cdot {im}^{2}\right) + 1\right)} \]
                            9. distribute-rgt-inN/A

                              \[\leadsto re \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)} + 1\right) \]
                            10. accelerator-lowering-fma.f64N/A

                              \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right), 1\right)} \]
                          8. Simplified51.5%

                            \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)} \]
                        13. Recombined 2 regimes into one program.
                        14. Final simplification57.3%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \end{array} \]
                        15. Add Preprocessing

                        Alternative 15: 52.4% accurate, 0.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), 0.041666666666666664, \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \end{array} \end{array} \]
                        (FPCore (re im)
                         :precision binary64
                         (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                           (* (fma (* re (* re re)) -0.16666666666666666 re) (fma (* im im) 0.5 1.0))
                           (*
                            re
                            (fma
                             (* im (* im (* im im)))
                             0.041666666666666664
                             (fma 0.5 (* im im) 1.0)))))
                        double code(double re, double im) {
                        	double tmp;
                        	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                        		tmp = fma((re * (re * re)), -0.16666666666666666, re) * fma((im * im), 0.5, 1.0);
                        	} else {
                        		tmp = re * fma((im * (im * (im * im))), 0.041666666666666664, fma(0.5, (im * im), 1.0));
                        	}
                        	return tmp;
                        }
                        
                        function code(re, im)
                        	tmp = 0.0
                        	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                        		tmp = Float64(fma(Float64(re * Float64(re * re)), -0.16666666666666666, re) * fma(Float64(im * im), 0.5, 1.0));
                        	else
                        		tmp = Float64(re * fma(Float64(im * Float64(im * Float64(im * im))), 0.041666666666666664, fma(0.5, Float64(im * im), 1.0)));
                        	end
                        	return tmp
                        end
                        
                        code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.041666666666666664 + N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                        \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), 0.041666666666666664, \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                          1. Initial program 100.0%

                            \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                          2. Add Preprocessing
                          3. Taylor expanded in im around 0

                            \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                          4. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                            2. distribute-lft-inN/A

                              \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                            3. associate-+l+N/A

                              \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                            4. associate-*r*N/A

                              \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                            5. associate-*r*N/A

                              \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                            6. *-commutativeN/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                            7. associate-*r*N/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                            8. *-commutativeN/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                            9. associate-*r*N/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                            10. distribute-lft1-inN/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                            11. unpow2N/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                            12. associate-*r*N/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                            13. *-commutativeN/A

                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                          5. Simplified91.5%

                            \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                          6. Taylor expanded in re around 0

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

                              \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            2. +-commutativeN/A

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

                              \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            4. unpow2N/A

                              \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            5. associate-*l*N/A

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

                              \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            7. *-lowering-*.f6466.9

                              \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                          8. Simplified66.9%

                            \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                          9. Step-by-step derivation
                            1. distribute-lft-inN/A

                              \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right) + re \cdot 1\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            2. associate-*r*N/A

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

                              \[\leadsto \left(\color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \frac{-1}{6}} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            4. cube-unmultN/A

                              \[\leadsto \left(\color{blue}{{re}^{3}} \cdot \frac{-1}{6} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            5. *-rgt-identityN/A

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

                              \[\leadsto \color{blue}{\mathsf{fma}\left({re}^{3}, \frac{-1}{6}, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            7. cube-unmultN/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            8. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                            9. *-lowering-*.f6466.9

                              \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot re\right)}, -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                          10. Applied egg-rr66.9%

                            \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                          11. Taylor expanded in im around 0

                            \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{2}}, 1\right) \]
                          12. Step-by-step derivation
                            1. Simplified61.2%

                              \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{0.5}, 1\right) \]

                            if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                            1. Initial program 100.0%

                              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                            2. Add Preprocessing
                            3. Taylor expanded in im around 0

                              \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                              2. distribute-lft-inN/A

                                \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                              3. associate-+l+N/A

                                \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                              4. associate-*r*N/A

                                \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                              5. associate-*r*N/A

                                \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                              6. *-commutativeN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                              7. associate-*r*N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                              8. *-commutativeN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                              9. associate-*r*N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                              10. distribute-lft1-inN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                              11. unpow2N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                              12. associate-*r*N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                              13. *-commutativeN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                            5. Simplified87.8%

                              \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                            6. Taylor expanded in re around 0

                              \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                            7. Step-by-step derivation
                              1. *-commutativeN/A

                                \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                              2. *-lowering-*.f64N/A

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

                                \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                              4. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                              5. unpow2N/A

                                \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                              6. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                              7. +-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                              8. *-commutativeN/A

                                \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                              9. accelerator-lowering-fma.f64N/A

                                \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                              10. unpow2N/A

                                \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                              11. *-lowering-*.f6448.7

                                \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                            8. Simplified48.7%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                            9. Step-by-step derivation
                              1. distribute-lft-inN/A

                                \[\leadsto \left(\color{blue}{\left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{1}{24}\right) + \left(im \cdot im\right) \cdot \frac{1}{2}\right)} + 1\right) \cdot re \]
                              2. associate-*r*N/A

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

                                \[\leadsto \left(\left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) + \color{blue}{\frac{1}{2} \cdot \left(im \cdot im\right)}\right) + 1\right) \cdot re \]
                              4. associate-+l+N/A

                                \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) + \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right)\right)} \cdot re \]
                              5. associate-*r*N/A

                                \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot \frac{1}{24}\right)} + \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right)\right) \cdot re \]
                              6. associate-*r*N/A

                                \[\leadsto \left(\color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \frac{1}{24}} + \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right)\right) \cdot re \]
                              7. associate-*r*N/A

                                \[\leadsto \left(\color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} \cdot \frac{1}{24} + \left(\frac{1}{2} \cdot \left(im \cdot im\right) + 1\right)\right) \cdot re \]
                              8. accelerator-lowering-fma.f64N/A

                                \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), \frac{1}{24}, \frac{1}{2} \cdot \left(im \cdot im\right) + 1\right)} \cdot re \]
                              9. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot \left(im \cdot \left(im \cdot im\right)\right)}, \frac{1}{24}, \frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot re \]
                              10. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(im \cdot \color{blue}{\left(im \cdot \left(im \cdot im\right)\right)}, \frac{1}{24}, \frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot re \]
                              11. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot im\right)}\right), \frac{1}{24}, \frac{1}{2} \cdot \left(im \cdot im\right) + 1\right) \cdot re \]
                              12. accelerator-lowering-fma.f64N/A

                                \[\leadsto \mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), \frac{1}{24}, \color{blue}{\mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right)}\right) \cdot re \]
                              13. *-lowering-*.f6449.7

                                \[\leadsto \mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), 0.041666666666666664, \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right)\right) \cdot re \]
                            10. Applied egg-rr49.7%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), 0.041666666666666664, \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \cdot re \]
                          13. Recombined 2 regimes into one program.
                          14. Final simplification56.6%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right), 0.041666666666666664, \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)\\ \end{array} \]
                          15. Add Preprocessing

                          Alternative 16: 52.3% accurate, 0.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\ \end{array} \end{array} \]
                          (FPCore (re im)
                           :precision binary64
                           (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                             (* (fma (* re (* re re)) -0.16666666666666666 re) (fma (* im im) 0.5 1.0))
                             (* (* (* im im) (* im im)) (* re 0.041666666666666664))))
                          double code(double re, double im) {
                          	double tmp;
                          	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                          		tmp = fma((re * (re * re)), -0.16666666666666666, re) * fma((im * im), 0.5, 1.0);
                          	} else {
                          		tmp = ((im * im) * (im * im)) * (re * 0.041666666666666664);
                          	}
                          	return tmp;
                          }
                          
                          function code(re, im)
                          	tmp = 0.0
                          	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                          		tmp = Float64(fma(Float64(re * Float64(re * re)), -0.16666666666666666, re) * fma(Float64(im * im), 0.5, 1.0));
                          	else
                          		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(re * 0.041666666666666664));
                          	end
                          	return tmp
                          end
                          
                          code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision] * -0.16666666666666666 + re), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                          \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                            1. Initial program 100.0%

                              \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                            2. Add Preprocessing
                            3. Taylor expanded in im around 0

                              \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                            4. Step-by-step derivation
                              1. +-commutativeN/A

                                \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                              2. distribute-lft-inN/A

                                \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                              3. associate-+l+N/A

                                \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                              4. associate-*r*N/A

                                \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                              5. associate-*r*N/A

                                \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                              6. *-commutativeN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                              7. associate-*r*N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                              8. *-commutativeN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                              9. associate-*r*N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                              10. distribute-lft1-inN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                              11. unpow2N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                              12. associate-*r*N/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                              13. *-commutativeN/A

                                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                            5. Simplified91.5%

                              \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                            6. Taylor expanded in re around 0

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

                                \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              2. +-commutativeN/A

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

                                \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              4. unpow2N/A

                                \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              5. associate-*l*N/A

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

                                \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              7. *-lowering-*.f6466.9

                                \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                            8. Simplified66.9%

                              \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                            9. Step-by-step derivation
                              1. distribute-lft-inN/A

                                \[\leadsto \color{blue}{\left(re \cdot \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right) + re \cdot 1\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              2. associate-*r*N/A

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

                                \[\leadsto \left(\color{blue}{\left(re \cdot \left(re \cdot re\right)\right) \cdot \frac{-1}{6}} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              4. cube-unmultN/A

                                \[\leadsto \left(\color{blue}{{re}^{3}} \cdot \frac{-1}{6} + re \cdot 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              5. *-rgt-identityN/A

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

                                \[\leadsto \color{blue}{\mathsf{fma}\left({re}^{3}, \frac{-1}{6}, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              7. cube-unmultN/A

                                \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              8. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(re \cdot re\right)}, \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              9. *-lowering-*.f6466.9

                                \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot re\right)}, -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                            10. Applied egg-rr66.9%

                              \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                            11. Taylor expanded in im around 0

                              \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot re\right), \frac{-1}{6}, re\right) \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{2}}, 1\right) \]
                            12. Step-by-step derivation
                              1. Simplified61.2%

                                \[\leadsto \mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{0.5}, 1\right) \]

                              if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                2. distribute-lft-inN/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                3. associate-+l+N/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                5. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                6. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                7. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                8. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                9. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                10. distribute-lft1-inN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                11. unpow2N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                12. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                13. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                              5. Simplified87.8%

                                \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                              7. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                2. *-lowering-*.f64N/A

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

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                4. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                5. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                7. +-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                8. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                9. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                10. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                11. *-lowering-*.f6448.7

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                              8. Simplified48.7%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                              9. Taylor expanded in im around inf

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

                                  \[\leadsto \color{blue}{{im}^{4} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right)} \]
                                2. metadata-evalN/A

                                  \[\leadsto {im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                3. pow-sqrN/A

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

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                5. unpow2N/A

                                  \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                7. unpow2N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                8. *-lowering-*.f64N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                9. associate-+r+N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot re + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right)} \]
                                10. *-commutativeN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(\color{blue}{re \cdot \frac{1}{24}} + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                11. associate-*r/N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{\frac{\frac{1}{2} \cdot re}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                12. *-commutativeN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \frac{\color{blue}{re \cdot \frac{1}{2}}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                13. associate-/l*N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{re \cdot \frac{\frac{1}{2}}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                14. metadata-evalN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \frac{\color{blue}{\frac{1}{2} \cdot 1}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                15. associate-*r/N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)}\right) + \frac{re}{{im}^{4}}\right) \]
                                16. distribute-lft-outN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{re \cdot \left(\frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)} + \frac{re}{{im}^{4}}\right) \]
                                17. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\mathsf{fma}\left(re, \frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}, \frac{re}{{im}^{4}}\right)} \]
                              11. Simplified49.0%

                                \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \mathsf{fma}\left(re, 0.041666666666666664 + \frac{0.5}{im \cdot im}, \frac{re}{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right)} \]
                              12. Taylor expanded in im around inf

                                \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\frac{1}{24} \cdot re\right)} \]
                              13. Step-by-step derivation
                                1. *-lowering-*.f6449.9

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot re\right)} \]
                              14. Simplified49.9%

                                \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot re\right)} \]
                            13. Recombined 2 regimes into one program.
                            14. Final simplification56.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot re\right), -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\ \end{array} \]
                            15. Add Preprocessing

                            Alternative 17: 52.3% accurate, 0.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(0.5, im \cdot im, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                               (* re (* (fma 0.5 (* im im) 1.0) (fma -0.16666666666666666 (* re re) 1.0)))
                               (* (* (* im im) (* im im)) (* re 0.041666666666666664))))
                            double code(double re, double im) {
                            	double tmp;
                            	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                            		tmp = re * (fma(0.5, (im * im), 1.0) * fma(-0.16666666666666666, (re * re), 1.0));
                            	} else {
                            		tmp = ((im * im) * (im * im)) * (re * 0.041666666666666664);
                            	}
                            	return tmp;
                            }
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                            		tmp = Float64(re * Float64(fma(0.5, Float64(im * im), 1.0) * fma(-0.16666666666666666, Float64(re * re), 1.0)));
                            	else
                            		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(re * 0.041666666666666664));
                            	end
                            	return tmp
                            end
                            
                            code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(re * N[(N[(0.5 * N[(im * im), $MachinePrecision] + 1.0), $MachinePrecision] * N[(-0.16666666666666666 * N[(re * re), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                            \;\;\;\;re \cdot \left(\mathsf{fma}\left(0.5, im \cdot im, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
                                2. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                3. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                4. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
                                5. +-commutativeN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
                                6. sub0-negN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
                                7. cosh-undefN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
                                8. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
                                9. metadata-evalN/A

                                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                10. exp-0N/A

                                  \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
                                11. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
                                12. exp-0N/A

                                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                13. cosh-lowering-cosh.f64N/A

                                  \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                14. sin-lowering-sin.f64100.0

                                  \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
                              4. Applied egg-rr100.0%

                                \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
                              5. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\left(1 + \frac{1}{2} \cdot {im}^{2}\right)} \cdot \sin re \]
                              6. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)} \cdot \sin re \]
                                2. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)} \cdot \sin re \]
                                3. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                                4. *-lowering-*.f6480.2

                                  \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                              7. Simplified80.2%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, im \cdot im, 1\right)} \cdot \sin re \]
                              8. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                              9. Step-by-step derivation
                                1. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                2. +-commutativeN/A

                                  \[\leadsto re \cdot \left(1 + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)}\right) \]
                                3. associate-+r+N/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto re \cdot \left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                                5. distribute-rgt1-inN/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                6. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                8. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {re}^{2} + 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                9. accelerator-lowering-fma.f64N/A

                                  \[\leadsto re \cdot \left(\color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                10. unpow2N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                11. *-lowering-*.f64N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                12. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right) \]
                                13. accelerator-lowering-fma.f64N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)}\right) \]
                                14. unpow2N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right)\right) \]
                                15. *-lowering-*.f6461.2

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right)\right) \]
                              10. Simplified61.2%

                                \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]

                              if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                2. distribute-lft-inN/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                3. associate-+l+N/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                5. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                6. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                7. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                8. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                9. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                10. distribute-lft1-inN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                11. unpow2N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                12. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                13. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                              5. Simplified87.8%

                                \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                              7. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                2. *-lowering-*.f64N/A

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

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                4. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                5. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                7. +-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                8. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                9. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                10. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                11. *-lowering-*.f6448.7

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                              8. Simplified48.7%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                              9. Taylor expanded in im around inf

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

                                  \[\leadsto \color{blue}{{im}^{4} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right)} \]
                                2. metadata-evalN/A

                                  \[\leadsto {im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                3. pow-sqrN/A

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

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                5. unpow2N/A

                                  \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                7. unpow2N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                8. *-lowering-*.f64N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                9. associate-+r+N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot re + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right)} \]
                                10. *-commutativeN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(\color{blue}{re \cdot \frac{1}{24}} + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                11. associate-*r/N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{\frac{\frac{1}{2} \cdot re}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                12. *-commutativeN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \frac{\color{blue}{re \cdot \frac{1}{2}}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                13. associate-/l*N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{re \cdot \frac{\frac{1}{2}}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                14. metadata-evalN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \frac{\color{blue}{\frac{1}{2} \cdot 1}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                15. associate-*r/N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)}\right) + \frac{re}{{im}^{4}}\right) \]
                                16. distribute-lft-outN/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{re \cdot \left(\frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)} + \frac{re}{{im}^{4}}\right) \]
                                17. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\mathsf{fma}\left(re, \frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}, \frac{re}{{im}^{4}}\right)} \]
                              11. Simplified49.0%

                                \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \mathsf{fma}\left(re, 0.041666666666666664 + \frac{0.5}{im \cdot im}, \frac{re}{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right)} \]
                              12. Taylor expanded in im around inf

                                \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\frac{1}{24} \cdot re\right)} \]
                              13. Step-by-step derivation
                                1. *-lowering-*.f6449.9

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot re\right)} \]
                              14. Simplified49.9%

                                \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot re\right)} \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification56.7%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(0.5, im \cdot im, 1\right) \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 18: 45.8% accurate, 0.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right)\right), re, re\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) -0.05)
                               (*
                                (* re re)
                                (* re (fma (* im im) -0.08333333333333333 -0.16666666666666666)))
                               (fma (* im (* im (fma (* im im) 0.041666666666666664 0.5))) re re)))
                            double code(double re, double im) {
                            	double tmp;
                            	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= -0.05) {
                            		tmp = (re * re) * (re * fma((im * im), -0.08333333333333333, -0.16666666666666666));
                            	} else {
                            		tmp = fma((im * (im * fma((im * im), 0.041666666666666664, 0.5))), re, re);
                            	}
                            	return tmp;
                            }
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= -0.05)
                            		tmp = Float64(Float64(re * re) * Float64(re * fma(Float64(im * im), -0.08333333333333333, -0.16666666666666666)));
                            	else
                            		tmp = fma(Float64(im * Float64(im * fma(Float64(im * im), 0.041666666666666664, 0.5))), re, re);
                            	end
                            	return tmp
                            end
                            
                            code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(re * re), $MachinePrecision] * N[(re * N[(N[(im * im), $MachinePrecision] * -0.08333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * re + re), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\
                            \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right)\right), re, re\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
                                2. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                3. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                4. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
                                5. +-commutativeN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
                                6. sub0-negN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
                                7. cosh-undefN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
                                8. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
                                9. metadata-evalN/A

                                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                10. exp-0N/A

                                  \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
                                11. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
                                12. exp-0N/A

                                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                13. cosh-lowering-cosh.f64N/A

                                  \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                14. sin-lowering-sin.f64100.0

                                  \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
                              4. Applied egg-rr100.0%

                                \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
                              5. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\left(1 + \frac{1}{2} \cdot {im}^{2}\right)} \cdot \sin re \]
                              6. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)} \cdot \sin re \]
                                2. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)} \cdot \sin re \]
                                3. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                                4. *-lowering-*.f6464.7

                                  \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                              7. Simplified64.7%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, im \cdot im, 1\right)} \cdot \sin re \]
                              8. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                              9. Step-by-step derivation
                                1. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                2. +-commutativeN/A

                                  \[\leadsto re \cdot \left(1 + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)}\right) \]
                                3. associate-+r+N/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto re \cdot \left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                                5. distribute-rgt1-inN/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                6. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                8. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {re}^{2} + 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                9. accelerator-lowering-fma.f64N/A

                                  \[\leadsto re \cdot \left(\color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                10. unpow2N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                11. *-lowering-*.f64N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                12. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right) \]
                                13. accelerator-lowering-fma.f64N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)}\right) \]
                                14. unpow2N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right)\right) \]
                                15. *-lowering-*.f6429.9

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right)\right) \]
                              10. Simplified29.9%

                                \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                              11. Taylor expanded in re around inf

                                \[\leadsto \color{blue}{\frac{-1}{6} \cdot \left({re}^{3} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                              12. Step-by-step derivation
                                1. *-commutativeN/A

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

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

                                  \[\leadsto {re}^{3} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                4. unpow3N/A

                                  \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot re\right)} \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                5. unpow2N/A

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

                                  \[\leadsto \color{blue}{{re}^{2} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{{re}^{2} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                8. unpow2N/A

                                  \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                9. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                10. *-lowering-*.f64N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \color{blue}{\left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                11. +-commutativeN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right)\right) \]
                                12. distribute-rgt-inN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \frac{-1}{6} + 1 \cdot \frac{-1}{6}\right)}\right) \]
                                13. metadata-evalN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \frac{-1}{6} + \color{blue}{\frac{-1}{6}}\right)\right) \]
                                14. *-commutativeN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\color{blue}{\left({im}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{-1}{6} + \frac{-1}{6}\right)\right) \]
                                15. associate-*l*N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \frac{-1}{6}\right)} + \frac{-1}{6}\right)\right) \]
                                16. metadata-evalN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left({im}^{2} \cdot \color{blue}{\frac{-1}{12}} + \frac{-1}{6}\right)\right) \]
                                17. metadata-evalN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \frac{1}{2}\right)} + \frac{-1}{6}\right)\right) \]
                                18. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)}\right) \]
                                19. unpow2N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)\right) \]
                                20. *-lowering-*.f64N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)\right) \]
                                21. metadata-eval11.0

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{-0.08333333333333333}, -0.16666666666666666\right)\right) \]
                              13. Simplified11.0%

                                \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)} \]

                              if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                2. distribute-lft-inN/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                3. associate-+l+N/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                5. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                6. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                7. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                8. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                9. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                10. distribute-lft1-inN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                11. unpow2N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                12. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                13. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                              5. Simplified92.0%

                                \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                              7. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                2. *-lowering-*.f64N/A

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

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                4. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                5. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                6. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                7. +-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                8. *-commutativeN/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                9. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                10. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                11. *-lowering-*.f6467.9

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                              8. Simplified67.9%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                              9. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{1}{24} + \frac{1}{2}\right) + 1\right)} \]
                                2. distribute-rgt-inN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(\left(\left(im \cdot im\right) \cdot \frac{1}{24}\right) \cdot \left(im \cdot im\right) + \frac{1}{2} \cdot \left(im \cdot im\right)\right)} + 1\right) \]
                                3. associate-*r*N/A

                                  \[\leadsto re \cdot \left(\left(\color{blue}{\left(im \cdot \left(im \cdot \frac{1}{24}\right)\right)} \cdot \left(im \cdot im\right) + \frac{1}{2} \cdot \left(im \cdot im\right)\right) + 1\right) \]
                                4. distribute-rgt-inN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right) + \frac{1}{2}\right)} + 1\right) \]
                                5. distribute-rgt-inN/A

                                  \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right) + \frac{1}{2}\right)\right) \cdot re + 1 \cdot re} \]
                                6. *-lft-identityN/A

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

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

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot \left(im \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right) + \frac{1}{2}\right)\right)}, re, re\right) \]
                                9. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot \left(im \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right) + \frac{1}{2}\right)\right)}, re, re\right) \]
                                10. *-lowering-*.f64N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot \frac{1}{24}\right) + \frac{1}{2}\right)\right)}, re, re\right) \]
                                11. associate-*r*N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot \left(im \cdot \left(\color{blue}{\left(im \cdot im\right) \cdot \frac{1}{24}} + \frac{1}{2}\right)\right), re, re\right) \]
                                12. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \mathsf{fma}\left(im \cdot \left(im \cdot \color{blue}{\mathsf{fma}\left(im \cdot im, \frac{1}{24}, \frac{1}{2}\right)}\right), re, re\right) \]
                                13. *-lowering-*.f6467.9

                                  \[\leadsto \mathsf{fma}\left(im \cdot \left(im \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right)\right), re, re\right) \]
                              10. Applied egg-rr67.9%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right)\right), re, re\right)} \]
                            3. Recombined 2 regimes into one program.
                            4. Final simplification49.9%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im \cdot \left(im \cdot \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right)\right), re, re\right)\\ \end{array} \]
                            5. Add Preprocessing

                            Alternative 19: 45.8% accurate, 0.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) -0.05)
                               (*
                                (* re re)
                                (* re (fma (* im im) -0.08333333333333333 -0.16666666666666666)))
                               (* re (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0))))
                            double code(double re, double im) {
                            	double tmp;
                            	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= -0.05) {
                            		tmp = (re * re) * (re * fma((im * im), -0.08333333333333333, -0.16666666666666666));
                            	} else {
                            		tmp = re * fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0);
                            	}
                            	return tmp;
                            }
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= -0.05)
                            		tmp = Float64(Float64(re * re) * Float64(re * fma(Float64(im * im), -0.08333333333333333, -0.16666666666666666)));
                            	else
                            		tmp = Float64(re * fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0));
                            	end
                            	return tmp
                            end
                            
                            code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(re * re), $MachinePrecision] * N[(re * N[(N[(im * im), $MachinePrecision] * -0.08333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\
                            \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Step-by-step derivation
                                1. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
                                2. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                3. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                4. *-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
                                5. +-commutativeN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
                                6. sub0-negN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
                                7. cosh-undefN/A

                                  \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
                                8. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
                                9. metadata-evalN/A

                                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                10. exp-0N/A

                                  \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
                                11. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
                                12. exp-0N/A

                                  \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                13. cosh-lowering-cosh.f64N/A

                                  \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                14. sin-lowering-sin.f64100.0

                                  \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
                              4. Applied egg-rr100.0%

                                \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
                              5. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\left(1 + \frac{1}{2} \cdot {im}^{2}\right)} \cdot \sin re \]
                              6. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)} \cdot \sin re \]
                                2. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)} \cdot \sin re \]
                                3. unpow2N/A

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                                4. *-lowering-*.f6464.7

                                  \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                              7. Simplified64.7%

                                \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, im \cdot im, 1\right)} \cdot \sin re \]
                              8. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                              9. Step-by-step derivation
                                1. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                2. +-commutativeN/A

                                  \[\leadsto re \cdot \left(1 + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)}\right) \]
                                3. associate-+r+N/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto re \cdot \left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                                5. distribute-rgt1-inN/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                6. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                8. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {re}^{2} + 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                9. accelerator-lowering-fma.f64N/A

                                  \[\leadsto re \cdot \left(\color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                10. unpow2N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                11. *-lowering-*.f64N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                12. +-commutativeN/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right) \]
                                13. accelerator-lowering-fma.f64N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)}\right) \]
                                14. unpow2N/A

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right)\right) \]
                                15. *-lowering-*.f6429.9

                                  \[\leadsto re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right)\right) \]
                              10. Simplified29.9%

                                \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                              11. Taylor expanded in re around inf

                                \[\leadsto \color{blue}{\frac{-1}{6} \cdot \left({re}^{3} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                              12. Step-by-step derivation
                                1. *-commutativeN/A

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

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

                                  \[\leadsto {re}^{3} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                4. unpow3N/A

                                  \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot re\right)} \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                5. unpow2N/A

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

                                  \[\leadsto \color{blue}{{re}^{2} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                7. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{{re}^{2} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                8. unpow2N/A

                                  \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                9. *-lowering-*.f64N/A

                                  \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                10. *-lowering-*.f64N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \color{blue}{\left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                11. +-commutativeN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right)\right) \]
                                12. distribute-rgt-inN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \frac{-1}{6} + 1 \cdot \frac{-1}{6}\right)}\right) \]
                                13. metadata-evalN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \frac{-1}{6} + \color{blue}{\frac{-1}{6}}\right)\right) \]
                                14. *-commutativeN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\color{blue}{\left({im}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{-1}{6} + \frac{-1}{6}\right)\right) \]
                                15. associate-*l*N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \frac{-1}{6}\right)} + \frac{-1}{6}\right)\right) \]
                                16. metadata-evalN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left({im}^{2} \cdot \color{blue}{\frac{-1}{12}} + \frac{-1}{6}\right)\right) \]
                                17. metadata-evalN/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \frac{1}{2}\right)} + \frac{-1}{6}\right)\right) \]
                                18. accelerator-lowering-fma.f64N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)}\right) \]
                                19. unpow2N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)\right) \]
                                20. *-lowering-*.f64N/A

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)\right) \]
                                21. metadata-eval11.0

                                  \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{-0.08333333333333333}, -0.16666666666666666\right)\right) \]
                              13. Simplified11.0%

                                \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)} \]

                              if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                              1. Initial program 100.0%

                                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                              2. Add Preprocessing
                              3. Taylor expanded in im around 0

                                \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                2. distribute-lft-inN/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                3. associate-+l+N/A

                                  \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                4. associate-*r*N/A

                                  \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                5. associate-*r*N/A

                                  \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                6. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                7. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                8. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                9. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                10. distribute-lft1-inN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                11. unpow2N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                12. associate-*r*N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                13. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                              5. Simplified92.0%

                                \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                              6. Taylor expanded in re around 0

                                \[\leadsto \color{blue}{re} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                              7. Step-by-step derivation
                                1. Simplified67.9%

                                  \[\leadsto \color{blue}{re} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                              8. Recombined 2 regimes into one program.
                              9. Final simplification49.9%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 20: 45.6% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot 0.041666666666666664\right), 1\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) -0.05)
                                 (*
                                  (* re re)
                                  (* re (fma (* im im) -0.08333333333333333 -0.16666666666666666)))
                                 (* re (fma (* im im) (* im (* im 0.041666666666666664)) 1.0))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= -0.05) {
                              		tmp = (re * re) * (re * fma((im * im), -0.08333333333333333, -0.16666666666666666));
                              	} else {
                              		tmp = re * fma((im * im), (im * (im * 0.041666666666666664)), 1.0);
                              	}
                              	return tmp;
                              }
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= -0.05)
                              		tmp = Float64(Float64(re * re) * Float64(re * fma(Float64(im * im), -0.08333333333333333, -0.16666666666666666)));
                              	else
                              		tmp = Float64(re * fma(Float64(im * im), Float64(im * Float64(im * 0.041666666666666664)), 1.0));
                              	end
                              	return tmp
                              end
                              
                              code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.05], N[(N[(re * re), $MachinePrecision] * N[(re * N[(N[(im * im), $MachinePrecision] * -0.08333333333333333 + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\
                              \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot 0.041666666666666664\right), 1\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(e^{0 - im} + e^{im}\right) \cdot \left(\frac{1}{2} \cdot \sin re\right)} \]
                                  2. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                  3. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{\left(\left(e^{0 - im} + e^{im}\right) \cdot \frac{1}{2}\right) \cdot \sin re} \]
                                  4. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \left(e^{0 - im} + e^{im}\right)\right)} \cdot \sin re \]
                                  5. +-commutativeN/A

                                    \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(e^{im} + e^{0 - im}\right)}\right) \cdot \sin re \]
                                  6. sub0-negN/A

                                    \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{\mathsf{neg}\left(im\right)}}\right)\right) \cdot \sin re \]
                                  7. cosh-undefN/A

                                    \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{\left(2 \cdot \cosh im\right)}\right) \cdot \sin re \]
                                  8. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left(\left(\frac{1}{2} \cdot 2\right) \cdot \cosh im\right)} \cdot \sin re \]
                                  9. metadata-evalN/A

                                    \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                  10. exp-0N/A

                                    \[\leadsto \left(\color{blue}{e^{0}} \cdot \cosh im\right) \cdot \sin re \]
                                  11. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{\left(e^{0} \cdot \cosh im\right)} \cdot \sin re \]
                                  12. exp-0N/A

                                    \[\leadsto \left(\color{blue}{1} \cdot \cosh im\right) \cdot \sin re \]
                                  13. cosh-lowering-cosh.f64N/A

                                    \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                  14. sin-lowering-sin.f64100.0

                                    \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\sin re} \]
                                4. Applied egg-rr100.0%

                                  \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right) \cdot \sin re} \]
                                5. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\left(1 + \frac{1}{2} \cdot {im}^{2}\right)} \cdot \sin re \]
                                6. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)} \cdot \sin re \]
                                  2. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)} \cdot \sin re \]
                                  3. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                                  4. *-lowering-*.f6464.7

                                    \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                                7. Simplified64.7%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(0.5, im \cdot im, 1\right)} \cdot \sin re \]
                                8. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                9. Step-by-step derivation
                                  1. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                  2. +-commutativeN/A

                                    \[\leadsto re \cdot \left(1 + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)}\right) \]
                                  3. associate-+r+N/A

                                    \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto re \cdot \left(\left(1 + \frac{1}{2} \cdot {im}^{2}\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)}\right) \]
                                  5. distribute-rgt1-inN/A

                                    \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                  6. +-commutativeN/A

                                    \[\leadsto re \cdot \left(\color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                  7. *-lowering-*.f64N/A

                                    \[\leadsto re \cdot \color{blue}{\left(\left(1 + \frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                  8. +-commutativeN/A

                                    \[\leadsto re \cdot \left(\color{blue}{\left(\frac{-1}{6} \cdot {re}^{2} + 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                  9. accelerator-lowering-fma.f64N/A

                                    \[\leadsto re \cdot \left(\color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                  10. unpow2N/A

                                    \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                  11. *-lowering-*.f64N/A

                                    \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                  12. +-commutativeN/A

                                    \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right) \]
                                  13. accelerator-lowering-fma.f64N/A

                                    \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2}, {im}^{2}, 1\right)}\right) \]
                                  14. unpow2N/A

                                    \[\leadsto re \cdot \left(\mathsf{fma}\left(\frac{-1}{6}, re \cdot re, 1\right) \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right)\right) \]
                                  15. *-lowering-*.f6429.9

                                    \[\leadsto re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right)\right) \]
                                10. Simplified29.9%

                                  \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                                11. Taylor expanded in re around inf

                                  \[\leadsto \color{blue}{\frac{-1}{6} \cdot \left({re}^{3} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                12. Step-by-step derivation
                                  1. *-commutativeN/A

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

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

                                    \[\leadsto {re}^{3} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)} \]
                                  4. unpow3N/A

                                    \[\leadsto \color{blue}{\left(\left(re \cdot re\right) \cdot re\right)} \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right) \]
                                  5. unpow2N/A

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

                                    \[\leadsto \color{blue}{{re}^{2} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                  7. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{{re}^{2} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                  8. unpow2N/A

                                    \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                  9. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right) \]
                                  10. *-lowering-*.f64N/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \color{blue}{\left(re \cdot \left(\frac{-1}{6} \cdot \left(1 + \frac{1}{2} \cdot {im}^{2}\right)\right)\right)} \]
                                  11. +-commutativeN/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\frac{-1}{6} \cdot \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right)}\right)\right) \]
                                  12. distribute-rgt-inN/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \frac{-1}{6} + 1 \cdot \frac{-1}{6}\right)}\right) \]
                                  13. metadata-evalN/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \frac{-1}{6} + \color{blue}{\frac{-1}{6}}\right)\right) \]
                                  14. *-commutativeN/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\color{blue}{\left({im}^{2} \cdot \frac{1}{2}\right)} \cdot \frac{-1}{6} + \frac{-1}{6}\right)\right) \]
                                  15. associate-*l*N/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \frac{-1}{6}\right)} + \frac{-1}{6}\right)\right) \]
                                  16. metadata-evalN/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left({im}^{2} \cdot \color{blue}{\frac{-1}{12}} + \frac{-1}{6}\right)\right) \]
                                  17. metadata-evalN/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \left({im}^{2} \cdot \color{blue}{\left(\frac{-1}{6} \cdot \frac{1}{2}\right)} + \frac{-1}{6}\right)\right) \]
                                  18. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)}\right) \]
                                  19. unpow2N/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)\right) \]
                                  20. *-lowering-*.f64N/A

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{-1}{6} \cdot \frac{1}{2}, \frac{-1}{6}\right)\right) \]
                                  21. metadata-eval11.0

                                    \[\leadsto \left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, \color{blue}{-0.08333333333333333}, -0.16666666666666666\right)\right) \]
                                13. Simplified11.0%

                                  \[\leadsto \color{blue}{\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)} \]

                                if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified92.0%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                                7. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                  2. *-lowering-*.f64N/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                  4. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                  5. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  7. +-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                  8. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                  9. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                  10. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                  11. *-lowering-*.f6467.9

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                                8. Simplified67.9%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                                9. Taylor expanded in im around inf

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2}}, 1\right) \cdot re \]
                                10. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}}, 1\right) \cdot re \]
                                  2. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{24}, 1\right) \cdot re \]
                                  3. associate-*l*N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \left(im \cdot \frac{1}{24}\right)}, 1\right) \cdot re \]
                                  4. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(\frac{1}{24} \cdot im\right)}, 1\right) \cdot re \]
                                  5. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \left(\frac{1}{24} \cdot im\right)}, 1\right) \cdot re \]
                                  6. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(im \cdot \frac{1}{24}\right)}, 1\right) \cdot re \]
                                  7. *-lowering-*.f6467.8

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}, 1\right) \cdot re \]
                                11. Simplified67.8%

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{im \cdot \left(im \cdot 0.041666666666666664\right)}, 1\right) \cdot re \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification49.8%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;\left(re \cdot re\right) \cdot \left(re \cdot \mathsf{fma}\left(im \cdot im, -0.08333333333333333, -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, im \cdot \left(im \cdot 0.041666666666666664\right), 1\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 21: 44.5% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                                 (fma (* re (* re -0.16666666666666666)) re re)
                                 (* (* (* im im) (* im im)) (* re 0.041666666666666664))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                              		tmp = fma((re * (re * -0.16666666666666666)), re, re);
                              	} else {
                              		tmp = ((im * im) * (im * im)) * (re * 0.041666666666666664);
                              	}
                              	return tmp;
                              }
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                              		tmp = fma(Float64(re * Float64(re * -0.16666666666666666)), re, re);
                              	else
                              		tmp = Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(re * 0.041666666666666664));
                              	end
                              	return tmp
                              end
                              
                              code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * re + re), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                              \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified91.5%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

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

                                    \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  2. +-commutativeN/A

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

                                    \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  5. associate-*l*N/A

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

                                    \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  7. *-lowering-*.f6466.9

                                    \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                8. Simplified66.9%

                                  \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                9. Taylor expanded in im around 0

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

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

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

                                    \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                  4. unpow2N/A

                                    \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                  5. *-lowering-*.f6450.8

                                    \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                11. Simplified50.8%

                                  \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]
                                12. Step-by-step derivation
                                  1. distribute-rgt-inN/A

                                    \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot \left(re \cdot re\right)\right) \cdot re + 1 \cdot re} \]
                                  2. *-lft-identityN/A

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot \left(re \cdot re\right), re, re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{6} \cdot re\right) \cdot re}, re, re\right) \]
                                  5. *-commutativeN/A

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot re\right)}, re, re\right) \]
                                  7. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{-1}{6}\right)}, re, re\right) \]
                                  8. *-lowering-*.f6450.8

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}, re, re\right) \]
                                13. Applied egg-rr50.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)} \]

                                if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified87.8%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                                7. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                  2. *-lowering-*.f64N/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                  4. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                  5. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  7. +-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                  8. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                  9. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                  10. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                  11. *-lowering-*.f6448.7

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                                8. Simplified48.7%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                                9. Taylor expanded in im around inf

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

                                    \[\leadsto \color{blue}{{im}^{4} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right)} \]
                                  2. metadata-evalN/A

                                    \[\leadsto {im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  3. pow-sqrN/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  5. unpow2N/A

                                    \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  7. unpow2N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  8. *-lowering-*.f64N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  9. associate-+r+N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot re + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right)} \]
                                  10. *-commutativeN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(\color{blue}{re \cdot \frac{1}{24}} + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  11. associate-*r/N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{\frac{\frac{1}{2} \cdot re}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  12. *-commutativeN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \frac{\color{blue}{re \cdot \frac{1}{2}}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  13. associate-/l*N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{re \cdot \frac{\frac{1}{2}}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  14. metadata-evalN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \frac{\color{blue}{\frac{1}{2} \cdot 1}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  15. associate-*r/N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)}\right) + \frac{re}{{im}^{4}}\right) \]
                                  16. distribute-lft-outN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{re \cdot \left(\frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)} + \frac{re}{{im}^{4}}\right) \]
                                  17. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\mathsf{fma}\left(re, \frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}, \frac{re}{{im}^{4}}\right)} \]
                                11. Simplified49.0%

                                  \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \mathsf{fma}\left(re, 0.041666666666666664 + \frac{0.5}{im \cdot im}, \frac{re}{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right)} \]
                                12. Taylor expanded in im around inf

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\frac{1}{24} \cdot re\right)} \]
                                13. Step-by-step derivation
                                  1. *-lowering-*.f6449.9

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot re\right)} \]
                                14. Simplified49.9%

                                  \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.041666666666666664 \cdot re\right)} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification50.5%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot 0.041666666666666664\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 22: 44.5% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                                 (fma (* re (* re -0.16666666666666666)) re re)
                                 (* re (* im (* im (* im (* im 0.041666666666666664)))))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                              		tmp = fma((re * (re * -0.16666666666666666)), re, re);
                              	} else {
                              		tmp = re * (im * (im * (im * (im * 0.041666666666666664))));
                              	}
                              	return tmp;
                              }
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                              		tmp = fma(Float64(re * Float64(re * -0.16666666666666666)), re, re);
                              	else
                              		tmp = Float64(re * Float64(im * Float64(im * Float64(im * Float64(im * 0.041666666666666664)))));
                              	end
                              	return tmp
                              end
                              
                              code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * re + re), $MachinePrecision], N[(re * N[(im * N[(im * N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                              \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified91.5%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

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

                                    \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  2. +-commutativeN/A

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

                                    \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  5. associate-*l*N/A

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

                                    \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  7. *-lowering-*.f6466.9

                                    \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                8. Simplified66.9%

                                  \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                9. Taylor expanded in im around 0

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

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

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

                                    \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                  4. unpow2N/A

                                    \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                  5. *-lowering-*.f6450.8

                                    \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                11. Simplified50.8%

                                  \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]
                                12. Step-by-step derivation
                                  1. distribute-rgt-inN/A

                                    \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot \left(re \cdot re\right)\right) \cdot re + 1 \cdot re} \]
                                  2. *-lft-identityN/A

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot \left(re \cdot re\right), re, re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{6} \cdot re\right) \cdot re}, re, re\right) \]
                                  5. *-commutativeN/A

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot re\right)}, re, re\right) \]
                                  7. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{-1}{6}\right)}, re, re\right) \]
                                  8. *-lowering-*.f6450.8

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}, re, re\right) \]
                                13. Applied egg-rr50.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)} \]

                                if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified87.8%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                                7. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                  2. *-lowering-*.f64N/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                  4. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                  5. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  7. +-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                  8. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                  9. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                  10. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                  11. *-lowering-*.f6448.7

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                                8. Simplified48.7%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                                9. Taylor expanded in im around inf

                                  \[\leadsto \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)} \cdot re \]
                                10. Step-by-step derivation
                                  1. metadata-evalN/A

                                    \[\leadsto \left(\frac{1}{24} \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}}\right) \cdot re \]
                                  2. pow-sqrN/A

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

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)} \cdot re \]
                                  5. unpow2N/A

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

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

                                    \[\leadsto \color{blue}{\left(im \cdot \left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \cdot re \]
                                  8. *-lowering-*.f64N/A

                                    \[\leadsto \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)}\right) \cdot re \]
                                  9. *-commutativeN/A

                                    \[\leadsto \left(im \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \frac{1}{24}\right)}\right)\right) \cdot re \]
                                  10. unpow2N/A

                                    \[\leadsto \left(im \cdot \left(im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{24}\right)\right)\right) \cdot re \]
                                  11. associate-*l*N/A

                                    \[\leadsto \left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot \left(im \cdot \frac{1}{24}\right)\right)}\right)\right) \cdot re \]
                                  12. *-commutativeN/A

                                    \[\leadsto \left(im \cdot \left(im \cdot \left(im \cdot \color{blue}{\left(\frac{1}{24} \cdot im\right)}\right)\right)\right) \cdot re \]
                                  13. *-lowering-*.f64N/A

                                    \[\leadsto \left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot im\right)\right)}\right)\right) \cdot re \]
                                  14. *-commutativeN/A

                                    \[\leadsto \left(im \cdot \left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{24}\right)}\right)\right)\right) \cdot re \]
                                  15. *-lowering-*.f6449.0

                                    \[\leadsto \left(im \cdot \left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot 0.041666666666666664\right)}\right)\right)\right) \cdot re \]
                                11. Simplified49.0%

                                  \[\leadsto \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\right)} \cdot re \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification50.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 23: 42.9% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                                 (fma (* re (* re -0.16666666666666666)) re re)
                                 (* im (* im (* re (* (* im im) 0.041666666666666664))))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                              		tmp = fma((re * (re * -0.16666666666666666)), re, re);
                              	} else {
                              		tmp = im * (im * (re * ((im * im) * 0.041666666666666664)));
                              	}
                              	return tmp;
                              }
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                              		tmp = fma(Float64(re * Float64(re * -0.16666666666666666)), re, re);
                              	else
                              		tmp = Float64(im * Float64(im * Float64(re * Float64(Float64(im * im) * 0.041666666666666664))));
                              	end
                              	return tmp
                              end
                              
                              code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * re + re), $MachinePrecision], N[(im * N[(im * N[(re * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                              \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;im \cdot \left(im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified91.5%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

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

                                    \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  2. +-commutativeN/A

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

                                    \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  5. associate-*l*N/A

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

                                    \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  7. *-lowering-*.f6466.9

                                    \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                8. Simplified66.9%

                                  \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                9. Taylor expanded in im around 0

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

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

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

                                    \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                  4. unpow2N/A

                                    \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                  5. *-lowering-*.f6450.8

                                    \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                11. Simplified50.8%

                                  \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]
                                12. Step-by-step derivation
                                  1. distribute-rgt-inN/A

                                    \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot \left(re \cdot re\right)\right) \cdot re + 1 \cdot re} \]
                                  2. *-lft-identityN/A

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot \left(re \cdot re\right), re, re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{6} \cdot re\right) \cdot re}, re, re\right) \]
                                  5. *-commutativeN/A

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot re\right)}, re, re\right) \]
                                  7. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{-1}{6}\right)}, re, re\right) \]
                                  8. *-lowering-*.f6450.8

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}, re, re\right) \]
                                13. Applied egg-rr50.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)} \]

                                if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified87.8%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                                7. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                  2. *-lowering-*.f64N/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                  4. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                  5. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  7. +-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                  8. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                  9. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                  10. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                  11. *-lowering-*.f6448.7

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                                8. Simplified48.7%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                                9. Taylor expanded in im around inf

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

                                    \[\leadsto \color{blue}{{im}^{4} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right)} \]
                                  2. metadata-evalN/A

                                    \[\leadsto {im}^{\color{blue}{\left(2 \cdot 2\right)}} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  3. pow-sqrN/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  5. unpow2N/A

                                    \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \left(\color{blue}{\left(im \cdot im\right)} \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  7. unpow2N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  8. *-lowering-*.f64N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left(\frac{1}{24} \cdot re + \left(\frac{1}{2} \cdot \frac{re}{{im}^{2}} + \frac{re}{{im}^{4}}\right)\right) \]
                                  9. associate-+r+N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot re + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right)} \]
                                  10. *-commutativeN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(\color{blue}{re \cdot \frac{1}{24}} + \frac{1}{2} \cdot \frac{re}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  11. associate-*r/N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{\frac{\frac{1}{2} \cdot re}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  12. *-commutativeN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \frac{\color{blue}{re \cdot \frac{1}{2}}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  13. associate-/l*N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + \color{blue}{re \cdot \frac{\frac{1}{2}}{{im}^{2}}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  14. metadata-evalN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \frac{\color{blue}{\frac{1}{2} \cdot 1}}{{im}^{2}}\right) + \frac{re}{{im}^{4}}\right) \]
                                  15. associate-*r/N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot \frac{1}{24} + re \cdot \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)}\right) + \frac{re}{{im}^{4}}\right) \]
                                  16. distribute-lft-outN/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{re \cdot \left(\frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}\right)} + \frac{re}{{im}^{4}}\right) \]
                                  17. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\mathsf{fma}\left(re, \frac{1}{24} + \frac{1}{2} \cdot \frac{1}{{im}^{2}}, \frac{re}{{im}^{4}}\right)} \]
                                11. Simplified49.0%

                                  \[\leadsto \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \mathsf{fma}\left(re, 0.041666666666666664 + \frac{0.5}{im \cdot im}, \frac{re}{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right)} \]
                                12. Taylor expanded in im around inf

                                  \[\leadsto \color{blue}{\frac{1}{24} \cdot \left({im}^{4} \cdot re\right)} \]
                                13. Step-by-step derivation
                                  1. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right) \cdot re} \]
                                  2. metadata-evalN/A

                                    \[\leadsto \left(\frac{1}{24} \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}}\right) \cdot re \]
                                  3. pow-sqrN/A

                                    \[\leadsto \left(\frac{1}{24} \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)}\right) \cdot re \]
                                  4. associate-*l*N/A

                                    \[\leadsto \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot {im}^{2}\right)} \cdot re \]
                                  5. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right)} \cdot re \]
                                  6. associate-*r*N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot re\right)} \]
                                  7. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\frac{1}{24} \cdot \left({im}^{2} \cdot re\right)\right)} \]
                                  8. unpow2N/A

                                    \[\leadsto \color{blue}{\left(im \cdot im\right)} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot re\right)\right) \]
                                  9. associate-*l*N/A

                                    \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot re\right)\right)\right)} \]
                                  10. *-lowering-*.f64N/A

                                    \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot re\right)\right)\right)} \]
                                  11. *-lowering-*.f64N/A

                                    \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot re\right)\right)\right)} \]
                                  12. associate-*r*N/A

                                    \[\leadsto im \cdot \left(im \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot re\right)}\right) \]
                                  13. *-lowering-*.f64N/A

                                    \[\leadsto im \cdot \left(im \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot re\right)}\right) \]
                                  14. *-commutativeN/A

                                    \[\leadsto im \cdot \left(im \cdot \left(\color{blue}{\left({im}^{2} \cdot \frac{1}{24}\right)} \cdot re\right)\right) \]
                                  15. *-lowering-*.f64N/A

                                    \[\leadsto im \cdot \left(im \cdot \left(\color{blue}{\left({im}^{2} \cdot \frac{1}{24}\right)} \cdot re\right)\right) \]
                                  16. unpow2N/A

                                    \[\leadsto im \cdot \left(im \cdot \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{24}\right) \cdot re\right)\right) \]
                                  17. *-lowering-*.f6447.2

                                    \[\leadsto im \cdot \left(im \cdot \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot 0.041666666666666664\right) \cdot re\right)\right) \]
                                14. Simplified47.2%

                                  \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\left(\left(im \cdot im\right) \cdot 0.041666666666666664\right) \cdot re\right)\right)} \]
                              3. Recombined 2 regimes into one program.
                              4. Final simplification49.4%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \]
                              5. Add Preprocessing

                              Alternative 24: 40.3% accurate, 0.9× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \end{array} \end{array} \]
                              (FPCore (re im)
                               :precision binary64
                               (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                                 (fma (* re (* re -0.16666666666666666)) re re)
                                 (* re (fma (* im im) 0.5 1.0))))
                              double code(double re, double im) {
                              	double tmp;
                              	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                              		tmp = fma((re * (re * -0.16666666666666666)), re, re);
                              	} else {
                              		tmp = re * fma((im * im), 0.5, 1.0);
                              	}
                              	return tmp;
                              }
                              
                              function code(re, im)
                              	tmp = 0.0
                              	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                              		tmp = fma(Float64(re * Float64(re * -0.16666666666666666)), re, re);
                              	else
                              		tmp = Float64(re * fma(Float64(im * im), 0.5, 1.0));
                              	end
                              	return tmp
                              end
                              
                              code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * re + re), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                              \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified91.5%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

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

                                    \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  2. +-commutativeN/A

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

                                    \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  4. unpow2N/A

                                    \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  5. associate-*l*N/A

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

                                    \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                  7. *-lowering-*.f6466.9

                                    \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                8. Simplified66.9%

                                  \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                9. Taylor expanded in im around 0

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

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

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

                                    \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                  4. unpow2N/A

                                    \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                  5. *-lowering-*.f6450.8

                                    \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                11. Simplified50.8%

                                  \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]
                                12. Step-by-step derivation
                                  1. distribute-rgt-inN/A

                                    \[\leadsto \color{blue}{\left(\frac{-1}{6} \cdot \left(re \cdot re\right)\right) \cdot re + 1 \cdot re} \]
                                  2. *-lft-identityN/A

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

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot \left(re \cdot re\right), re, re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{\left(\frac{-1}{6} \cdot re\right) \cdot re}, re, re\right) \]
                                  5. *-commutativeN/A

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

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{re \cdot \left(\frac{-1}{6} \cdot re\right)}, re, re\right) \]
                                  7. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot \frac{-1}{6}\right)}, re, re\right) \]
                                  8. *-lowering-*.f6450.8

                                    \[\leadsto \mathsf{fma}\left(re \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}, re, re\right) \]
                                13. Applied egg-rr50.8%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)} \]

                                if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                1. Initial program 100.0%

                                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in im around 0

                                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                4. Step-by-step derivation
                                  1. +-commutativeN/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                  2. distribute-lft-inN/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                  3. associate-+l+N/A

                                    \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                  4. associate-*r*N/A

                                    \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  5. associate-*r*N/A

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                  6. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                  7. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                  8. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                  9. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                  10. distribute-lft1-inN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                  11. unpow2N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                  12. associate-*r*N/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                  13. *-commutativeN/A

                                    \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                5. Simplified87.8%

                                  \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                6. Taylor expanded in re around 0

                                  \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                                7. Step-by-step derivation
                                  1. *-commutativeN/A

                                    \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                  2. *-lowering-*.f64N/A

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

                                    \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                  4. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                  5. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  6. *-lowering-*.f64N/A

                                    \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                  7. +-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                  8. *-commutativeN/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                  9. accelerator-lowering-fma.f64N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                  10. unpow2N/A

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                  11. *-lowering-*.f6448.7

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                                8. Simplified48.7%

                                  \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                                9. Taylor expanded in im around 0

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{2}}, 1\right) \cdot re \]
                                10. Step-by-step derivation
                                  1. Simplified43.2%

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{0.5}, 1\right) \cdot re \]
                                11. Recombined 2 regimes into one program.
                                12. Final simplification47.8%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;\mathsf{fma}\left(re \cdot \left(re \cdot -0.16666666666666666\right), re, re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \end{array} \]
                                13. Add Preprocessing

                                Alternative 25: 40.3% accurate, 0.9× speedup?

                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \end{array} \end{array} \]
                                (FPCore (re im)
                                 :precision binary64
                                 (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) 0.0001)
                                   (* re (fma -0.16666666666666666 (* re re) 1.0))
                                   (* re (fma (* im im) 0.5 1.0))))
                                double code(double re, double im) {
                                	double tmp;
                                	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= 0.0001) {
                                		tmp = re * fma(-0.16666666666666666, (re * re), 1.0);
                                	} else {
                                		tmp = re * fma((im * im), 0.5, 1.0);
                                	}
                                	return tmp;
                                }
                                
                                function code(re, im)
                                	tmp = 0.0
                                	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= 0.0001)
                                		tmp = Float64(re * fma(-0.16666666666666666, Float64(re * re), 1.0));
                                	else
                                		tmp = Float64(re * fma(Float64(im * im), 0.5, 1.0));
                                	end
                                	return tmp
                                end
                                
                                code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0001], N[(re * N[(-0.16666666666666666 * N[(re * re), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im * im), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision]), $MachinePrecision]]
                                
                                \begin{array}{l}
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\
                                \;\;\;\;re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < 1.00000000000000005e-4

                                  1. Initial program 100.0%

                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in im around 0

                                    \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                    2. distribute-lft-inN/A

                                      \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                    3. associate-+l+N/A

                                      \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                    4. associate-*r*N/A

                                      \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                    5. associate-*r*N/A

                                      \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                    6. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                    7. associate-*r*N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                    8. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                    9. associate-*r*N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                    10. distribute-lft1-inN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                    11. unpow2N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                    12. associate-*r*N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                    13. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                  5. Simplified91.5%

                                    \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                  6. Taylor expanded in re around 0

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

                                      \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                    2. +-commutativeN/A

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

                                      \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                    4. unpow2N/A

                                      \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                    5. associate-*l*N/A

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

                                      \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                    7. *-lowering-*.f6466.9

                                      \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                  8. Simplified66.9%

                                    \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                  9. Taylor expanded in im around 0

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

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

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

                                      \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                    4. unpow2N/A

                                      \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                    5. *-lowering-*.f6450.8

                                      \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                  11. Simplified50.8%

                                    \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]

                                  if 1.00000000000000005e-4 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                  1. Initial program 100.0%

                                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                  2. Add Preprocessing
                                  3. Taylor expanded in im around 0

                                    \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                  4. Step-by-step derivation
                                    1. +-commutativeN/A

                                      \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                    2. distribute-lft-inN/A

                                      \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                    3. associate-+l+N/A

                                      \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                    4. associate-*r*N/A

                                      \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                    5. associate-*r*N/A

                                      \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                    6. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                    7. associate-*r*N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                    8. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                    9. associate-*r*N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                    10. distribute-lft1-inN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                    11. unpow2N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                    12. associate-*r*N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                    13. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                  5. Simplified87.8%

                                    \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                  6. Taylor expanded in re around 0

                                    \[\leadsto \color{blue}{re \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                                  7. Step-by-step derivation
                                    1. *-commutativeN/A

                                      \[\leadsto \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot re} \]
                                    2. *-lowering-*.f64N/A

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

                                      \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + 1\right)} \cdot re \]
                                    4. accelerator-lowering-fma.f64N/A

                                      \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right)} \cdot re \]
                                    5. unpow2N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                    6. *-lowering-*.f64N/A

                                      \[\leadsto \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{2} + \frac{1}{24} \cdot {im}^{2}, 1\right) \cdot re \]
                                    7. +-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}}, 1\right) \cdot re \]
                                    8. *-commutativeN/A

                                      \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{{im}^{2} \cdot \frac{1}{24}} + \frac{1}{2}, 1\right) \cdot re \]
                                    9. accelerator-lowering-fma.f64N/A

                                      \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\mathsf{fma}\left({im}^{2}, \frac{1}{24}, \frac{1}{2}\right)}, 1\right) \cdot re \]
                                    10. unpow2N/A

                                      \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{24}, \frac{1}{2}\right), 1\right) \cdot re \]
                                    11. *-lowering-*.f6448.7

                                      \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, 0.041666666666666664, 0.5\right), 1\right) \cdot re \]
                                  8. Simplified48.7%

                                    \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.041666666666666664, 0.5\right), 1\right) \cdot re} \]
                                  9. Taylor expanded in im around 0

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{\frac{1}{2}}, 1\right) \cdot re \]
                                  10. Step-by-step derivation
                                    1. Simplified43.2%

                                      \[\leadsto \mathsf{fma}\left(im \cdot im, \color{blue}{0.5}, 1\right) \cdot re \]
                                  11. Recombined 2 regimes into one program.
                                  12. Final simplification47.7%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq 0.0001:\\ \;\;\;\;re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \mathsf{fma}\left(im \cdot im, 0.5, 1\right)\\ \end{array} \]
                                  13. Add Preprocessing

                                  Alternative 26: 29.6% accurate, 0.9× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re\\ \end{array} \end{array} \]
                                  (FPCore (re im)
                                   :precision binary64
                                   (if (<= (* (* (sin re) 0.5) (+ (exp (- 0.0 im)) (exp im))) -0.05)
                                     (* -0.16666666666666666 (* re (* re re)))
                                     re))
                                  double code(double re, double im) {
                                  	double tmp;
                                  	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= -0.05) {
                                  		tmp = -0.16666666666666666 * (re * (re * re));
                                  	} else {
                                  		tmp = re;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  real(8) function code(re, im)
                                      real(8), intent (in) :: re
                                      real(8), intent (in) :: im
                                      real(8) :: tmp
                                      if (((sin(re) * 0.5d0) * (exp((0.0d0 - im)) + exp(im))) <= (-0.05d0)) then
                                          tmp = (-0.16666666666666666d0) * (re * (re * re))
                                      else
                                          tmp = re
                                      end if
                                      code = tmp
                                  end function
                                  
                                  public static double code(double re, double im) {
                                  	double tmp;
                                  	if (((Math.sin(re) * 0.5) * (Math.exp((0.0 - im)) + Math.exp(im))) <= -0.05) {
                                  		tmp = -0.16666666666666666 * (re * (re * re));
                                  	} else {
                                  		tmp = re;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  def code(re, im):
                                  	tmp = 0
                                  	if ((math.sin(re) * 0.5) * (math.exp((0.0 - im)) + math.exp(im))) <= -0.05:
                                  		tmp = -0.16666666666666666 * (re * (re * re))
                                  	else:
                                  		tmp = re
                                  	return tmp
                                  
                                  function code(re, im)
                                  	tmp = 0.0
                                  	if (Float64(Float64(sin(re) * 0.5) * Float64(exp(Float64(0.0 - im)) + exp(im))) <= -0.05)
                                  		tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re)));
                                  	else
                                  		tmp = re;
                                  	end
                                  	return tmp
                                  end
                                  
                                  function tmp_2 = code(re, im)
                                  	tmp = 0.0;
                                  	if (((sin(re) * 0.5) * (exp((0.0 - im)) + exp(im))) <= -0.05)
                                  		tmp = -0.16666666666666666 * (re * (re * re));
                                  	else
                                  		tmp = re;
                                  	end
                                  	tmp_2 = tmp;
                                  end
                                  
                                  code[re_, im_] := If[LessEqual[N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(N[Exp[N[(0.0 - im), $MachinePrecision]], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.05], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], re]
                                  
                                  \begin{array}{l}
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\
                                  \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;re\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im))) < -0.050000000000000003

                                    1. Initial program 100.0%

                                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in im around 0

                                      \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                    4. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                      2. distribute-lft-inN/A

                                        \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                      3. associate-+l+N/A

                                        \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                      4. associate-*r*N/A

                                        \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                      5. associate-*r*N/A

                                        \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                      6. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                      7. associate-*r*N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                      8. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                      9. associate-*r*N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                      10. distribute-lft1-inN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                      11. unpow2N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                      12. associate-*r*N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                      13. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                    5. Simplified85.8%

                                      \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                    6. Taylor expanded in re around 0

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

                                        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      2. +-commutativeN/A

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

                                        \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      4. unpow2N/A

                                        \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      5. associate-*l*N/A

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

                                        \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      7. *-lowering-*.f6440.7

                                        \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                    8. Simplified40.7%

                                      \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                    9. Taylor expanded in im around 0

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

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

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

                                        \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                      4. unpow2N/A

                                        \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                      5. *-lowering-*.f6410.5

                                        \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                    11. Simplified10.5%

                                      \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]
                                    12. Taylor expanded in re around inf

                                      \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
                                    13. Step-by-step derivation
                                      1. *-lowering-*.f64N/A

                                        \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
                                      2. cube-multN/A

                                        \[\leadsto \frac{-1}{6} \cdot \color{blue}{\left(re \cdot \left(re \cdot re\right)\right)} \]
                                      3. unpow2N/A

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

                                        \[\leadsto \frac{-1}{6} \cdot \color{blue}{\left(re \cdot {re}^{2}\right)} \]
                                      5. unpow2N/A

                                        \[\leadsto \frac{-1}{6} \cdot \left(re \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
                                      6. *-lowering-*.f6410.2

                                        \[\leadsto -0.16666666666666666 \cdot \left(re \cdot \color{blue}{\left(re \cdot re\right)}\right) \]
                                    14. Simplified10.2%

                                      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)} \]

                                    if -0.050000000000000003 < (*.f64 (*.f64 #s(literal 1/2 binary64) (sin.f64 re)) (+.f64 (exp.f64 (-.f64 #s(literal 0 binary64) im)) (exp.f64 im)))

                                    1. Initial program 100.0%

                                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in im around 0

                                      \[\leadsto \color{blue}{\sin re} \]
                                    4. Step-by-step derivation
                                      1. sin-lowering-sin.f6462.1

                                        \[\leadsto \color{blue}{\sin re} \]
                                    5. Simplified62.1%

                                      \[\leadsto \color{blue}{\sin re} \]
                                    6. Taylor expanded in re around 0

                                      \[\leadsto \color{blue}{re} \]
                                    7. Step-by-step derivation
                                      1. Simplified40.9%

                                        \[\leadsto \color{blue}{re} \]
                                    8. Recombined 2 regimes into one program.
                                    9. Final simplification31.1%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\left(\sin re \cdot 0.5\right) \cdot \left(e^{0 - im} + e^{im}\right) \leq -0.05:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 27: 58.5% accurate, 2.0× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\sin re \leq 10^{-6}:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\ \end{array} \end{array} \]
                                    (FPCore (re im)
                                     :precision binary64
                                     (if (<= (sin re) 1e-6)
                                       (*
                                        re
                                        (*
                                         (fma re (* re -0.16666666666666666) 1.0)
                                         (fma
                                          (* im im)
                                          (fma
                                           (* im im)
                                           (fma (* im im) 0.001388888888888889 0.041666666666666664)
                                           0.5)
                                          1.0)))
                                       (*
                                        (fma (* im im) (fma im (* im 0.041666666666666664) 0.5) 1.0)
                                        (*
                                         re
                                         (fma
                                          (* re re)
                                          (fma (* re re) 0.008333333333333333 -0.16666666666666666)
                                          1.0)))))
                                    double code(double re, double im) {
                                    	double tmp;
                                    	if (sin(re) <= 1e-6) {
                                    		tmp = re * (fma(re, (re * -0.16666666666666666), 1.0) * fma((im * im), fma((im * im), fma((im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0));
                                    	} else {
                                    		tmp = fma((im * im), fma(im, (im * 0.041666666666666664), 0.5), 1.0) * (re * fma((re * re), fma((re * re), 0.008333333333333333, -0.16666666666666666), 1.0));
                                    	}
                                    	return tmp;
                                    }
                                    
                                    function code(re, im)
                                    	tmp = 0.0
                                    	if (sin(re) <= 1e-6)
                                    		tmp = Float64(re * Float64(fma(re, Float64(re * -0.16666666666666666), 1.0) * fma(Float64(im * im), fma(Float64(im * im), fma(Float64(im * im), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0)));
                                    	else
                                    		tmp = Float64(fma(Float64(im * im), fma(im, Float64(im * 0.041666666666666664), 0.5), 1.0) * Float64(re * fma(Float64(re * re), fma(Float64(re * re), 0.008333333333333333, -0.16666666666666666), 1.0)));
                                    	end
                                    	return tmp
                                    end
                                    
                                    code[re_, im_] := If[LessEqual[N[Sin[re], $MachinePrecision], 1e-6], N[(re * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * N[(N[(re * re), $MachinePrecision] * 0.008333333333333333 + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    \mathbf{if}\;\sin re \leq 10^{-6}:\\
                                    \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 2 regimes
                                    2. if (sin.f64 re) < 9.99999999999999955e-7

                                      1. Initial program 100.0%

                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in im around 0

                                        \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
                                      4. Step-by-step derivation
                                        1. +-commutativeN/A

                                          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \sin re} \]
                                        2. +-commutativeN/A

                                          \[\leadsto {im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} + \sin re \]
                                        3. distribute-rgt-inN/A

                                          \[\leadsto \color{blue}{\left(\left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) \cdot {im}^{2} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right)} + \sin re \]
                                        4. *-commutativeN/A

                                          \[\leadsto \left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} + \left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2}\right) + \sin re \]
                                        5. associate-+l+N/A

                                          \[\leadsto \color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right) + \left(\left(\frac{1}{2} \cdot \sin re\right) \cdot {im}^{2} + \sin re\right)} \]
                                      5. Simplified91.4%

                                        \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(\mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), im \cdot \left(im \cdot \left(im \cdot im\right)\right), \mathsf{fma}\left(0.5, im \cdot im, 1\right)\right)} \]
                                      6. Taylor expanded in re around 0

                                        \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                                      7. Step-by-step derivation
                                        1. *-lowering-*.f64N/A

                                          \[\leadsto \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right) + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                                        2. +-commutativeN/A

                                          \[\leadsto re \cdot \left(1 + \color{blue}{\left(\left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)}\right) \]
                                        3. associate-+r+N/A

                                          \[\leadsto re \cdot \color{blue}{\left(\left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right) + \frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)} \]
                                        4. associate-*r*N/A

                                          \[\leadsto re \cdot \left(\left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right) + \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)}\right) \]
                                        5. distribute-rgt1-inN/A

                                          \[\leadsto re \cdot \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2} + 1\right) \cdot \left(1 + \left(\frac{1}{2} \cdot {im}^{2} + {im}^{4} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)} \]
                                      8. Simplified70.5%

                                        \[\leadsto \color{blue}{re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)} \]

                                      if 9.99999999999999955e-7 < (sin.f64 re)

                                      1. Initial program 100.0%

                                        \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in im around 0

                                        \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                      4. Step-by-step derivation
                                        1. +-commutativeN/A

                                          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                        2. distribute-lft-inN/A

                                          \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                        3. associate-+l+N/A

                                          \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                        4. associate-*r*N/A

                                          \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                        5. associate-*r*N/A

                                          \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                        6. *-commutativeN/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                        7. associate-*r*N/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                        8. *-commutativeN/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                        9. associate-*r*N/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                        10. distribute-lft1-inN/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                        11. unpow2N/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                        12. associate-*r*N/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                        13. *-commutativeN/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                      5. Simplified93.4%

                                        \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                      6. Taylor expanded in re around 0

                                        \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      7. Step-by-step derivation
                                        1. *-lowering-*.f64N/A

                                          \[\leadsto \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        2. +-commutativeN/A

                                          \[\leadsto \left(re \cdot \color{blue}{\left({re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right) + 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        3. accelerator-lowering-fma.f64N/A

                                          \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        4. unpow2N/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        5. *-lowering-*.f64N/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120} \cdot {re}^{2} - \frac{1}{6}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        6. sub-negN/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\frac{1}{120} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        7. *-commutativeN/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{{re}^{2} \cdot \frac{1}{120}} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right), 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        8. metadata-evalN/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, {re}^{2} \cdot \frac{1}{120} + \color{blue}{\frac{-1}{6}}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        9. accelerator-lowering-fma.f64N/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \color{blue}{\mathsf{fma}\left({re}^{2}, \frac{1}{120}, \frac{-1}{6}\right)}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        10. unpow2N/A

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, \frac{1}{120}, \frac{-1}{6}\right), 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                        11. *-lowering-*.f6438.4

                                          \[\leadsto \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                      8. Simplified38.4%

                                        \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                    3. Recombined 2 regimes into one program.
                                    4. Final simplification61.4%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\sin re \leq 10^{-6}:\\ \;\;\;\;re \cdot \left(\mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \cdot \left(re \cdot \mathsf{fma}\left(re \cdot re, \mathsf{fma}\left(re \cdot re, 0.008333333333333333, -0.16666666666666666\right), 1\right)\right)\\ \end{array} \]
                                    5. Add Preprocessing

                                    Alternative 28: 33.7% accurate, 18.6× speedup?

                                    \[\begin{array}{l} \\ re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right) \end{array} \]
                                    (FPCore (re im)
                                     :precision binary64
                                     (* re (fma -0.16666666666666666 (* re re) 1.0)))
                                    double code(double re, double im) {
                                    	return re * fma(-0.16666666666666666, (re * re), 1.0);
                                    }
                                    
                                    function code(re, im)
                                    	return Float64(re * fma(-0.16666666666666666, Float64(re * re), 1.0))
                                    end
                                    
                                    code[re_, im_] := N[(re * N[(-0.16666666666666666 * N[(re * re), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 100.0%

                                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in im around 0

                                      \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                                    4. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) + \sin re} \]
                                      2. distribute-lft-inN/A

                                        \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right)\right)} + \sin re \]
                                      3. associate-+l+N/A

                                        \[\leadsto \color{blue}{{im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right)\right) + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right)} \]
                                      4. associate-*r*N/A

                                        \[\leadsto {im}^{2} \cdot \color{blue}{\left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re\right)} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                      5. associate-*r*N/A

                                        \[\leadsto \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re} + \left({im}^{2} \cdot \left(\frac{1}{2} \cdot \sin re\right) + \sin re\right) \]
                                      6. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left({im}^{2} \cdot \color{blue}{\left(\sin re \cdot \frac{1}{2}\right)} + \sin re\right) \]
                                      7. associate-*r*N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}} + \sin re\right) \]
                                      8. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} + \sin re\right) \]
                                      9. associate-*r*N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot {im}^{2}\right) \cdot \sin re} + \sin re\right) \]
                                      10. distribute-lft1-inN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(\frac{1}{2} \cdot {im}^{2} + 1\right) \cdot \sin re} \]
                                      11. unpow2N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\frac{1}{2} \cdot \color{blue}{\left(im \cdot im\right)} + 1\right) \cdot \sin re \]
                                      12. associate-*r*N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{\left(\frac{1}{2} \cdot im\right) \cdot im} + 1\right) \cdot \sin re \]
                                      13. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\color{blue}{im \cdot \left(\frac{1}{2} \cdot im\right)} + 1\right) \cdot \sin re \]
                                    5. Simplified90.0%

                                      \[\leadsto \color{blue}{\sin re \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right)} \]
                                    6. Taylor expanded in re around 0

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

                                        \[\leadsto \color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      2. +-commutativeN/A

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

                                        \[\leadsto \left(re \cdot \left(\color{blue}{{re}^{2} \cdot \frac{-1}{6}} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      4. unpow2N/A

                                        \[\leadsto \left(re \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6} + 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      5. associate-*l*N/A

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

                                        \[\leadsto \left(re \cdot \color{blue}{\mathsf{fma}\left(re, re \cdot \frac{-1}{6}, 1\right)}\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                      7. *-lowering-*.f6453.0

                                        \[\leadsto \left(re \cdot \mathsf{fma}\left(re, \color{blue}{re \cdot -0.16666666666666666}, 1\right)\right) \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                    8. Simplified53.0%

                                      \[\leadsto \color{blue}{\left(re \cdot \mathsf{fma}\left(re, re \cdot -0.16666666666666666, 1\right)\right)} \cdot \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot 0.041666666666666664, 0.5\right), 1\right) \]
                                    9. Taylor expanded in im around 0

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

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

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

                                        \[\leadsto re \cdot \color{blue}{\mathsf{fma}\left(\frac{-1}{6}, {re}^{2}, 1\right)} \]
                                      4. unpow2N/A

                                        \[\leadsto re \cdot \mathsf{fma}\left(\frac{-1}{6}, \color{blue}{re \cdot re}, 1\right) \]
                                      5. *-lowering-*.f6433.4

                                        \[\leadsto re \cdot \mathsf{fma}\left(-0.16666666666666666, \color{blue}{re \cdot re}, 1\right) \]
                                    11. Simplified33.4%

                                      \[\leadsto \color{blue}{re \cdot \mathsf{fma}\left(-0.16666666666666666, re \cdot re, 1\right)} \]
                                    12. Add Preprocessing

                                    Alternative 29: 26.3% accurate, 317.0× speedup?

                                    \[\begin{array}{l} \\ re \end{array} \]
                                    (FPCore (re im) :precision binary64 re)
                                    double code(double re, double im) {
                                    	return re;
                                    }
                                    
                                    real(8) function code(re, im)
                                        real(8), intent (in) :: re
                                        real(8), intent (in) :: im
                                        code = re
                                    end function
                                    
                                    public static double code(double re, double im) {
                                    	return re;
                                    }
                                    
                                    def code(re, im):
                                    	return re
                                    
                                    function code(re, im)
                                    	return re
                                    end
                                    
                                    function tmp = code(re, im)
                                    	tmp = re;
                                    end
                                    
                                    code[re_, im_] := re
                                    
                                    \begin{array}{l}
                                    
                                    \\
                                    re
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 100.0%

                                      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in im around 0

                                      \[\leadsto \color{blue}{\sin re} \]
                                    4. Step-by-step derivation
                                      1. sin-lowering-sin.f6452.3

                                        \[\leadsto \color{blue}{\sin re} \]
                                    5. Simplified52.3%

                                      \[\leadsto \color{blue}{\sin re} \]
                                    6. Taylor expanded in re around 0

                                      \[\leadsto \color{blue}{re} \]
                                    7. Step-by-step derivation
                                      1. Simplified28.8%

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

                                      Reproduce

                                      ?
                                      herbie shell --seed 2024198 
                                      (FPCore (re im)
                                        :name "math.sin on complex, real part"
                                        :precision binary64
                                        (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))