math.exp on complex, imaginary part

Percentage Accurate: 100.0% → 100.0%
Time: 4.5s
Alternatives: 17
Speedup: 1.0×

Specification

?
\[e^{re} \cdot \sin im \]
(FPCore (re im)
  :precision binary64
  (* (exp re) (sin im)))
double code(double re, double im) {
	return exp(re) * sin(im);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(re, im)
use fmin_fmax_functions
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.sin(im);
}
def code(re, im):
	return math.exp(re) * math.sin(im)
function code(re, im)
	return Float64(exp(re) * sin(im))
end
function tmp = code(re, im)
	tmp = exp(re) * sin(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
e^{re} \cdot \sin im

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 17 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

\[e^{re} \cdot \sin im \]
(FPCore (re im)
  :precision binary64
  (* (exp re) (sin im)))
double code(double re, double im) {
	return exp(re) * sin(im);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(re, im)
use fmin_fmax_functions
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = exp(re) * sin(im)
end function
public static double code(double re, double im) {
	return Math.exp(re) * Math.sin(im);
}
def code(re, im):
	return math.exp(re) * math.sin(im)
function code(re, im)
	return Float64(exp(re) * sin(im))
end
function tmp = code(re, im)
	tmp = exp(re) * sin(im);
end
code[re_, im_] := N[(N[Exp[re], $MachinePrecision] * N[Sin[im], $MachinePrecision]), $MachinePrecision]
e^{re} \cdot \sin im

Alternative 1: 98.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \left|im\right| \cdot e^{re}\\ t_1 := \left(\left(\left|im\right| \cdot \left|im\right|\right) \cdot \left|im\right|\right) \cdot \left|im\right|\\ t_2 := \sin \left(\left|im\right|\right)\\ t_3 := e^{re} \cdot t\_2\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\ \mathbf{elif}\;t\_3 \leq -0.05:\\ \;\;\;\;\left(1 + re \cdot \left(1 + 0.5 \cdot re\right)\right) \cdot t\_2\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-86}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_3 \leq 1:\\ \;\;\;\;\left(1 + re\right) \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (re im)
  :precision binary64
  (let* ((t_0 (* (fabs im) (exp re)))
       (t_1 (* (* (* (fabs im) (fabs im)) (fabs im)) (fabs im)))
       (t_2 (sin (fabs im)))
       (t_3 (* (exp re) t_2)))
  (*
   (copysign 1.0 im)
   (if (<= t_3 (- INFINITY))
     (*
      (fabs im)
      (+ 1.0 (* -0.16666666666666666 (sqrt (sqrt (* t_1 t_1))))))
     (if (<= t_3 -0.05)
       (* (+ 1.0 (* re (+ 1.0 (* 0.5 re)))) t_2)
       (if (<= t_3 5e-86)
         t_0
         (if (<= t_3 1.0) (* (+ 1.0 re) t_2) t_0)))))))
double code(double re, double im) {
	double t_0 = fabs(im) * exp(re);
	double t_1 = ((fabs(im) * fabs(im)) * fabs(im)) * fabs(im);
	double t_2 = sin(fabs(im));
	double t_3 = exp(re) * t_2;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_1 * t_1)))));
	} else if (t_3 <= -0.05) {
		tmp = (1.0 + (re * (1.0 + (0.5 * re)))) * t_2;
	} else if (t_3 <= 5e-86) {
		tmp = t_0;
	} else if (t_3 <= 1.0) {
		tmp = (1.0 + re) * t_2;
	} else {
		tmp = t_0;
	}
	return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.abs(im) * Math.exp(re);
	double t_1 = ((Math.abs(im) * Math.abs(im)) * Math.abs(im)) * Math.abs(im);
	double t_2 = Math.sin(Math.abs(im));
	double t_3 = Math.exp(re) * t_2;
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt(Math.sqrt((t_1 * t_1)))));
	} else if (t_3 <= -0.05) {
		tmp = (1.0 + (re * (1.0 + (0.5 * re)))) * t_2;
	} else if (t_3 <= 5e-86) {
		tmp = t_0;
	} else if (t_3 <= 1.0) {
		tmp = (1.0 + re) * t_2;
	} else {
		tmp = t_0;
	}
	return Math.copySign(1.0, im) * tmp;
}
def code(re, im):
	t_0 = math.fabs(im) * math.exp(re)
	t_1 = ((math.fabs(im) * math.fabs(im)) * math.fabs(im)) * math.fabs(im)
	t_2 = math.sin(math.fabs(im))
	t_3 = math.exp(re) * t_2
	tmp = 0
	if t_3 <= -math.inf:
		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt(math.sqrt((t_1 * t_1)))))
	elif t_3 <= -0.05:
		tmp = (1.0 + (re * (1.0 + (0.5 * re)))) * t_2
	elif t_3 <= 5e-86:
		tmp = t_0
	elif t_3 <= 1.0:
		tmp = (1.0 + re) * t_2
	else:
		tmp = t_0
	return math.copysign(1.0, im) * tmp
function code(re, im)
	t_0 = Float64(abs(im) * exp(re))
	t_1 = Float64(Float64(Float64(abs(im) * abs(im)) * abs(im)) * abs(im))
	t_2 = sin(abs(im))
	t_3 = Float64(exp(re) * t_2)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(sqrt(Float64(t_1 * t_1))))));
	elseif (t_3 <= -0.05)
		tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(0.5 * re)))) * t_2);
	elseif (t_3 <= 5e-86)
		tmp = t_0;
	elseif (t_3 <= 1.0)
		tmp = Float64(Float64(1.0 + re) * t_2);
	else
		tmp = t_0;
	end
	return Float64(copysign(1.0, im) * tmp)
end
function tmp_2 = code(re, im)
	t_0 = abs(im) * exp(re);
	t_1 = ((abs(im) * abs(im)) * abs(im)) * abs(im);
	t_2 = sin(abs(im));
	t_3 = exp(re) * t_2;
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_1 * t_1)))));
	elseif (t_3 <= -0.05)
		tmp = (1.0 + (re * (1.0 + (0.5 * re)))) * t_2;
	elseif (t_3 <= 5e-86)
		tmp = t_0;
	elseif (t_3 <= 1.0)
		tmp = (1.0 + re) * t_2;
	else
		tmp = t_0;
	end
	tmp_2 = (sign(im) * abs(1.0)) * tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Abs[im], $MachinePrecision] * N[Exp[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[re], $MachinePrecision] * t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$3, (-Infinity)], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -0.05], N[(N[(1.0 + N[(re * N[(1.0 + N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 5e-86], t$95$0, If[LessEqual[t$95$3, 1.0], N[(N[(1.0 + re), $MachinePrecision] * t$95$2), $MachinePrecision], t$95$0]]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left|im\right| \cdot e^{re}\\
t_1 := \left(\left(\left|im\right| \cdot \left|im\right|\right) \cdot \left|im\right|\right) \cdot \left|im\right|\\
t_2 := \sin \left(\left|im\right|\right)\\
t_3 := e^{re} \cdot t\_2\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\

\mathbf{elif}\;t\_3 \leq -0.05:\\
\;\;\;\;\left(1 + re \cdot \left(1 + 0.5 \cdot re\right)\right) \cdot t\_2\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_3 \leq 1:\\
\;\;\;\;\left(1 + re\right) \cdot t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{\sin im} \]
    5. Taylor expanded in im around 0

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

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

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

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
      4. lower-pow.f6429.8%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
    7. Applied rewrites29.8%

      \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      4. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      6. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      7. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      8. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
      10. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    9. Applied rewrites30.2%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}}\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      4. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      6. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      7. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      8. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      10. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      11. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      12. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      14. lower-unsound-pow.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      15. lower-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      16. pow3N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      17. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      18. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      19. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      20. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      21. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)}}\right) \]
      22. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      23. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      24. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      25. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      26. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      27. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
    11. Applied rewrites30.9%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right)}}\right) \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

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

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

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

        \[\leadsto \left(1 + re \cdot \left(1 + \color{blue}{\frac{1}{2} \cdot re}\right)\right) \cdot \sin im \]
      4. lower-*.f6463.1%

        \[\leadsto \left(1 + re \cdot \left(1 + 0.5 \cdot \color{blue}{re}\right)\right) \cdot \sin im \]
    4. Applied rewrites63.1%

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

    if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.9999999999999999e-86 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
      2. lower-exp.f6469.3%

        \[\leadsto im \cdot e^{re} \]
    4. Applied rewrites69.3%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]

    if 4.9999999999999999e-86 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
    3. Step-by-step derivation
      1. lower-+.f6451.4%

        \[\leadsto \left(1 + \color{blue}{re}\right) \cdot \sin im \]
    4. Applied rewrites51.4%

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

Alternative 2: 98.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \left|im\right| \cdot e^{re}\\ t_1 := \left(\left(\left|im\right| \cdot \left|im\right|\right) \cdot \left|im\right|\right) \cdot \left|im\right|\\ t_2 := \sin \left(\left|im\right|\right)\\ t_3 := e^{re} \cdot t\_2\\ t_4 := \left(1 + re\right) \cdot t\_2\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_3 \leq -\infty:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\ \mathbf{elif}\;t\_3 \leq -0.05:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-86}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_3 \leq 1:\\ \;\;\;\;t\_4\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (re im)
  :precision binary64
  (let* ((t_0 (* (fabs im) (exp re)))
       (t_1 (* (* (* (fabs im) (fabs im)) (fabs im)) (fabs im)))
       (t_2 (sin (fabs im)))
       (t_3 (* (exp re) t_2))
       (t_4 (* (+ 1.0 re) t_2)))
  (*
   (copysign 1.0 im)
   (if (<= t_3 (- INFINITY))
     (*
      (fabs im)
      (+ 1.0 (* -0.16666666666666666 (sqrt (sqrt (* t_1 t_1))))))
     (if (<= t_3 -0.05)
       t_4
       (if (<= t_3 5e-86) t_0 (if (<= t_3 1.0) t_4 t_0)))))))
double code(double re, double im) {
	double t_0 = fabs(im) * exp(re);
	double t_1 = ((fabs(im) * fabs(im)) * fabs(im)) * fabs(im);
	double t_2 = sin(fabs(im));
	double t_3 = exp(re) * t_2;
	double t_4 = (1.0 + re) * t_2;
	double tmp;
	if (t_3 <= -((double) INFINITY)) {
		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_1 * t_1)))));
	} else if (t_3 <= -0.05) {
		tmp = t_4;
	} else if (t_3 <= 5e-86) {
		tmp = t_0;
	} else if (t_3 <= 1.0) {
		tmp = t_4;
	} else {
		tmp = t_0;
	}
	return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.abs(im) * Math.exp(re);
	double t_1 = ((Math.abs(im) * Math.abs(im)) * Math.abs(im)) * Math.abs(im);
	double t_2 = Math.sin(Math.abs(im));
	double t_3 = Math.exp(re) * t_2;
	double t_4 = (1.0 + re) * t_2;
	double tmp;
	if (t_3 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt(Math.sqrt((t_1 * t_1)))));
	} else if (t_3 <= -0.05) {
		tmp = t_4;
	} else if (t_3 <= 5e-86) {
		tmp = t_0;
	} else if (t_3 <= 1.0) {
		tmp = t_4;
	} else {
		tmp = t_0;
	}
	return Math.copySign(1.0, im) * tmp;
}
def code(re, im):
	t_0 = math.fabs(im) * math.exp(re)
	t_1 = ((math.fabs(im) * math.fabs(im)) * math.fabs(im)) * math.fabs(im)
	t_2 = math.sin(math.fabs(im))
	t_3 = math.exp(re) * t_2
	t_4 = (1.0 + re) * t_2
	tmp = 0
	if t_3 <= -math.inf:
		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt(math.sqrt((t_1 * t_1)))))
	elif t_3 <= -0.05:
		tmp = t_4
	elif t_3 <= 5e-86:
		tmp = t_0
	elif t_3 <= 1.0:
		tmp = t_4
	else:
		tmp = t_0
	return math.copysign(1.0, im) * tmp
function code(re, im)
	t_0 = Float64(abs(im) * exp(re))
	t_1 = Float64(Float64(Float64(abs(im) * abs(im)) * abs(im)) * abs(im))
	t_2 = sin(abs(im))
	t_3 = Float64(exp(re) * t_2)
	t_4 = Float64(Float64(1.0 + re) * t_2)
	tmp = 0.0
	if (t_3 <= Float64(-Inf))
		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(sqrt(Float64(t_1 * t_1))))));
	elseif (t_3 <= -0.05)
		tmp = t_4;
	elseif (t_3 <= 5e-86)
		tmp = t_0;
	elseif (t_3 <= 1.0)
		tmp = t_4;
	else
		tmp = t_0;
	end
	return Float64(copysign(1.0, im) * tmp)
end
function tmp_2 = code(re, im)
	t_0 = abs(im) * exp(re);
	t_1 = ((abs(im) * abs(im)) * abs(im)) * abs(im);
	t_2 = sin(abs(im));
	t_3 = exp(re) * t_2;
	t_4 = (1.0 + re) * t_2;
	tmp = 0.0;
	if (t_3 <= -Inf)
		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_1 * t_1)))));
	elseif (t_3 <= -0.05)
		tmp = t_4;
	elseif (t_3 <= 5e-86)
		tmp = t_0;
	elseif (t_3 <= 1.0)
		tmp = t_4;
	else
		tmp = t_0;
	end
	tmp_2 = (sign(im) * abs(1.0)) * tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Abs[im], $MachinePrecision] * N[Exp[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[Exp[re], $MachinePrecision] * t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(1.0 + re), $MachinePrecision] * t$95$2), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$3, (-Infinity)], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, -0.05], t$95$4, If[LessEqual[t$95$3, 5e-86], t$95$0, If[LessEqual[t$95$3, 1.0], t$95$4, t$95$0]]]]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \left|im\right| \cdot e^{re}\\
