math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 10.2s
Alternatives: 18
Speedup: 1.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.5× speedup?

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

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

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

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

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

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

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

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

      \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
    7. sub0-negN/A

      \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
    8. cosh-defN/A

      \[\leadsto \sin re \cdot \cosh im \]
    9. *-lowering-*.f64N/A

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
    11. cosh-lowering-cosh.f64100.0%

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
  4. Applied egg-rr100.0%

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

Alternative 2: 73.2% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 1.75e-12)
   (sin re)
   (if (<= im 7e+51)
     (* (cosh im) (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
     (*
      (sin re)
      (+
       1.0
       (*
        (* im im)
        (+ 0.5 (* im (* im (* (* im im) 0.001388888888888889))))))))))
double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = sin(re);
	} else if (im <= 7e+51) {
		tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	} else {
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (im <= 1.75d-12) then
        tmp = sin(re)
    else if (im <= 7d+51) then
        tmp = cosh(im) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))
    else
        tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * ((im * im) * 0.001388888888888889d0))))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = Math.sin(re);
	} else if (im <= 7e+51) {
		tmp = Math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	} else {
		tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 1.75e-12:
		tmp = math.sin(re)
	elif im <= 7e+51:
		tmp = math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))))
	else:
		tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))))
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 7e+51)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))));
	else
		tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * Float64(Float64(im * im) * 0.001388888888888889)))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 7e+51)
		tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	else
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * ((im * im) * 0.001388888888888889))))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 7e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 1.75e-12

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{sin.f64}\left(re\right) \]
    5. Simplified69.3%

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

    if 1.75e-12 < im < 7e51

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
      7. sub0-negN/A

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
      8. cosh-defN/A

        \[\leadsto \sin re \cdot \cosh im \]
      9. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
      11. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    7. Simplified88.2%

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

    if 7e51 < im

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
      7. sub0-negN/A

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
      8. cosh-defN/A

        \[\leadsto \sin re \cdot \cosh im \]
      9. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
      11. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
    7. Simplified100.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \color{blue}{\left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)}\right)\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 7 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 72.7% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 1.75e-12)
   (sin re)
   (if (<= im 2.6e+77)
     (* (cosh im) (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
     (*
      (sin re)
      (+ 1.0 (* (* im im) (+ 0.5 (* (* im im) 0.041666666666666664))))))))
double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = sin(re);
	} else if (im <= 2.6e+77) {
		tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	} else {
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (im <= 1.75d-12) then
        tmp = sin(re)
    else if (im <= 2.6d+77) then
        tmp = cosh(im) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))
    else
        tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = Math.sin(re);
	} else if (im <= 2.6e+77) {
		tmp = Math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	} else {
		tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 1.75e-12:
		tmp = math.sin(re)
	elif im <= 2.6e+77:
		tmp = math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))))
	else:
		tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))))
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 2.6e+77)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))));
	else
		tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 2.6e+77)
		tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	else
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + ((im * im) * 0.041666666666666664))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 1.75e-12

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{sin.f64}\left(re\right) \]
    5. Simplified69.3%

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

    if 1.75e-12 < im < 2.6000000000000002e77

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
      7. sub0-negN/A

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
      8. cosh-defN/A

        \[\leadsto \sin re \cdot \cosh im \]
      9. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
      11. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    4. Applied egg-rr100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
      7. *-lowering-*.f6485.7%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    7. Simplified85.7%

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

    if 2.6000000000000002e77 < im

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification76.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 71.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 1.75e-12)
   (sin re)
   (if (<= im 1.35e+154)
     (* (cosh im) (* re (+ 1.0 (* re (* re -0.16666666666666666)))))
     (* (* im im) (* (sin re) 0.5)))))
double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = sin(re);
	} else if (im <= 1.35e+154) {
		tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	} else {
		tmp = (im * im) * (sin(re) * 0.5);
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (im <= 1.75d-12) then
        tmp = sin(re)
    else if (im <= 1.35d+154) then
        tmp = cosh(im) * (re * (1.0d0 + (re * (re * (-0.16666666666666666d0)))))
    else
        tmp = (im * im) * (sin(re) * 0.5d0)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = Math.sin(re);
	} else if (im <= 1.35e+154) {
		tmp = Math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	} else {
		tmp = (im * im) * (Math.sin(re) * 0.5);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 1.75e-12:
		tmp = math.sin(re)
	elif im <= 1.35e+154:
		tmp = math.cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))))
	else:
		tmp = (im * im) * (math.sin(re) * 0.5)
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 1.35e+154)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666)))));
	else
		tmp = Float64(Float64(im * im) * Float64(sin(re) * 0.5));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 1.35e+154)
		tmp = cosh(im) * (re * (1.0 + (re * (re * -0.16666666666666666))));
	else
		tmp = (im * im) * (sin(re) * 0.5);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 1.75e-12

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{sin.f64}\left(re\right) \]
    5. Simplified69.3%

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

    if 1.75e-12 < im < 1.35000000000000003e154

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
      7. sub0-negN/A

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
      8. cosh-defN/A

        \[\leadsto \sin re \cdot \cosh im \]
      9. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
      11. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    4. Applied egg-rr100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{cosh.f64}\left(im\right)\right) \]
      7. *-lowering-*.f6482.5%

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

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

    if 1.35000000000000003e154 < im

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot im\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification74.8%

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

Alternative 5: 71.1% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \cosh im\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 1.75e-12)
   (sin re)
   (if (<= im 1.35e+154) (* re (cosh im)) (* (* im im) (* (sin re) 0.5)))))
