math.cos on complex, imaginary part

Percentage Accurate: 65.8% → 99.7%
Time: 14.7s
Alternatives: 18
Speedup: 2.8×

Specification

?
\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-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(-im) - exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-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 18 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: 65.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-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(-im) - exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.7% accurate, 0.6× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{0 - im\_m} - e^{im\_m}\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.5:\\ \;\;\;\;t\_0 \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (- (exp (- 0.0 im_m)) (exp im_m))))
   (*
    im_s
    (if (<= t_0 -0.5)
      (* t_0 (* 0.5 (sin re)))
      (* im_m (* (sin re) (+ -1.0 (* im_m (* im_m -0.16666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = exp((0.0 - im_m)) - exp(im_m);
	double tmp;
	if (t_0 <= -0.5) {
		tmp = t_0 * (0.5 * sin(re));
	} else {
		tmp = im_m * (sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = exp((0.0d0 - im_m)) - exp(im_m)
    if (t_0 <= (-0.5d0)) then
        tmp = t_0 * (0.5d0 * sin(re))
    else
        tmp = im_m * (sin(re) * ((-1.0d0) + (im_m * (im_m * (-0.16666666666666666d0)))))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = Math.exp((0.0 - im_m)) - Math.exp(im_m);
	double tmp;
	if (t_0 <= -0.5) {
		tmp = t_0 * (0.5 * Math.sin(re));
	} else {
		tmp = im_m * (Math.sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = math.exp((0.0 - im_m)) - math.exp(im_m)
	tmp = 0
	if t_0 <= -0.5:
		tmp = t_0 * (0.5 * math.sin(re))
	else:
		tmp = im_m * (math.sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(exp(Float64(0.0 - im_m)) - exp(im_m))
	tmp = 0.0
	if (t_0 <= -0.5)
		tmp = Float64(t_0 * Float64(0.5 * sin(re)));
	else
		tmp = Float64(im_m * Float64(sin(re) * Float64(-1.0 + Float64(im_m * Float64(im_m * -0.16666666666666666)))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = exp((0.0 - im_m)) - exp(im_m);
	tmp = 0.0;
	if (t_0 <= -0.5)
		tmp = t_0 * (0.5 * sin(re));
	else
		tmp = im_m * (sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[N[(0.0 - im$95$m), $MachinePrecision]], $MachinePrecision] - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.5], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(N[Sin[re], $MachinePrecision] * N[(-1.0 + N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := e^{0 - im\_m} - e^{im\_m}\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -0.5:\\
\;\;\;\;t\_0 \cdot \left(0.5 \cdot \sin re\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -0.5

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
    2. Add Preprocessing

    if -0.5 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

    1. Initial program 52.9%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(im, \left(\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{-1} \cdot \sin re\right)\right) \]
      8. distribute-rgt-outN/A

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

        \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\frac{-1}{6} \cdot \left(im \cdot im\right) + -1\right)\right)\right) \]
      10. associate-*r*N/A

        \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\left(\frac{-1}{6} \cdot im\right) \cdot im + -1\right)\right)\right) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(im \cdot \left(\frac{-1}{6} \cdot im\right) + -1\right)\right)\right) \]
      12. *-lowering-*.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
      18. *-lowering-*.f6488.0%

        \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
    5. Simplified88.0%

      \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.5%

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

Alternative 2: 99.5% accurate, 0.7× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := 0.5 \cdot \sin re\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;e^{0 - im\_m} - e^{im\_m} \leq -5 \cdot 10^{+56}:\\ \;\;\;\;t\_0 \cdot \left(1 - e^{im\_m}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right) + im\_m \cdot -2\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (* 0.5 (sin re))))
   (*
    im_s
    (if (<= (- (exp (- 0.0 im_m)) (exp im_m)) -5e+56)
      (* t_0 (- 1.0 (exp im_m)))
      (*
       t_0
       (+
        (*
         (* im_m (* im_m im_m))
         (+
          -0.3333333333333333
          (*
           (* im_m im_m)
           (+
            -0.016666666666666666
            (* (* im_m im_m) -0.0003968253968253968)))))
        (* im_m -2.0)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = 0.5 * sin(re);
	double tmp;
	if ((exp((0.0 - im_m)) - exp(im_m)) <= -5e+56) {
		tmp = t_0 * (1.0 - exp(im_m));
	} else {
		tmp = t_0 * (((im_m * (im_m * im_m)) * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))) + (im_m * -2.0));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.5d0 * sin(re)
    if ((exp((0.0d0 - im_m)) - exp(im_m)) <= (-5d+56)) then
        tmp = t_0 * (1.0d0 - exp(im_m))
    else
        tmp = t_0 * (((im_m * (im_m * im_m)) * ((-0.3333333333333333d0) + ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0)))))) + (im_m * (-2.0d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = 0.5 * Math.sin(re);
	double tmp;
	if ((Math.exp((0.0 - im_m)) - Math.exp(im_m)) <= -5e+56) {
		tmp = t_0 * (1.0 - Math.exp(im_m));
	} else {
		tmp = t_0 * (((im_m * (im_m * im_m)) * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))) + (im_m * -2.0));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = 0.5 * math.sin(re)
	tmp = 0
	if (math.exp((0.0 - im_m)) - math.exp(im_m)) <= -5e+56:
		tmp = t_0 * (1.0 - math.exp(im_m))
	else:
		tmp = t_0 * (((im_m * (im_m * im_m)) * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))) + (im_m * -2.0))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(0.5 * sin(re))
	tmp = 0.0
	if (Float64(exp(Float64(0.0 - im_m)) - exp(im_m)) <= -5e+56)
		tmp = Float64(t_0 * Float64(1.0 - exp(im_m)));
	else
		tmp = Float64(t_0 * Float64(Float64(Float64(im_m * Float64(im_m * im_m)) * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968))))) + Float64(im_m * -2.0)));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = 0.5 * sin(re);
	tmp = 0.0;
	if ((exp((0.0 - im_m)) - exp(im_m)) <= -5e+56)
		tmp = t_0 * (1.0 - exp(im_m));
	else
		tmp = t_0 * (((im_m * (im_m * im_m)) * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))) + (im_m * -2.0));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[N[(N[Exp[N[(0.0 - im$95$m), $MachinePrecision]], $MachinePrecision] - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision], -5e+56], N[(t$95$0 * N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[(N[(N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(im$95$m * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := 0.5 \cdot \sin re\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;e^{0 - im\_m} - e^{im\_m} \leq -5 \cdot 10^{+56}:\\
\;\;\;\;t\_0 \cdot \left(1 - e^{im\_m}\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right) + im\_m \cdot -2\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -5.00000000000000024e56

    1. Initial program 100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
    4. Step-by-step derivation
      1. Simplified100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]

      if -5.00000000000000024e56 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

      1. Initial program 53.1%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
        3. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
        4. +-commutativeN/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
        7. associate-*l*N/A

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
        13. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
        14. +-commutativeN/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
      5. Simplified95.9%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right) + \color{blue}{-2}\right)\right)\right) \]
        2. distribute-lft-inN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right) + \color{blue}{im \cdot -2}\right)\right) \]
        3. *-commutativeN/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right)\right), \color{blue}{\left(-2 \cdot im\right)}\right)\right) \]
      7. Applied egg-rr95.9%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) + im \cdot -2\right)} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification96.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;e^{0 - im} - e^{im} \leq -5 \cdot 10^{+56}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(1 - e^{im}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) + im \cdot -2\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 97.9% accurate, 2.3× speedup?

    \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := -0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\\ t_1 := 0.5 \cdot \sin re\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;t\_1 \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot t\_0 + im\_m \cdot -2\right)\\ \mathbf{elif}\;im\_m \leq 3.35 \cdot 10^{+44}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
    im\_m = (fabs.f64 im)
    im\_s = (copysign.f64 #s(literal 1 binary64) im)
    (FPCore (im_s re im_m)
     :precision binary64
     (let* ((t_0
             (+
              -0.3333333333333333
              (*
               (* im_m im_m)
               (+
                -0.016666666666666666
                (* (* im_m im_m) -0.0003968253968253968)))))
            (t_1 (* 0.5 (sin re))))
       (*
        im_s
        (if (<= im_m 135.0)
          (* t_1 (+ (* (* im_m (* im_m im_m)) t_0) (* im_m -2.0)))
          (if (<= im_m 3.35e+44)
            (* (- 1.0 (exp im_m)) (* 0.5 re))
            (* t_1 (* im_m (+ -2.0 (* im_m (* im_m t_0))))))))))
    im\_m = fabs(im);
    im\_s = copysign(1.0, im);
    double code(double im_s, double re, double im_m) {
    	double t_0 = -0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)));
    	double t_1 = 0.5 * sin(re);
    	double tmp;
    	if (im_m <= 135.0) {
    		tmp = t_1 * (((im_m * (im_m * im_m)) * t_0) + (im_m * -2.0));
    	} else if (im_m <= 3.35e+44) {
    		tmp = (1.0 - exp(im_m)) * (0.5 * re);
    	} else {
    		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))));
    	}
    	return im_s * tmp;
    }
    
    im\_m = abs(im)
    im\_s = copysign(1.0d0, im)
    real(8) function code(im_s, re, im_m)
        real(8), intent (in) :: im_s
        real(8), intent (in) :: re
        real(8), intent (in) :: im_m
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: tmp
        t_0 = (-0.3333333333333333d0) + ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0))))
        t_1 = 0.5d0 * sin(re)
        if (im_m <= 135.0d0) then
            tmp = t_1 * (((im_m * (im_m * im_m)) * t_0) + (im_m * (-2.0d0)))
        else if (im_m <= 3.35d+44) then
            tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
        else
            tmp = t_1 * (im_m * ((-2.0d0) + (im_m * (im_m * t_0))))
        end if
        code = im_s * tmp
    end function
    
    im\_m = Math.abs(im);
    im\_s = Math.copySign(1.0, im);
    public static double code(double im_s, double re, double im_m) {
    	double t_0 = -0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)));
    	double t_1 = 0.5 * Math.sin(re);
    	double tmp;
    	if (im_m <= 135.0) {
    		tmp = t_1 * (((im_m * (im_m * im_m)) * t_0) + (im_m * -2.0));
    	} else if (im_m <= 3.35e+44) {
    		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
    	} else {
    		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))));
    	}
    	return im_s * tmp;
    }
    
    im\_m = math.fabs(im)
    im\_s = math.copysign(1.0, im)
    def code(im_s, re, im_m):
    	t_0 = -0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))
    	t_1 = 0.5 * math.sin(re)
    	tmp = 0
    	if im_m <= 135.0:
    		tmp = t_1 * (((im_m * (im_m * im_m)) * t_0) + (im_m * -2.0))
    	elif im_m <= 3.35e+44:
    		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
    	else:
    		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))))
    	return im_s * tmp
    
    im\_m = abs(im)
    im\_s = copysign(1.0, im)
    function code(im_s, re, im_m)
    	t_0 = Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968))))
    	t_1 = Float64(0.5 * sin(re))
    	tmp = 0.0
    	if (im_m <= 135.0)
    		tmp = Float64(t_1 * Float64(Float64(Float64(im_m * Float64(im_m * im_m)) * t_0) + Float64(im_m * -2.0)));
    	elseif (im_m <= 3.35e+44)
    		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
    	else
    		tmp = Float64(t_1 * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * t_0)))));
    	end
    	return Float64(im_s * tmp)
    end
    
    im\_m = abs(im);
    im\_s = sign(im) * abs(1.0);
    function tmp_2 = code(im_s, re, im_m)
    	t_0 = -0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)));
    	t_1 = 0.5 * sin(re);
    	tmp = 0.0;
    	if (im_m <= 135.0)
    		tmp = t_1 * (((im_m * (im_m * im_m)) * t_0) + (im_m * -2.0));
    	elseif (im_m <= 3.35e+44)
    		tmp = (1.0 - exp(im_m)) * (0.5 * re);
    	else
    		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))));
    	end
    	tmp_2 = im_s * tmp;
    end
    
    im\_m = N[Abs[im], $MachinePrecision]
    im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
    code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 135.0], N[(t$95$1 * N[(N[(N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(im$95$m * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 3.35e+44], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
    
    \begin{array}{l}
    im\_m = \left|im\right|
    \\
    im\_s = \mathsf{copysign}\left(1, im\right)
    
    \\
    \begin{array}{l}
    t_0 := -0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\\
    t_1 := 0.5 \cdot \sin re\\
    im\_s \cdot \begin{array}{l}
    \mathbf{if}\;im\_m \leq 135:\\
    \;\;\;\;t\_1 \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot t\_0 + im\_m \cdot -2\right)\\
    
    \mathbf{elif}\;im\_m \leq 3.35 \cdot 10^{+44}:\\
    \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot t\_0\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if im < 135

      1. Initial program 53.3%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
        2. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
        3. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
        4. +-commutativeN/A

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
        7. associate-*l*N/A

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
        13. metadata-evalN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
        14. +-commutativeN/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
      5. Simplified95.5%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
      6. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right) + \color{blue}{-2}\right)\right)\right) \]
        2. distribute-lft-inN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right) + \color{blue}{im \cdot -2}\right)\right) \]
        3. *-commutativeN/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right)\right), \color{blue}{\left(-2 \cdot im\right)}\right)\right) \]
      7. Applied egg-rr95.5%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) + im \cdot -2\right)} \]

      if 135 < im < 3.35000000000000018e44

      1. Initial program 100.0%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
      4. Step-by-step derivation
        1. Simplified100.0%

          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
        2. Taylor expanded in re around 0

          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
        3. Step-by-step derivation
          1. *-lowering-*.f6483.3%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
        4. Simplified83.3%

          \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]

        if 3.35000000000000018e44 < im

        1. Initial program 100.0%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
          3. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
          4. +-commutativeN/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
          7. associate-*l*N/A

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
          13. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
          14. +-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
        5. Simplified100.0%

          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
      5. Recombined 3 regimes into one program.
      6. Final simplification96.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) + im \cdot -2\right)\\ \mathbf{elif}\;im \leq 3.35 \cdot 10^{+44}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\\ \end{array} \]
      7. Add Preprocessing

      Alternative 4: 97.9% accurate, 2.3× speedup?

      \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im\_m \leq 3.35 \cdot 10^{+44}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
      im\_m = (fabs.f64 im)
      im\_s = (copysign.f64 #s(literal 1 binary64) im)
      (FPCore (im_s re im_m)
       :precision binary64
       (let* ((t_0
               (*
                (* 0.5 (sin re))
                (*
                 im_m
                 (+
                  -2.0
                  (*
                   im_m
                   (*
                    im_m
                    (+
                     -0.3333333333333333
                     (*
                      (* im_m im_m)
                      (+
                       -0.016666666666666666
                       (* (* im_m im_m) -0.0003968253968253968)))))))))))
         (*
          im_s
          (if (<= im_m 135.0)
            t_0
            (if (<= im_m 3.35e+44) (* (- 1.0 (exp im_m)) (* 0.5 re)) t_0)))))
      im\_m = fabs(im);
      im\_s = copysign(1.0, im);
      double code(double im_s, double re, double im_m) {
      	double t_0 = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))))));
      	double tmp;
      	if (im_m <= 135.0) {
      		tmp = t_0;
      	} else if (im_m <= 3.35e+44) {
      		tmp = (1.0 - exp(im_m)) * (0.5 * re);
      	} else {
      		tmp = t_0;
      	}
      	return im_s * tmp;
      }
      
      im\_m = abs(im)
      im\_s = copysign(1.0d0, im)
      real(8) function code(im_s, re, im_m)
          real(8), intent (in) :: im_s
          real(8), intent (in) :: re
          real(8), intent (in) :: im_m
          real(8) :: t_0
          real(8) :: tmp
          t_0 = (0.5d0 * sin(re)) * (im_m * ((-2.0d0) + (im_m * (im_m * ((-0.3333333333333333d0) + ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0)))))))))
          if (im_m <= 135.0d0) then
              tmp = t_0
          else if (im_m <= 3.35d+44) then
              tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
          else
              tmp = t_0
          end if
          code = im_s * tmp
      end function
      
      im\_m = Math.abs(im);
      im\_s = Math.copySign(1.0, im);
      public static double code(double im_s, double re, double im_m) {
      	double t_0 = (0.5 * Math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))))));
      	double tmp;
      	if (im_m <= 135.0) {
      		tmp = t_0;
      	} else if (im_m <= 3.35e+44) {
      		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
      	} else {
      		tmp = t_0;
      	}
      	return im_s * tmp;
      }
      
      im\_m = math.fabs(im)
      im\_s = math.copysign(1.0, im)
      def code(im_s, re, im_m):
      	t_0 = (0.5 * math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))))))
      	tmp = 0
      	if im_m <= 135.0:
      		tmp = t_0
      	elif im_m <= 3.35e+44:
      		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
      	else:
      		tmp = t_0
      	return im_s * tmp
      
      im\_m = abs(im)
      im\_s = copysign(1.0, im)
      function code(im_s, re, im_m)
      	t_0 = Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968)))))))))
      	tmp = 0.0
      	if (im_m <= 135.0)
      		tmp = t_0;
      	elseif (im_m <= 3.35e+44)
      		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
      	else
      		tmp = t_0;
      	end
      	return Float64(im_s * tmp)
      end
      
      im\_m = abs(im);
      im\_s = sign(im) * abs(1.0);
      function tmp_2 = code(im_s, re, im_m)
      	t_0 = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))))));
      	tmp = 0.0;
      	if (im_m <= 135.0)
      		tmp = t_0;
      	elseif (im_m <= 3.35e+44)
      		tmp = (1.0 - exp(im_m)) * (0.5 * re);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = im_s * tmp;
      end
      
      im\_m = N[Abs[im], $MachinePrecision]
      im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
      code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 135.0], t$95$0, If[LessEqual[im$95$m, 3.35e+44], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
      
      \begin{array}{l}
      im\_m = \left|im\right|
      \\
      im\_s = \mathsf{copysign}\left(1, im\right)
      
      \\
      \begin{array}{l}
      t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\\
      im\_s \cdot \begin{array}{l}
      \mathbf{if}\;im\_m \leq 135:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;im\_m \leq 3.35 \cdot 10^{+44}:\\
      \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if im < 135 or 3.35000000000000018e44 < im

        1. Initial program 61.5%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
        4. Step-by-step derivation
          1. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
          3. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
          4. +-commutativeN/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
          7. associate-*l*N/A

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
          13. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
          14. +-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
        5. Simplified96.3%

          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]

        if 135 < im < 3.35000000000000018e44

        1. Initial program 100.0%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
        4. Step-by-step derivation
          1. Simplified100.0%

            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
          2. Taylor expanded in re around 0

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
          3. Step-by-step derivation
            1. *-lowering-*.f6483.3%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
          4. Simplified83.3%

            \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]
        5. Recombined 2 regimes into one program.
        6. Final simplification96.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 3.35 \cdot 10^{+44}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\\ \end{array} \]
        7. Add Preprocessing

        Alternative 5: 96.8% accurate, 2.4× speedup?

        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := -0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot -0.016666666666666666\\ t_1 := 0.5 \cdot \sin re\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;im\_m \cdot \left(t\_1 \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot t\_0\right)\right)\\ \mathbf{elif}\;im\_m \leq 4.2 \cdot 10^{+58}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
        im\_m = (fabs.f64 im)
        im\_s = (copysign.f64 #s(literal 1 binary64) im)
        (FPCore (im_s re im_m)
         :precision binary64
         (let* ((t_0 (+ -0.3333333333333333 (* (* im_m im_m) -0.016666666666666666)))
                (t_1 (* 0.5 (sin re))))
           (*
            im_s
            (if (<= im_m 135.0)
              (* im_m (* t_1 (+ -2.0 (* (* im_m im_m) t_0))))
              (if (<= im_m 4.2e+58)
                (* (- 1.0 (exp im_m)) (* 0.5 re))
                (* t_1 (* im_m (+ -2.0 (* im_m (* im_m t_0))))))))))
        im\_m = fabs(im);
        im\_s = copysign(1.0, im);
        double code(double im_s, double re, double im_m) {
        	double t_0 = -0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666);
        	double t_1 = 0.5 * sin(re);
        	double tmp;
        	if (im_m <= 135.0) {
        		tmp = im_m * (t_1 * (-2.0 + ((im_m * im_m) * t_0)));
        	} else if (im_m <= 4.2e+58) {
        		tmp = (1.0 - exp(im_m)) * (0.5 * re);
        	} else {
        		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))));
        	}
        	return im_s * tmp;
        }
        
        im\_m = abs(im)
        im\_s = copysign(1.0d0, im)
        real(8) function code(im_s, re, im_m)
            real(8), intent (in) :: im_s
            real(8), intent (in) :: re
            real(8), intent (in) :: im_m
            real(8) :: t_0
            real(8) :: t_1
            real(8) :: tmp
            t_0 = (-0.3333333333333333d0) + ((im_m * im_m) * (-0.016666666666666666d0))
            t_1 = 0.5d0 * sin(re)
            if (im_m <= 135.0d0) then
                tmp = im_m * (t_1 * ((-2.0d0) + ((im_m * im_m) * t_0)))
            else if (im_m <= 4.2d+58) then
                tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
            else
                tmp = t_1 * (im_m * ((-2.0d0) + (im_m * (im_m * t_0))))
            end if
            code = im_s * tmp
        end function
        
        im\_m = Math.abs(im);
        im\_s = Math.copySign(1.0, im);
        public static double code(double im_s, double re, double im_m) {
        	double t_0 = -0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666);
        	double t_1 = 0.5 * Math.sin(re);
        	double tmp;
        	if (im_m <= 135.0) {
        		tmp = im_m * (t_1 * (-2.0 + ((im_m * im_m) * t_0)));
        	} else if (im_m <= 4.2e+58) {
        		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
        	} else {
        		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))));
        	}
        	return im_s * tmp;
        }
        
        im\_m = math.fabs(im)
        im\_s = math.copysign(1.0, im)
        def code(im_s, re, im_m):
        	t_0 = -0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666)
        	t_1 = 0.5 * math.sin(re)
        	tmp = 0
        	if im_m <= 135.0:
        		tmp = im_m * (t_1 * (-2.0 + ((im_m * im_m) * t_0)))
        	elif im_m <= 4.2e+58:
        		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
        	else:
        		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))))
        	return im_s * tmp
        
        im\_m = abs(im)
        im\_s = copysign(1.0, im)
        function code(im_s, re, im_m)
        	t_0 = Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * -0.016666666666666666))
        	t_1 = Float64(0.5 * sin(re))
        	tmp = 0.0
        	if (im_m <= 135.0)
        		tmp = Float64(im_m * Float64(t_1 * Float64(-2.0 + Float64(Float64(im_m * im_m) * t_0))));
        	elseif (im_m <= 4.2e+58)
        		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
        	else
        		tmp = Float64(t_1 * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * t_0)))));
        	end
        	return Float64(im_s * tmp)
        end
        
        im\_m = abs(im);
        im\_s = sign(im) * abs(1.0);
        function tmp_2 = code(im_s, re, im_m)
        	t_0 = -0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666);
        	t_1 = 0.5 * sin(re);
        	tmp = 0.0;
        	if (im_m <= 135.0)
        		tmp = im_m * (t_1 * (-2.0 + ((im_m * im_m) * t_0)));
        	elseif (im_m <= 4.2e+58)
        		tmp = (1.0 - exp(im_m)) * (0.5 * re);
        	else
        		tmp = t_1 * (im_m * (-2.0 + (im_m * (im_m * t_0))));
        	end
        	tmp_2 = im_s * tmp;
        end
        
        im\_m = N[Abs[im], $MachinePrecision]
        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
        code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 135.0], N[(im$95$m * N[(t$95$1 * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 4.2e+58], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
        
        \begin{array}{l}
        im\_m = \left|im\right|
        \\
        im\_s = \mathsf{copysign}\left(1, im\right)
        
        \\
        \begin{array}{l}
        t_0 := -0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot -0.016666666666666666\\
        t_1 := 0.5 \cdot \sin re\\
        im\_s \cdot \begin{array}{l}
        \mathbf{if}\;im\_m \leq 135:\\
        \;\;\;\;im\_m \cdot \left(t\_1 \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot t\_0\right)\right)\\
        
        \mathbf{elif}\;im\_m \leq 4.2 \cdot 10^{+58}:\\
        \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot t\_0\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if im < 135

          1. Initial program 53.3%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
          4. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
            3. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
            4. +-commutativeN/A

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
            7. associate-*l*N/A

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
            13. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
            14. +-commutativeN/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
          5. Simplified95.5%

            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
          6. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right) + \color{blue}{-2}\right)\right)\right) \]
            2. distribute-lft-inN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right) + \color{blue}{im \cdot -2}\right)\right) \]
            3. *-commutativeN/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right)\right), \color{blue}{\left(-2 \cdot im\right)}\right)\right) \]
          7. Applied egg-rr95.5%

            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) + im \cdot -2\right)} \]
          8. Taylor expanded in im around 0

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)}\right) \]
          9. Step-by-step derivation
            1. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)}\right)\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
            3. metadata-evalN/A

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)\right), -2\right)\right)\right) \]
            6. unpow2N/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)\right), -2\right)\right)\right) \]
            8. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{60} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), -2\right)\right)\right) \]
            9. metadata-evalN/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\left(\frac{-1}{60} \cdot {im}^{2}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
            11. *-commutativeN/A

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
            13. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
            14. *-lowering-*.f6493.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
          10. Simplified93.9%

            \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot -0.016666666666666666 + -0.3333333333333333\right) + -2\right)\right)} \]
          11. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right), im\right) \]
            12. *-lowering-*.f6493.9%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right), im\right) \]
          12. Applied egg-rr93.9%

            \[\leadsto \color{blue}{\left(\left(0.5 \cdot \sin re\right) \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot -0.016666666666666666 + -0.3333333333333333\right) + -2\right)\right) \cdot im} \]

          if 135 < im < 4.20000000000000024e58

          1. Initial program 100.0%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
          4. Step-by-step derivation
            1. Simplified100.0%

              \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
            2. Taylor expanded in re around 0

              \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
            3. Step-by-step derivation
              1. *-lowering-*.f6485.7%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
            4. Simplified85.7%

              \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]

            if 4.20000000000000024e58 < im

            1. Initial program 100.0%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)}\right) \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)}\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
              3. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) + -2\right)\right)\right) \]
              4. +-commutativeN/A

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
              10. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{60} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
              11. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{60} \cdot {im}^{2} + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
              12. +-commutativeN/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{-1}{60}}\right)\right)\right)\right)\right)\right)\right) \]
              16. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{-1}{60}\right)\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f64100.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right)\right)\right)\right)\right)\right)\right) \]
            5. Simplified100.0%

              \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)\right)} \]
          5. Recombined 3 regimes into one program.
          6. Final simplification94.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;im \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.2 \cdot 10^{+58}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)\right)\\ \end{array} \]
          7. Add Preprocessing

          Alternative 6: 96.8% accurate, 2.4× speedup?

          \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot -0.016666666666666666\right)\right)\right)\right)\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im\_m \leq 4.2 \cdot 10^{+58}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
          im\_m = (fabs.f64 im)
          im\_s = (copysign.f64 #s(literal 1 binary64) im)
          (FPCore (im_s re im_m)
           :precision binary64
           (let* ((t_0
                   (*
                    (* 0.5 (sin re))
                    (*
                     im_m
                     (+
                      -2.0
                      (*
                       im_m
                       (*
                        im_m
                        (+
                         -0.3333333333333333
                         (* (* im_m im_m) -0.016666666666666666)))))))))
             (*
              im_s
              (if (<= im_m 135.0)
                t_0
                (if (<= im_m 4.2e+58) (* (- 1.0 (exp im_m)) (* 0.5 re)) t_0)))))
          im\_m = fabs(im);
          im\_s = copysign(1.0, im);
          double code(double im_s, double re, double im_m) {
          	double t_0 = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))));
          	double tmp;
          	if (im_m <= 135.0) {
          		tmp = t_0;
          	} else if (im_m <= 4.2e+58) {
          		tmp = (1.0 - exp(im_m)) * (0.5 * re);
          	} else {
          		tmp = t_0;
          	}
          	return im_s * tmp;
          }
          
          im\_m = abs(im)
          im\_s = copysign(1.0d0, im)
          real(8) function code(im_s, re, im_m)
              real(8), intent (in) :: im_s
              real(8), intent (in) :: re
              real(8), intent (in) :: im_m
              real(8) :: t_0
              real(8) :: tmp
              t_0 = (0.5d0 * sin(re)) * (im_m * ((-2.0d0) + (im_m * (im_m * ((-0.3333333333333333d0) + ((im_m * im_m) * (-0.016666666666666666d0)))))))
              if (im_m <= 135.0d0) then
                  tmp = t_0
              else if (im_m <= 4.2d+58) then
                  tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
              else
                  tmp = t_0
              end if
              code = im_s * tmp
          end function
          
          im\_m = Math.abs(im);
          im\_s = Math.copySign(1.0, im);
          public static double code(double im_s, double re, double im_m) {
          	double t_0 = (0.5 * Math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))));
          	double tmp;
          	if (im_m <= 135.0) {
          		tmp = t_0;
          	} else if (im_m <= 4.2e+58) {
          		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
          	} else {
          		tmp = t_0;
          	}
          	return im_s * tmp;
          }
          
          im\_m = math.fabs(im)
          im\_s = math.copysign(1.0, im)
          def code(im_s, re, im_m):
          	t_0 = (0.5 * math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))))
          	tmp = 0
          	if im_m <= 135.0:
          		tmp = t_0
          	elif im_m <= 4.2e+58:
          		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
          	else:
          		tmp = t_0
          	return im_s * tmp
          
          im\_m = abs(im)
          im\_s = copysign(1.0, im)
          function code(im_s, re, im_m)
          	t_0 = Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * -0.016666666666666666)))))))
          	tmp = 0.0
          	if (im_m <= 135.0)
          		tmp = t_0;
          	elseif (im_m <= 4.2e+58)
          		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
          	else
          		tmp = t_0;
          	end
          	return Float64(im_s * tmp)
          end
          
          im\_m = abs(im);
          im\_s = sign(im) * abs(1.0);
          function tmp_2 = code(im_s, re, im_m)
          	t_0 = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))));
          	tmp = 0.0;
          	if (im_m <= 135.0)
          		tmp = t_0;
          	elseif (im_m <= 4.2e+58)
          		tmp = (1.0 - exp(im_m)) * (0.5 * re);
          	else
          		tmp = t_0;
          	end
          	tmp_2 = im_s * tmp;
          end
          
          im\_m = N[Abs[im], $MachinePrecision]
          im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
          code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 135.0], t$95$0, If[LessEqual[im$95$m, 4.2e+58], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
          
          \begin{array}{l}
          im\_m = \left|im\right|
          \\
          im\_s = \mathsf{copysign}\left(1, im\right)
          
          \\
          \begin{array}{l}
          t_0 := \left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot -0.016666666666666666\right)\right)\right)\right)\\
          im\_s \cdot \begin{array}{l}
          \mathbf{if}\;im\_m \leq 135:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;im\_m \leq 4.2 \cdot 10^{+58}:\\
          \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if im < 135 or 4.20000000000000024e58 < im

            1. Initial program 61.4%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)}\right) \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)}\right)\right) \]
              2. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
              3. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) + -2\right)\right)\right) \]
              4. +-commutativeN/A

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
              10. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{60} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
              11. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(\frac{-1}{60} \cdot {im}^{2} + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
              12. +-commutativeN/A

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{-1}{60}}\right)\right)\right)\right)\right)\right)\right) \]
              16. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{-1}{60}\right)\right)\right)\right)\right)\right)\right) \]
              17. *-lowering-*.f6495.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right)\right)\right)\right)\right)\right)\right) \]
            5. Simplified95.0%

              \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)\right)} \]

            if 135 < im < 4.20000000000000024e58

            1. Initial program 100.0%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
            4. Step-by-step derivation
              1. Simplified100.0%

                \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
              2. Taylor expanded in re around 0

                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
              3. Step-by-step derivation
                1. *-lowering-*.f6485.7%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
              4. Simplified85.7%

                \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]
            5. Recombined 2 regimes into one program.
            6. Final simplification94.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 4.2 \cdot 10^{+58}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right)\right)\\ \end{array} \]
            7. Add Preprocessing

            Alternative 7: 95.5% accurate, 2.5× speedup?

            \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\\ t_1 := 0.5 \cdot \sin re\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 155:\\ \;\;\;\;t\_1 \cdot \left(im\_m \cdot -2 + im\_m \cdot t\_0\right)\\ \mathbf{elif}\;im\_m \leq 8.2 \cdot 10^{+102}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + t\_0\right)\right)\\ \end{array} \end{array} \end{array} \]
            im\_m = (fabs.f64 im)
            im\_s = (copysign.f64 #s(literal 1 binary64) im)
            (FPCore (im_s re im_m)
             :precision binary64
             (let* ((t_0 (* im_m (* im_m -0.3333333333333333))) (t_1 (* 0.5 (sin re))))
               (*
                im_s
                (if (<= im_m 155.0)
                  (* t_1 (+ (* im_m -2.0) (* im_m t_0)))
                  (if (<= im_m 8.2e+102)
                    (* (- 1.0 (exp im_m)) (* 0.5 re))
                    (* t_1 (* im_m (+ -2.0 t_0))))))))
            im\_m = fabs(im);
            im\_s = copysign(1.0, im);
            double code(double im_s, double re, double im_m) {
            	double t_0 = im_m * (im_m * -0.3333333333333333);
            	double t_1 = 0.5 * sin(re);
            	double tmp;
            	if (im_m <= 155.0) {
            		tmp = t_1 * ((im_m * -2.0) + (im_m * t_0));
            	} else if (im_m <= 8.2e+102) {
            		tmp = (1.0 - exp(im_m)) * (0.5 * re);
            	} else {
            		tmp = t_1 * (im_m * (-2.0 + t_0));
            	}
            	return im_s * tmp;
            }
            
            im\_m = abs(im)
            im\_s = copysign(1.0d0, im)
            real(8) function code(im_s, re, im_m)
                real(8), intent (in) :: im_s
                real(8), intent (in) :: re
                real(8), intent (in) :: im_m
                real(8) :: t_0
                real(8) :: t_1
                real(8) :: tmp
                t_0 = im_m * (im_m * (-0.3333333333333333d0))
                t_1 = 0.5d0 * sin(re)
                if (im_m <= 155.0d0) then
                    tmp = t_1 * ((im_m * (-2.0d0)) + (im_m * t_0))
                else if (im_m <= 8.2d+102) then
                    tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
                else
                    tmp = t_1 * (im_m * ((-2.0d0) + t_0))
                end if
                code = im_s * tmp
            end function
            
            im\_m = Math.abs(im);
            im\_s = Math.copySign(1.0, im);
            public static double code(double im_s, double re, double im_m) {
            	double t_0 = im_m * (im_m * -0.3333333333333333);
            	double t_1 = 0.5 * Math.sin(re);
            	double tmp;
            	if (im_m <= 155.0) {
            		tmp = t_1 * ((im_m * -2.0) + (im_m * t_0));
            	} else if (im_m <= 8.2e+102) {
            		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
            	} else {
            		tmp = t_1 * (im_m * (-2.0 + t_0));
            	}
            	return im_s * tmp;
            }
            
            im\_m = math.fabs(im)
            im\_s = math.copysign(1.0, im)
            def code(im_s, re, im_m):
            	t_0 = im_m * (im_m * -0.3333333333333333)
            	t_1 = 0.5 * math.sin(re)
            	tmp = 0
            	if im_m <= 155.0:
            		tmp = t_1 * ((im_m * -2.0) + (im_m * t_0))
            	elif im_m <= 8.2e+102:
            		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
            	else:
            		tmp = t_1 * (im_m * (-2.0 + t_0))
            	return im_s * tmp
            
            im\_m = abs(im)
            im\_s = copysign(1.0, im)
            function code(im_s, re, im_m)
            	t_0 = Float64(im_m * Float64(im_m * -0.3333333333333333))
            	t_1 = Float64(0.5 * sin(re))
            	tmp = 0.0
            	if (im_m <= 155.0)
            		tmp = Float64(t_1 * Float64(Float64(im_m * -2.0) + Float64(im_m * t_0)));
            	elseif (im_m <= 8.2e+102)
            		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
            	else
            		tmp = Float64(t_1 * Float64(im_m * Float64(-2.0 + t_0)));
            	end
            	return Float64(im_s * tmp)
            end
            
            im\_m = abs(im);
            im\_s = sign(im) * abs(1.0);
            function tmp_2 = code(im_s, re, im_m)
            	t_0 = im_m * (im_m * -0.3333333333333333);
            	t_1 = 0.5 * sin(re);
            	tmp = 0.0;
            	if (im_m <= 155.0)
            		tmp = t_1 * ((im_m * -2.0) + (im_m * t_0));
            	elseif (im_m <= 8.2e+102)
            		tmp = (1.0 - exp(im_m)) * (0.5 * re);
            	else
            		tmp = t_1 * (im_m * (-2.0 + t_0));
            	end
            	tmp_2 = im_s * tmp;
            end
            
            im\_m = N[Abs[im], $MachinePrecision]
            im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
            code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(im$95$m * N[(im$95$m * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 155.0], N[(t$95$1 * N[(N[(im$95$m * -2.0), $MachinePrecision] + N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 8.2e+102], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * N[(im$95$m * N[(-2.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
            
            \begin{array}{l}
            im\_m = \left|im\right|
            \\
            im\_s = \mathsf{copysign}\left(1, im\right)
            
            \\
            \begin{array}{l}
            t_0 := im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\\
            t_1 := 0.5 \cdot \sin re\\
            im\_s \cdot \begin{array}{l}
            \mathbf{if}\;im\_m \leq 155:\\
            \;\;\;\;t\_1 \cdot \left(im\_m \cdot -2 + im\_m \cdot t\_0\right)\\
            
            \mathbf{elif}\;im\_m \leq 8.2 \cdot 10^{+102}:\\
            \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + t\_0\right)\right)\\
            
            
            \end{array}
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if im < 155

              1. Initial program 53.3%

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                2. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                3. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + -2\right)\right)\right) \]
                4. +-commutativeN/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \frac{-1}{3}\right)\right)\right)\right) \]
                8. associate-*l*N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                10. *-lowering-*.f6490.1%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{3}}\right)\right)\right)\right)\right) \]
              5. Simplified90.1%

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left(im \cdot \frac{-1}{3}\right)\right)\right), \left(-2 \cdot im\right)\right)\right) \]
                7. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{3}\right)\right)\right), \left(-2 \cdot im\right)\right)\right) \]
                8. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{3}\right)\right)\right), \left(im \cdot \color{blue}{-2}\right)\right)\right) \]
                9. *-lowering-*.f6490.1%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{3}\right)\right)\right), \mathsf{*.f64}\left(im, \color{blue}{-2}\right)\right)\right) \]
              7. Applied egg-rr90.1%

                \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right)\right) + im \cdot -2\right)} \]

              if 155 < im < 8.1999999999999999e102

              1. Initial program 100.0%

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
              4. Step-by-step derivation
                1. Simplified100.0%

                  \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
                2. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                3. Step-by-step derivation
                  1. *-lowering-*.f6476.5%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                4. Simplified76.5%

                  \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]

                if 8.1999999999999999e102 < im

                1. Initial program 100.0%

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                  2. sub-negN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                  3. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + -2\right)\right)\right) \]
                  4. +-commutativeN/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \frac{-1}{3}\right)\right)\right)\right) \]
                  8. associate-*l*N/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                  10. *-lowering-*.f64100.0%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{3}}\right)\right)\right)\right)\right) \]
                5. Simplified100.0%

                  \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)} \]
              5. Recombined 3 regimes into one program.
              6. Final simplification90.5%

                \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 155:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot -2 + im \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)\\ \mathbf{elif}\;im \leq 8.2 \cdot 10^{+102}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)\\ \end{array} \]
              7. Add Preprocessing

              Alternative 8: 95.5% accurate, 2.5× speedup?

              \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;im\_m \leq 8.2 \cdot 10^{+102}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
              im\_m = (fabs.f64 im)
              im\_s = (copysign.f64 #s(literal 1 binary64) im)
              (FPCore (im_s re im_m)
               :precision binary64
               (*
                im_s
                (if (<= im_m 135.0)
                  (* im_m (* (sin re) (+ -1.0 (* im_m (* im_m -0.16666666666666666)))))
                  (if (<= im_m 8.2e+102)
                    (* (- 1.0 (exp im_m)) (* 0.5 re))
                    (*
                     (* 0.5 (sin re))
                     (* im_m (+ -2.0 (* im_m (* im_m -0.3333333333333333)))))))))
              im\_m = fabs(im);
              im\_s = copysign(1.0, im);
              double code(double im_s, double re, double im_m) {
              	double tmp;
              	if (im_m <= 135.0) {
              		tmp = im_m * (sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
              	} else if (im_m <= 8.2e+102) {
              		tmp = (1.0 - exp(im_m)) * (0.5 * re);
              	} else {
              		tmp = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
              	}
              	return im_s * tmp;
              }
              
              im\_m = abs(im)
              im\_s = copysign(1.0d0, im)
              real(8) function code(im_s, re, im_m)
                  real(8), intent (in) :: im_s
                  real(8), intent (in) :: re
                  real(8), intent (in) :: im_m
                  real(8) :: tmp
                  if (im_m <= 135.0d0) then
                      tmp = im_m * (sin(re) * ((-1.0d0) + (im_m * (im_m * (-0.16666666666666666d0)))))
                  else if (im_m <= 8.2d+102) then
                      tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
                  else
                      tmp = (0.5d0 * sin(re)) * (im_m * ((-2.0d0) + (im_m * (im_m * (-0.3333333333333333d0)))))
                  end if
                  code = im_s * tmp
              end function
              
              im\_m = Math.abs(im);
              im\_s = Math.copySign(1.0, im);
              public static double code(double im_s, double re, double im_m) {
              	double tmp;
              	if (im_m <= 135.0) {
              		tmp = im_m * (Math.sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
              	} else if (im_m <= 8.2e+102) {
              		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
              	} else {
              		tmp = (0.5 * Math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
              	}
              	return im_s * tmp;
              }
              
              im\_m = math.fabs(im)
              im\_s = math.copysign(1.0, im)
              def code(im_s, re, im_m):
              	tmp = 0
              	if im_m <= 135.0:
              		tmp = im_m * (math.sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))))
              	elif im_m <= 8.2e+102:
              		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
              	else:
              		tmp = (0.5 * math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))))
              	return im_s * tmp
              
              im\_m = abs(im)
              im\_s = copysign(1.0, im)
              function code(im_s, re, im_m)
              	tmp = 0.0
              	if (im_m <= 135.0)
              		tmp = Float64(im_m * Float64(sin(re) * Float64(-1.0 + Float64(im_m * Float64(im_m * -0.16666666666666666)))));
              	elseif (im_m <= 8.2e+102)
              		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
              	else
              		tmp = Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * -0.3333333333333333)))));
              	end
              	return Float64(im_s * tmp)
              end
              
              im\_m = abs(im);
              im\_s = sign(im) * abs(1.0);
              function tmp_2 = code(im_s, re, im_m)
              	tmp = 0.0;
              	if (im_m <= 135.0)
              		tmp = im_m * (sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
              	elseif (im_m <= 8.2e+102)
              		tmp = (1.0 - exp(im_m)) * (0.5 * re);
              	else
              		tmp = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
              	end
              	tmp_2 = im_s * tmp;
              end
              
              im\_m = N[Abs[im], $MachinePrecision]
              im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
              code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 135.0], N[(im$95$m * N[(N[Sin[re], $MachinePrecision] * N[(-1.0 + N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 8.2e+102], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
              
              \begin{array}{l}
              im\_m = \left|im\right|
              \\
              im\_s = \mathsf{copysign}\left(1, im\right)
              
              \\
              im\_s \cdot \begin{array}{l}
              \mathbf{if}\;im\_m \leq 135:\\
              \;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\
              
              \mathbf{elif}\;im\_m \leq 8.2 \cdot 10^{+102}:\\
              \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if im < 135

                1. Initial program 53.3%

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(im, \left(\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{-1} \cdot \sin re\right)\right) \]
                  8. distribute-rgt-outN/A

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

                    \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\frac{-1}{6} \cdot \left(im \cdot im\right) + -1\right)\right)\right) \]
                  10. associate-*r*N/A

                    \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\left(\frac{-1}{6} \cdot im\right) \cdot im + -1\right)\right)\right) \]
                  11. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(im \cdot \left(\frac{-1}{6} \cdot im\right) + -1\right)\right)\right) \]
                  12. *-lowering-*.f64N/A

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                  18. *-lowering-*.f6487.3%

                    \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                5. Simplified87.3%

                  \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]

                if 135 < im < 8.1999999999999999e102

                1. Initial program 100.0%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                4. Step-by-step derivation
                  1. Simplified100.0%

                    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
                  2. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                  3. Step-by-step derivation
                    1. *-lowering-*.f6476.5%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                  4. Simplified76.5%

                    \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]

                  if 8.1999999999999999e102 < im

                  1. Initial program 100.0%

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                    2. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                    3. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + -2\right)\right)\right) \]
                    4. +-commutativeN/A

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \frac{-1}{3}\right)\right)\right)\right) \]
                    8. associate-*l*N/A

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                    10. *-lowering-*.f64100.0%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{3}}\right)\right)\right)\right)\right) \]
                  5. Simplified100.0%

                    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)} \]
                5. Recombined 3 regimes into one program.
                6. Final simplification88.3%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;im \leq 8.2 \cdot 10^{+102}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)\\ \end{array} \]
                7. Add Preprocessing

                Alternative 9: 93.1% accurate, 2.5× speedup?

                \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := im\_m \cdot \left(\sin re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im\_m \leq 5.5 \cdot 10^{+144}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \end{array} \]
                im\_m = (fabs.f64 im)
                im\_s = (copysign.f64 #s(literal 1 binary64) im)
                (FPCore (im_s re im_m)
                 :precision binary64
                 (let* ((t_0
                         (*
                          im_m
                          (* (sin re) (+ -1.0 (* im_m (* im_m -0.16666666666666666)))))))
                   (*
                    im_s
                    (if (<= im_m 135.0)
                      t_0
                      (if (<= im_m 5.5e+144) (* (- 1.0 (exp im_m)) (* 0.5 re)) t_0)))))
                im\_m = fabs(im);
                im\_s = copysign(1.0, im);
                double code(double im_s, double re, double im_m) {
                	double t_0 = im_m * (sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                	double tmp;
                	if (im_m <= 135.0) {
                		tmp = t_0;
                	} else if (im_m <= 5.5e+144) {
                		tmp = (1.0 - exp(im_m)) * (0.5 * re);
                	} else {
                		tmp = t_0;
                	}
                	return im_s * tmp;
                }
                
                im\_m = abs(im)
                im\_s = copysign(1.0d0, im)
                real(8) function code(im_s, re, im_m)
                    real(8), intent (in) :: im_s
                    real(8), intent (in) :: re
                    real(8), intent (in) :: im_m
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = im_m * (sin(re) * ((-1.0d0) + (im_m * (im_m * (-0.16666666666666666d0)))))
                    if (im_m <= 135.0d0) then
                        tmp = t_0
                    else if (im_m <= 5.5d+144) then
                        tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
                    else
                        tmp = t_0
                    end if
                    code = im_s * tmp
                end function
                
                im\_m = Math.abs(im);
                im\_s = Math.copySign(1.0, im);
                public static double code(double im_s, double re, double im_m) {
                	double t_0 = im_m * (Math.sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                	double tmp;
                	if (im_m <= 135.0) {
                		tmp = t_0;
                	} else if (im_m <= 5.5e+144) {
                		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
                	} else {
                		tmp = t_0;
                	}
                	return im_s * tmp;
                }
                
                im\_m = math.fabs(im)
                im\_s = math.copysign(1.0, im)
                def code(im_s, re, im_m):
                	t_0 = im_m * (math.sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))))
                	tmp = 0
                	if im_m <= 135.0:
                		tmp = t_0
                	elif im_m <= 5.5e+144:
                		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
                	else:
                		tmp = t_0
                	return im_s * tmp
                
                im\_m = abs(im)
                im\_s = copysign(1.0, im)
                function code(im_s, re, im_m)
                	t_0 = Float64(im_m * Float64(sin(re) * Float64(-1.0 + Float64(im_m * Float64(im_m * -0.16666666666666666)))))
                	tmp = 0.0
                	if (im_m <= 135.0)
                		tmp = t_0;
                	elseif (im_m <= 5.5e+144)
                		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
                	else
                		tmp = t_0;
                	end
                	return Float64(im_s * tmp)
                end
                
                im\_m = abs(im);
                im\_s = sign(im) * abs(1.0);
                function tmp_2 = code(im_s, re, im_m)
                	t_0 = im_m * (sin(re) * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                	tmp = 0.0;
                	if (im_m <= 135.0)
                		tmp = t_0;
                	elseif (im_m <= 5.5e+144)
                		tmp = (1.0 - exp(im_m)) * (0.5 * re);
                	else
                		tmp = t_0;
                	end
                	tmp_2 = im_s * tmp;
                end
                
                im\_m = N[Abs[im], $MachinePrecision]
                im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(im$95$m * N[(N[Sin[re], $MachinePrecision] * N[(-1.0 + N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 135.0], t$95$0, If[LessEqual[im$95$m, 5.5e+144], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], t$95$0]]), $MachinePrecision]]
                
                \begin{array}{l}
                im\_m = \left|im\right|
                \\
                im\_s = \mathsf{copysign}\left(1, im\right)
                
                \\
                \begin{array}{l}
                t_0 := im\_m \cdot \left(\sin re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\
                im\_s \cdot \begin{array}{l}
                \mathbf{if}\;im\_m \leq 135:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;im\_m \leq 5.5 \cdot 10^{+144}:\\
                \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if im < 135 or 5.50000000000000022e144 < im

                  1. Initial program 57.8%

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(im, \left(\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{-1} \cdot \sin re\right)\right) \]
                    8. distribute-rgt-outN/A

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

                      \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\frac{-1}{6} \cdot \left(im \cdot im\right) + -1\right)\right)\right) \]
                    10. associate-*r*N/A

                      \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\left(\frac{-1}{6} \cdot im\right) \cdot im + -1\right)\right)\right) \]
                    11. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(im \cdot \left(\frac{-1}{6} \cdot im\right) + -1\right)\right)\right) \]
                    12. *-lowering-*.f64N/A

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                    18. *-lowering-*.f6488.6%

                      \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                  5. Simplified88.6%

                    \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]

                  if 135 < im < 5.50000000000000022e144

                  1. Initial program 100.0%

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                  4. Step-by-step derivation
                    1. Simplified100.0%

                      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
                    2. Taylor expanded in re around 0

                      \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                    3. Step-by-step derivation
                      1. *-lowering-*.f6478.6%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                    4. Simplified78.6%

                      \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]
                  5. Recombined 2 regimes into one program.
                  6. Final simplification87.5%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{elif}\;im \leq 5.5 \cdot 10^{+144}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \end{array} \]
                  7. Add Preprocessing

                  Alternative 10: 87.2% accurate, 2.7× speedup?

                  \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 135:\\ \;\;\;\;0 - im\_m \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \end{array} \]
                  im\_m = (fabs.f64 im)
                  im\_s = (copysign.f64 #s(literal 1 binary64) im)
                  (FPCore (im_s re im_m)
                   :precision binary64
                   (*
                    im_s
                    (if (<= im_m 135.0)
                      (- 0.0 (* im_m (sin re)))
                      (* (- 1.0 (exp im_m)) (* 0.5 re)))))
                  im\_m = fabs(im);
                  im\_s = copysign(1.0, im);
                  double code(double im_s, double re, double im_m) {
                  	double tmp;
                  	if (im_m <= 135.0) {
                  		tmp = 0.0 - (im_m * sin(re));
                  	} else {
                  		tmp = (1.0 - exp(im_m)) * (0.5 * re);
                  	}
                  	return im_s * tmp;
                  }
                  
                  im\_m = abs(im)
                  im\_s = copysign(1.0d0, im)
                  real(8) function code(im_s, re, im_m)
                      real(8), intent (in) :: im_s
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im_m
                      real(8) :: tmp
                      if (im_m <= 135.0d0) then
                          tmp = 0.0d0 - (im_m * sin(re))
                      else
                          tmp = (1.0d0 - exp(im_m)) * (0.5d0 * re)
                      end if
                      code = im_s * tmp
                  end function
                  
                  im\_m = Math.abs(im);
                  im\_s = Math.copySign(1.0, im);
                  public static double code(double im_s, double re, double im_m) {
                  	double tmp;
                  	if (im_m <= 135.0) {
                  		tmp = 0.0 - (im_m * Math.sin(re));
                  	} else {
                  		tmp = (1.0 - Math.exp(im_m)) * (0.5 * re);
                  	}
                  	return im_s * tmp;
                  }
                  
                  im\_m = math.fabs(im)
                  im\_s = math.copysign(1.0, im)
                  def code(im_s, re, im_m):
                  	tmp = 0
                  	if im_m <= 135.0:
                  		tmp = 0.0 - (im_m * math.sin(re))
                  	else:
                  		tmp = (1.0 - math.exp(im_m)) * (0.5 * re)
                  	return im_s * tmp
                  
                  im\_m = abs(im)
                  im\_s = copysign(1.0, im)
                  function code(im_s, re, im_m)
                  	tmp = 0.0
                  	if (im_m <= 135.0)
                  		tmp = Float64(0.0 - Float64(im_m * sin(re)));
                  	else
                  		tmp = Float64(Float64(1.0 - exp(im_m)) * Float64(0.5 * re));
                  	end
                  	return Float64(im_s * tmp)
                  end
                  
                  im\_m = abs(im);
                  im\_s = sign(im) * abs(1.0);
                  function tmp_2 = code(im_s, re, im_m)
                  	tmp = 0.0;
                  	if (im_m <= 135.0)
                  		tmp = 0.0 - (im_m * sin(re));
                  	else
                  		tmp = (1.0 - exp(im_m)) * (0.5 * re);
                  	end
                  	tmp_2 = im_s * tmp;
                  end
                  
                  im\_m = N[Abs[im], $MachinePrecision]
                  im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                  code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 135.0], N[(0.0 - N[(im$95$m * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                  
                  \begin{array}{l}
                  im\_m = \left|im\right|
                  \\
                  im\_s = \mathsf{copysign}\left(1, im\right)
                  
                  \\
                  im\_s \cdot \begin{array}{l}
                  \mathbf{if}\;im\_m \leq 135:\\
                  \;\;\;\;0 - im\_m \cdot \sin re\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left(1 - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if im < 135

                    1. Initial program 53.3%

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

                      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \mathsf{neg}\left(im \cdot \sin re\right) \]
                      2. neg-sub0N/A

                        \[\leadsto 0 - \color{blue}{im \cdot \sin re} \]
                      3. --lowering--.f64N/A

                        \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(im \cdot \sin re\right)}\right) \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \color{blue}{\sin re}\right)\right) \]
                      5. sin-lowering-sin.f6468.9%

                        \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{sin.f64}\left(re\right)\right)\right) \]
                    5. Simplified68.9%

                      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
                    6. Step-by-step derivation
                      1. sub0-negN/A

                        \[\leadsto \mathsf{neg}\left(im \cdot \sin re\right) \]
                      2. *-commutativeN/A

                        \[\leadsto \mathsf{neg}\left(\sin re \cdot im\right) \]
                      3. distribute-lft-neg-inN/A

                        \[\leadsto \left(\mathsf{neg}\left(\sin re\right)\right) \cdot \color{blue}{im} \]
                      4. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sin re\right)\right), \color{blue}{im}\right) \]
                      5. neg-lowering-neg.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\sin re\right), im\right) \]
                      6. sin-lowering-sin.f6468.9%

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(re\right)\right), im\right) \]
                    7. Applied egg-rr68.9%

                      \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]

                    if 135 < im

                    1. Initial program 100.0%

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                    4. Step-by-step derivation
                      1. Simplified100.0%

                        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{1} - e^{im}\right) \]
                      2. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{\_.f64}\left(1, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                      3. Step-by-step derivation
                        1. *-lowering-*.f6474.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{\_.f64}\left(\color{blue}{1}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                      4. Simplified74.0%

                        \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(1 - e^{im}\right) \]
                    5. Recombined 2 regimes into one program.
                    6. Final simplification69.9%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 135:\\ \;\;\;\;0 - im \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;\left(1 - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 11: 82.1% accurate, 2.8× speedup?

                    \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 650:\\ \;\;\;\;0 - im\_m \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right) \cdot \left(\left(-2 + \left(im\_m \cdot im\_m\right) \cdot -0.3333333333333333\right) + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\\ \end{array} \end{array} \]
                    im\_m = (fabs.f64 im)
                    im\_s = (copysign.f64 #s(literal 1 binary64) im)
                    (FPCore (im_s re im_m)
                     :precision binary64
                     (*
                      im_s
                      (if (<= im_m 650.0)
                        (- 0.0 (* im_m (sin re)))
                        (*
                         im_m
                         (*
                          (*
                           re
                           (+
                            0.5
                            (*
                             (* re re)
                             (+
                              -0.08333333333333333
                              (*
                               (* re re)
                               (+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5)))))))
                          (+
                           (+ -2.0 (* (* im_m im_m) -0.3333333333333333))
                           (*
                            (* im_m im_m)
                            (*
                             (* im_m im_m)
                             (+
                              -0.016666666666666666
                              (* (* im_m im_m) -0.0003968253968253968))))))))))
                    im\_m = fabs(im);
                    im\_s = copysign(1.0, im);
                    double code(double im_s, double re, double im_m) {
                    	double tmp;
                    	if (im_m <= 650.0) {
                    		tmp = 0.0 - (im_m * sin(re));
                    	} else {
                    		tmp = im_m * ((re * (0.5 + ((re * re) * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5))))))) * ((-2.0 + ((im_m * im_m) * -0.3333333333333333)) + ((im_m * im_m) * ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))));
                    	}
                    	return im_s * tmp;
                    }
                    
                    im\_m = abs(im)
                    im\_s = copysign(1.0d0, im)
                    real(8) function code(im_s, re, im_m)
                        real(8), intent (in) :: im_s
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im_m
                        real(8) :: tmp
                        if (im_m <= 650.0d0) then
                            tmp = 0.0d0 - (im_m * sin(re))
                        else
                            tmp = im_m * ((re * (0.5d0 + ((re * re) * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5)))))))) * (((-2.0d0) + ((im_m * im_m) * (-0.3333333333333333d0))) + ((im_m * im_m) * ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0)))))))
                        end if
                        code = im_s * tmp
                    end function
                    
                    im\_m = Math.abs(im);
                    im\_s = Math.copySign(1.0, im);
                    public static double code(double im_s, double re, double im_m) {
                    	double tmp;
                    	if (im_m <= 650.0) {
                    		tmp = 0.0 - (im_m * Math.sin(re));
                    	} else {
                    		tmp = im_m * ((re * (0.5 + ((re * re) * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5))))))) * ((-2.0 + ((im_m * im_m) * -0.3333333333333333)) + ((im_m * im_m) * ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))));
                    	}
                    	return im_s * tmp;
                    }
                    
                    im\_m = math.fabs(im)
                    im\_s = math.copysign(1.0, im)
                    def code(im_s, re, im_m):
                    	tmp = 0
                    	if im_m <= 650.0:
                    		tmp = 0.0 - (im_m * math.sin(re))
                    	else:
                    		tmp = im_m * ((re * (0.5 + ((re * re) * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5))))))) * ((-2.0 + ((im_m * im_m) * -0.3333333333333333)) + ((im_m * im_m) * ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))))
                    	return im_s * tmp
                    
                    im\_m = abs(im)
                    im\_s = copysign(1.0, im)
                    function code(im_s, re, im_m)
                    	tmp = 0.0
                    	if (im_m <= 650.0)
                    		tmp = Float64(0.0 - Float64(im_m * sin(re)));
                    	else
                    		tmp = Float64(im_m * Float64(Float64(re * Float64(0.5 + Float64(Float64(re * re) * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5))))))) * Float64(Float64(-2.0 + Float64(Float64(im_m * im_m) * -0.3333333333333333)) + Float64(Float64(im_m * im_m) * Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968)))))));
                    	end
                    	return Float64(im_s * tmp)
                    end
                    
                    im\_m = abs(im);
                    im\_s = sign(im) * abs(1.0);
                    function tmp_2 = code(im_s, re, im_m)
                    	tmp = 0.0;
                    	if (im_m <= 650.0)
                    		tmp = 0.0 - (im_m * sin(re));
                    	else
                    		tmp = im_m * ((re * (0.5 + ((re * re) * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5))))))) * ((-2.0 + ((im_m * im_m) * -0.3333333333333333)) + ((im_m * im_m) * ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968))))));
                    	end
                    	tmp_2 = im_s * tmp;
                    end
                    
                    im\_m = N[Abs[im], $MachinePrecision]
                    im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                    code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 650.0], N[(0.0 - N[(im$95$m * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    im\_m = \left|im\right|
                    \\
                    im\_s = \mathsf{copysign}\left(1, im\right)
                    
                    \\
                    im\_s \cdot \begin{array}{l}
                    \mathbf{if}\;im\_m \leq 650:\\
                    \;\;\;\;0 - im\_m \cdot \sin re\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;im\_m \cdot \left(\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right) \cdot \left(\left(-2 + \left(im\_m \cdot im\_m\right) \cdot -0.3333333333333333\right) + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if im < 650

                      1. Initial program 53.3%

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

                        \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \mathsf{neg}\left(im \cdot \sin re\right) \]
                        2. neg-sub0N/A

                          \[\leadsto 0 - \color{blue}{im \cdot \sin re} \]
                        3. --lowering--.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(im \cdot \sin re\right)}\right) \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \color{blue}{\sin re}\right)\right) \]
                        5. sin-lowering-sin.f6468.9%

                          \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{sin.f64}\left(re\right)\right)\right) \]
                      5. Simplified68.9%

                        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
                      6. Step-by-step derivation
                        1. sub0-negN/A

                          \[\leadsto \mathsf{neg}\left(im \cdot \sin re\right) \]
                        2. *-commutativeN/A

                          \[\leadsto \mathsf{neg}\left(\sin re \cdot im\right) \]
                        3. distribute-lft-neg-inN/A

                          \[\leadsto \left(\mathsf{neg}\left(\sin re\right)\right) \cdot \color{blue}{im} \]
                        4. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(\sin re\right)\right), \color{blue}{im}\right) \]
                        5. neg-lowering-neg.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\sin re\right), im\right) \]
                        6. sin-lowering-sin.f6468.9%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(\mathsf{sin.f64}\left(re\right)\right), im\right) \]
                      7. Applied egg-rr68.9%

                        \[\leadsto \color{blue}{\left(-\sin re\right) \cdot im} \]

                      if 650 < im

                      1. Initial program 100.0%

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

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right)}, \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                      4. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right), \mathsf{\_.f64}\left(\color{blue}{\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right)}, \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        2. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \left({re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        3. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({re}^{2}\right), \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        4. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        5. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        6. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) + \left(\mathsf{neg}\left(\frac{1}{12}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        7. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) + \frac{-1}{12}\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        8. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{12} + {re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        9. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        10. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(\left(re \cdot re\right) \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        11. associate-*l*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(re \cdot \left(re \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        12. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(re \cdot \left(\left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) \cdot re\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        13. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \left(\left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) \cdot re\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        14. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \left(re \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        15. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        16. +-lowering-+.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \left(\frac{-1}{10080} \cdot {re}^{2}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        17. unpow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \left(\frac{-1}{10080} \cdot \left(re \cdot re\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        18. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \left(\left(\frac{-1}{10080} \cdot re\right) \cdot re\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        19. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \left(re \cdot \left(\frac{-1}{10080} \cdot re\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        20. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(re, \left(\frac{-1}{10080} \cdot re\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        21. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{10080}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                        22. *-lowering-*.f6480.0%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{10080}\right)\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{\_.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(im\right)\right), \mathsf{exp.f64}\left(im\right)\right)\right) \]
                      5. Simplified80.0%

                        \[\leadsto \color{blue}{\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot \left(0.004166666666666667 + re \cdot \left(re \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right)\right)} \cdot \left(e^{-im} - e^{im}\right) \]
                      6. Taylor expanded in im around 0

                        \[\leadsto \color{blue}{im \cdot \left(-2 \cdot \left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right) + {im}^{2} \cdot \left(\frac{-1}{3} \cdot \left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right) + {im}^{2} \cdot \left(\frac{-1}{60} \cdot \left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right) + \frac{-1}{2520} \cdot \left({im}^{2} \cdot \left(re \cdot \left(\frac{1}{2} + {re}^{2} \cdot \left({re}^{2} \cdot \left(\frac{1}{240} + \frac{-1}{10080} \cdot {re}^{2}\right) - \frac{1}{12}\right)\right)\right)\right)\right)\right)\right)} \]
                      7. Simplified66.6%

                        \[\leadsto \color{blue}{im \cdot \left(\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right) + \left(\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot -0.0003968253968253968 + -0.016666666666666666\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)} \]
                      8. Applied egg-rr70.3%

                        \[\leadsto \color{blue}{\left(\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right) \cdot \left(\left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right) + \left(\left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) \cdot \left(im \cdot im\right)\right)\right) \cdot im} \]
                    3. Recombined 2 regimes into one program.
                    4. Final simplification69.2%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 650:\\ \;\;\;\;0 - im \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right) \cdot \left(\left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right) + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\\ \end{array} \]
                    5. Add Preprocessing

                    Alternative 12: 58.8% accurate, 8.1× speedup?

                    \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\ \;\;\;\;\left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                    im\_m = (fabs.f64 im)
                    im\_s = (copysign.f64 #s(literal 1 binary64) im)
                    (FPCore (im_s re im_m)
                     :precision binary64
                     (*
                      im_s
                      (if (<= re 5e+179)
                        (*
                         (*
                          im_m
                          (+
                           -2.0
                           (*
                            im_m
                            (*
                             im_m
                             (+
                              -0.3333333333333333
                              (*
                               (* im_m im_m)
                               (+
                                -0.016666666666666666
                                (* (* im_m im_m) -0.0003968253968253968))))))))
                         (* 0.5 (* re (+ 1.0 (* re (* re -0.16666666666666666))))))
                        (* im_m (* re (+ -1.0 (* im_m (* im_m -0.16666666666666666))))))))
                    im\_m = fabs(im);
                    im\_s = copysign(1.0, im);
                    double code(double im_s, double re, double im_m) {
                    	double tmp;
                    	if (re <= 5e+179) {
                    		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (0.5 * (re * (1.0 + (re * (re * -0.16666666666666666)))));
                    	} else {
                    		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                    	}
                    	return im_s * tmp;
                    }
                    
                    im\_m = abs(im)
                    im\_s = copysign(1.0d0, im)
                    real(8) function code(im_s, re, im_m)
                        real(8), intent (in) :: im_s
                        real(8), intent (in) :: re
                        real(8), intent (in) :: im_m
                        real(8) :: tmp
                        if (re <= 5d+179) then
                            tmp = (im_m * ((-2.0d0) + (im_m * (im_m * ((-0.3333333333333333d0) + ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0))))))))) * (0.5d0 * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))))
                        else
                            tmp = im_m * (re * ((-1.0d0) + (im_m * (im_m * (-0.16666666666666666d0)))))
                        end if
                        code = im_s * tmp
                    end function
                    
                    im\_m = Math.abs(im);
                    im\_s = Math.copySign(1.0, im);
                    public static double code(double im_s, double re, double im_m) {
                    	double tmp;
                    	if (re <= 5e+179) {
                    		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (0.5 * (re * (1.0 + (re * (re * -0.16666666666666666)))));
                    	} else {
                    		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                    	}
                    	return im_s * tmp;
                    }
                    
                    im\_m = math.fabs(im)
                    im\_s = math.copysign(1.0, im)
                    def code(im_s, re, im_m):
                    	tmp = 0
                    	if re <= 5e+179:
                    		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (0.5 * (re * (1.0 + (re * (re * -0.16666666666666666)))))
                    	else:
                    		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))))
                    	return im_s * tmp
                    
                    im\_m = abs(im)
                    im\_s = copysign(1.0, im)
                    function code(im_s, re, im_m)
                    	tmp = 0.0
                    	if (re <= 5e+179)
                    		tmp = Float64(Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968)))))))) * Float64(0.5 * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))))));
                    	else
                    		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(im_m * Float64(im_m * -0.16666666666666666)))));
                    	end
                    	return Float64(im_s * tmp)
                    end
                    
                    im\_m = abs(im);
                    im\_s = sign(im) * abs(1.0);
                    function tmp_2 = code(im_s, re, im_m)
                    	tmp = 0.0;
                    	if (re <= 5e+179)
                    		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (0.5 * (re * (1.0 + (re * (re * -0.16666666666666666)))));
                    	else
                    		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                    	end
                    	tmp_2 = im_s * tmp;
                    end
                    
                    im\_m = N[Abs[im], $MachinePrecision]
                    im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                    code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 5e+179], N[(N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(-1.0 + N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                    
                    \begin{array}{l}
                    im\_m = \left|im\right|
                    \\
                    im\_s = \mathsf{copysign}\left(1, im\right)
                    
                    \\
                    im\_s \cdot \begin{array}{l}
                    \mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\
                    \;\;\;\;\left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if re < 5e179

                      1. Initial program 64.0%

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

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
                      4. Step-by-step derivation
                        1. *-lowering-*.f64N/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
                        2. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                        3. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
                        4. +-commutativeN/A

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
                        7. associate-*l*N/A

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
                        12. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                        13. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
                        14. +-commutativeN/A

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                      5. Simplified94.3%

                        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        5. associate-*l*N/A

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        7. *-lowering-*.f6459.6%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                      8. Simplified59.6%

                        \[\leadsto \left(0.5 \cdot \color{blue}{\left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)}\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]

                      if 5e179 < re

                      1. Initial program 48.6%

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(im, \left(\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{-1} \cdot \sin re\right)\right) \]
                        8. distribute-rgt-outN/A

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

                          \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\frac{-1}{6} \cdot \left(im \cdot im\right) + -1\right)\right)\right) \]
                        10. associate-*r*N/A

                          \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\left(\frac{-1}{6} \cdot im\right) \cdot im + -1\right)\right)\right) \]
                        11. *-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(im \cdot \left(\frac{-1}{6} \cdot im\right) + -1\right)\right)\right) \]
                        12. *-lowering-*.f64N/A

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                        18. *-lowering-*.f6485.3%

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                      5. Simplified85.3%

                        \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
                      6. Taylor expanded in re around 0

                        \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\color{blue}{re}, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
                      7. Step-by-step derivation
                        1. Simplified20.7%

                          \[\leadsto im \cdot \left(\color{blue}{re} \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification55.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\ \;\;\;\;\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 13: 58.8% accurate, 8.6× speedup?

                      \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\ \;\;\;\;\left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
                      im\_m = (fabs.f64 im)
                      im\_s = (copysign.f64 #s(literal 1 binary64) im)
                      (FPCore (im_s re im_m)
                       :precision binary64
                       (*
                        im_s
                        (if (<= re 5e+179)
                          (*
                           (*
                            im_m
                            (+
                             -2.0
                             (*
                              im_m
                              (*
                               im_m
                               (+
                                -0.3333333333333333
                                (*
                                 (* im_m im_m)
                                 (+
                                  -0.016666666666666666
                                  (* (* im_m im_m) -0.0003968253968253968))))))))
                           (* re (+ 0.5 (* (* re re) -0.08333333333333333))))
                          (* im_m (* re (+ -1.0 (* im_m (* im_m -0.16666666666666666))))))))
                      im\_m = fabs(im);
                      im\_s = copysign(1.0, im);
                      double code(double im_s, double re, double im_m) {
                      	double tmp;
                      	if (re <= 5e+179) {
                      		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (re * (0.5 + ((re * re) * -0.08333333333333333)));
                      	} else {
                      		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                      	}
                      	return im_s * tmp;
                      }
                      
                      im\_m = abs(im)
                      im\_s = copysign(1.0d0, im)
                      real(8) function code(im_s, re, im_m)
                          real(8), intent (in) :: im_s
                          real(8), intent (in) :: re
                          real(8), intent (in) :: im_m
                          real(8) :: tmp
                          if (re <= 5d+179) then
                              tmp = (im_m * ((-2.0d0) + (im_m * (im_m * ((-0.3333333333333333d0) + ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0))))))))) * (re * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
                          else
                              tmp = im_m * (re * ((-1.0d0) + (im_m * (im_m * (-0.16666666666666666d0)))))
                          end if
                          code = im_s * tmp
                      end function
                      
                      im\_m = Math.abs(im);
                      im\_s = Math.copySign(1.0, im);
                      public static double code(double im_s, double re, double im_m) {
                      	double tmp;
                      	if (re <= 5e+179) {
                      		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (re * (0.5 + ((re * re) * -0.08333333333333333)));
                      	} else {
                      		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                      	}
                      	return im_s * tmp;
                      }
                      
                      im\_m = math.fabs(im)
                      im\_s = math.copysign(1.0, im)
                      def code(im_s, re, im_m):
                      	tmp = 0
                      	if re <= 5e+179:
                      		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (re * (0.5 + ((re * re) * -0.08333333333333333)))
                      	else:
                      		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))))
                      	return im_s * tmp
                      
                      im\_m = abs(im)
                      im\_s = copysign(1.0, im)
                      function code(im_s, re, im_m)
                      	tmp = 0.0
                      	if (re <= 5e+179)
                      		tmp = Float64(Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968)))))))) * Float64(re * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333))));
                      	else
                      		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(im_m * Float64(im_m * -0.16666666666666666)))));
                      	end
                      	return Float64(im_s * tmp)
                      end
                      
                      im\_m = abs(im);
                      im\_s = sign(im) * abs(1.0);
                      function tmp_2 = code(im_s, re, im_m)
                      	tmp = 0.0;
                      	if (re <= 5e+179)
                      		tmp = (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))) * (re * (0.5 + ((re * re) * -0.08333333333333333)));
                      	else
                      		tmp = im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666))));
                      	end
                      	tmp_2 = im_s * tmp;
                      end
                      
                      im\_m = N[Abs[im], $MachinePrecision]
                      im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                      code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 5e+179], N[(N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(-1.0 + N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
                      
                      \begin{array}{l}
                      im\_m = \left|im\right|
                      \\
                      im\_s = \mathsf{copysign}\left(1, im\right)
                      
                      \\
                      im\_s \cdot \begin{array}{l}
                      \mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\
                      \;\;\;\;\left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if re < 5e179

                        1. Initial program 64.0%

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
                        4. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
                          2. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                          3. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
                          4. +-commutativeN/A

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
                          7. associate-*l*N/A

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
                          12. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                          13. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
                          14. +-commutativeN/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                        5. Simplified94.3%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
                        6. Taylor expanded in re around 0

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{-1}{12}, \left({re}^{2}\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                          4. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{-1}{12}, \left(re \cdot re\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                          5. *-lowering-*.f6459.6%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, re\right)\right)\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        8. Simplified59.6%

                          \[\leadsto \color{blue}{\left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]

                        if 5e179 < re

                        1. Initial program 48.6%

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{-1} \cdot \sin re\right)\right) \]
                          8. distribute-rgt-outN/A

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

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\frac{-1}{6} \cdot \left(im \cdot im\right) + -1\right)\right)\right) \]
                          10. associate-*r*N/A

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\left(\frac{-1}{6} \cdot im\right) \cdot im + -1\right)\right)\right) \]
                          11. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(im \cdot \left(\frac{-1}{6} \cdot im\right) + -1\right)\right)\right) \]
                          12. *-lowering-*.f64N/A

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                          18. *-lowering-*.f6485.3%

                            \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                        5. Simplified85.3%

                          \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\color{blue}{re}, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
                        7. Step-by-step derivation
                          1. Simplified20.7%

                            \[\leadsto im \cdot \left(\color{blue}{re} \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification55.7%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 5 \cdot 10^{+179}:\\ \;\;\;\;\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \cdot \left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)\\ \end{array} \]
                        10. Add Preprocessing

                        Alternative 14: 59.7% accurate, 12.3× speedup?

                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \end{array} \]
                        im\_m = (fabs.f64 im)
                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                        (FPCore (im_s re im_m)
                         :precision binary64
                         (*
                          im_s
                          (*
                           (* 0.5 re)
                           (*
                            im_m
                            (+
                             -2.0
                             (*
                              im_m
                              (*
                               im_m
                               (+
                                -0.3333333333333333
                                (*
                                 (* im_m im_m)
                                 (+
                                  -0.016666666666666666
                                  (* (* im_m im_m) -0.0003968253968253968)))))))))))
                        im\_m = fabs(im);
                        im\_s = copysign(1.0, im);
                        double code(double im_s, double re, double im_m) {
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))));
                        }
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0d0, im)
                        real(8) function code(im_s, re, im_m)
                            real(8), intent (in) :: im_s
                            real(8), intent (in) :: re
                            real(8), intent (in) :: im_m
                            code = im_s * ((0.5d0 * re) * (im_m * ((-2.0d0) + (im_m * (im_m * ((-0.3333333333333333d0) + ((im_m * im_m) * ((-0.016666666666666666d0) + ((im_m * im_m) * (-0.0003968253968253968d0))))))))))
                        end function
                        
                        im\_m = Math.abs(im);
                        im\_s = Math.copySign(1.0, im);
                        public static double code(double im_s, double re, double im_m) {
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))));
                        }
                        
                        im\_m = math.fabs(im)
                        im\_s = math.copysign(1.0, im)
                        def code(im_s, re, im_m):
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))))
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0, im)
                        function code(im_s, re, im_m)
                        	return Float64(im_s * Float64(Float64(0.5 * re) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * Float64(-0.016666666666666666 + Float64(Float64(im_m * im_m) * -0.0003968253968253968))))))))))
                        end
                        
                        im\_m = abs(im);
                        im\_s = sign(im) * abs(1.0);
                        function tmp = code(im_s, re, im_m)
                        	tmp = im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * (-0.3333333333333333 + ((im_m * im_m) * (-0.016666666666666666 + ((im_m * im_m) * -0.0003968253968253968)))))))));
                        end
                        
                        im\_m = N[Abs[im], $MachinePrecision]
                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(N[(0.5 * re), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.016666666666666666 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        im\_m = \left|im\right|
                        \\
                        im\_s = \mathsf{copysign}\left(1, im\right)
                        
                        \\
                        im\_s \cdot \left(\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.016666666666666666 + \left(im\_m \cdot im\_m\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 62.4%

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
                        4. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
                          2. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                          3. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
                          4. +-commutativeN/A

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
                          7. associate-*l*N/A

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
                          12. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                          13. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
                          14. +-commutativeN/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                        5. Simplified94.1%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        7. Step-by-step derivation
                          1. *-lowering-*.f6456.5%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{*.f64}\left(\color{blue}{im}, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{-1}{60}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{2520}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                        8. Simplified56.5%

                          \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]
                        9. Add Preprocessing

                        Alternative 15: 57.7% accurate, 16.2× speedup?

                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot -0.016666666666666666\right)\right)\right)\right) \end{array} \]
                        im\_m = (fabs.f64 im)
                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                        (FPCore (im_s re im_m)
                         :precision binary64
                         (*
                          im_s
                          (*
                           (* 0.5 re)
                           (*
                            im_m
                            (+
                             -2.0
                             (*
                              (* im_m im_m)
                              (+ -0.3333333333333333 (* (* im_m im_m) -0.016666666666666666))))))))
                        im\_m = fabs(im);
                        im\_s = copysign(1.0, im);
                        double code(double im_s, double re, double im_m) {
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))));
                        }
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0d0, im)
                        real(8) function code(im_s, re, im_m)
                            real(8), intent (in) :: im_s
                            real(8), intent (in) :: re
                            real(8), intent (in) :: im_m
                            code = im_s * ((0.5d0 * re) * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + ((im_m * im_m) * (-0.016666666666666666d0)))))))
                        end function
                        
                        im\_m = Math.abs(im);
                        im\_s = Math.copySign(1.0, im);
                        public static double code(double im_s, double re, double im_m) {
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))));
                        }
                        
                        im\_m = math.fabs(im)
                        im\_s = math.copysign(1.0, im)
                        def code(im_s, re, im_m):
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))))
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0, im)
                        function code(im_s, re, im_m)
                        	return Float64(im_s * Float64(Float64(0.5 * re) * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(Float64(im_m * im_m) * -0.016666666666666666)))))))
                        end
                        
                        im\_m = abs(im);
                        im\_s = sign(im) * abs(1.0);
                        function tmp = code(im_s, re, im_m)
                        	tmp = im_s * ((0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + ((im_m * im_m) * -0.016666666666666666))))));
                        end
                        
                        im\_m = N[Abs[im], $MachinePrecision]
                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(N[(0.5 * re), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        im\_m = \left|im\right|
                        \\
                        im\_s = \mathsf{copysign}\left(1, im\right)
                        
                        \\
                        im\_s \cdot \left(\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + \left(im\_m \cdot im\_m\right) \cdot -0.016666666666666666\right)\right)\right)\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 62.4%

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)\right)}\right) \]
                        4. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) - 2\right)}\right)\right) \]
                          2. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                          3. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right) + -2\right)\right)\right) \]
                          4. +-commutativeN/A

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)} - \frac{1}{3}\right)\right)\right)\right)\right) \]
                          7. associate-*l*N/A

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) - \frac{1}{3}\right)}\right)\right)\right)\right)\right) \]
                          12. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \color{blue}{\left(\mathsf{neg}\left(\frac{1}{3}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                          13. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right) + \frac{-1}{3}\right)\right)\right)\right)\right)\right) \]
                          14. +-commutativeN/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{-1}{3}, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{2520} \cdot {im}^{2} - \frac{1}{60}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                        5. Simplified94.1%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right)\right)\right)\right)} \]
                        6. Step-by-step derivation
                          1. +-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right) + \color{blue}{-2}\right)\right)\right) \]
                          2. distribute-lft-inN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right) + \color{blue}{im \cdot -2}\right)\right) \]
                          3. *-commutativeN/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(\left(im \cdot \left(im \cdot \left(im \cdot \left(\frac{-1}{3} + \left(im \cdot im\right) \cdot \left(\frac{-1}{60} + \left(im \cdot im\right) \cdot \frac{-1}{2520}\right)\right)\right)\right)\right), \color{blue}{\left(-2 \cdot im\right)}\right)\right) \]
                        7. Applied egg-rr94.1%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 + \left(im \cdot im\right) \cdot -0.0003968253968253968\right)\right) + im \cdot -2\right)} \]
                        8. Taylor expanded in im around 0

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)\right)}\right) \]
                        9. Step-by-step derivation
                          1. *-lowering-*.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) - 2\right)}\right)\right) \]
                          2. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left({im}^{2} \cdot \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right) + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                          3. metadata-evalN/A

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)\right), -2\right)\right)\right) \]
                          6. unpow2N/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{60} \cdot {im}^{2} - \frac{1}{3}\right)\right), -2\right)\right)\right) \]
                          8. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \left(\frac{-1}{60} \cdot {im}^{2} + \left(\mathsf{neg}\left(\frac{1}{3}\right)\right)\right)\right), -2\right)\right)\right) \]
                          9. metadata-evalN/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\left(\frac{-1}{60} \cdot {im}^{2}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
                          11. *-commutativeN/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left({im}^{2}\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
                          13. unpow2N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(im \cdot im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
                          14. *-lowering-*.f6492.5%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
                        10. Simplified92.5%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot -0.016666666666666666 + -0.3333333333333333\right) + -2\right)\right)} \]
                        11. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{2} \cdot re\right)}, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
                        12. Step-by-step derivation
                          1. *-lowering-*.f6455.3%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{*.f64}\left(\color{blue}{im}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{-1}{60}\right), \frac{-1}{3}\right)\right), -2\right)\right)\right) \]
                        13. Simplified55.3%

                          \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot -0.016666666666666666 + -0.3333333333333333\right) + -2\right)\right) \]
                        14. Final simplification55.3%

                          \[\leadsto \left(0.5 \cdot re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \left(im \cdot im\right) \cdot -0.016666666666666666\right)\right)\right) \]
                        15. Add Preprocessing

                        Alternative 16: 53.7% accurate, 23.7× speedup?

                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\right) \end{array} \]
                        im\_m = (fabs.f64 im)
                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                        (FPCore (im_s re im_m)
                         :precision binary64
                         (*
                          im_s
                          (* (* 0.5 re) (* im_m (+ -2.0 (* im_m (* im_m -0.3333333333333333)))))))
                        im\_m = fabs(im);
                        im\_s = copysign(1.0, im);
                        double code(double im_s, double re, double im_m) {
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333)))));
                        }
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0d0, im)
                        real(8) function code(im_s, re, im_m)
                            real(8), intent (in) :: im_s
                            real(8), intent (in) :: re
                            real(8), intent (in) :: im_m
                            code = im_s * ((0.5d0 * re) * (im_m * ((-2.0d0) + (im_m * (im_m * (-0.3333333333333333d0))))))
                        end function
                        
                        im\_m = Math.abs(im);
                        im\_s = Math.copySign(1.0, im);
                        public static double code(double im_s, double re, double im_m) {
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333)))));
                        }
                        
                        im\_m = math.fabs(im)
                        im\_s = math.copysign(1.0, im)
                        def code(im_s, re, im_m):
                        	return im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333)))))
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0, im)
                        function code(im_s, re, im_m)
                        	return Float64(im_s * Float64(Float64(0.5 * re) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * -0.3333333333333333))))))
                        end
                        
                        im\_m = abs(im);
                        im\_s = sign(im) * abs(1.0);
                        function tmp = code(im_s, re, im_m)
                        	tmp = im_s * ((0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333)))));
                        end
                        
                        im\_m = N[Abs[im], $MachinePrecision]
                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(N[(0.5 * re), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        im\_m = \left|im\right|
                        \\
                        im\_s = \mathsf{copysign}\left(1, im\right)
                        
                        \\
                        im\_s \cdot \left(\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 62.4%

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \color{blue}{\left(\frac{-1}{3} \cdot {im}^{2} - 2\right)}\right)\right) \]
                          2. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + \color{blue}{\left(\mathsf{neg}\left(2\right)\right)}\right)\right)\right) \]
                          3. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \left(\frac{-1}{3} \cdot {im}^{2} + -2\right)\right)\right) \]
                          4. +-commutativeN/A

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \left(\left(im \cdot im\right) \cdot \frac{-1}{3}\right)\right)\right)\right) \]
                          8. associate-*l*N/A

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \color{blue}{\left(im \cdot \frac{-1}{3}\right)}\right)\right)\right)\right) \]
                          10. *-lowering-*.f6485.7%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{3}}\right)\right)\right)\right)\right) \]
                        5. Simplified85.7%

                          \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)} \]
                        6. Taylor expanded in re around 0

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, re\right), \mathsf{*.f64}\left(\color{blue}{im}, \mathsf{+.f64}\left(-2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{3}\right)\right)\right)\right)\right) \]
                        8. Simplified52.7%

                          \[\leadsto \color{blue}{\left(0.5 \cdot re\right)} \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) \]
                        9. Add Preprocessing

                        Alternative 17: 50.5% accurate, 28.0× speedup?

                        \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\right) \end{array} \]
                        im\_m = (fabs.f64 im)
                        im\_s = (copysign.f64 #s(literal 1 binary64) im)
                        (FPCore (im_s re im_m)
                         :precision binary64
                         (* im_s (* im_m (* re (+ -1.0 (* im_m (* im_m -0.16666666666666666)))))))
                        im\_m = fabs(im);
                        im\_s = copysign(1.0, im);
                        double code(double im_s, double re, double im_m) {
                        	return im_s * (im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666)))));
                        }
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0d0, im)
                        real(8) function code(im_s, re, im_m)
                            real(8), intent (in) :: im_s
                            real(8), intent (in) :: re
                            real(8), intent (in) :: im_m
                            code = im_s * (im_m * (re * ((-1.0d0) + (im_m * (im_m * (-0.16666666666666666d0))))))
                        end function
                        
                        im\_m = Math.abs(im);
                        im\_s = Math.copySign(1.0, im);
                        public static double code(double im_s, double re, double im_m) {
                        	return im_s * (im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666)))));
                        }
                        
                        im\_m = math.fabs(im)
                        im\_s = math.copysign(1.0, im)
                        def code(im_s, re, im_m):
                        	return im_s * (im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666)))))
                        
                        im\_m = abs(im)
                        im\_s = copysign(1.0, im)
                        function code(im_s, re, im_m)
                        	return Float64(im_s * Float64(im_m * Float64(re * Float64(-1.0 + Float64(im_m * Float64(im_m * -0.16666666666666666))))))
                        end
                        
                        im\_m = abs(im);
                        im\_s = sign(im) * abs(1.0);
                        function tmp = code(im_s, re, im_m)
                        	tmp = im_s * (im_m * (re * (-1.0 + (im_m * (im_m * -0.16666666666666666)))));
                        end
                        
                        im\_m = N[Abs[im], $MachinePrecision]
                        im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                        code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(im$95$m * N[(re * N[(-1.0 + N[(im$95$m * N[(im$95$m * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        im\_m = \left|im\right|
                        \\
                        im\_s = \mathsf{copysign}\left(1, im\right)
                        
                        \\
                        im\_s \cdot \left(im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot -0.16666666666666666\right)\right)\right)\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 62.4%

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{-1} \cdot \sin re\right)\right) \]
                          8. distribute-rgt-outN/A

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

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\frac{-1}{6} \cdot \left(im \cdot im\right) + -1\right)\right)\right) \]
                          10. associate-*r*N/A

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(\left(\frac{-1}{6} \cdot im\right) \cdot im + -1\right)\right)\right) \]
                          11. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(im, \left(\sin re \cdot \left(im \cdot \left(\frac{-1}{6} \cdot im\right) + -1\right)\right)\right) \]
                          12. *-lowering-*.f64N/A

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \left(im \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                          18. *-lowering-*.f6482.0%

                            \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right) \]
                        5. Simplified82.0%

                          \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
                        6. Taylor expanded in re around 0

                          \[\leadsto \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\color{blue}{re}, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \frac{-1}{6}\right)\right)\right)\right)\right) \]
                        7. Step-by-step derivation
                          1. Simplified49.0%

                            \[\leadsto im \cdot \left(\color{blue}{re} \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \]
                          2. Add Preprocessing

                          Alternative 18: 33.8% accurate, 61.6× speedup?

                          \[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(0 - im\_m \cdot re\right) \end{array} \]
                          im\_m = (fabs.f64 im)
                          im\_s = (copysign.f64 #s(literal 1 binary64) im)
                          (FPCore (im_s re im_m) :precision binary64 (* im_s (- 0.0 (* im_m re))))
                          im\_m = fabs(im);
                          im\_s = copysign(1.0, im);
                          double code(double im_s, double re, double im_m) {
                          	return im_s * (0.0 - (im_m * re));
                          }
                          
                          im\_m = abs(im)
                          im\_s = copysign(1.0d0, im)
                          real(8) function code(im_s, re, im_m)
                              real(8), intent (in) :: im_s
                              real(8), intent (in) :: re
                              real(8), intent (in) :: im_m
                              code = im_s * (0.0d0 - (im_m * re))
                          end function
                          
                          im\_m = Math.abs(im);
                          im\_s = Math.copySign(1.0, im);
                          public static double code(double im_s, double re, double im_m) {
                          	return im_s * (0.0 - (im_m * re));
                          }
                          
                          im\_m = math.fabs(im)
                          im\_s = math.copysign(1.0, im)
                          def code(im_s, re, im_m):
                          	return im_s * (0.0 - (im_m * re))
                          
                          im\_m = abs(im)
                          im\_s = copysign(1.0, im)
                          function code(im_s, re, im_m)
                          	return Float64(im_s * Float64(0.0 - Float64(im_m * re)))
                          end
                          
                          im\_m = abs(im);
                          im\_s = sign(im) * abs(1.0);
                          function tmp = code(im_s, re, im_m)
                          	tmp = im_s * (0.0 - (im_m * re));
                          end
                          
                          im\_m = N[Abs[im], $MachinePrecision]
                          im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
                          code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(0.0 - N[(im$95$m * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                          
                          \begin{array}{l}
                          im\_m = \left|im\right|
                          \\
                          im\_s = \mathsf{copysign}\left(1, im\right)
                          
                          \\
                          im\_s \cdot \left(0 - im\_m \cdot re\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 62.4%

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

                            \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
                          4. Step-by-step derivation
                            1. mul-1-negN/A

                              \[\leadsto \mathsf{neg}\left(im \cdot \sin re\right) \]
                            2. neg-sub0N/A

                              \[\leadsto 0 - \color{blue}{im \cdot \sin re} \]
                            3. --lowering--.f64N/A

                              \[\leadsto \mathsf{\_.f64}\left(0, \color{blue}{\left(im \cdot \sin re\right)}\right) \]
                            4. *-lowering-*.f64N/A

                              \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \color{blue}{\sin re}\right)\right) \]
                            5. sin-lowering-sin.f6456.2%

                              \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \mathsf{sin.f64}\left(re\right)\right)\right) \]
                          5. Simplified56.2%

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

                            \[\leadsto \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(im, \color{blue}{re}\right)\right) \]
                          7. Step-by-step derivation
                            1. Simplified34.3%

                              \[\leadsto 0 - im \cdot \color{blue}{re} \]
                            2. Step-by-step derivation
                              1. sub0-negN/A

                                \[\leadsto \mathsf{neg}\left(im \cdot re\right) \]
                              2. *-commutativeN/A

                                \[\leadsto \mathsf{neg}\left(re \cdot im\right) \]
                              3. distribute-lft-neg-inN/A

                                \[\leadsto \left(\mathsf{neg}\left(re\right)\right) \cdot \color{blue}{im} \]
                              4. *-lowering-*.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\left(\mathsf{neg}\left(re\right)\right), \color{blue}{im}\right) \]
                              5. neg-lowering-neg.f6434.3%

                                \[\leadsto \mathsf{*.f64}\left(\mathsf{neg.f64}\left(re\right), im\right) \]
                            3. Applied egg-rr34.3%

                              \[\leadsto \color{blue}{\left(-re\right) \cdot im} \]
                            4. Final simplification34.3%

                              \[\leadsto 0 - im \cdot re \]
                            5. Add Preprocessing

                            Developer Target 1: 99.7% accurate, 0.7× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|im\right| < 1:\\ \;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\ \end{array} \end{array} \]
                            (FPCore (re im)
                             :precision binary64
                             (if (< (fabs im) 1.0)
                               (-
                                (*
                                 (sin re)
                                 (+
                                  (+ im (* (* (* 0.16666666666666666 im) im) im))
                                  (* (* (* (* (* 0.008333333333333333 im) im) im) im) im))))
                               (* (* 0.5 (sin re)) (- (exp (- im)) (exp im)))))
                            double code(double re, double im) {
                            	double tmp;
                            	if (fabs(im) < 1.0) {
                            		tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                            	} else {
                            		tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(re, im)
                                real(8), intent (in) :: re
                                real(8), intent (in) :: im
                                real(8) :: tmp
                                if (abs(im) < 1.0d0) then
                                    tmp = -(sin(re) * ((im + (((0.16666666666666666d0 * im) * im) * im)) + (((((0.008333333333333333d0 * im) * im) * im) * im) * im)))
                                else
                                    tmp = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double re, double im) {
                            	double tmp;
                            	if (Math.abs(im) < 1.0) {
                            		tmp = -(Math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                            	} else {
                            		tmp = (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
                            	}
                            	return tmp;
                            }
                            
                            def code(re, im):
                            	tmp = 0
                            	if math.fabs(im) < 1.0:
                            		tmp = -(math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)))
                            	else:
                            		tmp = (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
                            	return tmp
                            
                            function code(re, im)
                            	tmp = 0.0
                            	if (abs(im) < 1.0)
                            		tmp = Float64(-Float64(sin(re) * Float64(Float64(im + Float64(Float64(Float64(0.16666666666666666 * im) * im) * im)) + Float64(Float64(Float64(Float64(Float64(0.008333333333333333 * im) * im) * im) * im) * im))));
                            	else
                            		tmp = Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)));
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(re, im)
                            	tmp = 0.0;
                            	if (abs(im) < 1.0)
                            		tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
                            	else
                            		tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[re_, im_] := If[Less[N[Abs[im], $MachinePrecision], 1.0], (-N[(N[Sin[re], $MachinePrecision] * N[(N[(im + N[(N[(N[(0.16666666666666666 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(0.008333333333333333 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;\left|im\right| < 1:\\
                            \;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            

                            Reproduce

                            ?
                            herbie shell --seed 2024161 
                            (FPCore (re im)
                              :name "math.cos on complex, imaginary part"
                              :precision binary64
                            
                              :alt
                              (! :herbie-platform default (if (< (fabs im) 1) (- (* (sin re) (+ im (* 1/6 im im im) (* 1/120 im im im im im)))) (* (* 1/2 (sin re)) (- (exp (- im)) (exp im)))))
                            
                              (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))