t_1 := \left(\left(\left|im\right| \cdot \left|im\right|\right) \cdot \left|im\right|\right) \cdot \left|im\right|\\
t_2 := \sin \left(\left|im\right|\right)\\
t_3 := e^{re} \cdot t\_2\\
t_4 := \left(1 + re\right) \cdot t\_2\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\

\mathbf{elif}\;t\_3 \leq -0.05:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_3 \leq 1:\\
\;\;\;\;t\_4\\

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


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

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{\sin im} \]
    5. Taylor expanded in im around 0

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

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

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

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
      4. lower-pow.f6429.8%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
    7. Applied rewrites29.8%

      \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      4. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      6. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      7. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      8. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
      10. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    9. Applied rewrites30.2%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}}\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      4. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      6. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      7. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      8. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      10. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      11. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      12. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      14. lower-unsound-pow.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      15. lower-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      16. pow3N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      17. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      18. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      19. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      20. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      21. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)}}\right) \]
      22. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      23. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      24. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      25. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      26. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      27. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
    11. Applied rewrites30.9%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right)}}\right) \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 4.9999999999999999e-86 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
    3. Step-by-step derivation
      1. lower-+.f6451.4%

        \[\leadsto \left(1 + \color{blue}{re}\right) \cdot \sin im \]
    4. Applied rewrites51.4%

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

    if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.9999999999999999e-86 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
      2. lower-exp.f6469.3%

        \[\leadsto im \cdot e^{re} \]
    4. Applied rewrites69.3%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 3: 98.1% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \left(\left(\left|im\right| \cdot \left|im\right|\right) \cdot \left|im\right|\right) \cdot \left|im\right|\\ t_1 := \sin \left(\left|im\right|\right)\\ t_2 := e^{re} \cdot t\_1\\ t_3 := \left|im\right| \cdot e^{re}\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\right)\\ \mathbf{elif}\;t\_2 \leq -0.05:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-86}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 1:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (re im)
  :precision binary64
  (let* ((t_0 (* (* (* (fabs im) (fabs im)) (fabs im)) (fabs im)))
       (t_1 (sin (fabs im)))
       (t_2 (* (exp re) t_1))
       (t_3 (* (fabs im) (exp re))))
  (*
   (copysign 1.0 im)
   (if (<= t_2 (- INFINITY))
     (*
      (fabs im)
      (+ 1.0 (* -0.16666666666666666 (sqrt (sqrt (* t_0 t_0))))))
     (if (<= t_2 -0.05)
       t_1
       (if (<= t_2 5e-86) t_3 (if (<= t_2 1.0) t_1 t_3)))))))
double code(double re, double im) {
	double t_0 = ((fabs(im) * fabs(im)) * fabs(im)) * fabs(im);
	double t_1 = sin(fabs(im));
	double t_2 = exp(re) * t_1;
	double t_3 = fabs(im) * exp(re);
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_0 * t_0)))));
	} else if (t_2 <= -0.05) {
		tmp = t_1;
	} else if (t_2 <= 5e-86) {
		tmp = t_3;
	} else if (t_2 <= 1.0) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
	double t_0 = ((Math.abs(im) * Math.abs(im)) * Math.abs(im)) * Math.abs(im);
	double t_1 = Math.sin(Math.abs(im));
	double t_2 = Math.exp(re) * t_1;
	double t_3 = Math.abs(im) * Math.exp(re);
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt(Math.sqrt((t_0 * t_0)))));
	} else if (t_2 <= -0.05) {
		tmp = t_1;
	} else if (t_2 <= 5e-86) {
		tmp = t_3;
	} else if (t_2 <= 1.0) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return Math.copySign(1.0, im) * tmp;
}
def code(re, im):
	t_0 = ((math.fabs(im) * math.fabs(im)) * math.fabs(im)) * math.fabs(im)
	t_1 = math.sin(math.fabs(im))
	t_2 = math.exp(re) * t_1
	t_3 = math.fabs(im) * math.exp(re)
	tmp = 0
	if t_2 <= -math.inf:
		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt(math.sqrt((t_0 * t_0)))))
	elif t_2 <= -0.05:
		tmp = t_1
	elif t_2 <= 5e-86:
		tmp = t_3
	elif t_2 <= 1.0:
		tmp = t_1
	else:
		tmp = t_3
	return math.copysign(1.0, im) * tmp
function code(re, im)
	t_0 = Float64(Float64(Float64(abs(im) * abs(im)) * abs(im)) * abs(im))
	t_1 = sin(abs(im))
	t_2 = Float64(exp(re) * t_1)
	t_3 = Float64(abs(im) * exp(re))
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(sqrt(Float64(t_0 * t_0))))));
	elseif (t_2 <= -0.05)
		tmp = t_1;
	elseif (t_2 <= 5e-86)
		tmp = t_3;
	elseif (t_2 <= 1.0)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return Float64(copysign(1.0, im) * tmp)
end
function tmp_2 = code(re, im)
	t_0 = ((abs(im) * abs(im)) * abs(im)) * abs(im);
	t_1 = sin(abs(im));
	t_2 = exp(re) * t_1;
	t_3 = abs(im) * exp(re);
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_0 * t_0)))));
	elseif (t_2 <= -0.05)
		tmp = t_1;
	elseif (t_2 <= 5e-86)
		tmp = t_3;
	elseif (t_2 <= 1.0)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = (sign(im) * abs(1.0)) * tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[Abs[im], $MachinePrecision] * N[Exp[re], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, (-Infinity)], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -0.05], t$95$1, If[LessEqual[t$95$2, 5e-86], t$95$3, If[LessEqual[t$95$2, 1.0], t$95$1, t$95$3]]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(\left(\left|im\right| \cdot \left|im\right|\right) \cdot \left|im\right|\right) \cdot \left|im\right|\\
t_1 := \sin \left(\left|im\right|\right)\\
t_2 := e^{re} \cdot t\_1\\
t_3 := \left|im\right| \cdot e^{re}\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\right)\\

\mathbf{elif}\;t\_2 \leq -0.05:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 1:\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{\sin im} \]
    5. Taylor expanded in im around 0

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

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

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

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
      4. lower-pow.f6429.8%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
    7. Applied rewrites29.8%

      \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      4. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      6. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      7. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      8. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
      10. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    9. Applied rewrites30.2%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}}\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      4. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      6. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      7. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      8. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      10. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      11. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      12. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      14. lower-unsound-pow.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      15. lower-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      16. pow3N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      17. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      18. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      19. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      20. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      21. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)}}\right) \]
      22. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      23. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      24. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      25. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      26. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      27. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
    11. Applied rewrites30.9%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right)}}\right) \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 4.9999999999999999e-86 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

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

    if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.9999999999999999e-86 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
      2. lower-exp.f6469.3%

        \[\leadsto im \cdot e^{re} \]
    4. Applied rewrites69.3%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 4: 97.2% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \left|im\right| \cdot e^{re}\\ t_1 := \sin \left(\left|im\right|\right)\\ t_2 := e^{re} \cdot t\_1\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -0.05:\\ \;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \cdot t\_1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-86}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq 1:\\ \;\;\;\;\left(1 + re\right) \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (re im)
  :precision binary64
  (let* ((t_0 (* (fabs im) (exp re)))
       (t_1 (sin (fabs im)))
       (t_2 (* (exp re) t_1)))
  (*
   (copysign 1.0 im)
   (if (<= t_2 -0.05)
     (*
      (+ 1.0 (* re (+ 1.0 (* re (+ 0.5 (* 0.16666666666666666 re))))))
      t_1)
     (if (<= t_2 5e-86)
       t_0
       (if (<= t_2 1.0) (* (+ 1.0 re) t_1) t_0))))))
double code(double re, double im) {
	double t_0 = fabs(im) * exp(re);
	double t_1 = sin(fabs(im));
	double t_2 = exp(re) * t_1;
	double tmp;
	if (t_2 <= -0.05) {
		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re)))))) * t_1;
	} else if (t_2 <= 5e-86) {
		tmp = t_0;
	} else if (t_2 <= 1.0) {
		tmp = (1.0 + re) * t_1;
	} else {
		tmp = t_0;
	}
	return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.abs(im) * Math.exp(re);
	double t_1 = Math.sin(Math.abs(im));
	double t_2 = Math.exp(re) * t_1;
	double tmp;
	if (t_2 <= -0.05) {
		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re)))))) * t_1;
	} else if (t_2 <= 5e-86) {
		tmp = t_0;
	} else if (t_2 <= 1.0) {
		tmp = (1.0 + re) * t_1;
	} else {
		tmp = t_0;
	}
	return Math.copySign(1.0, im) * tmp;
}
def code(re, im):
	t_0 = math.fabs(im) * math.exp(re)
	t_1 = math.sin(math.fabs(im))
	t_2 = math.exp(re) * t_1
	tmp = 0
	if t_2 <= -0.05:
		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re)))))) * t_1
	elif t_2 <= 5e-86:
		tmp = t_0
	elif t_2 <= 1.0:
		tmp = (1.0 + re) * t_1
	else:
		tmp = t_0
	return math.copysign(1.0, im) * tmp
function code(re, im)
	t_0 = Float64(abs(im) * exp(re))
	t_1 = sin(abs(im))
	t_2 = Float64(exp(re) * t_1)
	tmp = 0.0
	if (t_2 <= -0.05)
		tmp = Float64(Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(0.16666666666666666 * re)))))) * t_1);
	elseif (t_2 <= 5e-86)
		tmp = t_0;
	elseif (t_2 <= 1.0)
		tmp = Float64(Float64(1.0 + re) * t_1);
	else
		tmp = t_0;
	end
	return Float64(copysign(1.0, im) * tmp)
end
function tmp_2 = code(re, im)
	t_0 = abs(im) * exp(re);
	t_1 = sin(abs(im));
	t_2 = exp(re) * t_1;
	tmp = 0.0;
	if (t_2 <= -0.05)
		tmp = (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re)))))) * t_1;
	elseif (t_2 <= 5e-86)
		tmp = t_0;
	elseif (t_2 <= 1.0)
		tmp = (1.0 + re) * t_1;
	else
		tmp = t_0;
	end
	tmp_2 = (sign(im) * abs(1.0)) * tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Abs[im], $MachinePrecision] * N[Exp[re], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, -0.05], N[(N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(0.16666666666666666 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e-86], t$95$0, If[LessEqual[t$95$2, 1.0], N[(N[(1.0 + re), $MachinePrecision] * t$95$1), $MachinePrecision], t$95$0]]]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left|im\right| \cdot e^{re}\\
t_1 := \sin \left(\left|im\right|\right)\\
t_2 := e^{re} \cdot t\_1\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_2 \leq -0.05:\\
\;\;\;\;\left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \cdot t\_1\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_2 \leq 1:\\
\;\;\;\;\left(1 + re\right) \cdot t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

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

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

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

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

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

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

        \[\leadsto \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot \color{blue}{re}\right)\right)\right) \cdot \sin im \]
    4. Applied rewrites67.2%

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

    if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 4.9999999999999999e-86 or 1 < (*.f64 (exp.f64 re) (sin.f64 im))

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in im around 0

      \[\leadsto \color{blue}{im \cdot e^{re}} \]
    3. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto im \cdot \color{blue}{e^{re}} \]
      2. lower-exp.f6469.3%

        \[\leadsto im \cdot e^{re} \]
    4. Applied rewrites69.3%

      \[\leadsto \color{blue}{im \cdot e^{re}} \]

    if 4.9999999999999999e-86 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\left(1 + re\right)} \cdot \sin im \]
    3. Step-by-step derivation
      1. lower-+.f6451.4%

        \[\leadsto \left(1 + \color{blue}{re}\right) \cdot \sin im \]
    4. Applied rewrites51.4%

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

Alternative 5: 75.9% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \sin \left(\left|im\right|\right)\\ t_1 := e^{re} \cdot t\_0\\ t_2 := \left|im\right| \cdot \left|im\right|\\ t_3 := \left(t\_2 \cdot \left|im\right|\right) \cdot \left|im\right|\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -\infty:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_3 \cdot t\_3}}\right)\\ \mathbf{elif}\;t\_1 \leq -0.05:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_2 \cdot -0.16666666666666666 - 1}\\ \mathbf{elif}\;t\_1 \leq 1:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - -1}\\ \end{array} \end{array} \]
(FPCore (re im)
  :precision binary64
  (let* ((t_0 (sin (fabs im)))
       (t_1 (* (exp re) t_0))
       (t_2 (* (fabs im) (fabs im)))
       (t_3 (* (* t_2 (fabs im)) (fabs im))))
  (*
   (copysign 1.0 im)
   (if (<= t_1 (- INFINITY))
     (*
      (fabs im)
      (+ 1.0 (* -0.16666666666666666 (sqrt (sqrt (* t_3 t_3))))))
     (if (<= t_1 -0.05)
       t_0
       (if (<= t_1 0.0)
         (* (fabs im) (/ -1.0 (- (* t_2 -0.16666666666666666) 1.0)))
         (if (<= t_1 1.0)
           t_0
           (*
            (fabs im)
            (/
             (*
              (-
               (- re -1.0)
               (* (- -0.5 (* 0.16666666666666666 re)) (* re re)))
              (- re -1.0))
             (- re -1.0))))))))))