double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = sin(re);
	} else if (im <= 1.35e+154) {
		tmp = re * cosh(im);
	} else {
		tmp = (im * im) * (sin(re) * 0.5);
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (im <= 1.75d-12) then
        tmp = sin(re)
    else if (im <= 1.35d+154) then
        tmp = re * cosh(im)
    else
        tmp = (im * im) * (sin(re) * 0.5d0)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 1.75e-12) {
		tmp = Math.sin(re);
	} else if (im <= 1.35e+154) {
		tmp = re * Math.cosh(im);
	} else {
		tmp = (im * im) * (Math.sin(re) * 0.5);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 1.75e-12:
		tmp = math.sin(re)
	elif im <= 1.35e+154:
		tmp = re * math.cosh(im)
	else:
		tmp = (im * im) * (math.sin(re) * 0.5)
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 1.35e+154)
		tmp = Float64(re * cosh(im));
	else
		tmp = Float64(Float64(im * im) * Float64(sin(re) * 0.5));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 1.75e-12)
		tmp = sin(re);
	elseif (im <= 1.35e+154)
		tmp = re * cosh(im);
	else
		tmp = (im * im) * (sin(re) * 0.5);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[(im * im), $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;re \cdot \cosh im\\

\mathbf{else}:\\
\;\;\;\;\left(im \cdot im\right) \cdot \left(\sin re \cdot 0.5\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 1.75e-12

    1. Initial program 100.0%

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

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

        \[\leadsto \mathsf{sin.f64}\left(re\right) \]
    5. Simplified69.3%

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

    if 1.75e-12 < im < 1.35000000000000003e154

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
      7. sub0-negN/A

        \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
      8. cosh-defN/A

        \[\leadsto \sin re \cdot \cosh im \]
      9. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
      11. cosh-lowering-cosh.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{re}, \mathsf{cosh.f64}\left(im\right)\right) \]
    6. Step-by-step derivation
      1. Simplified77.5%

        \[\leadsto \color{blue}{re} \cdot \cosh im \]

      if 1.35000000000000003e154 < im

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot im\right)} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification74.1%

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

    Alternative 6: 68.0% accurate, 2.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \cosh im\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= im 1.75e-12) (sin re) (* re (cosh im))))
    double code(double re, double im) {
    	double tmp;
    	if (im <= 1.75e-12) {
    		tmp = sin(re);
    	} else {
    		tmp = re * cosh(im);
    	}
    	return tmp;
    }
    
    real(8) function code(re, im)
        real(8), intent (in) :: re
        real(8), intent (in) :: im
        real(8) :: tmp
        if (im <= 1.75d-12) then
            tmp = sin(re)
        else
            tmp = re * cosh(im)
        end if
        code = tmp
    end function
    
    public static double code(double re, double im) {
    	double tmp;
    	if (im <= 1.75e-12) {
    		tmp = Math.sin(re);
    	} else {
    		tmp = re * Math.cosh(im);
    	}
    	return tmp;
    }
    
    def code(re, im):
    	tmp = 0
    	if im <= 1.75e-12:
    		tmp = math.sin(re)
    	else:
    		tmp = re * math.cosh(im)
    	return tmp
    
    function code(re, im)
    	tmp = 0.0
    	if (im <= 1.75e-12)
    		tmp = sin(re);
    	else
    		tmp = Float64(re * cosh(im));
    	end
    	return tmp
    end
    
    function tmp_2 = code(re, im)
    	tmp = 0.0;
    	if (im <= 1.75e-12)
    		tmp = sin(re);
    	else
    		tmp = re * cosh(im);
    	end
    	tmp_2 = tmp;
    end
    
    code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
    \;\;\;\;\sin re\\
    
    \mathbf{else}:\\
    \;\;\;\;re \cdot \cosh im\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if im < 1.75e-12

      1. Initial program 100.0%

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

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

          \[\leadsto \mathsf{sin.f64}\left(re\right) \]
      5. Simplified69.3%

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

      if 1.75e-12 < im

      1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
        7. sub0-negN/A

          \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
        8. cosh-defN/A

          \[\leadsto \sin re \cdot \cosh im \]
        9. *-lowering-*.f64N/A

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
        11. cosh-lowering-cosh.f64100.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
      4. Applied egg-rr100.0%

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

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{re}, \mathsf{cosh.f64}\left(im\right)\right) \]
      6. Step-by-step derivation
        1. Simplified76.8%

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

      Alternative 7: 65.7% accurate, 2.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 9 \cdot 10^{+172}:\\ \;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (if (<= im 1.75e-12)
         (sin re)
         (if (<= im 9e+172)
           (*
            (*
             re
             (+
              0.5
              (*
               re
               (*
                re
                (+
                 -0.08333333333333333
                 (*
                  (* re re)
                  (+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5))))))))
            (+
             2.0
             (*
              (* im im)
              (+
               1.0
               (*
                (* im im)
                (+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))
           (* (* re 0.5) (+ (* im im) 2.0)))))
      double code(double re, double im) {
      	double tmp;
      	if (im <= 1.75e-12) {
      		tmp = sin(re);
      	} else if (im <= 9e+172) {
      		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
      	} else {
      		tmp = (re * 0.5) * ((im * im) + 2.0);
      	}
      	return tmp;
      }
      
      real(8) function code(re, im)
          real(8), intent (in) :: re
          real(8), intent (in) :: im
          real(8) :: tmp
          if (im <= 1.75d-12) then
              tmp = sin(re)
          else if (im <= 9d+172) then
              tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5))))))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
          else
              tmp = (re * 0.5d0) * ((im * im) + 2.0d0)
          end if
          code = tmp
      end function
      
      public static double code(double re, double im) {
      	double tmp;
      	if (im <= 1.75e-12) {
      		tmp = Math.sin(re);
      	} else if (im <= 9e+172) {
      		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
      	} else {
      		tmp = (re * 0.5) * ((im * im) + 2.0);
      	}
      	return tmp;
      }
      
      def code(re, im):
      	tmp = 0
      	if im <= 1.75e-12:
      		tmp = math.sin(re)
      	elif im <= 9e+172:
      		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))))
      	else:
      		tmp = (re * 0.5) * ((im * im) + 2.0)
      	return tmp
      
      function code(re, im)
      	tmp = 0.0
      	if (im <= 1.75e-12)
      		tmp = sin(re);
      	elseif (im <= 9e+172)
      		tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5)))))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))));
      	else
      		tmp = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0));
      	end
      	return tmp
      end
      
      function tmp_2 = code(re, im)
      	tmp = 0.0;
      	if (im <= 1.75e-12)
      		tmp = sin(re);
      	elseif (im <= 9e+172)
      		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
      	else
      		tmp = (re * 0.5) * ((im * im) + 2.0);
      	end
      	tmp_2 = tmp;
      end
      
      code[re_, im_] := If[LessEqual[im, 1.75e-12], N[Sin[re], $MachinePrecision], If[LessEqual[im, 9e+172], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\
      \;\;\;\;\sin re\\
      
      \mathbf{elif}\;im \leq 9 \cdot 10^{+172}:\\
      \;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if im < 1.75e-12

        1. Initial program 100.0%

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

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

            \[\leadsto \mathsf{sin.f64}\left(re\right) \]
        5. Simplified69.3%

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

        if 1.75e-12 < im < 9.0000000000000004e172

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
          13. *-lowering-*.f6470.2%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
        5. Simplified70.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{10080}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
          18. *-lowering-*.f6461.2%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{10080}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
        8. Simplified61.2%

          \[\leadsto \color{blue}{\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right)} \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \]

        if 9.0000000000000004e172 < im

        1. Initial program 100.0%

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

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

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

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

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

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

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

            \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(2 + im \cdot im\right) \]
        8. Recombined 3 regimes into one program.
        9. Final simplification68.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.75 \cdot 10^{-12}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 9 \cdot 10^{+172}:\\ \;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \end{array} \]
        10. Add Preprocessing

        Alternative 8: 59.3% accurate, 6.7× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (if (<= re 1.2e+154)
           (*
            (*
             re
             (+
              0.5
              (*
               re
               (*
                re
                (+
                 -0.08333333333333333
                 (*
                  (* re re)
                  (+ 0.004166666666666667 (* (* re re) -9.92063492063492e-5))))))))
            (+
             2.0
             (*
              (* im im)
              (+
               1.0
               (*
                (* im im)
                (+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))
           (if (<= re 6.5e+296)
             (*
              re
              (+
               1.0
               (*
                (* re re)
                (+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
             (* re (+ 1.0 (* -0.16666666666666666 (* re re)))))))
        double code(double re, double im) {
        	double tmp;
        	if (re <= 1.2e+154) {
        		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
        	} else if (re <= 6.5e+296) {
        		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
        	} else {
        		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
        	}
        	return tmp;
        }
        
        real(8) function code(re, im)
            real(8), intent (in) :: re
            real(8), intent (in) :: im
            real(8) :: tmp
            if (re <= 1.2d+154) then
                tmp = (re * (0.5d0 + (re * (re * ((-0.08333333333333333d0) + ((re * re) * (0.004166666666666667d0 + ((re * re) * (-9.92063492063492d-5))))))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
            else if (re <= 6.5d+296) then
                tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
            else
                tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
            end if
            code = tmp
        end function
        
        public static double code(double re, double im) {
        	double tmp;
        	if (re <= 1.2e+154) {
        		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
        	} else if (re <= 6.5e+296) {
        		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
        	} else {
        		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
        	}
        	return tmp;
        }
        
        def code(re, im):
        	tmp = 0
        	if re <= 1.2e+154:
        		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))))
        	elif re <= 6.5e+296:
        		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))
        	else:
        		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
        	return tmp
        
        function code(re, im)
        	tmp = 0.0
        	if (re <= 1.2e+154)
        		tmp = Float64(Float64(re * Float64(0.5 + Float64(re * Float64(re * Float64(-0.08333333333333333 + Float64(Float64(re * re) * Float64(0.004166666666666667 + Float64(Float64(re * re) * -9.92063492063492e-5)))))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))));
        	elseif (re <= 6.5e+296)
        		tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))));
        	else
        		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	tmp = 0.0;
        	if (re <= 1.2e+154)
        		tmp = (re * (0.5 + (re * (re * (-0.08333333333333333 + ((re * re) * (0.004166666666666667 + ((re * re) * -9.92063492063492e-5)))))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
        	elseif (re <= 6.5e+296)
        		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
        	else
        		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
        	end
        	tmp_2 = tmp;
        end
        
        code[re_, im_] := If[LessEqual[re, 1.2e+154], N[(N[(re * N[(0.5 + N[(re * N[(re * N[(-0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * N[(0.004166666666666667 + N[(N[(re * re), $MachinePrecision] * -9.92063492063492e-5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;re \leq 1.2 \cdot 10^{+154}:\\
        \;\;\;\;\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right) \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\\
        
        \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
        \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if re < 1.20000000000000007e154

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
          5. Simplified89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{10080}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
            18. *-lowering-*.f6461.0%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{1}{240}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{10080}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
          8. Simplified61.0%

            \[\leadsto \color{blue}{\left(re \cdot \left(0.5 + re \cdot \left(re \cdot \left(-0.08333333333333333 + \left(re \cdot re\right) \cdot \left(0.004166666666666667 + \left(re \cdot re\right) \cdot -9.92063492063492 \cdot 10^{-5}\right)\right)\right)\right)\right)} \cdot \left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \]

          if 1.20000000000000007e154 < re < 6.5e296

          1. Initial program 100.0%

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

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

              \[\leadsto \mathsf{sin.f64}\left(re\right) \]
          5. Simplified72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
            13. *-lowering-*.f6429.5%

              \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
          8. Simplified29.5%

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

          if 6.5e296 < re

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
          8. Simplified66.9%

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
            5. *-lowering-*.f6466.9%

              \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
          11. Simplified66.9%

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

        Alternative 9: 59.0% accurate, 9.1× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 2 \cdot 10^{+172}:\\ \;\;\;\;\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (if (<= im 2e+172)
           (*
            (+
             2.0
             (*
              (* im im)
              (+
               1.0
               (*
                (* im im)
                (+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))
            (* re (+ 0.5 (* -0.08333333333333333 (* re re)))))
           (* (* re 0.5) (+ (* im im) 2.0))))
        double code(double re, double im) {
        	double tmp;
        	if (im <= 2e+172) {
        		tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
        	} else {
        		tmp = (re * 0.5) * ((im * im) + 2.0);
        	}
        	return tmp;
        }
        
        real(8) function code(re, im)
            real(8), intent (in) :: re
            real(8), intent (in) :: im
            real(8) :: tmp
            if (im <= 2d+172) then
                tmp = (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))))) * (re * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
            else
                tmp = (re * 0.5d0) * ((im * im) + 2.0d0)
            end if
            code = tmp
        end function
        
        public static double code(double re, double im) {
        	double tmp;
        	if (im <= 2e+172) {
        		tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
        	} else {
        		tmp = (re * 0.5) * ((im * im) + 2.0);
        	}
        	return tmp;
        }
        
        def code(re, im):
        	tmp = 0
        	if im <= 2e+172:
        		tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re))))
        	else:
        		tmp = (re * 0.5) * ((im * im) + 2.0)
        	return tmp
        
        function code(re, im)
        	tmp = 0.0
        	if (im <= 2e+172)
        		tmp = Float64(Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))) * Float64(re * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re)))));
        	else
        		tmp = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0));
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	tmp = 0.0;
        	if (im <= 2e+172)
        		tmp = (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))))) * (re * (0.5 + (-0.08333333333333333 * (re * re))));
        	else
        		tmp = (re * 0.5) * ((im * im) + 2.0);
        	end
        	tmp_2 = tmp;
        end
        
        code[re_, im_] := If[LessEqual[im, 2e+172], N[(N[(2.0 + N[(N[(im * im), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(re * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;im \leq 2 \cdot 10^{+172}:\\
        \;\;\;\;\left(2 + \left(im \cdot im\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if im < 2.0000000000000002e172

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
            13. *-lowering-*.f6489.7%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
          5. Simplified89.7%

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{-1}{12}, \left(re \cdot re\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
            5. *-lowering-*.f6452.0%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, re\right)\right)\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right) \]
          8. Simplified52.0%

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

          if 2.0000000000000002e172 < im

          1. Initial program 100.0%

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

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

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

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

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

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

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

              \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(2 + im \cdot im\right) \]
          8. Recombined 2 regimes into one program.
          9. Final simplification54.5%

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

          Alternative 10: 59.1% accurate, 10.0× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + re \cdot \left(re \cdot \left(0.008333333333333333 + \left(re \cdot re\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (if (<= re 6.2e+41)
             (*
              re
              (+
               1.0
               (*
                im
                (*
                 im
                 (+
                  0.5
                  (*
                   im
                   (*
                    im
                    (+ (* (* im im) 0.001388888888888889) 0.041666666666666664))))))))
             (if (<= re 1.2e+154)
               (*
                re
                (+
                 1.0
                 (*
                  (* re re)
                  (+
                   -0.16666666666666666
                   (*
                    re
                    (*
                     re
                     (+ 0.008333333333333333 (* (* re re) -0.0001984126984126984))))))))
               (if (<= re 6.5e+296)
                 (*
                  re
                  (+
                   1.0
                   (*
                    (* re re)
                    (+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
                 (* re (+ 1.0 (* -0.16666666666666666 (* re re))))))))
          double code(double re, double im) {
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	} else if (re <= 1.2e+154) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))));
          	} else if (re <= 6.5e+296) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: tmp
              if (re <= 6.2d+41) then
                  tmp = re * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0)))))))
              else if (re <= 1.2d+154) then
                  tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + (re * (re * (0.008333333333333333d0 + ((re * re) * (-0.0001984126984126984d0))))))))
              else if (re <= 6.5d+296) then
                  tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
              else
                  tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	} else if (re <= 1.2e+154) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))));
          	} else if (re <= 6.5e+296) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	tmp = 0
          	if re <= 6.2e+41:
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))))
          	elif re <= 1.2e+154:
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))))
          	elif re <= 6.5e+296:
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))
          	else:
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
          	return tmp
          
          function code(re, im)
          	tmp = 0.0
          	if (re <= 6.2e+41)
          		tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664))))))));
          	elseif (re <= 1.2e+154)
          		tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(re * Float64(re * Float64(0.008333333333333333 + Float64(Float64(re * re) * -0.0001984126984126984))))))));
          	elseif (re <= 6.5e+296)
          		tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))));
          	else
          		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	tmp = 0.0;
          	if (re <= 6.2e+41)
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	elseif (re <= 1.2e+154)
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + (re * (re * (0.008333333333333333 + ((re * re) * -0.0001984126984126984)))))));
          	elseif (re <= 6.5e+296)
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	else
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := If[LessEqual[re, 6.2e+41], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.2e+154], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(re * N[(re * N[(0.008333333333333333 + N[(N[(re * re), $MachinePrecision] * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
          \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
          \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + re \cdot \left(re \cdot \left(0.008333333333333333 + \left(re \cdot re\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
          \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if re < 6.2e41

            1. Initial program 100.0%

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

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

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

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

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

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

                \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
              7. sub0-negN/A

                \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
              8. cosh-defN/A

                \[\leadsto \sin re \cdot \cosh im \]
              9. *-lowering-*.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
              11. cosh-lowering-cosh.f64100.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
            4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            7. Simplified89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
              15. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f6463.0%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
            10. Simplified63.0%

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

            if 6.2e41 < re < 1.20000000000000007e154

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(re\right) \]
            5. Simplified56.4%

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \frac{-1}{6}\right)\right)\right)\right) \]
              8. +-commutativeN/A

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{120}} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)\right)\right)\right)\right) \]
              11. associate-*l*N/A

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{5040}\right)\right)\right)\right)\right)\right)\right)\right) \]
              18. *-lowering-*.f6426.0%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{5040}\right)\right)\right)\right)\right)\right)\right)\right) \]
            8. Simplified26.0%

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

            if 1.20000000000000007e154 < re < 6.5e296

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(re\right) \]
            5. Simplified72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
              13. *-lowering-*.f6429.5%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
            8. Simplified29.5%

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

            if 6.5e296 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
            8. Simplified66.9%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
              5. *-lowering-*.f6466.9%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
            11. Simplified66.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + re \cdot \left(re \cdot \left(0.008333333333333333 + \left(re \cdot re\right) \cdot -0.0001984126984126984\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 11: 59.1% accurate, 10.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (if (<= re 6.2e+41)
             (*
              re
              (+
               1.0
               (*
                im
                (*
                 im
                 (+
                  0.5
                  (*
                   im
                   (*
                    im
                    (+ (* (* im im) 0.001388888888888889) 0.041666666666666664))))))))
             (if (<= re 1.2e+154)
               (* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
               (if (<= re 6.5e+296)
                 (*
                  re
                  (+
                   1.0
                   (*
                    (* re re)
                    (+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
                 (* re (+ 1.0 (* -0.16666666666666666 (* re re))))))))
          double code(double re, double im) {
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: tmp
              if (re <= 6.2d+41) then
                  tmp = re * (1.0d0 + (im * (im * (0.5d0 + (im * (im * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0)))))))
              else if (re <= 1.2d+154) then
                  tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
              else if (re <= 6.5d+296) then
                  tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
              else
                  tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	tmp = 0
          	if re <= 6.2e+41:
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))))
          	elif re <= 1.2e+154:
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))))
          	elif re <= 6.5e+296:
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))
          	else:
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
          	return tmp
          
          function code(re, im)
          	tmp = 0.0
          	if (re <= 6.2e+41)
          		tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(im * Float64(im * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664))))))));
          	elseif (re <= 1.2e+154)
          		tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re)))));
          	elseif (re <= 6.5e+296)
          		tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))));
          	else
          		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	tmp = 0.0;
          	if (re <= 6.2e+41)
          		tmp = re * (1.0 + (im * (im * (0.5 + (im * (im * (((im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	elseif (re <= 1.2e+154)
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	elseif (re <= 6.5e+296)
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	else
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := If[LessEqual[re, 6.2e+41], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(im * N[(im * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
          \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
          \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
          \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if re < 6.2e41

            1. Initial program 100.0%

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

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

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

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

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

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

                \[\leadsto \sin re \cdot \frac{e^{im} + e^{0 - im}}{2} \]
              7. sub0-negN/A

                \[\leadsto \sin re \cdot \frac{e^{im} + e^{\mathsf{neg}\left(im\right)}}{2} \]
              8. cosh-defN/A

                \[\leadsto \sin re \cdot \cosh im \]
              9. *-lowering-*.f64N/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \cosh \color{blue}{im}\right) \]
              11. cosh-lowering-cosh.f64100.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{cosh.f64}\left(im\right)\right) \]
            4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right) \]
            7. Simplified89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left({im}^{2}\right), \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
              15. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
              16. *-lowering-*.f6463.0%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
            10. Simplified63.0%

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

            if 6.2e41 < re < 1.20000000000000007e154

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{1}{2} \cdot re\right) \cdot \left(2 + {im}^{2}\right) + \left(re \cdot \left(\frac{-1}{12} \cdot {re}^{2}\right)\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)} \]
              7. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)} \]
            9. Taylor expanded in im around inf

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{12}\right)\right)\right)\right) \]
            11. Simplified27.1%

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

            if 1.20000000000000007e154 < re < 6.5e296

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(re\right) \]
            5. Simplified72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
              13. *-lowering-*.f6429.5%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
            8. Simplified29.5%

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

            if 6.5e296 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
            8. Simplified66.9%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
              5. *-lowering-*.f6466.9%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
            11. Simplified66.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 12: 56.6% accurate, 10.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (if (<= re 6.2e+41)
             (* re (+ 1.0 (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))
             (if (<= re 1.2e+154)
               (* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
               (if (<= re 6.5e+296)
                 (*
                  re
                  (+
                   1.0
                   (*
                    (* re re)
                    (+ -0.16666666666666666 (* (* re re) 0.008333333333333333)))))
                 (* re (+ 1.0 (* -0.16666666666666666 (* re re))))))))
          double code(double re, double im) {
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: tmp
              if (re <= 6.2d+41) then
                  tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0)))))
              else if (re <= 1.2d+154) then
                  tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
              else if (re <= 6.5d+296) then
                  tmp = re * (1.0d0 + ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0))))
              else
                  tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	tmp = 0
          	if re <= 6.2e+41:
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))))
          	elif re <= 1.2e+154:
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))))
          	elif re <= 6.5e+296:
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))))
          	else:
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
          	return tmp
          
          function code(re, im)
          	tmp = 0.0
          	if (re <= 6.2e+41)
          		tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))));
          	elseif (re <= 1.2e+154)
          		tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re)))));
          	elseif (re <= 6.5e+296)
          		tmp = Float64(re * Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333)))));
          	else
          		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	tmp = 0.0;
          	if (re <= 6.2e+41)
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
          	elseif (re <= 1.2e+154)
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	elseif (re <= 6.5e+296)
          		tmp = re * (1.0 + ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333))));
          	else
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := If[LessEqual[re, 6.2e+41], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
          \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
          \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
          \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if re < 6.2e41

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              11. *-lowering-*.f6460.7%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            8. Simplified60.7%

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

            if 6.2e41 < re < 1.20000000000000007e154

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{1}{2} \cdot re\right) \cdot \left(2 + {im}^{2}\right) + \left(re \cdot \left(\frac{-1}{12} \cdot {re}^{2}\right)\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)} \]
              7. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)} \]
            9. Taylor expanded in im around inf

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{12}\right)\right)\right)\right) \]
            11. Simplified27.1%

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

            if 1.20000000000000007e154 < re < 6.5e296

            1. Initial program 100.0%

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

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

                \[\leadsto \mathsf{sin.f64}\left(re\right) \]
            5. Simplified72.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
              13. *-lowering-*.f6429.5%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{1}{120}\right)\right)\right)\right)\right) \]
            8. Simplified29.5%

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

            if 6.5e296 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
            8. Simplified66.9%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
              5. *-lowering-*.f6466.9%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
            11. Simplified66.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 13: 56.4% accurate, 10.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0
                   (*
                    re
                    (+ 1.0 (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))))
             (if (<= re 6.2e+41)
               t_0
               (if (<= re 1.2e+154)
                 (* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
                 (if (<= re 6.5e+296)
                   t_0
                   (* re (+ 1.0 (* -0.16666666666666666 (* re re)))))))))
          double code(double re, double im) {
          	double t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = t_0;
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = t_0;
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: t_0
              real(8) :: tmp
              t_0 = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0)))))
              if (re <= 6.2d+41) then
                  tmp = t_0
              else if (re <= 1.2d+154) then
                  tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
              else if (re <= 6.5d+296) then
                  tmp = t_0
              else
                  tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = t_0;
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = t_0;
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))))
          	tmp = 0
          	if re <= 6.2e+41:
          		tmp = t_0
          	elif re <= 1.2e+154:
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))))
          	elif re <= 6.5e+296:
          		tmp = t_0
          	else:
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664))))))
          	tmp = 0.0
          	if (re <= 6.2e+41)
          		tmp = t_0;
          	elseif (re <= 1.2e+154)
          		tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re)))));
          	elseif (re <= 6.5e+296)
          		tmp = t_0;
          	else
          		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = re * (1.0 + (im * (im * (0.5 + ((im * im) * 0.041666666666666664)))));
          	tmp = 0.0;
          	if (re <= 6.2e+41)
          		tmp = t_0;
          	elseif (re <= 1.2e+154)
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	elseif (re <= 6.5e+296)
          		tmp = t_0;
          	else
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 6.2e+41], t$95$0, If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], t$95$0, N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
          \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
          \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if re < 6.2e41 or 1.20000000000000007e154 < re < 6.5e296

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              11. *-lowering-*.f6456.9%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            8. Simplified56.9%

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

            if 6.2e41 < re < 1.20000000000000007e154

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(\frac{1}{2} \cdot re\right) \cdot \left(2 + {im}^{2}\right) + \left(re \cdot \left(\frac{-1}{12} \cdot {re}^{2}\right)\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)} \]
              7. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)} \]
            9. Taylor expanded in im around inf

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{12}\right)\right)\right)\right) \]
            11. Simplified27.1%

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

            if 6.5e296 < re

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
            8. Simplified66.9%

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
              5. *-lowering-*.f6466.9%

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
            11. Simplified66.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 14: 49.1% accurate, 12.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* (* re 0.5) (+ (* im im) 2.0))))
             (if (<= re 6.2e+41)
               t_0
               (if (<= re 1.2e+154)
                 (* re (* (* im im) (+ 0.5 (* -0.08333333333333333 (* re re)))))
                 (if (<= re 6.5e+296)
                   t_0
                   (* re (+ 1.0 (* -0.16666666666666666 (* re re)))))))))
          double code(double re, double im) {
          	double t_0 = (re * 0.5) * ((im * im) + 2.0);
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = t_0;
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = t_0;
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: t_0
              real(8) :: tmp
              t_0 = (re * 0.5d0) * ((im * im) + 2.0d0)
              if (re <= 6.2d+41) then
                  tmp = t_0
              else if (re <= 1.2d+154) then
                  tmp = re * ((im * im) * (0.5d0 + ((-0.08333333333333333d0) * (re * re))))
              else if (re <= 6.5d+296) then
                  tmp = t_0
              else
                  tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = (re * 0.5) * ((im * im) + 2.0);
          	double tmp;
          	if (re <= 6.2e+41) {
          		tmp = t_0;
          	} else if (re <= 1.2e+154) {
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	} else if (re <= 6.5e+296) {
          		tmp = t_0;
          	} else {
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = (re * 0.5) * ((im * im) + 2.0)
          	tmp = 0
          	if re <= 6.2e+41:
          		tmp = t_0
          	elif re <= 1.2e+154:
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))))
          	elif re <= 6.5e+296:
          		tmp = t_0
          	else:
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0))
          	tmp = 0.0
          	if (re <= 6.2e+41)
          		tmp = t_0;
          	elseif (re <= 1.2e+154)
          		tmp = Float64(re * Float64(Float64(im * im) * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re)))));
          	elseif (re <= 6.5e+296)
          		tmp = t_0;
          	else
          		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = (re * 0.5) * ((im * im) + 2.0);
          	tmp = 0.0;
          	if (re <= 6.2e+41)
          		tmp = t_0;
          	elseif (re <= 1.2e+154)
          		tmp = re * ((im * im) * (0.5 + (-0.08333333333333333 * (re * re))));
          	elseif (re <= 6.5e+296)
          		tmp = t_0;
          	else
          		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 6.2e+41], t$95$0, If[LessEqual[re, 1.2e+154], N[(re * N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 6.5e+296], t$95$0, N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
          \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\
          \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if re < 6.2e41 or 1.20000000000000007e154 < re < 6.5e296

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

              if 6.2e41 < re < 1.20000000000000007e154

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left(\frac{1}{2} \cdot re\right) \cdot \left(2 + {im}^{2}\right) + \left(re \cdot \left(\frac{-1}{12} \cdot {re}^{2}\right)\right) \cdot \color{blue}{\left(2 + {im}^{2}\right)} \]
                7. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)} \]
              9. Taylor expanded in im around inf

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{12}\right)\right)\right)\right) \]
              11. Simplified27.1%

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

              if 6.5e296 < re

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
              8. Simplified66.9%

                \[\leadsto \color{blue}{\left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)} \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right) \]
              9. Taylor expanded in im around 0

                \[\leadsto \color{blue}{re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
              10. Step-by-step derivation
                1. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)}\right) \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right)}\right)\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right) \]
                4. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
                5. *-lowering-*.f6466.9%

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
              11. Simplified66.9%

                \[\leadsto \color{blue}{re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)} \]
            8. Recombined 3 regimes into one program.
            9. Final simplification48.7%

              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 6.2 \cdot 10^{+41}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \mathbf{elif}\;re \leq 1.2 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{elif}\;re \leq 6.5 \cdot 10^{+296}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \end{array} \]
            10. Add Preprocessing

            Alternative 15: 42.0% accurate, 22.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1.8 \cdot 10^{+81}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (if (<= im 1.8e+81)
               (* re (+ 1.0 (* -0.16666666666666666 (* re re))))
               (* (* re 0.5) (+ (* im im) 2.0))))
            double code(double re, double im) {
            	double tmp;
            	if (im <= 1.8e+81) {
            		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
            	} else {
            		tmp = (re * 0.5) * ((im * im) + 2.0);
            	}
            	return tmp;
            }
            
            real(8) function code(re, im)
                real(8), intent (in) :: re
                real(8), intent (in) :: im
                real(8) :: tmp
                if (im <= 1.8d+81) then
                    tmp = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
                else
                    tmp = (re * 0.5d0) * ((im * im) + 2.0d0)
                end if
                code = tmp
            end function
            
            public static double code(double re, double im) {
            	double tmp;
            	if (im <= 1.8e+81) {
            		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
            	} else {
            		tmp = (re * 0.5) * ((im * im) + 2.0);
            	}
            	return tmp;
            }
            
            def code(re, im):
            	tmp = 0
            	if im <= 1.8e+81:
            		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)))
            	else:
            		tmp = (re * 0.5) * ((im * im) + 2.0)
            	return tmp
            
            function code(re, im)
            	tmp = 0.0
            	if (im <= 1.8e+81)
            		tmp = Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))));
            	else
            		tmp = Float64(Float64(re * 0.5) * Float64(Float64(im * im) + 2.0));
            	end
            	return tmp
            end
            
            function tmp_2 = code(re, im)
            	tmp = 0.0;
            	if (im <= 1.8e+81)
            		tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
            	else
            		tmp = (re * 0.5) * ((im * im) + 2.0);
            	end
            	tmp_2 = tmp;
            end
            
            code[re_, im_] := If[LessEqual[im, 1.8e+81], N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;im \leq 1.8 \cdot 10^{+81}:\\
            \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if im < 1.80000000000000003e81

              1. Initial program 100.0%

                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in im around 0

                \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
              4. Step-by-step derivation
                1. *-rgt-identityN/A

                  \[\leadsto \sin re \cdot 1 + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) \]
                2. associate-*r*N/A

                  \[\leadsto \sin re \cdot 1 + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{\frac{1}{2}} \cdot \sin re\right) \]
                3. distribute-rgt-outN/A

                  \[\leadsto \sin re \cdot 1 + {im}^{2} \cdot \left(\sin re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}\right)}\right) \]
                4. associate-*r*N/A

                  \[\leadsto \sin re \cdot 1 + \left({im}^{2} \cdot \sin re\right) \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}\right)} \]
                5. distribute-lft-outN/A

                  \[\leadsto \sin re \cdot 1 + \left(\left({im}^{2} \cdot \sin re\right) \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}}\right) \]
                6. *-commutativeN/A

                  \[\leadsto \sin re \cdot 1 + \left(\left(\sin re \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{{im}^{2}} \cdot \sin re\right) \cdot \frac{1}{2}\right) \]
                7. associate-*l*N/A

                  \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \color{blue}{\left({im}^{2} \cdot \sin re\right)} \cdot \frac{1}{2}\right) \]
                8. *-commutativeN/A

                  \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \left(\sin re \cdot {im}^{2}\right) \cdot \frac{1}{2}\right) \]
                9. associate-*l*N/A

                  \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \color{blue}{\left({im}^{2} \cdot \frac{1}{2}\right)}\right) \]
                10. unpow2N/A

                  \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right)\right) \]
                11. associate-*r*N/A

                  \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{2}\right)}\right)\right) \]
                12. *-commutativeN/A

                  \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(im \cdot \left(\frac{1}{2} \cdot \color{blue}{im}\right)\right)\right) \]
                13. distribute-lft-outN/A

                  \[\leadsto \sin re \cdot 1 + \sin re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
              5. Simplified84.5%

                \[\leadsto \color{blue}{\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
              6. Taylor expanded in re around 0

                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
              7. Step-by-step derivation
                1. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                3. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left({re}^{2} \cdot \frac{-1}{6}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                4. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \frac{-1}{6}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                5. associate-*l*N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                6. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                7. *-lowering-*.f6446.9%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
              8. Simplified46.9%

                \[\leadsto \color{blue}{\left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)} \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right) \]
              9. Taylor expanded in im around 0

                \[\leadsto \color{blue}{re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
              10. Step-by-step derivation
                1. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)}\right) \]
                2. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right)}\right)\right) \]
                3. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right) \]
                4. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
                5. *-lowering-*.f6434.1%

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
              11. Simplified34.1%

                \[\leadsto \color{blue}{re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)} \]

              if 1.80000000000000003e81 < im

              1. Initial program 100.0%

                \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in im around 0

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \color{blue}{\left(2 + {im}^{2}\right)}\right) \]
              4. Step-by-step derivation
                1. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \color{blue}{\left({im}^{2}\right)}\right)\right) \]
                2. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \left(im \cdot \color{blue}{im}\right)\right)\right) \]
                3. *-lowering-*.f6464.9%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(im, \color{blue}{im}\right)\right)\right) \]
              5. Simplified64.9%

                \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(2 + im \cdot im\right)} \]
              6. Taylor expanded in re around 0

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{re}\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(im, im\right)\right)\right) \]
              7. Step-by-step derivation
                1. Simplified57.2%

                  \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(2 + im \cdot im\right) \]
              8. Recombined 2 regimes into one program.
              9. Final simplification38.3%

                \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.8 \cdot 10^{+81}:\\ \;\;\;\;re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \left(im \cdot im + 2\right)\\ \end{array} \]
              10. Add Preprocessing

              Alternative 16: 30.6% accurate, 25.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 39000000000000:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (if (<= re 39000000000000.0) re (* re (* re (* re -0.16666666666666666)))))
              double code(double re, double im) {
              	double tmp;
              	if (re <= 39000000000000.0) {
              		tmp = re;
              	} else {
              		tmp = re * (re * (re * -0.16666666666666666));
              	}
              	return tmp;
              }
              
              real(8) function code(re, im)
                  real(8), intent (in) :: re
                  real(8), intent (in) :: im
                  real(8) :: tmp
                  if (re <= 39000000000000.0d0) then
                      tmp = re
                  else
                      tmp = re * (re * (re * (-0.16666666666666666d0)))
                  end if
                  code = tmp
              end function
              
              public static double code(double re, double im) {
              	double tmp;
              	if (re <= 39000000000000.0) {
              		tmp = re;
              	} else {
              		tmp = re * (re * (re * -0.16666666666666666));
              	}
              	return tmp;
              }
              
              def code(re, im):
              	tmp = 0
              	if re <= 39000000000000.0:
              		tmp = re
              	else:
              		tmp = re * (re * (re * -0.16666666666666666))
              	return tmp
              
              function code(re, im)
              	tmp = 0.0
              	if (re <= 39000000000000.0)
              		tmp = re;
              	else
              		tmp = Float64(re * Float64(re * Float64(re * -0.16666666666666666)));
              	end
              	return tmp
              end
              
              function tmp_2 = code(re, im)
              	tmp = 0.0;
              	if (re <= 39000000000000.0)
              		tmp = re;
              	else
              		tmp = re * (re * (re * -0.16666666666666666));
              	end
              	tmp_2 = tmp;
              end
              
              code[re_, im_] := If[LessEqual[re, 39000000000000.0], re, N[(re * N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;re \leq 39000000000000:\\
              \;\;\;\;re\\
              
              \mathbf{else}:\\
              \;\;\;\;re \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if re < 3.9e13

                1. Initial program 100.0%

                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{\sin re} \]
                4. Step-by-step derivation
                  1. sin-lowering-sin.f6448.9%

                    \[\leadsto \mathsf{sin.f64}\left(re\right) \]
                5. Simplified48.9%

                  \[\leadsto \color{blue}{\sin re} \]
                6. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{re} \]
                7. Step-by-step derivation
                  1. Simplified30.9%

                    \[\leadsto \color{blue}{re} \]

                  if 3.9e13 < re

                  1. Initial program 100.0%

                    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                  2. Add Preprocessing
                  3. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                  4. Step-by-step derivation
                    1. *-rgt-identityN/A

                      \[\leadsto \sin re \cdot 1 + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) \]
                    2. associate-*r*N/A

                      \[\leadsto \sin re \cdot 1 + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{\frac{1}{2}} \cdot \sin re\right) \]
                    3. distribute-rgt-outN/A

                      \[\leadsto \sin re \cdot 1 + {im}^{2} \cdot \left(\sin re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}\right)}\right) \]
                    4. associate-*r*N/A

                      \[\leadsto \sin re \cdot 1 + \left({im}^{2} \cdot \sin re\right) \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}\right)} \]
                    5. distribute-lft-outN/A

                      \[\leadsto \sin re \cdot 1 + \left(\left({im}^{2} \cdot \sin re\right) \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}}\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \sin re \cdot 1 + \left(\left(\sin re \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{{im}^{2}} \cdot \sin re\right) \cdot \frac{1}{2}\right) \]
                    7. associate-*l*N/A

                      \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \color{blue}{\left({im}^{2} \cdot \sin re\right)} \cdot \frac{1}{2}\right) \]
                    8. *-commutativeN/A

                      \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \left(\sin re \cdot {im}^{2}\right) \cdot \frac{1}{2}\right) \]
                    9. associate-*l*N/A

                      \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \color{blue}{\left({im}^{2} \cdot \frac{1}{2}\right)}\right) \]
                    10. unpow2N/A

                      \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right)\right) \]
                    11. associate-*r*N/A

                      \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{2}\right)}\right)\right) \]
                    12. *-commutativeN/A

                      \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(im \cdot \left(\frac{1}{2} \cdot \color{blue}{im}\right)\right)\right) \]
                    13. distribute-lft-outN/A

                      \[\leadsto \sin re \cdot 1 + \sin re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                  5. Simplified91.3%

                    \[\leadsto \color{blue}{\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
                  6. Taylor expanded in re around 0

                    \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  7. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                    3. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left({re}^{2} \cdot \frac{-1}{6}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \frac{-1}{6}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                    5. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                    6. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                    7. *-lowering-*.f6414.2%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  8. Simplified14.2%

                    \[\leadsto \color{blue}{\left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)} \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right) \]
                  9. Taylor expanded in im around 0

                    \[\leadsto \color{blue}{re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
                  10. Step-by-step derivation
                    1. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)}\right) \]
                    2. +-lowering-+.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right)}\right)\right) \]
                    3. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right) \]
                    4. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
                    5. *-lowering-*.f649.1%

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
                  11. Simplified9.1%

                    \[\leadsto \color{blue}{re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)} \]
                  12. Taylor expanded in re around inf

                    \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right)}\right) \]
                  13. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \mathsf{*.f64}\left(re, \left({re}^{2} \cdot \color{blue}{\frac{-1}{6}}\right)\right) \]
                    2. unpow2N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \left(\left(re \cdot re\right) \cdot \frac{-1}{6}\right)\right) \]
                    3. associate-*l*N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \left(re \cdot \color{blue}{\left(re \cdot \frac{-1}{6}\right)}\right)\right) \]
                    4. *-lowering-*.f64N/A

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\left(re \cdot \frac{-1}{6}\right)}\right)\right) \]
                    5. *-lowering-*.f649.1%

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{\frac{-1}{6}}\right)\right)\right) \]
                  14. Simplified9.1%

                    \[\leadsto re \cdot \color{blue}{\left(re \cdot \left(re \cdot -0.16666666666666666\right)\right)} \]
                8. Recombined 2 regimes into one program.
                9. Add Preprocessing

                Alternative 17: 34.2% accurate, 34.3× speedup?

                \[\begin{array}{l} \\ re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right) \end{array} \]
                (FPCore (re im)
                 :precision binary64
                 (* re (+ 1.0 (* -0.16666666666666666 (* re re)))))
                double code(double re, double im) {
                	return re * (1.0 + (-0.16666666666666666 * (re * re)));
                }
                
                real(8) function code(re, im)
                    real(8), intent (in) :: re
                    real(8), intent (in) :: im
                    code = re * (1.0d0 + ((-0.16666666666666666d0) * (re * re)))
                end function
                
                public static double code(double re, double im) {
                	return re * (1.0 + (-0.16666666666666666 * (re * re)));
                }
                
                def code(re, im):
                	return re * (1.0 + (-0.16666666666666666 * (re * re)))
                
                function code(re, im)
                	return Float64(re * Float64(1.0 + Float64(-0.16666666666666666 * Float64(re * re))))
                end
                
                function tmp = code(re, im)
                	tmp = re * (1.0 + (-0.16666666666666666 * (re * re)));
                end
                
                code[re_, im_] := N[(re * N[(1.0 + N[(-0.16666666666666666 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                \begin{array}{l}
                
                \\
                re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)
                \end{array}
                
                Derivation
                1. Initial program 100.0%

                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{\sin re + {im}^{2} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right)} \]
                4. Step-by-step derivation
                  1. *-rgt-identityN/A

                    \[\leadsto \sin re \cdot 1 + \color{blue}{{im}^{2}} \cdot \left(\frac{1}{24} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{2} \cdot \sin re\right) \]
                  2. associate-*r*N/A

                    \[\leadsto \sin re \cdot 1 + {im}^{2} \cdot \left(\left(\frac{1}{24} \cdot {im}^{2}\right) \cdot \sin re + \color{blue}{\frac{1}{2}} \cdot \sin re\right) \]
                  3. distribute-rgt-outN/A

                    \[\leadsto \sin re \cdot 1 + {im}^{2} \cdot \left(\sin re \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}\right)}\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \sin re \cdot 1 + \left({im}^{2} \cdot \sin re\right) \cdot \color{blue}{\left(\frac{1}{24} \cdot {im}^{2} + \frac{1}{2}\right)} \]
                  5. distribute-lft-outN/A

                    \[\leadsto \sin re \cdot 1 + \left(\left({im}^{2} \cdot \sin re\right) \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \color{blue}{\left({im}^{2} \cdot \sin re\right) \cdot \frac{1}{2}}\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \sin re \cdot 1 + \left(\left(\sin re \cdot {im}^{2}\right) \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + \left(\color{blue}{{im}^{2}} \cdot \sin re\right) \cdot \frac{1}{2}\right) \]
                  7. associate-*l*N/A

                    \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \color{blue}{\left({im}^{2} \cdot \sin re\right)} \cdot \frac{1}{2}\right) \]
                  8. *-commutativeN/A

                    \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \left(\sin re \cdot {im}^{2}\right) \cdot \frac{1}{2}\right) \]
                  9. associate-*l*N/A

                    \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \color{blue}{\left({im}^{2} \cdot \frac{1}{2}\right)}\right) \]
                  10. unpow2N/A

                    \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(\left(im \cdot im\right) \cdot \frac{1}{2}\right)\right) \]
                  11. associate-*r*N/A

                    \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(im \cdot \color{blue}{\left(im \cdot \frac{1}{2}\right)}\right)\right) \]
                  12. *-commutativeN/A

                    \[\leadsto \sin re \cdot 1 + \left(\sin re \cdot \left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right)\right) + \sin re \cdot \left(im \cdot \left(\frac{1}{2} \cdot \color{blue}{im}\right)\right)\right) \]
                  13. distribute-lft-outN/A

                    \[\leadsto \sin re \cdot 1 + \sin re \cdot \color{blue}{\left({im}^{2} \cdot \left(\frac{1}{24} \cdot {im}^{2}\right) + im \cdot \left(\frac{1}{2} \cdot im\right)\right)} \]
                5. Simplified87.3%

                  \[\leadsto \color{blue}{\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)} \]
                6. Taylor expanded in re around 0

                  \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                7. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\frac{-1}{6} \cdot {re}^{2}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  3. *-commutativeN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left({re}^{2} \cdot \frac{-1}{6}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \frac{-1}{6}\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  5. associate-*l*N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  7. *-lowering-*.f6453.0%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{-1}{6}\right)\right)\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                8. Simplified53.0%

                  \[\leadsto \color{blue}{\left(re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\right)} \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right) \]
                9. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)} \]
                10. Step-by-step derivation
                  1. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left(1 + \frac{-1}{6} \cdot {re}^{2}\right)}\right) \]
                  2. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{-1}{6} \cdot {re}^{2}\right)}\right)\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \color{blue}{\left({re}^{2}\right)}\right)\right)\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \left(re \cdot \color{blue}{re}\right)\right)\right)\right) \]
                  5. *-lowering-*.f6431.4%

                    \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right) \]
                11. Simplified31.4%

                  \[\leadsto \color{blue}{re \cdot \left(1 + -0.16666666666666666 \cdot \left(re \cdot re\right)\right)} \]
                12. Add Preprocessing

                Alternative 18: 26.7% accurate, 309.0× speedup?

                \[\begin{array}{l} \\ re \end{array} \]
                (FPCore (re im) :precision binary64 re)
                double code(double re, double im) {
                	return re;
                }
                
                real(8) function code(re, im)
                    real(8), intent (in) :: re
                    real(8), intent (in) :: im
                    code = re
                end function
                
                public static double code(double re, double im) {
                	return re;
                }
                
                def code(re, im):
                	return re
                
                function code(re, im)
                	return re
                end
                
                function tmp = code(re, im)
                	tmp = re;
                end
                
                code[re_, im_] := re
                
                \begin{array}{l}
                
                \\
                re
                \end{array}
                
                Derivation
                1. Initial program 100.0%

                  \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in im around 0

                  \[\leadsto \color{blue}{\sin re} \]
                4. Step-by-step derivation
                  1. sin-lowering-sin.f6452.3%

                    \[\leadsto \mathsf{sin.f64}\left(re\right) \]
                5. Simplified52.3%

                  \[\leadsto \color{blue}{\sin re} \]
                6. Taylor expanded in re around 0

                  \[\leadsto \color{blue}{re} \]
                7. Step-by-step derivation
                  1. Simplified25.0%

                    \[\leadsto \color{blue}{re} \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2024159 
                  (FPCore (re im)
                    :name "math.sin on complex, real part"
                    :precision binary64
                    (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))