math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 10.3s
Alternatives: 16
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 16 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.0× speedup?

\[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} t_0 := e^{-im\_m}\\ \left(0.5 \cdot \sin re\right) \cdot \left(t\_0 + \frac{1}{t\_0}\right) \end{array} \end{array} \]
im_m = (fabs.f64 im)
(FPCore (re im_m)
 :precision binary64
 (let* ((t_0 (exp (- im_m)))) (* (* 0.5 (sin re)) (+ t_0 (/ 1.0 t_0)))))
im_m = fabs(im);
double code(double re, double im_m) {
	double t_0 = exp(-im_m);
	return (0.5 * sin(re)) * (t_0 + (1.0 / t_0));
}
im_m = abs(im)
real(8) function code(re, im_m)
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    t_0 = exp(-im_m)
    code = (0.5d0 * sin(re)) * (t_0 + (1.0d0 / t_0))
end function
im_m = Math.abs(im);
public static double code(double re, double im_m) {
	double t_0 = Math.exp(-im_m);
	return (0.5 * Math.sin(re)) * (t_0 + (1.0 / t_0));
}
im_m = math.fabs(im)
def code(re, im_m):
	t_0 = math.exp(-im_m)
	return (0.5 * math.sin(re)) * (t_0 + (1.0 / t_0))
im_m = abs(im)
function code(re, im_m)
	t_0 = exp(Float64(-im_m))
	return Float64(Float64(0.5 * sin(re)) * Float64(t_0 + Float64(1.0 / t_0)))
end
im_m = abs(im);
function tmp = code(re, im_m)
	t_0 = exp(-im_m);
	tmp = (0.5 * sin(re)) * (t_0 + (1.0 / t_0));
end
im_m = N[Abs[im], $MachinePrecision]
code[re_, im$95$m_] := Block[{t$95$0 = N[Exp[(-im$95$m)], $MachinePrecision]}, N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(t$95$0 + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
im_m = \left|im\right|

\\
\begin{array}{l}
t_0 := e^{-im\_m}\\
\left(0.5 \cdot \sin re\right) \cdot \left(t\_0 + \frac{1}{t\_0}\right)
\end{array}
\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. /-rgt-identityN/A

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

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

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

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

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

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

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

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

      \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(e^{0 - im} + \color{blue}{\frac{e^{0}}{e^{0 - im}}}\right) \]
    10. exp-0100.0

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + \frac{\color{blue}{1}}{e^{0 - im}}\right) \]
    11. lift--.f64N/A

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

      \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(e^{0 - im} + \frac{1}{e^{\color{blue}{\mathsf{neg}\left(im\right)}}}\right) \]
    13. lower-neg.f64100.0

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + \frac{1}{e^{\color{blue}{-im}}}\right) \]
  4. Applied rewrites100.0%

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + \color{blue}{\frac{1}{e^{-im}}}\right) \]
  5. Step-by-step derivation
    1. lift--.f64N/A

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

      \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(e^{\color{blue}{\mathsf{neg}\left(im\right)}} + \frac{1}{e^{\mathsf{neg}\left(im\right)}}\right) \]
    3. lift-neg.f64100.0

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \frac{1}{e^{-im}}\right) \]
  6. Applied rewrites100.0%

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \frac{1}{e^{-im}}\right) \]
  7. Add Preprocessing

Alternative 2: 80.3% accurate, 0.4× speedup?

\[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right)\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq 40000:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\right)\right)\\ \end{array} \end{array} \]
im_m = (fabs.f64 im)
(FPCore (re im_m)
 :precision binary64
 (let* ((t_0 (* (* 0.5 (sin re)) (+ (exp (- im_m)) (exp im_m)))))
   (if (<= t_0 (- INFINITY))
     (*
      (fma re (* (* re re) -0.16666666666666666) re)
      (fma
       (* im_m im_m)
       (fma
        im_m
        (* im_m (fma (* im_m im_m) 0.001388888888888889 0.041666666666666664))
        0.5)
       1.0))
     (if (<= t_0 40000.0)
       (* (sin re) (fma 0.5 (* im_m im_m) 1.0))
       (* re (* (* im_m im_m) (* (* im_m im_m) 0.041666666666666664)))))))
im_m = fabs(im);
double code(double re, double im_m) {
	double t_0 = (0.5 * sin(re)) * (exp(-im_m) + exp(im_m));
	double tmp;
	if (t_0 <= -((double) INFINITY)) {
		tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im_m * im_m), fma(im_m, (im_m * fma((im_m * im_m), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0);
	} else if (t_0 <= 40000.0) {
		tmp = sin(re) * fma(0.5, (im_m * im_m), 1.0);
	} else {
		tmp = re * ((im_m * im_m) * ((im_m * im_m) * 0.041666666666666664));
	}
	return tmp;
}
im_m = abs(im)
function code(re, im_m)
	t_0 = Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im_m)) + exp(im_m)))
	tmp = 0.0
	if (t_0 <= Float64(-Inf))
		tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im_m * im_m), fma(im_m, Float64(im_m * fma(Float64(im_m * im_m), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0));
	elseif (t_0 <= 40000.0)
		tmp = Float64(sin(re) * fma(0.5, Float64(im_m * im_m), 1.0));
	else
		tmp = Float64(re * Float64(Float64(im_m * im_m) * Float64(Float64(im_m * im_m) * 0.041666666666666664)));
	end
	return tmp
end
im_m = N[Abs[im], $MachinePrecision]
code[re_, im$95$m_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im$95$m)], $MachinePrecision] + N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 40000.0], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im$95$m * im$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
im_m = \left|im\right|

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

\mathbf{elif}\;t\_0 \leq 40000:\\
\;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\