double code(double re, double im) {
	double t_0 = sin(fabs(im));
	double t_1 = exp(re) * t_0;
	double t_2 = fabs(im) * fabs(im);
	double t_3 = (t_2 * fabs(im)) * fabs(im);
	double tmp;
	if (t_1 <= -((double) INFINITY)) {
		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_3 * t_3)))));
	} else if (t_1 <= -0.05) {
		tmp = t_0;
	} else if (t_1 <= 0.0) {
		tmp = fabs(im) * (-1.0 / ((t_2 * -0.16666666666666666) - 1.0));
	} else if (t_1 <= 1.0) {
		tmp = t_0;
	} else {
		tmp = fabs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
	}
	return copysign(1.0, im) * tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.sin(Math.abs(im));
	double t_1 = Math.exp(re) * t_0;
	double t_2 = Math.abs(im) * Math.abs(im);
	double t_3 = (t_2 * Math.abs(im)) * Math.abs(im);
	double tmp;
	if (t_1 <= -Double.POSITIVE_INFINITY) {
		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt(Math.sqrt((t_3 * t_3)))));
	} else if (t_1 <= -0.05) {
		tmp = t_0;
	} else if (t_1 <= 0.0) {
		tmp = Math.abs(im) * (-1.0 / ((t_2 * -0.16666666666666666) - 1.0));
	} else if (t_1 <= 1.0) {
		tmp = t_0;
	} else {
		tmp = Math.abs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
	}
	return Math.copySign(1.0, im) * tmp;
}
def code(re, im):
	t_0 = math.sin(math.fabs(im))
	t_1 = math.exp(re) * t_0
	t_2 = math.fabs(im) * math.fabs(im)
	t_3 = (t_2 * math.fabs(im)) * math.fabs(im)
	tmp = 0
	if t_1 <= -math.inf:
		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt(math.sqrt((t_3 * t_3)))))
	elif t_1 <= -0.05:
		tmp = t_0
	elif t_1 <= 0.0:
		tmp = math.fabs(im) * (-1.0 / ((t_2 * -0.16666666666666666) - 1.0))
	elif t_1 <= 1.0:
		tmp = t_0
	else:
		tmp = math.fabs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0))
	return math.copysign(1.0, im) * tmp
function code(re, im)
	t_0 = sin(abs(im))
	t_1 = Float64(exp(re) * t_0)
	t_2 = Float64(abs(im) * abs(im))
	t_3 = Float64(Float64(t_2 * abs(im)) * abs(im))
	tmp = 0.0
	if (t_1 <= Float64(-Inf))
		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(sqrt(Float64(t_3 * t_3))))));
	elseif (t_1 <= -0.05)
		tmp = t_0;
	elseif (t_1 <= 0.0)
		tmp = Float64(abs(im) * Float64(-1.0 / Float64(Float64(t_2 * -0.16666666666666666) - 1.0)));
	elseif (t_1 <= 1.0)
		tmp = t_0;
	else
		tmp = Float64(abs(im) * Float64(Float64(Float64(Float64(re - -1.0) - Float64(Float64(-0.5 - Float64(0.16666666666666666 * re)) * Float64(re * re))) * Float64(re - -1.0)) / Float64(re - -1.0)));
	end
	return Float64(copysign(1.0, im) * tmp)
end
function tmp_2 = code(re, im)
	t_0 = sin(abs(im));
	t_1 = exp(re) * t_0;
	t_2 = abs(im) * abs(im);
	t_3 = (t_2 * abs(im)) * abs(im);
	tmp = 0.0;
	if (t_1 <= -Inf)
		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_3 * t_3)))));
	elseif (t_1 <= -0.05)
		tmp = t_0;
	elseif (t_1 <= 0.0)
		tmp = abs(im) * (-1.0 / ((t_2 * -0.16666666666666666) - 1.0));
	elseif (t_1 <= 1.0)
		tmp = t_0;
	else
		tmp = abs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
	end
	tmp_2 = (sign(im) * abs(1.0)) * tmp;