\mathbf{else}:\\
\;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\right)\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. Step-by-step derivation
      1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
      12. 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 \]
      13. cosh-undefN/A

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

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

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

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

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

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

        \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
    4. Applied rewrites100.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. +-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) \]
      2. distribute-lft-inN/A

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

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

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

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

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

        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
      8. lower-*.f6483.3

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

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

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

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

        \[\leadsto \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)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
      3. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\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))) < 4e4

    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 + \frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin re \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \]
      14. lower-*.f6499.1

        \[\leadsto \sin re \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \]
    5. Applied rewrites99.1%

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

    if 4e4 < (*.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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
      7. unpow2N/A

        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
      8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
      9. *-commutativeN/A

        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
      11. distribute-rgt-outN/A

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

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

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

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

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

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

        \[\leadsto \frac{1}{24} \cdot \left({im}^{4} \cdot \color{blue}{re}\right) \]
      3. Step-by-step derivation
        1. Applied rewrites55.6%

          \[\leadsto re \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)}\right) \]
      4. Recombined 3 regimes into one program.
      5. Final simplification83.3%

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

      Alternative 3: 80.0% accurate, 0.4× speedup?

      \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right)\\ \mathbf{if}\;t\_0 \leq -\infty:\\ \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \mathbf{elif}\;t\_0 \leq 40000:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\right)\right)\\ \end{array} \end{array} \]
      im_m = (fabs.f64 im)
      (FPCore (re im_m)
       :precision binary64
       (let* ((t_0 (* (* 0.5 (sin re)) (+ (exp (- im_m)) (exp im_m)))))
         (if (<= t_0 (- INFINITY))
           (*
            (fma re (* (* re re) -0.16666666666666666) re)
            (fma
             (* im_m im_m)
             (fma
              im_m
              (* im_m (fma (* im_m im_m) 0.001388888888888889 0.041666666666666664))
              0.5)
             1.0))
           (if (<= t_0 40000.0)
             (sin re)
             (* re (* (* im_m im_m) (* (* im_m im_m) 0.041666666666666664)))))))
      im_m = fabs(im);
      double code(double re, double im_m) {
      	double t_0 = (0.5 * sin(re)) * (exp(-im_m) + exp(im_m));
      	double tmp;
      	if (t_0 <= -((double) INFINITY)) {
      		tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im_m * im_m), fma(im_m, (im_m * fma((im_m * im_m), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0);
      	} else if (t_0 <= 40000.0) {
      		tmp = sin(re);
      	} else {
      		tmp = re * ((im_m * im_m) * ((im_m * im_m) * 0.041666666666666664));
      	}
      	return tmp;
      }
      
      im_m = abs(im)
      function code(re, im_m)
      	t_0 = Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im_m)) + exp(im_m)))
      	tmp = 0.0
      	if (t_0 <= Float64(-Inf))
      		tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im_m * im_m), fma(im_m, Float64(im_m * fma(Float64(im_m * im_m), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0));
      	elseif (t_0 <= 40000.0)
      		tmp = sin(re);
      	else
      		tmp = Float64(re * Float64(Float64(im_m * im_m) * Float64(Float64(im_m * im_m) * 0.041666666666666664)));
      	end
      	return tmp
      end
      
      im_m = N[Abs[im], $MachinePrecision]
      code[re_, im$95$m_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im$95$m)], $MachinePrecision] + N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, (-Infinity)], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 40000.0], N[Sin[re], $MachinePrecision], N[(re * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      im_m = \left|im\right|
      
      \\
      \begin{array}{l}
      t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right)\\
      \mathbf{if}\;t\_0 \leq -\infty:\\
      \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
      
      \mathbf{elif}\;t\_0 \leq 40000:\\
      \;\;\;\;\sin re\\
      
      \mathbf{else}:\\
      \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\right)\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. Step-by-step derivation
          1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
          12. 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 \]
          13. cosh-undefN/A

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

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

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

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

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

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

            \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
        4. Applied rewrites100.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. +-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) \]
          2. distribute-lft-inN/A

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

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

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

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

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

            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
          8. lower-*.f6483.3

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

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

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

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

            \[\leadsto \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)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
          3. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im, im \cdot \mathsf{fma}\left(im \cdot im, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\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))) < 4e4

        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. lower-sin.f6498.5

            \[\leadsto \color{blue}{\sin re} \]
        5. Applied rewrites98.5%

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

        if 4e4 < (*.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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
          7. unpow2N/A

            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
          8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
          9. *-commutativeN/A

            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
          11. distribute-rgt-outN/A

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

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

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

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

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

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

            \[\leadsto \frac{1}{24} \cdot \left({im}^{4} \cdot \color{blue}{re}\right) \]
          3. Step-by-step derivation
            1. Applied rewrites55.6%

              \[\leadsto re \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)}\right) \]
          4. Recombined 3 regimes into one program.
          5. Final simplification83.0%

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

          Alternative 4: 52.1% accurate, 0.9× speedup?

          \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right) \leq 0.05:\\ \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\right)\right)\\ \end{array} \end{array} \]
          im_m = (fabs.f64 im)
          (FPCore (re im_m)
           :precision binary64
           (if (<= (* (* 0.5 (sin re)) (+ (exp (- im_m)) (exp im_m))) 0.05)
             (*
              (fma re (* (* re re) -0.16666666666666666) re)
              (fma 0.5 (* im_m im_m) 1.0))
             (* re (* (* im_m im_m) (* (* im_m im_m) 0.041666666666666664)))))
          im_m = fabs(im);
          double code(double re, double im_m) {
          	double tmp;
          	if (((0.5 * sin(re)) * (exp(-im_m) + exp(im_m))) <= 0.05) {
          		tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma(0.5, (im_m * im_m), 1.0);
          	} else {
          		tmp = re * ((im_m * im_m) * ((im_m * im_m) * 0.041666666666666664));
          	}
          	return tmp;
          }
          
          im_m = abs(im)
          function code(re, im_m)
          	tmp = 0.0
          	if (Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im_m)) + exp(im_m))) <= 0.05)
          		tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(0.5, Float64(im_m * im_m), 1.0));
          	else
          		tmp = Float64(re * Float64(Float64(im_m * im_m) * Float64(Float64(im_m * im_m) * 0.041666666666666664)));
          	end
          	return tmp
          end
          
          im_m = N[Abs[im], $MachinePrecision]
          code[re_, im$95$m_] := If[LessEqual[N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im$95$m)], $MachinePrecision] + N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.05], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(0.5 * N[(im$95$m * im$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(re * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          im_m = \left|im\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right) \leq 0.05:\\
          \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\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))) < 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
              12. 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 \]
              13. cosh-undefN/A

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

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

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

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

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

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

                \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
            4. Applied rewrites100.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. lower-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. lower-*.f6484.9

                \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
            7. Applied rewrites84.9%

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\frac{1}{2}, im \cdot im, 1\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
              8. lower-*.f6461.2

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

              \[\leadsto \mathsf{fma}\left(0.5, im \cdot im, 1\right) \cdot \color{blue}{\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
              7. unpow2N/A

                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
              8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
              9. *-commutativeN/A

                \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
              11. distribute-rgt-outN/A

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

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

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

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

              \[\leadsto re \cdot \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
            7. Step-by-step derivation
              1. Applied rewrites39.4%

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

                \[\leadsto \frac{1}{24} \cdot \left({im}^{4} \cdot \color{blue}{re}\right) \]
              3. Step-by-step derivation
                1. Applied rewrites40.4%

                  \[\leadsto re \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)}\right) \]
              4. Recombined 2 regimes into one program.
              5. Final simplification54.3%

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

              Alternative 5: 44.1% accurate, 0.9× speedup?

              \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right) \leq 0.05:\\ \;\;\;\;\mathsf{fma}\left(re, re \cdot \left(re \cdot -0.16666666666666666\right), re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\right)\right)\\ \end{array} \end{array} \]
              im_m = (fabs.f64 im)
              (FPCore (re im_m)
               :precision binary64
               (if (<= (* (* 0.5 (sin re)) (+ (exp (- im_m)) (exp im_m))) 0.05)
                 (fma re (* re (* re -0.16666666666666666)) re)
                 (* re (* (* im_m im_m) (* (* im_m im_m) 0.041666666666666664)))))
              im_m = fabs(im);
              double code(double re, double im_m) {
              	double tmp;
              	if (((0.5 * sin(re)) * (exp(-im_m) + exp(im_m))) <= 0.05) {
              		tmp = fma(re, (re * (re * -0.16666666666666666)), re);
              	} else {
              		tmp = re * ((im_m * im_m) * ((im_m * im_m) * 0.041666666666666664));
              	}
              	return tmp;
              }
              
              im_m = abs(im)
              function code(re, im_m)
              	tmp = 0.0
              	if (Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im_m)) + exp(im_m))) <= 0.05)
              		tmp = fma(re, Float64(re * Float64(re * -0.16666666666666666)), re);
              	else
              		tmp = Float64(re * Float64(Float64(im_m * im_m) * Float64(Float64(im_m * im_m) * 0.041666666666666664)));
              	end
              	return tmp
              end
              
              im_m = N[Abs[im], $MachinePrecision]
              code[re_, im$95$m_] := If[LessEqual[N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im$95$m)], $MachinePrecision] + N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.05], N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision], N[(re * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              im_m = \left|im\right|
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right) \leq 0.05:\\
              \;\;\;\;\mathsf{fma}\left(re, re \cdot \left(re \cdot -0.16666666666666666\right), re\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;re \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot 0.041666666666666664\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))) < 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} \]
                4. Step-by-step derivation
                  1. lower-sin.f6461.6

                    \[\leadsto \color{blue}{\sin re} \]
                5. Applied rewrites61.6%

                  \[\leadsto \color{blue}{\sin re} \]
                6. Taylor expanded in re around 0

                  \[\leadsto re \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
                7. Step-by-step derivation
                  1. Applied rewrites44.3%

                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right) \cdot -0.16666666666666666}, re\right) \]
                  2. Step-by-step derivation
                    1. Applied rewrites44.3%

                      \[\leadsto \mathsf{fma}\left(re, \left(re \cdot -0.16666666666666666\right) \cdot re, re\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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                      7. unpow2N/A

                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                      8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                      9. *-commutativeN/A

                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                      11. distribute-rgt-outN/A

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

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

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

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

                      \[\leadsto re \cdot \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites39.4%

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

                        \[\leadsto \frac{1}{24} \cdot \left({im}^{4} \cdot \color{blue}{re}\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites40.4%

                          \[\leadsto re \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)}\right) \]
                      4. Recombined 2 regimes into one program.
                      5. Final simplification43.0%

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

                      Alternative 6: 40.4% accurate, 0.9× speedup?

                      \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right) \leq -0.1:\\ \;\;\;\;re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im\_m \cdot im\_m, 0.5 \cdot re, re\right)\\ \end{array} \end{array} \]
                      im_m = (fabs.f64 im)
                      (FPCore (re im_m)
                       :precision binary64
                       (if (<= (* (* 0.5 (sin re)) (+ (exp (- im_m)) (exp im_m))) -0.1)
                         (* re (* re (* re -0.16666666666666666)))
                         (fma (* im_m im_m) (* 0.5 re) re)))
                      im_m = fabs(im);
                      double code(double re, double im_m) {
                      	double tmp;
                      	if (((0.5 * sin(re)) * (exp(-im_m) + exp(im_m))) <= -0.1) {
                      		tmp = re * (re * (re * -0.16666666666666666));
                      	} else {
                      		tmp = fma((im_m * im_m), (0.5 * re), re);
                      	}
                      	return tmp;
                      }
                      
                      im_m = abs(im)
                      function code(re, im_m)
                      	tmp = 0.0
                      	if (Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im_m)) + exp(im_m))) <= -0.1)
                      		tmp = Float64(re * Float64(re * Float64(re * -0.16666666666666666)));
                      	else
                      		tmp = fma(Float64(im_m * im_m), Float64(0.5 * re), re);
                      	end
                      	return tmp
                      end
                      
                      im_m = N[Abs[im], $MachinePrecision]
                      code[re_, im$95$m_] := If[LessEqual[N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im$95$m)], $MachinePrecision] + N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.1], N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(0.5 * re), $MachinePrecision] + re), $MachinePrecision]]
                      
                      \begin{array}{l}
                      im_m = \left|im\right|
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im\_m} + e^{im\_m}\right) \leq -0.1:\\
                      \;\;\;\;re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\mathsf{fma}\left(im\_m \cdot im\_m, 0.5 \cdot 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.10000000000000001

                        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. lower-sin.f6436.1

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

                          \[\leadsto \color{blue}{\sin re} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto re \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
                        7. Step-by-step derivation
                          1. Applied rewrites9.7%

                            \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right) \cdot -0.16666666666666666}, re\right) \]
                          2. Taylor expanded in re around inf

                            \[\leadsto \frac{-1}{6} \cdot {re}^{\color{blue}{3}} \]
                          3. Step-by-step derivation
                            1. Applied rewrites9.4%

                              \[\leadsto re \cdot \left(\left(re \cdot re\right) \cdot \color{blue}{-0.16666666666666666}\right) \]
                            2. Step-by-step derivation
                              1. Applied rewrites9.4%

                                \[\leadsto re \cdot \left(\left(re \cdot -0.16666666666666666\right) \cdot re\right) \]

                              if -0.10000000000000001 < (*.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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                7. unpow2N/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                9. *-commutativeN/A

                                  \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                11. distribute-rgt-outN/A

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

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

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

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

                                \[\leadsto re \cdot \color{blue}{\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)} \]
                              7. Step-by-step derivation
                                1. Applied rewrites64.5%

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

                                  \[\leadsto \mathsf{fma}\left(im \cdot im, \frac{1}{2} \cdot re, re\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites62.0%

                                    \[\leadsto \mathsf{fma}\left(im \cdot im, 0.5 \cdot re, re\right) \]
                                4. Recombined 2 regimes into one program.
                                5. Final simplification41.0%

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

                                Alternative 7: 100.0% accurate, 1.5× speedup?

                                \[\begin{array}{l} im_m = \left|im\right| \\ \sin re \cdot \cosh im\_m \end{array} \]
                                im_m = (fabs.f64 im)
                                (FPCore (re im_m) :precision binary64 (* (sin re) (cosh im_m)))
                                im_m = fabs(im);
                                double code(double re, double im_m) {
                                	return sin(re) * cosh(im_m);
                                }
                                
                                im_m = abs(im)
                                real(8) function code(re, im_m)
                                    real(8), intent (in) :: re
                                    real(8), intent (in) :: im_m
                                    code = sin(re) * cosh(im_m)
                                end function
                                
                                im_m = Math.abs(im);
                                public static double code(double re, double im_m) {
                                	return Math.sin(re) * Math.cosh(im_m);
                                }
                                
                                im_m = math.fabs(im)
                                def code(re, im_m):
                                	return math.sin(re) * math.cosh(im_m)
                                
                                im_m = abs(im)
                                function code(re, im_m)
                                	return Float64(sin(re) * cosh(im_m))
                                end
                                
                                im_m = abs(im);
                                function tmp = code(re, im_m)
                                	tmp = sin(re) * cosh(im_m);
                                end
                                
                                im_m = N[Abs[im], $MachinePrecision]
                                code[re_, im$95$m_] := N[(N[Sin[re], $MachinePrecision] * N[Cosh[im$95$m], $MachinePrecision]), $MachinePrecision]
                                
                                \begin{array}{l}
                                im_m = \left|im\right|
                                
                                \\
                                \sin re \cdot \cosh im\_m
                                \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. /-rgt-identityN/A

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

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

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

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

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

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

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

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

                                    \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(e^{0 - im} + \color{blue}{\frac{e^{0}}{e^{0 - im}}}\right) \]
                                  10. exp-0100.0

                                    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + \frac{\color{blue}{1}}{e^{0 - im}}\right) \]
                                  11. lift--.f64N/A

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

                                    \[\leadsto \left(\frac{1}{2} \cdot \sin re\right) \cdot \left(e^{0 - im} + \frac{1}{e^{\color{blue}{\mathsf{neg}\left(im\right)}}}\right) \]
                                  13. lower-neg.f64100.0

                                    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + \frac{1}{e^{\color{blue}{-im}}}\right) \]
                                4. Applied rewrites100.0%

                                  \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + \color{blue}{\frac{1}{e^{-im}}}\right) \]
                                5. Step-by-step derivation
                                  1. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \color{blue}{\left(\sin re \cdot \left(e^{0 - im} + e^{im}\right)\right) \cdot \frac{1}{2}} \]
                                6. Applied rewrites100.0%

                                  \[\leadsto \color{blue}{\sin re \cdot \cosh im} \]
                                7. Add Preprocessing

                                Alternative 8: 57.8% accurate, 1.7× speedup?

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

                                  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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                    12. 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 \]
                                    13. cosh-undefN/A

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

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

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

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

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

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

                                      \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                  4. Applied rewrites100.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. +-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) \]
                                    2. distribute-lft-inN/A

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

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

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

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

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

                                      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
                                    8. lower-*.f6476.5

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

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

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

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

                                      \[\leadsto \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)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
                                    3. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 2.00000000000000007e-10 < (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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                    7. unpow2N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                    8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                    9. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                    11. distribute-rgt-outN/A

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

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

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

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

                                    \[\leadsto re \cdot \color{blue}{\left(1 + \left({im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right) + {re}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) + \frac{1}{120} \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)\right)} \]
                                  7. Applied rewrites26.3%

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

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

                                Alternative 9: 57.6% accurate, 2.0× speedup?

                                \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;\sin re \leq 0.01:\\ \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im\_m \cdot im\_m, re \cdot \mathsf{fma}\left(im\_m, im\_m \cdot 0.041666666666666664, 0.5\right), re\right)\\ \end{array} \end{array} \]
                                im_m = (fabs.f64 im)
                                (FPCore (re im_m)
                                 :precision binary64
                                 (if (<= (sin re) 0.01)
                                   (*
                                    (fma re (* (* re re) -0.16666666666666666) re)
                                    (fma
                                     (* im_m im_m)
                                     (fma
                                      im_m
                                      (* im_m (fma (* im_m im_m) 0.001388888888888889 0.041666666666666664))
                                      0.5)
                                     1.0))
                                   (fma (* im_m im_m) (* re (fma im_m (* im_m 0.041666666666666664) 0.5)) re)))
                                im_m = fabs(im);
                                double code(double re, double im_m) {
                                	double tmp;
                                	if (sin(re) <= 0.01) {
                                		tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im_m * im_m), fma(im_m, (im_m * fma((im_m * im_m), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0);
                                	} else {
                                		tmp = fma((im_m * im_m), (re * fma(im_m, (im_m * 0.041666666666666664), 0.5)), re);
                                	}
                                	return tmp;
                                }
                                
                                im_m = abs(im)
                                function code(re, im_m)
                                	tmp = 0.0
                                	if (sin(re) <= 0.01)
                                		tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im_m * im_m), fma(im_m, Float64(im_m * fma(Float64(im_m * im_m), 0.001388888888888889, 0.041666666666666664)), 0.5), 1.0));
                                	else
                                		tmp = fma(Float64(im_m * im_m), Float64(re * fma(im_m, Float64(im_m * 0.041666666666666664), 0.5)), re);
                                	end
                                	return tmp
                                end
                                
                                im_m = N[Abs[im], $MachinePrecision]
                                code[re_, im$95$m_] := If[LessEqual[N[Sin[re], $MachinePrecision], 0.01], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision]), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * N[(im$95$m * N[(im$95$m * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]]
                                
                                \begin{array}{l}
                                im_m = \left|im\right|
                                
                                \\
                                \begin{array}{l}
                                \mathbf{if}\;\sin re \leq 0.01:\\
                                \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m, im\_m \cdot \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
                                
                                \mathbf{else}:\\
                                \;\;\;\;\mathsf{fma}\left(im\_m \cdot im\_m, re \cdot \mathsf{fma}\left(im\_m, im\_m \cdot 0.041666666666666664, 0.5\right), re\right)\\
                                
                                
                                \end{array}
                                \end{array}
                                
                                Derivation
                                1. Split input into 2 regimes
                                2. if (sin.f64 re) < 0.0100000000000000002

                                  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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                    12. 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 \]
                                    13. cosh-undefN/A

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

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

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

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

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

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

                                      \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                  4. Applied rewrites100.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. +-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) \]
                                    2. distribute-lft-inN/A

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

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

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

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

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

                                      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
                                    8. lower-*.f6476.1

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

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

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

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

                                      \[\leadsto \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)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
                                    3. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  if 0.0100000000000000002 < (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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                    7. unpow2N/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                    8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                    9. *-commutativeN/A

                                      \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                    11. distribute-rgt-outN/A

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

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

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

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

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

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

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

                                  Alternative 10: 97.3% accurate, 2.1× speedup?

                                  \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} t_0 := \sin re \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\ \mathbf{if}\;im\_m \leq 11.5:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im\_m \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                  im_m = (fabs.f64 im)
                                  (FPCore (re im_m)
                                   :precision binary64
                                   (let* ((t_0
                                           (*
                                            (sin re)
                                            (fma
                                             (* im_m im_m)
                                             (fma
                                              (* im_m im_m)
                                              (fma (* im_m im_m) 0.001388888888888889 0.041666666666666664)
                                              0.5)
                                             1.0))))
                                     (if (<= im_m 11.5)
                                       t_0
                                       (if (<= im_m 7e+51)
                                         (* (cosh im_m) (fma re (* (* re re) -0.16666666666666666) re))
                                         t_0))))
                                  im_m = fabs(im);
                                  double code(double re, double im_m) {
                                  	double t_0 = sin(re) * fma((im_m * im_m), fma((im_m * im_m), fma((im_m * im_m), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0);
                                  	double tmp;
                                  	if (im_m <= 11.5) {
                                  		tmp = t_0;
                                  	} else if (im_m <= 7e+51) {
                                  		tmp = cosh(im_m) * fma(re, ((re * re) * -0.16666666666666666), re);
                                  	} else {
                                  		tmp = t_0;
                                  	}
                                  	return tmp;
                                  }
                                  
                                  im_m = abs(im)
                                  function code(re, im_m)
                                  	t_0 = Float64(sin(re) * fma(Float64(im_m * im_m), fma(Float64(im_m * im_m), fma(Float64(im_m * im_m), 0.001388888888888889, 0.041666666666666664), 0.5), 1.0))
                                  	tmp = 0.0
                                  	if (im_m <= 11.5)
                                  		tmp = t_0;
                                  	elseif (im_m <= 7e+51)
                                  		tmp = Float64(cosh(im_m) * fma(re, Float64(Float64(re * re) * -0.16666666666666666), re));
                                  	else
                                  		tmp = t_0;
                                  	end
                                  	return tmp
                                  end
                                  
                                  im_m = N[Abs[im], $MachinePrecision]
                                  code[re_, im$95$m_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.001388888888888889 + 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im$95$m, 11.5], t$95$0, If[LessEqual[im$95$m, 7e+51], N[(N[Cosh[im$95$m], $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                  
                                  \begin{array}{l}
                                  im_m = \left|im\right|
                                  
                                  \\
                                  \begin{array}{l}
                                  t_0 := \sin re \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.001388888888888889, 0.041666666666666664\right), 0.5\right), 1\right)\\
                                  \mathbf{if}\;im\_m \leq 11.5:\\
                                  \;\;\;\;t\_0\\
                                  
                                  \mathbf{elif}\;im\_m \leq 7 \cdot 10^{+51}:\\
                                  \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;t\_0\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if im < 11.5 or 7e51 < 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                      12. 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 \]
                                      13. cosh-undefN/A

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

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

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

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

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

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

                                        \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                    4. Applied rewrites100.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 + {im}^{2} \cdot \left(\frac{1}{2} + {im}^{2} \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)} \cdot \sin re \]
                                    6. Step-by-step derivation
                                      1. +-commutativeN/A

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

                                        \[\leadsto \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)} \cdot \sin re \]
                                      3. unpow2N/A

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(im \cdot im, \mathsf{fma}\left(\color{blue}{im \cdot im}, \frac{1}{720}, \frac{1}{24}\right), \frac{1}{2}\right), 1\right) \cdot \sin re \]
                                      13. lower-*.f6495.8

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

                                      \[\leadsto \color{blue}{\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)} \cdot \sin re \]

                                    if 11.5 < im < 7e51

                                    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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                      12. 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 \]
                                      13. cosh-undefN/A

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

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

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

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

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

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

                                        \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                    4. Applied rewrites100.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. +-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) \]
                                      2. distribute-lft-inN/A

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

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

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

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

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

                                        \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
                                      8. lower-*.f64100.0

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

                                      \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)} \]
                                    8. Step-by-step derivation
                                      1. lift-*.f64N/A

                                        \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
                                      2. *-lft-identity100.0

                                        \[\leadsto \color{blue}{\cosh im} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \]
                                    9. Applied rewrites100.0%

                                      \[\leadsto \color{blue}{\cosh im} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \]
                                  3. Recombined 2 regimes into one program.
                                  4. Final simplification95.9%

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 11.5:\\ \;\;\;\;\sin 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)\\ \mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin 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 11: 55.6% accurate, 2.1× speedup?

                                  \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;\sin re \leq 0.01:\\ \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.041666666666666664, 0.5\right), 1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im\_m \cdot im\_m, re \cdot \mathsf{fma}\left(im\_m, im\_m \cdot 0.041666666666666664, 0.5\right), re\right)\\ \end{array} \end{array} \]
                                  im_m = (fabs.f64 im)
                                  (FPCore (re im_m)
                                   :precision binary64
                                   (if (<= (sin re) 0.01)
                                     (*
                                      (fma re (* (* re re) -0.16666666666666666) re)
                                      (fma (* im_m im_m) (fma (* im_m im_m) 0.041666666666666664 0.5) 1.0))
                                     (fma (* im_m im_m) (* re (fma im_m (* im_m 0.041666666666666664) 0.5)) re)))
                                  im_m = fabs(im);
                                  double code(double re, double im_m) {
                                  	double tmp;
                                  	if (sin(re) <= 0.01) {
                                  		tmp = fma(re, ((re * re) * -0.16666666666666666), re) * fma((im_m * im_m), fma((im_m * im_m), 0.041666666666666664, 0.5), 1.0);
                                  	} else {
                                  		tmp = fma((im_m * im_m), (re * fma(im_m, (im_m * 0.041666666666666664), 0.5)), re);
                                  	}
                                  	return tmp;
                                  }
                                  
                                  im_m = abs(im)
                                  function code(re, im_m)
                                  	tmp = 0.0
                                  	if (sin(re) <= 0.01)
                                  		tmp = Float64(fma(re, Float64(Float64(re * re) * -0.16666666666666666), re) * fma(Float64(im_m * im_m), fma(Float64(im_m * im_m), 0.041666666666666664, 0.5), 1.0));
                                  	else
                                  		tmp = fma(Float64(im_m * im_m), Float64(re * fma(im_m, Float64(im_m * 0.041666666666666664), 0.5)), re);
                                  	end
                                  	return tmp
                                  end
                                  
                                  im_m = N[Abs[im], $MachinePrecision]
                                  code[re_, im$95$m_] := If[LessEqual[N[Sin[re], $MachinePrecision], 0.01], N[(N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * N[(im$95$m * N[(im$95$m * 0.041666666666666664), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]]
                                  
                                  \begin{array}{l}
                                  im_m = \left|im\right|
                                  
                                  \\
                                  \begin{array}{l}
                                  \mathbf{if}\;\sin re \leq 0.01:\\
                                  \;\;\;\;\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.041666666666666664, 0.5\right), 1\right)\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\mathsf{fma}\left(im\_m \cdot im\_m, re \cdot \mathsf{fma}\left(im\_m, im\_m \cdot 0.041666666666666664, 0.5\right), re\right)\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if (sin.f64 re) < 0.0100000000000000002

                                    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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                      7. unpow2N/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                      8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                      9. *-commutativeN/A

                                        \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                      11. distribute-rgt-outN/A

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

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

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

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

                                      \[\leadsto \left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right) \cdot \mathsf{fma}\left(\color{blue}{im \cdot im}, \mathsf{fma}\left(im \cdot im, \frac{1}{24}, \frac{1}{2}\right), 1\right) \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites69.3%

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

                                      if 0.0100000000000000002 < (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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                        7. unpow2N/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                        8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                        9. *-commutativeN/A

                                          \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                        11. distribute-rgt-outN/A

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

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

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

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

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

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

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

                                      Alternative 12: 96.2% accurate, 2.3× speedup?

                                      \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;im\_m \leq 11.5:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.041666666666666664, 0.5\right), 1\right)\\ \mathbf{elif}\;im\_m \leq 1.15 \cdot 10^{+77}:\\ \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin re \cdot 0.041666666666666664\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\\ \end{array} \end{array} \]
                                      im_m = (fabs.f64 im)
                                      (FPCore (re im_m)
                                       :precision binary64
                                       (if (<= im_m 11.5)
                                         (*
                                          (sin re)
                                          (fma (* im_m im_m) (fma (* im_m im_m) 0.041666666666666664 0.5) 1.0))
                                         (if (<= im_m 1.15e+77)
                                           (* (cosh im_m) (fma re (* (* re re) -0.16666666666666666) re))
                                           (* (* (sin re) 0.041666666666666664) (* (* im_m im_m) (* im_m im_m))))))
                                      im_m = fabs(im);
                                      double code(double re, double im_m) {
                                      	double tmp;
                                      	if (im_m <= 11.5) {
                                      		tmp = sin(re) * fma((im_m * im_m), fma((im_m * im_m), 0.041666666666666664, 0.5), 1.0);
                                      	} else if (im_m <= 1.15e+77) {
                                      		tmp = cosh(im_m) * fma(re, ((re * re) * -0.16666666666666666), re);
                                      	} else {
                                      		tmp = (sin(re) * 0.041666666666666664) * ((im_m * im_m) * (im_m * im_m));
                                      	}
                                      	return tmp;
                                      }
                                      
                                      im_m = abs(im)
                                      function code(re, im_m)
                                      	tmp = 0.0
                                      	if (im_m <= 11.5)
                                      		tmp = Float64(sin(re) * fma(Float64(im_m * im_m), fma(Float64(im_m * im_m), 0.041666666666666664, 0.5), 1.0));
                                      	elseif (im_m <= 1.15e+77)
                                      		tmp = Float64(cosh(im_m) * fma(re, Float64(Float64(re * re) * -0.16666666666666666), re));
                                      	else
                                      		tmp = Float64(Float64(sin(re) * 0.041666666666666664) * Float64(Float64(im_m * im_m) * Float64(im_m * im_m)));
                                      	end
                                      	return tmp
                                      end
                                      
                                      im_m = N[Abs[im], $MachinePrecision]
                                      code[re_, im$95$m_] := If[LessEqual[im$95$m, 11.5], N[(N[Sin[re], $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * 0.041666666666666664 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 1.15e+77], N[(N[Cosh[im$95$m], $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                      
                                      \begin{array}{l}
                                      im_m = \left|im\right|
                                      
                                      \\
                                      \begin{array}{l}
                                      \mathbf{if}\;im\_m \leq 11.5:\\
                                      \;\;\;\;\sin re \cdot \mathsf{fma}\left(im\_m \cdot im\_m, \mathsf{fma}\left(im\_m \cdot im\_m, 0.041666666666666664, 0.5\right), 1\right)\\
                                      
                                      \mathbf{elif}\;im\_m \leq 1.15 \cdot 10^{+77}:\\
                                      \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;\left(\sin re \cdot 0.041666666666666664\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if im < 11.5

                                        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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                          7. unpow2N/A

                                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                          8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                          9. *-commutativeN/A

                                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                          11. distribute-rgt-outN/A

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

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

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

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

                                        if 11.5 < im < 1.14999999999999997e77

                                        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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                          12. 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 \]
                                          13. cosh-undefN/A

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

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

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

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

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

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

                                            \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                        4. Applied rewrites100.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. +-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) \]
                                          2. distribute-lft-inN/A

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

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

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

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

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

                                            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
                                          8. lower-*.f64100.0

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

                                          \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)} \]
                                        8. Step-by-step derivation
                                          1. lift-*.f64N/A

                                            \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
                                          2. *-lft-identity100.0

                                            \[\leadsto \color{blue}{\cosh im} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \]
                                        9. Applied rewrites100.0%

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

                                        if 1.14999999999999997e77 < 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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                          7. unpow2N/A

                                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                          8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                          9. *-commutativeN/A

                                            \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                          11. distribute-rgt-outN/A

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

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

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

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

                                          \[\leadsto \frac{1}{24} \cdot \color{blue}{\left({im}^{4} \cdot \sin re\right)} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites100.0%

                                            \[\leadsto \left(\sin re \cdot 0.041666666666666664\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)} \]
                                        8. Recombined 3 regimes into one program.
                                        9. Add Preprocessing

                                        Alternative 13: 96.1% accurate, 2.3× speedup?

                                        \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;im\_m \leq 11.5:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\ \mathbf{elif}\;im\_m \leq 1.15 \cdot 10^{+77}:\\ \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\sin re \cdot 0.041666666666666664\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\\ \end{array} \end{array} \]
                                        im_m = (fabs.f64 im)
                                        (FPCore (re im_m)
                                         :precision binary64
                                         (if (<= im_m 11.5)
                                           (* (sin re) (fma 0.5 (* im_m im_m) 1.0))
                                           (if (<= im_m 1.15e+77)
                                             (* (cosh im_m) (fma re (* (* re re) -0.16666666666666666) re))
                                             (* (* (sin re) 0.041666666666666664) (* (* im_m im_m) (* im_m im_m))))))
                                        im_m = fabs(im);
                                        double code(double re, double im_m) {
                                        	double tmp;
                                        	if (im_m <= 11.5) {
                                        		tmp = sin(re) * fma(0.5, (im_m * im_m), 1.0);
                                        	} else if (im_m <= 1.15e+77) {
                                        		tmp = cosh(im_m) * fma(re, ((re * re) * -0.16666666666666666), re);
                                        	} else {
                                        		tmp = (sin(re) * 0.041666666666666664) * ((im_m * im_m) * (im_m * im_m));
                                        	}
                                        	return tmp;
                                        }
                                        
                                        im_m = abs(im)
                                        function code(re, im_m)
                                        	tmp = 0.0
                                        	if (im_m <= 11.5)
                                        		tmp = Float64(sin(re) * fma(0.5, Float64(im_m * im_m), 1.0));
                                        	elseif (im_m <= 1.15e+77)
                                        		tmp = Float64(cosh(im_m) * fma(re, Float64(Float64(re * re) * -0.16666666666666666), re));
                                        	else
                                        		tmp = Float64(Float64(sin(re) * 0.041666666666666664) * Float64(Float64(im_m * im_m) * Float64(im_m * im_m)));
                                        	end
                                        	return tmp
                                        end
                                        
                                        im_m = N[Abs[im], $MachinePrecision]
                                        code[re_, im$95$m_] := If[LessEqual[im$95$m, 11.5], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im$95$m * im$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 1.15e+77], N[(N[Cosh[im$95$m], $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * 0.041666666666666664), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                        
                                        \begin{array}{l}
                                        im_m = \left|im\right|
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;im\_m \leq 11.5:\\
                                        \;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\
                                        
                                        \mathbf{elif}\;im\_m \leq 1.15 \cdot 10^{+77}:\\
                                        \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\left(\sin re \cdot 0.041666666666666664\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(im\_m \cdot im\_m\right)\right)\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 3 regimes
                                        2. if im < 11.5

                                          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 + \frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} \]
                                          4. Step-by-step derivation
                                            1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \sin re \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \]
                                            14. lower-*.f6485.7

                                              \[\leadsto \sin re \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \]
                                          5. Applied rewrites85.7%

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

                                          if 11.5 < im < 1.14999999999999997e77

                                          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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                            12. 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 \]
                                            13. cosh-undefN/A

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

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

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

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

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

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

                                              \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                          4. Applied rewrites100.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. +-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) \]
                                            2. distribute-lft-inN/A

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

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

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

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

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

                                              \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
                                            8. lower-*.f64100.0

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

                                            \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)} \]
                                          8. Step-by-step derivation
                                            1. lift-*.f64N/A

                                              \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
                                            2. *-lft-identity100.0

                                              \[\leadsto \color{blue}{\cosh im} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \]
                                          9. Applied rewrites100.0%

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

                                          if 1.14999999999999997e77 < 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. 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 \frac{1}{2}\right) \cdot \sin re} + \sin re\right) \]
                                            7. unpow2N/A

                                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot \frac{1}{2}\right) \cdot \sin re + \sin re\right) \]
                                            8. 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 \cdot \left(im \cdot \frac{1}{2}\right)\right)} \cdot \sin re + \sin re\right) \]
                                            9. *-commutativeN/A

                                              \[\leadsto \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \sin re + \left(\left(im \cdot \color{blue}{\left(\frac{1}{2} \cdot im\right)}\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(im \cdot \left(\frac{1}{2} \cdot im\right) + 1\right) \cdot \sin re} \]
                                            11. distribute-rgt-outN/A

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

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

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

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

                                            \[\leadsto \frac{1}{24} \cdot \color{blue}{\left({im}^{4} \cdot \sin re\right)} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites100.0%

                                              \[\leadsto \left(\sin re \cdot 0.041666666666666664\right) \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)} \]
                                          8. Recombined 3 regimes into one program.
                                          9. Add Preprocessing

                                          Alternative 14: 92.4% accurate, 2.4× speedup?

                                          \[\begin{array}{l} im_m = \left|im\right| \\ \begin{array}{l} \mathbf{if}\;im\_m \leq 11.5:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\ \mathbf{elif}\;im\_m \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im\_m \cdot im\_m\right)\right)\\ \end{array} \end{array} \]
                                          im_m = (fabs.f64 im)
                                          (FPCore (re im_m)
                                           :precision binary64
                                           (if (<= im_m 11.5)
                                             (* (sin re) (fma 0.5 (* im_m im_m) 1.0))
                                             (if (<= im_m 1.35e+154)
                                               (* (cosh im_m) (fma re (* (* re re) -0.16666666666666666) re))
                                               (* (sin re) (* 0.5 (* im_m im_m))))))
                                          im_m = fabs(im);
                                          double code(double re, double im_m) {
                                          	double tmp;
                                          	if (im_m <= 11.5) {
                                          		tmp = sin(re) * fma(0.5, (im_m * im_m), 1.0);
                                          	} else if (im_m <= 1.35e+154) {
                                          		tmp = cosh(im_m) * fma(re, ((re * re) * -0.16666666666666666), re);
                                          	} else {
                                          		tmp = sin(re) * (0.5 * (im_m * im_m));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          im_m = abs(im)
                                          function code(re, im_m)
                                          	tmp = 0.0
                                          	if (im_m <= 11.5)
                                          		tmp = Float64(sin(re) * fma(0.5, Float64(im_m * im_m), 1.0));
                                          	elseif (im_m <= 1.35e+154)
                                          		tmp = Float64(cosh(im_m) * fma(re, Float64(Float64(re * re) * -0.16666666666666666), re));
                                          	else
                                          		tmp = Float64(sin(re) * Float64(0.5 * Float64(im_m * im_m)));
                                          	end
                                          	return tmp
                                          end
                                          
                                          im_m = N[Abs[im], $MachinePrecision]
                                          code[re_, im$95$m_] := If[LessEqual[im$95$m, 11.5], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im$95$m * im$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 1.35e+154], N[(N[Cosh[im$95$m], $MachinePrecision] * N[(re * N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + re), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          im_m = \left|im\right|
                                          
                                          \\
                                          \begin{array}{l}
                                          \mathbf{if}\;im\_m \leq 11.5:\\
                                          \;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im\_m \cdot im\_m, 1\right)\\
                                          
                                          \mathbf{elif}\;im\_m \leq 1.35 \cdot 10^{+154}:\\
                                          \;\;\;\;\cosh im\_m \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im\_m \cdot im\_m\right)\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if im < 11.5

                                            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 + \frac{1}{2} \cdot \left({im}^{2} \cdot \sin re\right)} \]
                                            4. Step-by-step derivation
                                              1. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \sin re \cdot \mathsf{fma}\left(\frac{1}{2}, \color{blue}{im \cdot im}, 1\right) \]
                                              14. lower-*.f6485.7

                                                \[\leadsto \sin re \cdot \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \]
                                            5. Applied rewrites85.7%

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

                                            if 11.5 < im < 1.35000000000000003e154

                                            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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                              12. 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 \]
                                              13. cosh-undefN/A

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

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

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

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

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

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

                                                \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                            4. Applied rewrites100.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. +-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) \]
                                              2. distribute-lft-inN/A

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

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

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

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

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

                                                \[\leadsto \left(1 \cdot \cosh im\right) \cdot \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right)} \cdot \frac{-1}{6}, re\right) \]
                                              8. lower-*.f6484.0

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

                                              \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{\mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)} \]
                                            8. Step-by-step derivation
                                              1. lift-*.f64N/A

                                                \[\leadsto \color{blue}{\left(1 \cdot \cosh im\right)} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot \frac{-1}{6}, re\right) \]
                                              2. *-lft-identity84.0

                                                \[\leadsto \color{blue}{\cosh im} \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right) \]
                                            9. Applied rewrites84.0%

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

                                            if 1.35000000000000003e154 < 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. lift-*.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \left(\frac{1}{2} \cdot \left(e^{im} + e^{\color{blue}{0 - im}}\right)\right) \cdot \sin re \]
                                              12. 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 \]
                                              13. cosh-undefN/A

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

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

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

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

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

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

                                                \[\leadsto \left(1 \cdot \color{blue}{\cosh im}\right) \cdot \sin re \]
                                            4. Applied rewrites100.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. lower-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. lower-*.f64100.0

                                                \[\leadsto \mathsf{fma}\left(0.5, \color{blue}{im \cdot im}, 1\right) \cdot \sin re \]
                                            7. Applied rewrites100.0%

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

                                              \[\leadsto \left(\frac{1}{2} \cdot \color{blue}{{im}^{2}}\right) \cdot \sin re \]
                                            9. Step-by-step derivation
                                              1. Applied rewrites100.0%

                                                \[\leadsto \left(0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \sin re \]
                                            10. Recombined 3 regimes into one program.
                                            11. Final simplification87.5%

                                              \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 11.5:\\ \;\;\;\;\sin re \cdot \mathsf{fma}\left(0.5, im \cdot im, 1\right)\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\cosh im \cdot \mathsf{fma}\left(re, \left(re \cdot re\right) \cdot -0.16666666666666666, re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]
                                            12. Add Preprocessing

                                            Alternative 15: 33.4% accurate, 18.6× speedup?

                                            \[\begin{array}{l} im_m = \left|im\right| \\ \mathsf{fma}\left(re, re \cdot \left(re \cdot -0.16666666666666666\right), re\right) \end{array} \]
                                            im_m = (fabs.f64 im)
                                            (FPCore (re im_m)
                                             :precision binary64
                                             (fma re (* re (* re -0.16666666666666666)) re))
                                            im_m = fabs(im);
                                            double code(double re, double im_m) {
                                            	return fma(re, (re * (re * -0.16666666666666666)), re);
                                            }
                                            
                                            im_m = abs(im)
                                            function code(re, im_m)
                                            	return fma(re, Float64(re * Float64(re * -0.16666666666666666)), re)
                                            end
                                            
                                            im_m = N[Abs[im], $MachinePrecision]
                                            code[re_, im$95$m_] := N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + re), $MachinePrecision]
                                            
                                            \begin{array}{l}
                                            im_m = \left|im\right|
                                            
                                            \\
                                            \mathsf{fma}\left(re, re \cdot \left(re \cdot -0.16666666666666666\right), re\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} \]
                                            4. Step-by-step derivation
                                              1. lower-sin.f6451.3

                                                \[\leadsto \color{blue}{\sin re} \]
                                            5. Applied rewrites51.3%

                                              \[\leadsto \color{blue}{\sin re} \]
                                            6. Taylor expanded in re around 0

                                              \[\leadsto re \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites34.1%

                                                \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right) \cdot -0.16666666666666666}, re\right) \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites34.1%

                                                  \[\leadsto \mathsf{fma}\left(re, \left(re \cdot -0.16666666666666666\right) \cdot re, re\right) \]
                                                2. Final simplification34.1%

                                                  \[\leadsto \mathsf{fma}\left(re, re \cdot \left(re \cdot -0.16666666666666666\right), re\right) \]
                                                3. Add Preprocessing

                                                Alternative 16: 10.5% accurate, 19.8× speedup?

                                                \[\begin{array}{l} im_m = \left|im\right| \\ re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right) \end{array} \]
                                                im_m = (fabs.f64 im)
                                                (FPCore (re im_m)
                                                 :precision binary64
                                                 (* re (* re (* re -0.16666666666666666))))
                                                im_m = fabs(im);
                                                double code(double re, double im_m) {
                                                	return re * (re * (re * -0.16666666666666666));
                                                }
                                                
                                                im_m = abs(im)
                                                real(8) function code(re, im_m)
                                                    real(8), intent (in) :: re
                                                    real(8), intent (in) :: im_m
                                                    code = re * (re * (re * (-0.16666666666666666d0)))
                                                end function
                                                
                                                im_m = Math.abs(im);
                                                public static double code(double re, double im_m) {
                                                	return re * (re * (re * -0.16666666666666666));
                                                }
                                                
                                                im_m = math.fabs(im)
                                                def code(re, im_m):
                                                	return re * (re * (re * -0.16666666666666666))
                                                
                                                im_m = abs(im)
                                                function code(re, im_m)
                                                	return Float64(re * Float64(re * Float64(re * -0.16666666666666666)))
                                                end
                                                
                                                im_m = abs(im);
                                                function tmp = code(re, im_m)
                                                	tmp = re * (re * (re * -0.16666666666666666));
                                                end
                                                
                                                im_m = N[Abs[im], $MachinePrecision]
                                                code[re_, im$95$m_] := N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                
                                                \begin{array}{l}
                                                im_m = \left|im\right|
                                                
                                                \\
                                                re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\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} \]
                                                4. Step-by-step derivation
                                                  1. lower-sin.f6451.3

                                                    \[\leadsto \color{blue}{\sin re} \]
                                                5. Applied rewrites51.3%

                                                  \[\leadsto \color{blue}{\sin re} \]
                                                6. Taylor expanded in re around 0

                                                  \[\leadsto re \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites34.1%

                                                    \[\leadsto \mathsf{fma}\left(re, \color{blue}{\left(re \cdot re\right) \cdot -0.16666666666666666}, re\right) \]
                                                  2. Taylor expanded in re around inf

                                                    \[\leadsto \frac{-1}{6} \cdot {re}^{\color{blue}{3}} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites9.6%

                                                      \[\leadsto re \cdot \left(\left(re \cdot re\right) \cdot \color{blue}{-0.16666666666666666}\right) \]
                                                    2. Step-by-step derivation
                                                      1. Applied rewrites9.6%

                                                        \[\leadsto re \cdot \left(\left(re \cdot -0.16666666666666666\right) \cdot re\right) \]
                                                      2. Final simplification9.6%

                                                        \[\leadsto re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right) \]
                                                      3. Add Preprocessing

                                                      Reproduce

                                                      ?
                                                      herbie shell --seed 2024221 
                                                      (FPCore (re im)
                                                        :name "math.sin on complex, real part"
                                                        :precision binary64
                                                        (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))