end
code[re_, im_] := Block[{t$95$0 = N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$2 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, (-Infinity)], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[Sqrt[N[(t$95$3 * t$95$3), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -0.05], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[Abs[im], $MachinePrecision] * N[(-1.0 / N[(N[(t$95$2 * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1.0], t$95$0, N[(N[Abs[im], $MachinePrecision] * N[(N[(N[(N[(re - -1.0), $MachinePrecision] - N[(N[(-0.5 - N[(0.16666666666666666 * re), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re - -1.0), $MachinePrecision]), $MachinePrecision] / N[(re - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \sin \left(\left|im\right|\right)\\
t_1 := e^{re} \cdot t\_0\\
t_2 := \left|im\right| \cdot \left|im\right|\\
t_3 := \left(t\_2 \cdot \left|im\right|\right) \cdot \left|im\right|\\
\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_3 \cdot t\_3}}\right)\\

\mathbf{elif}\;t\_1 \leq -0.05:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left|im\right| \cdot \frac{-1}{t\_2 \cdot -0.16666666666666666 - 1}\\

\mathbf{elif}\;t\_1 \leq 1:\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;\left|im\right| \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - -1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -inf.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{\sin im} \]
    5. Taylor expanded in im around 0

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

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

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

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
      4. lower-pow.f6429.8%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
    7. Applied rewrites29.8%

      \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
    8. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      4. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      5. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
      6. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      7. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      8. lift-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
      9. unpow2N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
      10. lower-*.f6430.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    9. Applied rewrites30.2%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
    10. Step-by-step derivation
      1. rem-square-sqrtN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}}\right) \]
      2. sqrt-unprodN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      3. lower-sqrt.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      4. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      5. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      6. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      7. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      8. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      9. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      10. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      11. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      12. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      13. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      14. lower-unsound-pow.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      15. lower-pow.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      16. pow3N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      17. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      18. lower-*.f6430.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      19. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      20. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
      21. associate-*l*N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)}}\right) \]
      22. *-commutativeN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      23. lift-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
      24. cube-unmultN/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      25. lower-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      26. lower-unsound-pow.f32N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      27. lower-*.f64N/A

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
    11. Applied rewrites30.9%

      \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right)}}\right) \]

    if -inf.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < -0.050000000000000003 or 0.0 < (*.f64 (exp.f64 re) (sin.f64 im)) < 1

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

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

    if -0.050000000000000003 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

    1. Initial program 100.0%

      \[e^{re} \cdot \sin im \]
    2. Taylor expanded in re around 0

      \[\leadsto \color{blue}{\sin im} \]
    3. Step-by-step derivation
      1. lower-sin.f6450.9%

        \[\leadsto \sin im \]
    4. Applied rewrites50.9%

      \[\leadsto \color{blue}{\sin im} \]
    5. Taylor expanded in im around 0

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

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

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

        \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
      4. lower-pow.f6429.8%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
    7. Applied rewrites29.8%

      \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
    8. Step-by-step derivation
      1. lift-+.f64N/A

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

        \[\leadsto im \cdot \left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \]
      3. flip-+N/A

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

        \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - \color{blue}{1}} \]
      5. lower-unsound--.f64N/A

        \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      6. lower-unsound-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      7. lift-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      8. *-commutativeN/A

        \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      9. lower-*.f64N/A

        \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      10. lift-pow.f64N/A

        \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      11. unpow2N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      12. lower-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      13. lift-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      14. *-commutativeN/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      15. lower-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      16. lift-pow.f64N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      17. unpow2N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      18. lower-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      19. lower-unsound-*.f64N/A

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
      20. lower-unsound--.f6427.0%

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{-0.16666666666666666 \cdot {im}^{2} - 1} \]
    9. Applied rewrites27.0%

      \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - \color{blue}{1}} \]
    10. Taylor expanded in im around 0

      \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]
    11. Step-by-step derivation
      1. Applied rewrites32.6%

        \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]

      if 1 < (*.f64 (exp.f64 re) (sin.f64 im))

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Taylor expanded in im around 0

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto im \cdot \color{blue}{e^{re}} \]
        2. lower-exp.f6469.3%

          \[\leadsto im \cdot e^{re} \]
      4. Applied rewrites69.3%

        \[\leadsto \color{blue}{im \cdot e^{re}} \]
      5. Taylor expanded in re around 0

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

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

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

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

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

          \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot \color{blue}{re}\right)\right)\right) \]
        6. lower-*.f6439.7%

          \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \]
      7. Applied rewrites39.7%

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

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

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

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

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

          \[\leadsto im \cdot \left(1 + \left(1 \cdot re - \left(\mathsf{neg}\left(\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re\right)\right)\right)\right) \]
        6. *-lft-identityN/A

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

          \[\leadsto im \cdot \left(\left(1 + re\right) - \left(\mathsf{neg}\left(\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re\right)\right)\right) \]
        8. add-flipN/A

          \[\leadsto im \cdot \left(\left(1 + re\right) + \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot \color{blue}{re}\right) \]
        9. sum-to-multN/A

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

          \[\leadsto im \cdot \left(\left(1 + \frac{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re}{1 + re}\right) \cdot \left(1 + \color{blue}{re}\right)\right) \]
      9. Applied rewrites39.7%

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

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

          \[\leadsto im \cdot \left(\left(1 + \frac{\left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re}{1 + re}\right) \cdot \left(1 + re\right)\right) \]
        3. lift-/.f64N/A

          \[\leadsto im \cdot \left(\left(1 + \frac{\left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re}{1 + re}\right) \cdot \left(1 + re\right)\right) \]
        4. add-to-fractionN/A

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

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

          \[\leadsto im \cdot \frac{\left(1 \cdot \left(1 + re\right) + \left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re\right) \cdot \left(1 + re\right)}{1 + \color{blue}{re}} \]
      11. Applied rewrites40.7%

        \[\leadsto im \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - \color{blue}{-1}} \]
    12. Recombined 4 regimes into one program.
    13. Add Preprocessing

    Alternative 6: 52.7% accurate, 0.4× speedup?

    \[\begin{array}{l} t_0 := \left|im\right| \cdot \left|im\right|\\ t_1 := \left(t\_0 \cdot \left|im\right|\right) \cdot \left|im\right|\\ t_2 := e^{re} \cdot \sin \left(\left|im\right|\right)\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -0.1:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_0 \cdot -0.16666666666666666 - 1}\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - -1}\\ \end{array} \end{array} \]
    (FPCore (re im)
      :precision binary64
      (let* ((t_0 (* (fabs im) (fabs im)))
           (t_1 (* (* t_0 (fabs im)) (fabs im)))
           (t_2 (* (exp re) (sin (fabs im)))))
      (*
       (copysign 1.0 im)
       (if (<= t_2 -0.1)
         (*
          (fabs im)
          (+ 1.0 (* -0.16666666666666666 (sqrt (sqrt (* t_1 t_1))))))
         (if (<= t_2 0.0)
           (* (fabs im) (/ -1.0 (- (* t_0 -0.16666666666666666) 1.0)))
           (*
            (fabs im)
            (/
             (*
              (-
               (- re -1.0)
               (* (- -0.5 (* 0.16666666666666666 re)) (* re re)))
              (- re -1.0))
             (- re -1.0))))))))
    double code(double re, double im) {
    	double t_0 = fabs(im) * fabs(im);
    	double t_1 = (t_0 * fabs(im)) * fabs(im);
    	double t_2 = exp(re) * sin(fabs(im));
    	double tmp;
    	if (t_2 <= -0.1) {
    		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_1 * t_1)))));
    	} else if (t_2 <= 0.0) {
    		tmp = fabs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
    	} else {
    		tmp = fabs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
    	}
    	return copysign(1.0, im) * tmp;
    }
    
    public static double code(double re, double im) {
    	double t_0 = Math.abs(im) * Math.abs(im);
    	double t_1 = (t_0 * Math.abs(im)) * Math.abs(im);
    	double t_2 = Math.exp(re) * Math.sin(Math.abs(im));
    	double tmp;
    	if (t_2 <= -0.1) {
    		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt(Math.sqrt((t_1 * t_1)))));
    	} else if (t_2 <= 0.0) {
    		tmp = Math.abs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
    	} else {
    		tmp = Math.abs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
    	}
    	return Math.copySign(1.0, im) * tmp;
    }
    
    def code(re, im):
    	t_0 = math.fabs(im) * math.fabs(im)
    	t_1 = (t_0 * math.fabs(im)) * math.fabs(im)
    	t_2 = math.exp(re) * math.sin(math.fabs(im))
    	tmp = 0
    	if t_2 <= -0.1:
    		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt(math.sqrt((t_1 * t_1)))))
    	elif t_2 <= 0.0:
    		tmp = math.fabs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0))
    	else:
    		tmp = math.fabs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0))
    	return math.copysign(1.0, im) * tmp
    
    function code(re, im)
    	t_0 = Float64(abs(im) * abs(im))
    	t_1 = Float64(Float64(t_0 * abs(im)) * abs(im))
    	t_2 = Float64(exp(re) * sin(abs(im)))
    	tmp = 0.0
    	if (t_2 <= -0.1)
    		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(sqrt(Float64(t_1 * t_1))))));
    	elseif (t_2 <= 0.0)
    		tmp = Float64(abs(im) * Float64(-1.0 / Float64(Float64(t_0 * -0.16666666666666666) - 1.0)));
    	else
    		tmp = Float64(abs(im) * Float64(Float64(Float64(Float64(re - -1.0) - Float64(Float64(-0.5 - Float64(0.16666666666666666 * re)) * Float64(re * re))) * Float64(re - -1.0)) / Float64(re - -1.0)));
    	end
    	return Float64(copysign(1.0, im) * tmp)
    end
    
    function tmp_2 = code(re, im)
    	t_0 = abs(im) * abs(im);
    	t_1 = (t_0 * abs(im)) * abs(im);
    	t_2 = exp(re) * sin(abs(im));
    	tmp = 0.0;
    	if (t_2 <= -0.1)
    		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt(sqrt((t_1 * t_1)))));
    	elseif (t_2 <= 0.0)
    		tmp = abs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
    	else
    		tmp = abs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
    	end
    	tmp_2 = (sign(im) * abs(1.0)) * tmp;
    end
    
    code[re_, im_] := Block[{t$95$0 = N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(t$95$0 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, -0.1], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[Sqrt[N[(t$95$1 * t$95$1), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 0.0], N[(N[Abs[im], $MachinePrecision] * N[(-1.0 / N[(N[(t$95$0 * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] * N[(N[(N[(N[(re - -1.0), $MachinePrecision] - N[(N[(-0.5 - N[(0.16666666666666666 * re), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re - -1.0), $MachinePrecision]), $MachinePrecision] / N[(re - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]]
    
    \begin{array}{l}
    t_0 := \left|im\right| \cdot \left|im\right|\\
    t_1 := \left(t\_0 \cdot \left|im\right|\right) \cdot \left|im\right|\\
    t_2 := e^{re} \cdot \sin \left(\left|im\right|\right)\\
    \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
    \mathbf{if}\;t\_2 \leq -0.1:\\
    \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{t\_1 \cdot t\_1}}\right)\\
    
    \mathbf{elif}\;t\_2 \leq 0:\\
    \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_0 \cdot -0.16666666666666666 - 1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|im\right| \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - -1}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\sin im} \]
      3. Step-by-step derivation
        1. lower-sin.f6450.9%

          \[\leadsto \sin im \]
      4. Applied rewrites50.9%

        \[\leadsto \color{blue}{\sin im} \]
      5. Taylor expanded in im around 0

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

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

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

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
        4. lower-pow.f6429.8%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
      7. Applied rewrites29.8%

        \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
      8. Step-by-step derivation
        1. rem-square-sqrtN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
        2. sqrt-unprodN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
        3. lower-sqrt.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
        4. lower-*.f6430.2%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
        5. lift-pow.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
        6. unpow2N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
        7. lower-*.f6430.2%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
        8. lift-pow.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
        9. unpow2N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
        10. lower-*.f6430.2%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
      9. Applied rewrites30.2%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
      10. Step-by-step derivation
        1. rem-square-sqrtN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}}\right) \]
        2. sqrt-unprodN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        3. lower-sqrt.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        4. lower-*.f6430.9%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        5. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        6. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        7. associate-*l*N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        8. *-commutativeN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        9. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        10. cube-unmultN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        11. lower-pow.f32N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        12. lower-unsound-pow.f32N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        13. lower-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        14. lower-unsound-pow.f6430.9%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        15. lower-pow.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left({im}^{3} \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        16. pow3N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        17. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        18. lower-*.f6430.9%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        19. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        20. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}}\right) \]
        21. associate-*l*N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)}}\right) \]
        22. *-commutativeN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
        23. lift-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot im\right)}}\right) \]
        24. cube-unmultN/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
        25. lower-pow.f32N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
        26. lower-unsound-pow.f32N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
        27. lower-*.f64N/A

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left({im}^{3} \cdot im\right)}}\right) \]
      11. Applied rewrites30.9%

        \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right) \cdot \left(\left(\left(im \cdot im\right) \cdot im\right) \cdot im\right)}}\right) \]

      if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

      1. Initial program 100.0%

        \[e^{re} \cdot \sin im \]
      2. Taylor expanded in re around 0

        \[\leadsto \color{blue}{\sin im} \]
      3. Step-by-step derivation
        1. lower-sin.f6450.9%

          \[\leadsto \sin im \]
      4. Applied rewrites50.9%

        \[\leadsto \color{blue}{\sin im} \]
      5. Taylor expanded in im around 0

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

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

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

          \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
        4. lower-pow.f6429.8%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
      7. Applied rewrites29.8%

        \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
      8. Step-by-step derivation
        1. lift-+.f64N/A

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

          \[\leadsto im \cdot \left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \]
        3. flip-+N/A

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

          \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - \color{blue}{1}} \]
        5. lower-unsound--.f64N/A

          \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        6. lower-unsound-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        7. lift-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        8. *-commutativeN/A

          \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        9. lower-*.f64N/A

          \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        10. lift-pow.f64N/A

          \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        11. unpow2N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        12. lower-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        13. lift-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        14. *-commutativeN/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        15. lower-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        16. lift-pow.f64N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        17. unpow2N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        18. lower-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        19. lower-unsound-*.f64N/A

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
        20. lower-unsound--.f6427.0%

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{-0.16666666666666666 \cdot {im}^{2} - 1} \]
      9. Applied rewrites27.0%

        \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - \color{blue}{1}} \]
      10. Taylor expanded in im around 0

        \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]
      11. Step-by-step derivation
        1. Applied rewrites32.6%

          \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]

        if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

        1. Initial program 100.0%

          \[e^{re} \cdot \sin im \]
        2. Taylor expanded in im around 0

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto im \cdot \color{blue}{e^{re}} \]
          2. lower-exp.f6469.3%

            \[\leadsto im \cdot e^{re} \]
        4. Applied rewrites69.3%

          \[\leadsto \color{blue}{im \cdot e^{re}} \]
        5. Taylor expanded in re around 0

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

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

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

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

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

            \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot \color{blue}{re}\right)\right)\right) \]
          6. lower-*.f6439.7%

            \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \]
        7. Applied rewrites39.7%

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

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

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

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

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

            \[\leadsto im \cdot \left(1 + \left(1 \cdot re - \left(\mathsf{neg}\left(\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re\right)\right)\right)\right) \]
          6. *-lft-identityN/A

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

            \[\leadsto im \cdot \left(\left(1 + re\right) - \left(\mathsf{neg}\left(\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re\right)\right)\right) \]
          8. add-flipN/A

            \[\leadsto im \cdot \left(\left(1 + re\right) + \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot \color{blue}{re}\right) \]
          9. sum-to-multN/A

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

            \[\leadsto im \cdot \left(\left(1 + \frac{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re}{1 + re}\right) \cdot \left(1 + \color{blue}{re}\right)\right) \]
        9. Applied rewrites39.7%

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

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

            \[\leadsto im \cdot \left(\left(1 + \frac{\left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re}{1 + re}\right) \cdot \left(1 + re\right)\right) \]
          3. lift-/.f64N/A

            \[\leadsto im \cdot \left(\left(1 + \frac{\left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re}{1 + re}\right) \cdot \left(1 + re\right)\right) \]
          4. add-to-fractionN/A

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

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

            \[\leadsto im \cdot \frac{\left(1 \cdot \left(1 + re\right) + \left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re\right) \cdot \left(1 + re\right)}{1 + \color{blue}{re}} \]
        11. Applied rewrites40.7%

          \[\leadsto im \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - \color{blue}{-1}} \]
      12. Recombined 3 regimes into one program.
      13. Add Preprocessing

      Alternative 7: 52.0% accurate, 0.4× speedup?

      \[\begin{array}{l} t_0 := \left|im\right| \cdot \left|im\right|\\ t_1 := e^{re} \cdot \sin \left(\left|im\right|\right)\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -0.1:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_0 \cdot -0.16666666666666666 - 1}\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - -1}\\ \end{array} \end{array} \]
      (FPCore (re im)
        :precision binary64
        (let* ((t_0 (* (fabs im) (fabs im)))
             (t_1 (* (exp re) (sin (fabs im)))))
        (*
         (copysign 1.0 im)
         (if (<= t_1 -0.1)
           (* (fabs im) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
           (if (<= t_1 0.0)
             (* (fabs im) (/ -1.0 (- (* t_0 -0.16666666666666666) 1.0)))
             (*
              (fabs im)
              (/
               (*
                (-
                 (- re -1.0)
                 (* (- -0.5 (* 0.16666666666666666 re)) (* re re)))
                (- re -1.0))
               (- re -1.0))))))))
      double code(double re, double im) {
      	double t_0 = fabs(im) * fabs(im);
      	double t_1 = exp(re) * sin(fabs(im));
      	double tmp;
      	if (t_1 <= -0.1) {
      		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))));
      	} else if (t_1 <= 0.0) {
      		tmp = fabs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
      	} else {
      		tmp = fabs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
      	}
      	return copysign(1.0, im) * tmp;
      }
      
      public static double code(double re, double im) {
      	double t_0 = Math.abs(im) * Math.abs(im);
      	double t_1 = Math.exp(re) * Math.sin(Math.abs(im));
      	double tmp;
      	if (t_1 <= -0.1) {
      		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))));
      	} else if (t_1 <= 0.0) {
      		tmp = Math.abs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
      	} else {
      		tmp = Math.abs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
      	}
      	return Math.copySign(1.0, im) * tmp;
      }
      
      def code(re, im):
      	t_0 = math.fabs(im) * math.fabs(im)
      	t_1 = math.exp(re) * math.sin(math.fabs(im))
      	tmp = 0
      	if t_1 <= -0.1:
      		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))
      	elif t_1 <= 0.0:
      		tmp = math.fabs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0))
      	else:
      		tmp = math.fabs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0))
      	return math.copysign(1.0, im) * tmp
      
      function code(re, im)
      	t_0 = Float64(abs(im) * abs(im))
      	t_1 = Float64(exp(re) * sin(abs(im)))
      	tmp = 0.0
      	if (t_1 <= -0.1)
      		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0)))));
      	elseif (t_1 <= 0.0)
      		tmp = Float64(abs(im) * Float64(-1.0 / Float64(Float64(t_0 * -0.16666666666666666) - 1.0)));
      	else
      		tmp = Float64(abs(im) * Float64(Float64(Float64(Float64(re - -1.0) - Float64(Float64(-0.5 - Float64(0.16666666666666666 * re)) * Float64(re * re))) * Float64(re - -1.0)) / Float64(re - -1.0)));
      	end
      	return Float64(copysign(1.0, im) * tmp)
      end
      
      function tmp_2 = code(re, im)
      	t_0 = abs(im) * abs(im);
      	t_1 = exp(re) * sin(abs(im));
      	tmp = 0.0;
      	if (t_1 <= -0.1)
      		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))));
      	elseif (t_1 <= 0.0)
      		tmp = abs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
      	else
      		tmp = abs(im) * ((((re - -1.0) - ((-0.5 - (0.16666666666666666 * re)) * (re * re))) * (re - -1.0)) / (re - -1.0));
      	end
      	tmp_2 = (sign(im) * abs(1.0)) * tmp;
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, -0.1], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[Abs[im], $MachinePrecision] * N[(-1.0 / N[(N[(t$95$0 * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] * N[(N[(N[(N[(re - -1.0), $MachinePrecision] - N[(N[(-0.5 - N[(0.16666666666666666 * re), $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re - -1.0), $MachinePrecision]), $MachinePrecision] / N[(re - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
      
      \begin{array}{l}
      t_0 := \left|im\right| \cdot \left|im\right|\\
      t_1 := e^{re} \cdot \sin \left(\left|im\right|\right)\\
      \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
      \mathbf{if}\;t\_1 \leq -0.1:\\
      \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\\
      
      \mathbf{elif}\;t\_1 \leq 0:\\
      \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_0 \cdot -0.16666666666666666 - 1}\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|im\right| \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - -1}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

        1. Initial program 100.0%

          \[e^{re} \cdot \sin im \]
        2. Taylor expanded in re around 0

          \[\leadsto \color{blue}{\sin im} \]
        3. Step-by-step derivation
          1. lower-sin.f6450.9%

            \[\leadsto \sin im \]
        4. Applied rewrites50.9%

          \[\leadsto \color{blue}{\sin im} \]
        5. Taylor expanded in im around 0

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

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

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

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
          4. lower-pow.f6429.8%

            \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
        7. Applied rewrites29.8%

          \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
        8. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
          2. sqrt-unprodN/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
          3. lower-sqrt.f64N/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
          4. lower-*.f6430.2%

            \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
          5. lift-pow.f64N/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
          6. unpow2N/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
          7. lower-*.f6430.2%

            \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
          8. lift-pow.f64N/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
          9. unpow2N/A

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
          10. lower-*.f6430.2%

            \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
        9. Applied rewrites30.2%

          \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]

        if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

        1. Initial program 100.0%

          \[e^{re} \cdot \sin im \]
        2. Taylor expanded in re around 0

          \[\leadsto \color{blue}{\sin im} \]
        3. Step-by-step derivation
          1. lower-sin.f6450.9%

            \[\leadsto \sin im \]
        4. Applied rewrites50.9%

          \[\leadsto \color{blue}{\sin im} \]
        5. Taylor expanded in im around 0

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

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

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

            \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
          4. lower-pow.f6429.8%

            \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
        7. Applied rewrites29.8%

          \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
        8. Step-by-step derivation
          1. lift-+.f64N/A

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

            \[\leadsto im \cdot \left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \]
          3. flip-+N/A

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

            \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - \color{blue}{1}} \]
          5. lower-unsound--.f64N/A

            \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          6. lower-unsound-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          7. lift-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          8. *-commutativeN/A

            \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          9. lower-*.f64N/A

            \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          10. lift-pow.f64N/A

            \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          11. unpow2N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          12. lower-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          13. lift-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          14. *-commutativeN/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          15. lower-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          16. lift-pow.f64N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          17. unpow2N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          18. lower-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          19. lower-unsound-*.f64N/A

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
          20. lower-unsound--.f6427.0%

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{-0.16666666666666666 \cdot {im}^{2} - 1} \]
        9. Applied rewrites27.0%

          \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - \color{blue}{1}} \]
        10. Taylor expanded in im around 0

          \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]
        11. Step-by-step derivation
          1. Applied rewrites32.6%

            \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]

          if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

          1. Initial program 100.0%

            \[e^{re} \cdot \sin im \]
          2. Taylor expanded in im around 0

            \[\leadsto \color{blue}{im \cdot e^{re}} \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto im \cdot \color{blue}{e^{re}} \]
            2. lower-exp.f6469.3%

              \[\leadsto im \cdot e^{re} \]
          4. Applied rewrites69.3%

            \[\leadsto \color{blue}{im \cdot e^{re}} \]
          5. Taylor expanded in re around 0

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

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

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

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

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

              \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot \color{blue}{re}\right)\right)\right) \]
            6. lower-*.f6439.7%

              \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \]
          7. Applied rewrites39.7%

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

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

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

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

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

              \[\leadsto im \cdot \left(1 + \left(1 \cdot re - \left(\mathsf{neg}\left(\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re\right)\right)\right)\right) \]
            6. *-lft-identityN/A

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

              \[\leadsto im \cdot \left(\left(1 + re\right) - \left(\mathsf{neg}\left(\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re\right)\right)\right) \]
            8. add-flipN/A

              \[\leadsto im \cdot \left(\left(1 + re\right) + \left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot \color{blue}{re}\right) \]
            9. sum-to-multN/A

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

              \[\leadsto im \cdot \left(\left(1 + \frac{\left(re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot re\right)\right) \cdot re}{1 + re}\right) \cdot \left(1 + \color{blue}{re}\right)\right) \]
          9. Applied rewrites39.7%

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

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

              \[\leadsto im \cdot \left(\left(1 + \frac{\left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re}{1 + re}\right) \cdot \left(1 + re\right)\right) \]
            3. lift-/.f64N/A

              \[\leadsto im \cdot \left(\left(1 + \frac{\left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re}{1 + re}\right) \cdot \left(1 + re\right)\right) \]
            4. add-to-fractionN/A

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

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

              \[\leadsto im \cdot \frac{\left(1 \cdot \left(1 + re\right) + \left(\left(\frac{1}{6} \cdot re - \frac{-1}{2}\right) \cdot re\right) \cdot re\right) \cdot \left(1 + re\right)}{1 + \color{blue}{re}} \]
          11. Applied rewrites40.7%

            \[\leadsto im \cdot \frac{\left(\left(re - -1\right) - \left(-0.5 - 0.16666666666666666 \cdot re\right) \cdot \left(re \cdot re\right)\right) \cdot \left(re - -1\right)}{re - \color{blue}{-1}} \]
        12. Recombined 3 regimes into one program.
        13. Add Preprocessing

        Alternative 8: 51.0% accurate, 0.4× speedup?

        \[\begin{array}{l} t_0 := \left|im\right| \cdot \left|im\right|\\ t_1 := e^{re} \cdot \sin \left(\left|im\right|\right)\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \leq -0.1:\\ \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_0 \cdot -0.16666666666666666 - 1}\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right)\\ \end{array} \end{array} \]
        (FPCore (re im)
          :precision binary64
          (let* ((t_0 (* (fabs im) (fabs im)))
               (t_1 (* (exp re) (sin (fabs im)))))
          (*
           (copysign 1.0 im)
           (if (<= t_1 -0.1)
             (* (fabs im) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
             (if (<= t_1 0.0)
               (* (fabs im) (/ -1.0 (- (* t_0 -0.16666666666666666) 1.0)))
               (*
                (fabs im)
                (+
                 1.0
                 (*
                  re
                  (+ 1.0 (* re (+ 0.5 (* 0.16666666666666666 re))))))))))))
        double code(double re, double im) {
        	double t_0 = fabs(im) * fabs(im);
        	double t_1 = exp(re) * sin(fabs(im));
        	double tmp;
        	if (t_1 <= -0.1) {
        		tmp = fabs(im) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))));
        	} else if (t_1 <= 0.0) {
        		tmp = fabs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
        	} else {
        		tmp = fabs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))));
        	}
        	return copysign(1.0, im) * tmp;
        }
        
        public static double code(double re, double im) {
        	double t_0 = Math.abs(im) * Math.abs(im);
        	double t_1 = Math.exp(re) * Math.sin(Math.abs(im));
        	double tmp;
        	if (t_1 <= -0.1) {
        		tmp = Math.abs(im) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))));
        	} else if (t_1 <= 0.0) {
        		tmp = Math.abs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
        	} else {
        		tmp = Math.abs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))));
        	}
        	return Math.copySign(1.0, im) * tmp;
        }
        
        def code(re, im):
        	t_0 = math.fabs(im) * math.fabs(im)
        	t_1 = math.exp(re) * math.sin(math.fabs(im))
        	tmp = 0
        	if t_1 <= -0.1:
        		tmp = math.fabs(im) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))
        	elif t_1 <= 0.0:
        		tmp = math.fabs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0))
        	else:
        		tmp = math.fabs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))))
        	return math.copysign(1.0, im) * tmp
        
        function code(re, im)
        	t_0 = Float64(abs(im) * abs(im))
        	t_1 = Float64(exp(re) * sin(abs(im)))
        	tmp = 0.0
        	if (t_1 <= -0.1)
        		tmp = Float64(abs(im) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0)))));
        	elseif (t_1 <= 0.0)
        		tmp = Float64(abs(im) * Float64(-1.0 / Float64(Float64(t_0 * -0.16666666666666666) - 1.0)));
        	else
        		tmp = Float64(abs(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(0.16666666666666666 * re)))))));
        	end
        	return Float64(copysign(1.0, im) * tmp)
        end
        
        function tmp_2 = code(re, im)
        	t_0 = abs(im) * abs(im);
        	t_1 = exp(re) * sin(abs(im));
        	tmp = 0.0;
        	if (t_1 <= -0.1)
        		tmp = abs(im) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))));
        	elseif (t_1 <= 0.0)
        		tmp = abs(im) * (-1.0 / ((t_0 * -0.16666666666666666) - 1.0));
        	else
        		tmp = abs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))));
        	end
        	tmp_2 = (sign(im) * abs(1.0)) * tmp;
        end
        
        code[re_, im_] := Block[{t$95$0 = N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, -0.1], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[Abs[im], $MachinePrecision] * N[(-1.0 / N[(N[(t$95$0 * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(0.16666666666666666 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]]
        
        \begin{array}{l}
        t_0 := \left|im\right| \cdot \left|im\right|\\
        t_1 := e^{re} \cdot \sin \left(\left|im\right|\right)\\
        \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
        \mathbf{if}\;t\_1 \leq -0.1:\\
        \;\;\;\;\left|im\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\\
        
        \mathbf{elif}\;t\_1 \leq 0:\\
        \;\;\;\;\left|im\right| \cdot \frac{-1}{t\_0 \cdot -0.16666666666666666 - 1}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left|im\right| \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

          1. Initial program 100.0%

            \[e^{re} \cdot \sin im \]
          2. Taylor expanded in re around 0

            \[\leadsto \color{blue}{\sin im} \]
          3. Step-by-step derivation
            1. lower-sin.f6450.9%

              \[\leadsto \sin im \]
          4. Applied rewrites50.9%

            \[\leadsto \color{blue}{\sin im} \]
          5. Taylor expanded in im around 0

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

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

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

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
            4. lower-pow.f6429.8%

              \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
          7. Applied rewrites29.8%

            \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
          8. Step-by-step derivation
            1. rem-square-sqrtN/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
            2. sqrt-unprodN/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
            3. lower-sqrt.f64N/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
            4. lower-*.f6430.2%

              \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
            5. lift-pow.f64N/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
            6. unpow2N/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
            7. lower-*.f6430.2%

              \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
            8. lift-pow.f64N/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
            9. unpow2N/A

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
            10. lower-*.f6430.2%

              \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
          9. Applied rewrites30.2%

            \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]

          if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

          1. Initial program 100.0%

            \[e^{re} \cdot \sin im \]
          2. Taylor expanded in re around 0

            \[\leadsto \color{blue}{\sin im} \]
          3. Step-by-step derivation
            1. lower-sin.f6450.9%

              \[\leadsto \sin im \]
          4. Applied rewrites50.9%

            \[\leadsto \color{blue}{\sin im} \]
          5. Taylor expanded in im around 0

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

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

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

              \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
            4. lower-pow.f6429.8%

              \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
          7. Applied rewrites29.8%

            \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
          8. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto im \cdot \left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \]
            3. flip-+N/A

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

              \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - \color{blue}{1}} \]
            5. lower-unsound--.f64N/A

              \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            6. lower-unsound-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            7. lift-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            8. *-commutativeN/A

              \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            9. lower-*.f64N/A

              \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            10. lift-pow.f64N/A

              \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            11. unpow2N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            12. lower-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            13. lift-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            14. *-commutativeN/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            15. lower-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            16. lift-pow.f64N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            17. unpow2N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            18. lower-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            19. lower-unsound-*.f64N/A

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
            20. lower-unsound--.f6427.0%

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{-0.16666666666666666 \cdot {im}^{2} - 1} \]
          9. Applied rewrites27.0%

            \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - \color{blue}{1}} \]
          10. Taylor expanded in im around 0

            \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]
          11. Step-by-step derivation
            1. Applied rewrites32.6%

              \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]

            if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

            1. Initial program 100.0%

              \[e^{re} \cdot \sin im \]
            2. Taylor expanded in im around 0

              \[\leadsto \color{blue}{im \cdot e^{re}} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto im \cdot \color{blue}{e^{re}} \]
              2. lower-exp.f6469.3%

                \[\leadsto im \cdot e^{re} \]
            4. Applied rewrites69.3%

              \[\leadsto \color{blue}{im \cdot e^{re}} \]
            5. Taylor expanded in re around 0

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

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

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

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

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

                \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot \color{blue}{re}\right)\right)\right) \]
              6. lower-*.f6439.7%

                \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \]
            7. Applied rewrites39.7%

              \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)}\right) \]
          12. Recombined 3 regimes into one program.
          13. Add Preprocessing

          Alternative 9: 50.5% accurate, 0.4× speedup?

          \[\begin{array}{l} t_0 := e^{re} \cdot \sin \left(\left|im\right|\right)\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.1:\\ \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left|im\right| \cdot \frac{-1}{\left(\left|im\right| \cdot \left|im\right|\right) \cdot -0.16666666666666666 - 1}\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
            :precision binary64
            (let* ((t_0 (* (exp re) (sin (fabs im)))))
            (*
             (copysign 1.0 im)
             (if (<= t_0 -0.1)
               (*
                (fabs im)
                (+ 1.0 (* (* -0.16666666666666666 (fabs im)) (fabs im))))
               (if (<= t_0 0.0)
                 (*
                  (fabs im)
                  (/
                   -1.0
                   (- (* (* (fabs im) (fabs im)) -0.16666666666666666) 1.0)))
                 (*
                  (fabs im)
                  (+
                   1.0
                   (*
                    re
                    (+ 1.0 (* re (+ 0.5 (* 0.16666666666666666 re))))))))))))
          double code(double re, double im) {
          	double t_0 = exp(re) * sin(fabs(im));
          	double tmp;
          	if (t_0 <= -0.1) {
          		tmp = fabs(im) * (1.0 + ((-0.16666666666666666 * fabs(im)) * fabs(im)));
          	} else if (t_0 <= 0.0) {
          		tmp = fabs(im) * (-1.0 / (((fabs(im) * fabs(im)) * -0.16666666666666666) - 1.0));
          	} else {
          		tmp = fabs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))));
          	}
          	return copysign(1.0, im) * tmp;
          }
          
          public static double code(double re, double im) {
          	double t_0 = Math.exp(re) * Math.sin(Math.abs(im));
          	double tmp;
          	if (t_0 <= -0.1) {
          		tmp = Math.abs(im) * (1.0 + ((-0.16666666666666666 * Math.abs(im)) * Math.abs(im)));
          	} else if (t_0 <= 0.0) {
          		tmp = Math.abs(im) * (-1.0 / (((Math.abs(im) * Math.abs(im)) * -0.16666666666666666) - 1.0));
          	} else {
          		tmp = Math.abs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))));
          	}
          	return Math.copySign(1.0, im) * tmp;
          }
          
          def code(re, im):
          	t_0 = math.exp(re) * math.sin(math.fabs(im))
          	tmp = 0
          	if t_0 <= -0.1:
          		tmp = math.fabs(im) * (1.0 + ((-0.16666666666666666 * math.fabs(im)) * math.fabs(im)))
          	elif t_0 <= 0.0:
          		tmp = math.fabs(im) * (-1.0 / (((math.fabs(im) * math.fabs(im)) * -0.16666666666666666) - 1.0))
          	else:
          		tmp = math.fabs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))))
          	return math.copysign(1.0, im) * tmp
          
          function code(re, im)
          	t_0 = Float64(exp(re) * sin(abs(im)))
          	tmp = 0.0
          	if (t_0 <= -0.1)
          		tmp = Float64(abs(im) * Float64(1.0 + Float64(Float64(-0.16666666666666666 * abs(im)) * abs(im))));
          	elseif (t_0 <= 0.0)
          		tmp = Float64(abs(im) * Float64(-1.0 / Float64(Float64(Float64(abs(im) * abs(im)) * -0.16666666666666666) - 1.0)));
          	else
          		tmp = Float64(abs(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(re * Float64(0.5 + Float64(0.16666666666666666 * re)))))));
          	end
          	return Float64(copysign(1.0, im) * tmp)
          end
          
          function tmp_2 = code(re, im)
          	t_0 = exp(re) * sin(abs(im));
          	tmp = 0.0;
          	if (t_0 <= -0.1)
          		tmp = abs(im) * (1.0 + ((-0.16666666666666666 * abs(im)) * abs(im)));
          	elseif (t_0 <= 0.0)
          		tmp = abs(im) * (-1.0 / (((abs(im) * abs(im)) * -0.16666666666666666) - 1.0));
          	else
          		tmp = abs(im) * (1.0 + (re * (1.0 + (re * (0.5 + (0.16666666666666666 * re))))));
          	end
          	tmp_2 = (sign(im) * abs(1.0)) * tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, -0.1], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(N[(-0.16666666666666666 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[Abs[im], $MachinePrecision] * N[(-1.0 / N[(N[(N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(re * N[(0.5 + N[(0.16666666666666666 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
          
          \begin{array}{l}
          t_0 := e^{re} \cdot \sin \left(\left|im\right|\right)\\
          \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
          \mathbf{if}\;t\_0 \leq -0.1:\\
          \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\
          
          \mathbf{elif}\;t\_0 \leq 0:\\
          \;\;\;\;\left|im\right| \cdot \frac{-1}{\left(\left|im\right| \cdot \left|im\right|\right) \cdot -0.16666666666666666 - 1}\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|im\right| \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

            1. Initial program 100.0%

              \[e^{re} \cdot \sin im \]
            2. Taylor expanded in re around 0

              \[\leadsto \color{blue}{\sin im} \]
            3. Step-by-step derivation
              1. lower-sin.f6450.9%

                \[\leadsto \sin im \]
            4. Applied rewrites50.9%

              \[\leadsto \color{blue}{\sin im} \]
            5. Taylor expanded in im around 0

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

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

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

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
              4. lower-pow.f6429.8%

                \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
            7. Applied rewrites29.8%

              \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
            8. Step-by-step derivation
              1. rem-square-sqrtN/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
              2. sqrt-unprodN/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
              3. lower-sqrt.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
              4. lower-*.f6430.2%

                \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
              5. lift-pow.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
              6. unpow2N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
              7. lower-*.f6430.2%

                \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
              8. lift-pow.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
              9. unpow2N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
              10. lower-*.f6430.2%

                \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
            9. Applied rewrites30.2%

              \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
            10. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
              2. lift-sqrt.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
              3. lift-*.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
              4. rem-sqrt-squareN/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
              5. lift-*.f64N/A

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
              6. fabs-sqrN/A

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

                \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
              8. *-commutativeN/A

                \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
              9. lower-*.f64N/A

                \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
              10. *-commutativeN/A

                \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
              11. lower-*.f6429.8%

                \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]
            11. Applied rewrites29.8%

              \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]

            if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

            1. Initial program 100.0%

              \[e^{re} \cdot \sin im \]
            2. Taylor expanded in re around 0

              \[\leadsto \color{blue}{\sin im} \]
            3. Step-by-step derivation
              1. lower-sin.f6450.9%

                \[\leadsto \sin im \]
            4. Applied rewrites50.9%

              \[\leadsto \color{blue}{\sin im} \]
            5. Taylor expanded in im around 0

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

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

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

                \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
              4. lower-pow.f6429.8%

                \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
            7. Applied rewrites29.8%

              \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
            8. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto im \cdot \left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \]
              3. flip-+N/A

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

                \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - \color{blue}{1}} \]
              5. lower-unsound--.f64N/A

                \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              6. lower-unsound-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              7. lift-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              8. *-commutativeN/A

                \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              9. lower-*.f64N/A

                \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              10. lift-pow.f64N/A

                \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              11. unpow2N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              12. lower-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              13. lift-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              14. *-commutativeN/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              15. lower-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              16. lift-pow.f64N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              17. unpow2N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              18. lower-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              19. lower-unsound-*.f64N/A

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
              20. lower-unsound--.f6427.0%

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{-0.16666666666666666 \cdot {im}^{2} - 1} \]
            9. Applied rewrites27.0%

              \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - \color{blue}{1}} \]
            10. Taylor expanded in im around 0

              \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]
            11. Step-by-step derivation
              1. Applied rewrites32.6%

                \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]

              if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

              1. Initial program 100.0%

                \[e^{re} \cdot \sin im \]
              2. Taylor expanded in im around 0

                \[\leadsto \color{blue}{im \cdot e^{re}} \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto im \cdot \color{blue}{e^{re}} \]
                2. lower-exp.f6469.3%

                  \[\leadsto im \cdot e^{re} \]
              4. Applied rewrites69.3%

                \[\leadsto \color{blue}{im \cdot e^{re}} \]
              5. Taylor expanded in re around 0

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

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

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

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

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

                  \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot \color{blue}{re}\right)\right)\right) \]
                6. lower-*.f6439.7%

                  \[\leadsto im \cdot \left(1 + re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)\right) \]
              7. Applied rewrites39.7%

                \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + re \cdot \left(0.5 + 0.16666666666666666 \cdot re\right)\right)}\right) \]
            12. Recombined 3 regimes into one program.
            13. Add Preprocessing

            Alternative 10: 47.8% accurate, 0.4× speedup?

            \[\begin{array}{l} t_0 := e^{re} \cdot \sin \left(\left|im\right|\right)\\ \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.1:\\ \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\ \mathbf{elif}\;t\_0 \leq 0:\\ \;\;\;\;\left|im\right| \cdot \frac{-1}{\left(\left|im\right| \cdot \left|im\right|\right) \cdot -0.16666666666666666 - 1}\\ \mathbf{else}:\\ \;\;\;\;\left(1 + re\right) \cdot \left|im\right| - \left(-0.5 \cdot \left|im\right|\right) \cdot \left(re \cdot re\right)\\ \end{array} \end{array} \]
            (FPCore (re im)
              :precision binary64
              (let* ((t_0 (* (exp re) (sin (fabs im)))))
              (*
               (copysign 1.0 im)
               (if (<= t_0 -0.1)
                 (*
                  (fabs im)
                  (+ 1.0 (* (* -0.16666666666666666 (fabs im)) (fabs im))))
                 (if (<= t_0 0.0)
                   (*
                    (fabs im)
                    (/
                     -1.0
                     (- (* (* (fabs im) (fabs im)) -0.16666666666666666) 1.0)))
                   (-
                    (* (+ 1.0 re) (fabs im))
                    (* (* -0.5 (fabs im)) (* re re))))))))
            double code(double re, double im) {
            	double t_0 = exp(re) * sin(fabs(im));
            	double tmp;
            	if (t_0 <= -0.1) {
            		tmp = fabs(im) * (1.0 + ((-0.16666666666666666 * fabs(im)) * fabs(im)));
            	} else if (t_0 <= 0.0) {
            		tmp = fabs(im) * (-1.0 / (((fabs(im) * fabs(im)) * -0.16666666666666666) - 1.0));
            	} else {
            		tmp = ((1.0 + re) * fabs(im)) - ((-0.5 * fabs(im)) * (re * re));
            	}
            	return copysign(1.0, im) * tmp;
            }
            
            public static double code(double re, double im) {
            	double t_0 = Math.exp(re) * Math.sin(Math.abs(im));
            	double tmp;
            	if (t_0 <= -0.1) {
            		tmp = Math.abs(im) * (1.0 + ((-0.16666666666666666 * Math.abs(im)) * Math.abs(im)));
            	} else if (t_0 <= 0.0) {
            		tmp = Math.abs(im) * (-1.0 / (((Math.abs(im) * Math.abs(im)) * -0.16666666666666666) - 1.0));
            	} else {
            		tmp = ((1.0 + re) * Math.abs(im)) - ((-0.5 * Math.abs(im)) * (re * re));
            	}
            	return Math.copySign(1.0, im) * tmp;
            }
            
            def code(re, im):
            	t_0 = math.exp(re) * math.sin(math.fabs(im))
            	tmp = 0
            	if t_0 <= -0.1:
            		tmp = math.fabs(im) * (1.0 + ((-0.16666666666666666 * math.fabs(im)) * math.fabs(im)))
            	elif t_0 <= 0.0:
            		tmp = math.fabs(im) * (-1.0 / (((math.fabs(im) * math.fabs(im)) * -0.16666666666666666) - 1.0))
            	else:
            		tmp = ((1.0 + re) * math.fabs(im)) - ((-0.5 * math.fabs(im)) * (re * re))
            	return math.copysign(1.0, im) * tmp
            
            function code(re, im)
            	t_0 = Float64(exp(re) * sin(abs(im)))
            	tmp = 0.0
            	if (t_0 <= -0.1)
            		tmp = Float64(abs(im) * Float64(1.0 + Float64(Float64(-0.16666666666666666 * abs(im)) * abs(im))));
            	elseif (t_0 <= 0.0)
            		tmp = Float64(abs(im) * Float64(-1.0 / Float64(Float64(Float64(abs(im) * abs(im)) * -0.16666666666666666) - 1.0)));
            	else
            		tmp = Float64(Float64(Float64(1.0 + re) * abs(im)) - Float64(Float64(-0.5 * abs(im)) * Float64(re * re)));
            	end
            	return Float64(copysign(1.0, im) * tmp)
            end
            
            function tmp_2 = code(re, im)
            	t_0 = exp(re) * sin(abs(im));
            	tmp = 0.0;
            	if (t_0 <= -0.1)
            		tmp = abs(im) * (1.0 + ((-0.16666666666666666 * abs(im)) * abs(im)));
            	elseif (t_0 <= 0.0)
            		tmp = abs(im) * (-1.0 / (((abs(im) * abs(im)) * -0.16666666666666666) - 1.0));
            	else
            		tmp = ((1.0 + re) * abs(im)) - ((-0.5 * abs(im)) * (re * re));
            	end
            	tmp_2 = (sign(im) * abs(1.0)) * tmp;
            end
            
            code[re_, im_] := Block[{t$95$0 = N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$0, -0.1], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(N[(-0.16666666666666666 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 0.0], N[(N[Abs[im], $MachinePrecision] * N[(-1.0 / N[(N[(N[(N[Abs[im], $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + re), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.5 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
            
            \begin{array}{l}
            t_0 := e^{re} \cdot \sin \left(\left|im\right|\right)\\
            \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
            \mathbf{if}\;t\_0 \leq -0.1:\\
            \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\
            
            \mathbf{elif}\;t\_0 \leq 0:\\
            \;\;\;\;\left|im\right| \cdot \frac{-1}{\left(\left|im\right| \cdot \left|im\right|\right) \cdot -0.16666666666666666 - 1}\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(1 + re\right) \cdot \left|im\right| - \left(-0.5 \cdot \left|im\right|\right) \cdot \left(re \cdot re\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if (*.f64 (exp.f64 re) (sin.f64 im)) < -0.10000000000000001

              1. Initial program 100.0%

                \[e^{re} \cdot \sin im \]
              2. Taylor expanded in re around 0

                \[\leadsto \color{blue}{\sin im} \]
              3. Step-by-step derivation
                1. lower-sin.f6450.9%

                  \[\leadsto \sin im \]
              4. Applied rewrites50.9%

                \[\leadsto \color{blue}{\sin im} \]
              5. Taylor expanded in im around 0

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

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

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

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
                4. lower-pow.f6429.8%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
              7. Applied rewrites29.8%

                \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
              8. Step-by-step derivation
                1. rem-square-sqrtN/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
                2. sqrt-unprodN/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                3. lower-sqrt.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                4. lower-*.f6430.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                5. lift-pow.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                6. unpow2N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                7. lower-*.f6430.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                8. lift-pow.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                9. unpow2N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                10. lower-*.f6430.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
              9. Applied rewrites30.2%

                \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
              10. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                2. lift-sqrt.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                3. lift-*.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                4. rem-sqrt-squareN/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                5. lift-*.f64N/A

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                6. fabs-sqrN/A

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

                  \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                8. *-commutativeN/A

                  \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                9. lower-*.f64N/A

                  \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                10. *-commutativeN/A

                  \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                11. lower-*.f6429.8%

                  \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]
              11. Applied rewrites29.8%

                \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]

              if -0.10000000000000001 < (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

              1. Initial program 100.0%

                \[e^{re} \cdot \sin im \]
              2. Taylor expanded in re around 0

                \[\leadsto \color{blue}{\sin im} \]
              3. Step-by-step derivation
                1. lower-sin.f6450.9%

                  \[\leadsto \sin im \]
              4. Applied rewrites50.9%

                \[\leadsto \color{blue}{\sin im} \]
              5. Taylor expanded in im around 0

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

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

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

                  \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
                4. lower-pow.f6429.8%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
              7. Applied rewrites29.8%

                \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
              8. Step-by-step derivation
                1. lift-+.f64N/A

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

                  \[\leadsto im \cdot \left(\frac{-1}{6} \cdot {im}^{2} + 1\right) \]
                3. flip-+N/A

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

                  \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - \color{blue}{1}} \]
                5. lower-unsound--.f64N/A

                  \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                6. lower-unsound-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                7. lift-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\frac{-1}{6} \cdot {im}^{2}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                8. *-commutativeN/A

                  \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                9. lower-*.f64N/A

                  \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                10. lift-pow.f64N/A

                  \[\leadsto im \cdot \frac{\left({im}^{2} \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                11. unpow2N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                12. lower-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                13. lift-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\frac{-1}{6} \cdot {im}^{2}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                14. *-commutativeN/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                15. lower-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                16. lift-pow.f64N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left({im}^{2} \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                17. unpow2N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                18. lower-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                19. lower-unsound-*.f64N/A

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) \cdot \left(\left(im \cdot im\right) \cdot \frac{-1}{6}\right) - 1 \cdot 1}{\frac{-1}{6} \cdot {im}^{2} - 1} \]
                20. lower-unsound--.f6427.0%

                  \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{-0.16666666666666666 \cdot {im}^{2} - 1} \]
              9. Applied rewrites27.0%

                \[\leadsto im \cdot \frac{\left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) \cdot \left(\left(im \cdot im\right) \cdot -0.16666666666666666\right) - 1 \cdot 1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - \color{blue}{1}} \]
              10. Taylor expanded in im around 0

                \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]
              11. Step-by-step derivation
                1. Applied rewrites32.6%

                  \[\leadsto im \cdot \frac{-1}{\left(im \cdot im\right) \cdot -0.16666666666666666 - 1} \]

                if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto im \cdot \color{blue}{e^{re}} \]
                  2. lower-exp.f6469.3%

                    \[\leadsto im \cdot e^{re} \]
                4. Applied rewrites69.3%

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                5. Taylor expanded in re around 0

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

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

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

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

                    \[\leadsto im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot \color{blue}{re}\right)\right) \]
                  5. lower-*.f6434.0%

                    \[\leadsto im + re \cdot \left(im + 0.5 \cdot \left(im \cdot re\right)\right) \]
                7. Applied rewrites34.0%

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

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

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

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

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

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

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

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

                    \[\leadsto \left(im + im \cdot re\right) - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  9. lower--.f64N/A

                    \[\leadsto \left(im + im \cdot re\right) - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  10. lift-*.f64N/A

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

                    \[\leadsto \left(im + re \cdot im\right) - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  12. distribute-rgt1-inN/A

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  14. lower-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  15. lower-+.f64N/A

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right) \cdot re\right)\right) \]
                  17. distribute-lft-neg-outN/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right) \cdot re \]
                  18. lower-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right) \cdot re \]
                  19. lift-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right) \cdot re \]
                  20. distribute-lft-neg-outN/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left(im \cdot re\right)\right) \cdot re \]
                  21. lower-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left(im \cdot re\right)\right) \cdot re \]
                  22. metadata-eval33.9%

                    \[\leadsto \left(1 + re\right) \cdot im - \left(-0.5 \cdot \left(im \cdot re\right)\right) \cdot re \]
                9. Applied rewrites33.9%

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\frac{-1}{2} \cdot \left(im \cdot re\right)\right) \cdot re \]
                  2. lift-*.f64N/A

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

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

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

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

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\frac{-1}{2} \cdot im\right) \cdot \left(re \cdot re\right) \]
                  8. lower-*.f6436.9%

                    \[\leadsto \left(1 + re\right) \cdot im - \left(-0.5 \cdot im\right) \cdot \left(re \cdot re\right) \]
                11. Applied rewrites36.9%

                  \[\leadsto \left(1 + re\right) \cdot im - \left(-0.5 \cdot im\right) \cdot \left(re \cdot \color{blue}{re}\right) \]
              12. Recombined 3 regimes into one program.
              13. Add Preprocessing

              Alternative 11: 41.6% accurate, 0.6× speedup?

              \[\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\ \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\ \mathbf{else}:\\ \;\;\;\;\left(1 + re\right) \cdot \left|im\right| - \left(-0.5 \cdot \left|im\right|\right) \cdot \left(re \cdot re\right)\\ \end{array} \]
              (FPCore (re im)
                :precision binary64
                (*
               (copysign 1.0 im)
               (if (<= (* (exp re) (sin (fabs im))) 0.0)
                 (*
                  (fabs im)
                  (+ 1.0 (* (* -0.16666666666666666 (fabs im)) (fabs im))))
                 (- (* (+ 1.0 re) (fabs im)) (* (* -0.5 (fabs im)) (* re re))))))
              double code(double re, double im) {
              	double tmp;
              	if ((exp(re) * sin(fabs(im))) <= 0.0) {
              		tmp = fabs(im) * (1.0 + ((-0.16666666666666666 * fabs(im)) * fabs(im)));
              	} else {
              		tmp = ((1.0 + re) * fabs(im)) - ((-0.5 * fabs(im)) * (re * re));
              	}
              	return copysign(1.0, im) * tmp;
              }
              
              public static double code(double re, double im) {
              	double tmp;
              	if ((Math.exp(re) * Math.sin(Math.abs(im))) <= 0.0) {
              		tmp = Math.abs(im) * (1.0 + ((-0.16666666666666666 * Math.abs(im)) * Math.abs(im)));
              	} else {
              		tmp = ((1.0 + re) * Math.abs(im)) - ((-0.5 * Math.abs(im)) * (re * re));
              	}
              	return Math.copySign(1.0, im) * tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if (math.exp(re) * math.sin(math.fabs(im))) <= 0.0:
              		tmp = math.fabs(im) * (1.0 + ((-0.16666666666666666 * math.fabs(im)) * math.fabs(im)))
              	else:
              		tmp = ((1.0 + re) * math.fabs(im)) - ((-0.5 * math.fabs(im)) * (re * re))
              	return math.copysign(1.0, im) * tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (Float64(exp(re) * sin(abs(im))) <= 0.0)
              		tmp = Float64(abs(im) * Float64(1.0 + Float64(Float64(-0.16666666666666666 * abs(im)) * abs(im))));
              	else
              		tmp = Float64(Float64(Float64(1.0 + re) * abs(im)) - Float64(Float64(-0.5 * abs(im)) * Float64(re * re)));
              	end
              	return Float64(copysign(1.0, im) * tmp)
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if ((exp(re) * sin(abs(im))) <= 0.0)
              		tmp = abs(im) * (1.0 + ((-0.16666666666666666 * abs(im)) * abs(im)));
              	else
              		tmp = ((1.0 + re) * abs(im)) - ((-0.5 * abs(im)) * (re * re));
              	end
              	tmp_2 = (sign(im) * abs(1.0)) * tmp;
              end
              
              code[re_, im_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(N[(-0.16666666666666666 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 + re), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.5 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
              
              \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
              \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\
              \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(1 + re\right) \cdot \left|im\right| - \left(-0.5 \cdot \left|im\right|\right) \cdot \left(re \cdot re\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{\sin im} \]
                3. Step-by-step derivation
                  1. lower-sin.f6450.9%

                    \[\leadsto \sin im \]
                4. Applied rewrites50.9%

                  \[\leadsto \color{blue}{\sin im} \]
                5. Taylor expanded in im around 0

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

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

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

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
                  4. lower-pow.f6429.8%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
                7. Applied rewrites29.8%

                  \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
                8. Step-by-step derivation
                  1. rem-square-sqrtN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
                  2. sqrt-unprodN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  4. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  5. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  6. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  7. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  8. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  9. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  10. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                9. Applied rewrites30.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                10. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  3. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  4. rem-sqrt-squareN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  6. fabs-sqrN/A

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

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  8. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  9. lower-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  10. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  11. lower-*.f6429.8%

                    \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]
                11. Applied rewrites29.8%

                  \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]

                if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto im \cdot \color{blue}{e^{re}} \]
                  2. lower-exp.f6469.3%

                    \[\leadsto im \cdot e^{re} \]
                4. Applied rewrites69.3%

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                5. Taylor expanded in re around 0

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

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

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

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

                    \[\leadsto im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot \color{blue}{re}\right)\right) \]
                  5. lower-*.f6434.0%

                    \[\leadsto im + re \cdot \left(im + 0.5 \cdot \left(im \cdot re\right)\right) \]
                7. Applied rewrites34.0%

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

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

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

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

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

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

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

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

                    \[\leadsto \left(im + im \cdot re\right) - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  9. lower--.f64N/A

                    \[\leadsto \left(im + im \cdot re\right) - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  10. lift-*.f64N/A

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

                    \[\leadsto \left(im + re \cdot im\right) - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  12. distribute-rgt1-inN/A

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  14. lower-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(re \cdot \left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right)\right) \]
                  15. lower-+.f64N/A

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right) \cdot re\right)\right) \]
                  17. distribute-lft-neg-outN/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right) \cdot re \]
                  18. lower-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right) \cdot re \]
                  19. lift-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\mathsf{neg}\left(\frac{1}{2} \cdot \left(im \cdot re\right)\right)\right) \cdot re \]
                  20. distribute-lft-neg-outN/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left(im \cdot re\right)\right) \cdot re \]
                  21. lower-*.f64N/A

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\left(\mathsf{neg}\left(\frac{1}{2}\right)\right) \cdot \left(im \cdot re\right)\right) \cdot re \]
                  22. metadata-eval33.9%

                    \[\leadsto \left(1 + re\right) \cdot im - \left(-0.5 \cdot \left(im \cdot re\right)\right) \cdot re \]
                9. Applied rewrites33.9%

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\frac{-1}{2} \cdot \left(im \cdot re\right)\right) \cdot re \]
                  2. lift-*.f64N/A

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

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

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

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

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

                    \[\leadsto \left(1 + re\right) \cdot im - \left(\frac{-1}{2} \cdot im\right) \cdot \left(re \cdot re\right) \]
                  8. lower-*.f6436.9%

                    \[\leadsto \left(1 + re\right) \cdot im - \left(-0.5 \cdot im\right) \cdot \left(re \cdot re\right) \]
                11. Applied rewrites36.9%

                  \[\leadsto \left(1 + re\right) \cdot im - \left(-0.5 \cdot im\right) \cdot \left(re \cdot \color{blue}{re}\right) \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 12: 41.6% accurate, 0.6× speedup?

              \[\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\ \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| \cdot \left(1 + re \cdot \left(1 + 0.5 \cdot re\right)\right)\\ \end{array} \]
              (FPCore (re im)
                :precision binary64
                (*
               (copysign 1.0 im)
               (if (<= (* (exp re) (sin (fabs im))) 0.0)
                 (*
                  (fabs im)
                  (+ 1.0 (* (* -0.16666666666666666 (fabs im)) (fabs im))))
                 (* (fabs im) (+ 1.0 (* re (+ 1.0 (* 0.5 re))))))))
              double code(double re, double im) {
              	double tmp;
              	if ((exp(re) * sin(fabs(im))) <= 0.0) {
              		tmp = fabs(im) * (1.0 + ((-0.16666666666666666 * fabs(im)) * fabs(im)));
              	} else {
              		tmp = fabs(im) * (1.0 + (re * (1.0 + (0.5 * re))));
              	}
              	return copysign(1.0, im) * tmp;
              }
              
              public static double code(double re, double im) {
              	double tmp;
              	if ((Math.exp(re) * Math.sin(Math.abs(im))) <= 0.0) {
              		tmp = Math.abs(im) * (1.0 + ((-0.16666666666666666 * Math.abs(im)) * Math.abs(im)));
              	} else {
              		tmp = Math.abs(im) * (1.0 + (re * (1.0 + (0.5 * re))));
              	}
              	return Math.copySign(1.0, im) * tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if (math.exp(re) * math.sin(math.fabs(im))) <= 0.0:
              		tmp = math.fabs(im) * (1.0 + ((-0.16666666666666666 * math.fabs(im)) * math.fabs(im)))
              	else:
              		tmp = math.fabs(im) * (1.0 + (re * (1.0 + (0.5 * re))))
              	return math.copysign(1.0, im) * tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (Float64(exp(re) * sin(abs(im))) <= 0.0)
              		tmp = Float64(abs(im) * Float64(1.0 + Float64(Float64(-0.16666666666666666 * abs(im)) * abs(im))));
              	else
              		tmp = Float64(abs(im) * Float64(1.0 + Float64(re * Float64(1.0 + Float64(0.5 * re)))));
              	end
              	return Float64(copysign(1.0, im) * tmp)
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if ((exp(re) * sin(abs(im))) <= 0.0)
              		tmp = abs(im) * (1.0 + ((-0.16666666666666666 * abs(im)) * abs(im)));
              	else
              		tmp = abs(im) * (1.0 + (re * (1.0 + (0.5 * re))));
              	end
              	tmp_2 = (sign(im) * abs(1.0)) * tmp;
              end
              
              code[re_, im_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(N[(-0.16666666666666666 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(re * N[(1.0 + N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
              
              \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
              \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\
              \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|im\right| \cdot \left(1 + re \cdot \left(1 + 0.5 \cdot re\right)\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{\sin im} \]
                3. Step-by-step derivation
                  1. lower-sin.f6450.9%

                    \[\leadsto \sin im \]
                4. Applied rewrites50.9%

                  \[\leadsto \color{blue}{\sin im} \]
                5. Taylor expanded in im around 0

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

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

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

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
                  4. lower-pow.f6429.8%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
                7. Applied rewrites29.8%

                  \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
                8. Step-by-step derivation
                  1. rem-square-sqrtN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
                  2. sqrt-unprodN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  4. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  5. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  6. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  7. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  8. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  9. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  10. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                9. Applied rewrites30.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                10. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  3. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  4. rem-sqrt-squareN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  6. fabs-sqrN/A

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

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  8. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  9. lower-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  10. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  11. lower-*.f6429.8%

                    \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]
                11. Applied rewrites29.8%

                  \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]

                if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto im \cdot \color{blue}{e^{re}} \]
                  2. lower-exp.f6469.3%

                    \[\leadsto im \cdot e^{re} \]
                4. Applied rewrites69.3%

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                5. Taylor expanded in re around 0

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

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

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

                    \[\leadsto im \cdot \left(1 + re \cdot \left(1 + \frac{1}{2} \cdot \color{blue}{re}\right)\right) \]
                  4. lower-*.f6436.9%

                    \[\leadsto im \cdot \left(1 + re \cdot \left(1 + 0.5 \cdot re\right)\right) \]
                7. Applied rewrites36.9%

                  \[\leadsto im \cdot \left(1 + \color{blue}{re \cdot \left(1 + 0.5 \cdot re\right)}\right) \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 13: 38.7% accurate, 0.6× speedup?

              \[\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\ \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| + re \cdot \left(\left|im\right| + 0.5 \cdot \left(\left|im\right| \cdot re\right)\right)\\ \end{array} \]
              (FPCore (re im)
                :precision binary64
                (*
               (copysign 1.0 im)
               (if (<= (* (exp re) (sin (fabs im))) 0.0)
                 (*
                  (fabs im)
                  (+ 1.0 (* (* -0.16666666666666666 (fabs im)) (fabs im))))
                 (+ (fabs im) (* re (+ (fabs im) (* 0.5 (* (fabs im) re))))))))
              double code(double re, double im) {
              	double tmp;
              	if ((exp(re) * sin(fabs(im))) <= 0.0) {
              		tmp = fabs(im) * (1.0 + ((-0.16666666666666666 * fabs(im)) * fabs(im)));
              	} else {
              		tmp = fabs(im) + (re * (fabs(im) + (0.5 * (fabs(im) * re))));
              	}
              	return copysign(1.0, im) * tmp;
              }
              
              public static double code(double re, double im) {
              	double tmp;
              	if ((Math.exp(re) * Math.sin(Math.abs(im))) <= 0.0) {
              		tmp = Math.abs(im) * (1.0 + ((-0.16666666666666666 * Math.abs(im)) * Math.abs(im)));
              	} else {
              		tmp = Math.abs(im) + (re * (Math.abs(im) + (0.5 * (Math.abs(im) * re))));
              	}
              	return Math.copySign(1.0, im) * tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if (math.exp(re) * math.sin(math.fabs(im))) <= 0.0:
              		tmp = math.fabs(im) * (1.0 + ((-0.16666666666666666 * math.fabs(im)) * math.fabs(im)))
              	else:
              		tmp = math.fabs(im) + (re * (math.fabs(im) + (0.5 * (math.fabs(im) * re))))
              	return math.copysign(1.0, im) * tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (Float64(exp(re) * sin(abs(im))) <= 0.0)
              		tmp = Float64(abs(im) * Float64(1.0 + Float64(Float64(-0.16666666666666666 * abs(im)) * abs(im))));
              	else
              		tmp = Float64(abs(im) + Float64(re * Float64(abs(im) + Float64(0.5 * Float64(abs(im) * re)))));
              	end
              	return Float64(copysign(1.0, im) * tmp)
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if ((exp(re) * sin(abs(im))) <= 0.0)
              		tmp = abs(im) * (1.0 + ((-0.16666666666666666 * abs(im)) * abs(im)));
              	else
              		tmp = abs(im) + (re * (abs(im) + (0.5 * (abs(im) * re))));
              	end
              	tmp_2 = (sign(im) * abs(1.0)) * tmp;
              end
              
              code[re_, im_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(N[(-0.16666666666666666 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] + N[(re * N[(N[Abs[im], $MachinePrecision] + N[(0.5 * N[(N[Abs[im], $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
              
              \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
              \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\
              \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|im\right| + re \cdot \left(\left|im\right| + 0.5 \cdot \left(\left|im\right| \cdot re\right)\right)\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{\sin im} \]
                3. Step-by-step derivation
                  1. lower-sin.f6450.9%

                    \[\leadsto \sin im \]
                4. Applied rewrites50.9%

                  \[\leadsto \color{blue}{\sin im} \]
                5. Taylor expanded in im around 0

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

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

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

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
                  4. lower-pow.f6429.8%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
                7. Applied rewrites29.8%

                  \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
                8. Step-by-step derivation
                  1. rem-square-sqrtN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
                  2. sqrt-unprodN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  4. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  5. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  6. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  7. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  8. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  9. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  10. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                9. Applied rewrites30.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                10. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  3. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  4. rem-sqrt-squareN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  6. fabs-sqrN/A

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

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  8. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  9. lower-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  10. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  11. lower-*.f6429.8%

                    \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]
                11. Applied rewrites29.8%

                  \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]

                if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto im \cdot \color{blue}{e^{re}} \]
                  2. lower-exp.f6469.3%

                    \[\leadsto im \cdot e^{re} \]
                4. Applied rewrites69.3%

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                5. Taylor expanded in re around 0

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

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

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

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

                    \[\leadsto im + re \cdot \left(im + \frac{1}{2} \cdot \left(im \cdot \color{blue}{re}\right)\right) \]
                  5. lower-*.f6434.0%

                    \[\leadsto im + re \cdot \left(im + 0.5 \cdot \left(im \cdot re\right)\right) \]
                7. Applied rewrites34.0%

                  \[\leadsto im + \color{blue}{re \cdot \left(im + 0.5 \cdot \left(im \cdot re\right)\right)} \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 14: 34.0% accurate, 0.6× speedup?

              \[\mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l} \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\ \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\ \mathbf{else}:\\ \;\;\;\;\left|im\right| + \left|im\right| \cdot re\\ \end{array} \]
              (FPCore (re im)
                :precision binary64
                (*
               (copysign 1.0 im)
               (if (<= (* (exp re) (sin (fabs im))) 0.0)
                 (*
                  (fabs im)
                  (+ 1.0 (* (* -0.16666666666666666 (fabs im)) (fabs im))))
                 (+ (fabs im) (* (fabs im) re)))))
              double code(double re, double im) {
              	double tmp;
              	if ((exp(re) * sin(fabs(im))) <= 0.0) {
              		tmp = fabs(im) * (1.0 + ((-0.16666666666666666 * fabs(im)) * fabs(im)));
              	} else {
              		tmp = fabs(im) + (fabs(im) * re);
              	}
              	return copysign(1.0, im) * tmp;
              }
              
              public static double code(double re, double im) {
              	double tmp;
              	if ((Math.exp(re) * Math.sin(Math.abs(im))) <= 0.0) {
              		tmp = Math.abs(im) * (1.0 + ((-0.16666666666666666 * Math.abs(im)) * Math.abs(im)));
              	} else {
              		tmp = Math.abs(im) + (Math.abs(im) * re);
              	}
              	return Math.copySign(1.0, im) * tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if (math.exp(re) * math.sin(math.fabs(im))) <= 0.0:
              		tmp = math.fabs(im) * (1.0 + ((-0.16666666666666666 * math.fabs(im)) * math.fabs(im)))
              	else:
              		tmp = math.fabs(im) + (math.fabs(im) * re)
              	return math.copysign(1.0, im) * tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (Float64(exp(re) * sin(abs(im))) <= 0.0)
              		tmp = Float64(abs(im) * Float64(1.0 + Float64(Float64(-0.16666666666666666 * abs(im)) * abs(im))));
              	else
              		tmp = Float64(abs(im) + Float64(abs(im) * re));
              	end
              	return Float64(copysign(1.0, im) * tmp)
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if ((exp(re) * sin(abs(im))) <= 0.0)
              		tmp = abs(im) * (1.0 + ((-0.16666666666666666 * abs(im)) * abs(im)));
              	else
              		tmp = abs(im) + (abs(im) * re);
              	end
              	tmp_2 = (sign(im) * abs(1.0)) * tmp;
              end
              
              code[re_, im_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Exp[re], $MachinePrecision] * N[Sin[N[Abs[im], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], N[(N[Abs[im], $MachinePrecision] * N[(1.0 + N[(N[(-0.16666666666666666 * N[Abs[im], $MachinePrecision]), $MachinePrecision] * N[Abs[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Abs[im], $MachinePrecision] + N[(N[Abs[im], $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
              
              \mathsf{copysign}\left(1, im\right) \cdot \begin{array}{l}
              \mathbf{if}\;e^{re} \cdot \sin \left(\left|im\right|\right) \leq 0:\\
              \;\;\;\;\left|im\right| \cdot \left(1 + \left(-0.16666666666666666 \cdot \left|im\right|\right) \cdot \left|im\right|\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|im\right| + \left|im\right| \cdot re\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 (exp.f64 re) (sin.f64 im)) < 0.0

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{\sin im} \]
                3. Step-by-step derivation
                  1. lower-sin.f6450.9%

                    \[\leadsto \sin im \]
                4. Applied rewrites50.9%

                  \[\leadsto \color{blue}{\sin im} \]
                5. Taylor expanded in im around 0

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

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

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

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot {im}^{\color{blue}{2}}\right) \]
                  4. lower-pow.f6429.8%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot {im}^{2}\right) \]
                7. Applied rewrites29.8%

                  \[\leadsto im \cdot \color{blue}{\left(1 + -0.16666666666666666 \cdot {im}^{2}\right)} \]
                8. Step-by-step derivation
                  1. rem-square-sqrtN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{im}^{2}} \cdot \sqrt{{im}^{2}}\right)\right) \]
                  2. sqrt-unprodN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  3. lower-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  4. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  5. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{im}^{2} \cdot {im}^{2}}\right) \]
                  6. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  7. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  8. lift-pow.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot {im}^{2}}\right) \]
                  9. unpow2N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  10. lower-*.f6430.2%

                    \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                9. Applied rewrites30.2%

                  \[\leadsto im \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                10. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  3. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(im \cdot im\right) \cdot \left(im \cdot im\right)}\right) \]
                  4. rem-sqrt-squareN/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  5. lift-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \frac{-1}{6} \cdot \left|im \cdot im\right|\right) \]
                  6. fabs-sqrN/A

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

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  8. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  9. lower-*.f64N/A

                    \[\leadsto im \cdot \left(1 + \left(im \cdot \frac{-1}{6}\right) \cdot im\right) \]
                  10. *-commutativeN/A

                    \[\leadsto im \cdot \left(1 + \left(\frac{-1}{6} \cdot im\right) \cdot im\right) \]
                  11. lower-*.f6429.8%

                    \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]
                11. Applied rewrites29.8%

                  \[\leadsto im \cdot \left(1 + \left(-0.16666666666666666 \cdot im\right) \cdot im\right) \]

                if 0.0 < (*.f64 (exp.f64 re) (sin.f64 im))

                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto im \cdot \color{blue}{e^{re}} \]
                  2. lower-exp.f6469.3%

                    \[\leadsto im \cdot e^{re} \]
                4. Applied rewrites69.3%

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                5. Taylor expanded in re around 0

                  \[\leadsto im \]
                6. Step-by-step derivation
                  1. Applied rewrites26.4%

                    \[\leadsto im \]
                  2. Taylor expanded in re around 0

                    \[\leadsto im + \color{blue}{im \cdot re} \]
                  3. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto im + im \cdot \color{blue}{re} \]
                    2. lower-*.f6429.4%

                      \[\leadsto im + im \cdot re \]
                  4. Applied rewrites29.4%

                    \[\leadsto im + \color{blue}{im \cdot re} \]
                7. Recombined 2 regimes into one program.
                8. Add Preprocessing

                Alternative 15: 29.4% accurate, 22.9× speedup?

                \[im + im \cdot re \]
                (FPCore (re im)
                  :precision binary64
                  (+ im (* im re)))
                double code(double re, double im) {
                	return im + (im * re);
                }
                
                module fmin_fmax_functions
                    implicit none
                    private
                    public fmax
                    public fmin
                
                    interface fmax
                        module procedure fmax88
                        module procedure fmax44
                        module procedure fmax84
                        module procedure fmax48
                    end interface
                    interface fmin
                        module procedure fmin88
                        module procedure fmin44
                        module procedure fmin84
                        module procedure fmin48
                    end interface
                contains
                    real(8) function fmax88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmax44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmax84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmax48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                    end function
                    real(8) function fmin88(x, y) result (res)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(4) function fmin44(x, y) result (res)
                        real(4), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                    end function
                    real(8) function fmin84(x, y) result(res)
                        real(8), intent (in) :: x
                        real(4), intent (in) :: y
                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                    end function
                    real(8) function fmin48(x, y) result(res)
                        real(4), intent (in) :: x
                        real(8), intent (in) :: y
                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                    end function
                end module
                
                real(8) function code(re, im)
                use fmin_fmax_functions
                    real(8), intent (in) :: re
                    real(8), intent (in) :: im
                    code = im + (im * re)
                end function
                
                public static double code(double re, double im) {
                	return im + (im * re);
                }
                
                def code(re, im):
                	return im + (im * re)
                
                function code(re, im)
                	return Float64(im + Float64(im * re))
                end
                
                function tmp = code(re, im)
                	tmp = im + (im * re);
                end
                
                code[re_, im_] := N[(im + N[(im * re), $MachinePrecision]), $MachinePrecision]
                
                im + im \cdot re
                
                Derivation
                1. Initial program 100.0%

                  \[e^{re} \cdot \sin im \]
                2. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto im \cdot \color{blue}{e^{re}} \]
                  2. lower-exp.f6469.3%

                    \[\leadsto im \cdot e^{re} \]
                4. Applied rewrites69.3%

                  \[\leadsto \color{blue}{im \cdot e^{re}} \]
                5. Taylor expanded in re around 0

                  \[\leadsto im \]
                6. Step-by-step derivation
                  1. Applied rewrites26.4%

                    \[\leadsto im \]
                  2. Taylor expanded in re around 0

                    \[\leadsto im + \color{blue}{im \cdot re} \]
                  3. Step-by-step derivation
                    1. lower-+.f64N/A

                      \[\leadsto im + im \cdot \color{blue}{re} \]
                    2. lower-*.f6429.4%

                      \[\leadsto im + im \cdot re \]
                  4. Applied rewrites29.4%

                    \[\leadsto im + \color{blue}{im \cdot re} \]
                  5. Add Preprocessing

                  Alternative 16: 26.4% accurate, 206.0× speedup?

                  \[im \]
                  (FPCore (re im)
                    :precision binary64
                    im)
                  double code(double re, double im) {
                  	return im;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(re, im)
                  use fmin_fmax_functions
                      real(8), intent (in) :: re
                      real(8), intent (in) :: im
                      code = im
                  end function
                  
                  public static double code(double re, double im) {
                  	return im;
                  }
                  
                  def code(re, im):
                  	return im
                  
                  function code(re, im)
                  	return im
                  end
                  
                  function tmp = code(re, im)
                  	tmp = im;
                  end
                  
                  code[re_, im_] := im
                  
                  im
                  
                  Derivation
                  1. Initial program 100.0%

                    \[e^{re} \cdot \sin im \]
                  2. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{im \cdot e^{re}} \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto im \cdot \color{blue}{e^{re}} \]
                    2. lower-exp.f6469.3%

                      \[\leadsto im \cdot e^{re} \]
                  4. Applied rewrites69.3%

                    \[\leadsto \color{blue}{im \cdot e^{re}} \]
                  5. Taylor expanded in re around 0

                    \[\leadsto im \]
                  6. Step-by-step derivation
                    1. Applied rewrites26.4%

                      \[\leadsto im \]
                    2. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2025258 
                    (FPCore (re im)
                      :name "math.exp on complex, imaginary part"
                      :precision binary64
                      (* (exp re) (sin im)))