math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 10.5s
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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
    2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
    4. *-lft-identityN/A

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

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

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

Alternative 2: 87.3% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.016:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;re \cdot \cosh im\\ \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 0.016)
   (* (* (sin re) 0.5) (+ 2.0 (* im im)))
   (if (<= im 7.2e+51)
     (* re (cosh im))
     (*
      (sin re)
      (+
       1.0
       (*
        (* im im)
        (+ 0.5 (* im (* im (* (* im im) 0.001388888888888889))))))))))
double code(double re, double im) {
	double tmp;
	if (im <= 0.016) {
		tmp = (sin(re) * 0.5) * (2.0 + (im * im));
	} else if (im <= 7.2e+51) {
		tmp = re * cosh(im);
	} 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 <= 0.016d0) then
        tmp = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
    else if (im <= 7.2d+51) then
        tmp = re * cosh(im)
    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 <= 0.016) {
		tmp = (Math.sin(re) * 0.5) * (2.0 + (im * im));
	} else if (im <= 7.2e+51) {
		tmp = re * Math.cosh(im);
	} 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 <= 0.016:
		tmp = (math.sin(re) * 0.5) * (2.0 + (im * im))
	elif im <= 7.2e+51:
		tmp = re * math.cosh(im)
	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 <= 0.016)
		tmp = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * im)));
	elseif (im <= 7.2e+51)
		tmp = Float64(re * cosh(im));
	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 <= 0.016)
		tmp = (sin(re) * 0.5) * (2.0 + (im * im));
	elseif (im <= 7.2e+51)
		tmp = re * cosh(im);
	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, 0.016], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+51], N[(re * N[Cosh[im], $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 0.016:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\

\mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\
\;\;\;\;re \cdot \cosh im\\

\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 < 0.016

    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-*.f6486.6%

        \[\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. Simplified86.6%

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

    if 0.016 < im < 7.20000000000000022e51

    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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
      2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
      4. *-lft-identityN/A

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

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

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

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

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

      if 7.20000000000000022e51 < 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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
        2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
        4. *-lft-identityN/A

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

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

        \[\leadsto \color{blue}{\sin re \cdot \cosh im} \]
      7. 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) \]
      8. 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) \]
      9. 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)} \]
      10. 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) \]
      11. 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) \]
      12. 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) \]
    9. Recombined 3 regimes into one program.
    10. Final simplification88.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 0.016:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;re \cdot \cosh im\\ \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} \]
    11. Add Preprocessing

    Alternative 3: 86.7% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.32:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\ \mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\ \;\;\;\;re \cdot \cosh im\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
    (FPCore (re im)
     :precision binary64
     (if (<= im 0.32)
       (* (* (sin re) 0.5) (+ 2.0 (* im im)))
       (if (<= im 2.6e+77)
         (* re (cosh im))
         (* (sin re) (* (* im im) (* im (* im 0.041666666666666664)))))))
    double code(double re, double im) {
    	double tmp;
    	if (im <= 0.32) {
    		tmp = (sin(re) * 0.5) * (2.0 + (im * im));
    	} else if (im <= 2.6e+77) {
    		tmp = re * cosh(im);
    	} else {
    		tmp = sin(re) * ((im * im) * (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 <= 0.32d0) then
            tmp = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
        else if (im <= 2.6d+77) then
            tmp = re * cosh(im)
        else
            tmp = sin(re) * ((im * im) * (im * (im * 0.041666666666666664d0)))
        end if
        code = tmp
    end function
    
    public static double code(double re, double im) {
    	double tmp;
    	if (im <= 0.32) {
    		tmp = (Math.sin(re) * 0.5) * (2.0 + (im * im));
    	} else if (im <= 2.6e+77) {
    		tmp = re * Math.cosh(im);
    	} else {
    		tmp = Math.sin(re) * ((im * im) * (im * (im * 0.041666666666666664)));
    	}
    	return tmp;
    }
    
    def code(re, im):
    	tmp = 0
    	if im <= 0.32:
    		tmp = (math.sin(re) * 0.5) * (2.0 + (im * im))
    	elif im <= 2.6e+77:
    		tmp = re * math.cosh(im)
    	else:
    		tmp = math.sin(re) * ((im * im) * (im * (im * 0.041666666666666664)))
    	return tmp
    
    function code(re, im)
    	tmp = 0.0
    	if (im <= 0.32)
    		tmp = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * im)));
    	elseif (im <= 2.6e+77)
    		tmp = Float64(re * cosh(im));
    	else
    		tmp = Float64(sin(re) * Float64(Float64(im * im) * Float64(im * Float64(im * 0.041666666666666664))));
    	end
    	return tmp
    end
    
    function tmp_2 = code(re, im)
    	tmp = 0.0;
    	if (im <= 0.32)
    		tmp = (sin(re) * 0.5) * (2.0 + (im * im));
    	elseif (im <= 2.6e+77)
    		tmp = re * cosh(im);
    	else
    		tmp = sin(re) * ((im * im) * (im * (im * 0.041666666666666664)));
    	end
    	tmp_2 = tmp;
    end
    
    code[re_, im_] := If[LessEqual[im, 0.32], N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(im * im), $MachinePrecision] * N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;im \leq 0.32:\\
    \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
    
    \mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
    \;\;\;\;re \cdot \cosh im\\
    
    \mathbf{else}:\\
    \;\;\;\;\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if im < 0.320000000000000007

      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-*.f6486.6%

          \[\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. Simplified86.6%

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

      if 0.320000000000000007 < 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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
        2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
        4. *-lft-identityN/A

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

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

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

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

          \[\leadsto \color{blue}{re} \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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 85.4% accurate, 2.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\ \mathbf{if}\;im \leq 0.09:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;re \cdot \cosh im\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (re im)
       :precision binary64
       (let* ((t_0 (* (* (sin re) 0.5) (+ 2.0 (* im im)))))
         (if (<= im 0.09) t_0 (if (<= im 1.35e+154) (* re (cosh im)) t_0))))
      double code(double re, double im) {
      	double t_0 = (sin(re) * 0.5) * (2.0 + (im * im));
      	double tmp;
      	if (im <= 0.09) {
      		tmp = t_0;
      	} else if (im <= 1.35e+154) {
      		tmp = re * cosh(im);
      	} else {
      		tmp = t_0;
      	}
      	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 = (sin(re) * 0.5d0) * (2.0d0 + (im * im))
          if (im <= 0.09d0) then
              tmp = t_0
          else if (im <= 1.35d+154) then
              tmp = re * cosh(im)
          else
              tmp = t_0
          end if
          code = tmp
      end function
      
      public static double code(double re, double im) {
      	double t_0 = (Math.sin(re) * 0.5) * (2.0 + (im * im));
      	double tmp;
      	if (im <= 0.09) {
      		tmp = t_0;
      	} else if (im <= 1.35e+154) {
      		tmp = re * Math.cosh(im);
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      def code(re, im):
      	t_0 = (math.sin(re) * 0.5) * (2.0 + (im * im))
      	tmp = 0
      	if im <= 0.09:
      		tmp = t_0
      	elif im <= 1.35e+154:
      		tmp = re * math.cosh(im)
      	else:
      		tmp = t_0
      	return tmp
      
      function code(re, im)
      	t_0 = Float64(Float64(sin(re) * 0.5) * Float64(2.0 + Float64(im * im)))
      	tmp = 0.0
      	if (im <= 0.09)
      		tmp = t_0;
      	elseif (im <= 1.35e+154)
      		tmp = Float64(re * cosh(im));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(re, im)
      	t_0 = (sin(re) * 0.5) * (2.0 + (im * im));
      	tmp = 0.0;
      	if (im <= 0.09)
      		tmp = t_0;
      	elseif (im <= 1.35e+154)
      		tmp = re * cosh(im);
      	else
      		tmp = t_0;
      	end
      	tmp_2 = tmp;
      end
      
      code[re_, im_] := Block[{t$95$0 = N[(N[(N[Sin[re], $MachinePrecision] * 0.5), $MachinePrecision] * N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.09], t$95$0, If[LessEqual[im, 1.35e+154], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := \left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\
      \mathbf{if}\;im \leq 0.09:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
      \;\;\;\;re \cdot \cosh im\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if im < 0.089999999999999997 or 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-*.f6488.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. Simplified88.0%

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

        if 0.089999999999999997 < 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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
          2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
          4. *-lft-identityN/A

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

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

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

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

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

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

        Alternative 5: 70.5% accurate, 2.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.00088:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \cosh im\\ \end{array} \end{array} \]
        (FPCore (re im)
         :precision binary64
         (if (<= im 0.00088) (sin re) (* re (cosh im))))
        double code(double re, double im) {
        	double tmp;
        	if (im <= 0.00088) {
        		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 <= 0.00088d0) 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 <= 0.00088) {
        		tmp = Math.sin(re);
        	} else {
        		tmp = re * Math.cosh(im);
        	}
        	return tmp;
        }
        
        def code(re, im):
        	tmp = 0
        	if im <= 0.00088:
        		tmp = math.sin(re)
        	else:
        		tmp = re * math.cosh(im)
        	return tmp
        
        function code(re, im)
        	tmp = 0.0
        	if (im <= 0.00088)
        		tmp = sin(re);
        	else
        		tmp = Float64(re * cosh(im));
        	end
        	return tmp
        end
        
        function tmp_2 = code(re, im)
        	tmp = 0.0;
        	if (im <= 0.00088)
        		tmp = sin(re);
        	else
        		tmp = re * cosh(im);
        	end
        	tmp_2 = tmp;
        end
        
        code[re_, im_] := If[LessEqual[im, 0.00088], N[Sin[re], $MachinePrecision], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;im \leq 0.00088:\\
        \;\;\;\;\sin re\\
        
        \mathbf{else}:\\
        \;\;\;\;re \cdot \cosh im\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if im < 8.80000000000000031e-4

          1. Initial program 100.0%

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

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

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

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

          if 8.80000000000000031e-4 < 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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
            2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
            4. *-lft-identityN/A

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

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

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

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

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

          Alternative 6: 68.4% accurate, 2.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.0065:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\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)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (if (<= im 0.0065)
             (sin re)
             (*
              (*
               re
               (+
                0.5
                (*
                 (* re re)
                 (+ -0.08333333333333333 (* re (* re 0.004166666666666667))))))
              (+
               2.0
               (*
                (* im im)
                (+
                 1.0
                 (*
                  (* im im)
                  (+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))))))
          double code(double re, double im) {
          	double tmp;
          	if (im <= 0.0065) {
          		tmp = sin(re);
          	} else {
          		tmp = (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: tmp
              if (im <= 0.0065d0) then
                  tmp = sin(re)
              else
                  tmp = (re * (0.5d0 + ((re * re) * ((-0.08333333333333333d0) + (re * (re * 0.004166666666666667d0)))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double tmp;
          	if (im <= 0.0065) {
          		tmp = Math.sin(re);
          	} else {
          		tmp = (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	tmp = 0
          	if im <= 0.0065:
          		tmp = math.sin(re)
          	else:
          		tmp = (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))))
          	return tmp
          
          function code(re, im)
          	tmp = 0.0
          	if (im <= 0.0065)
          		tmp = sin(re);
          	else
          		tmp = Float64(Float64(re * Float64(0.5 + Float64(Float64(re * re) * Float64(-0.08333333333333333 + Float64(re * Float64(re * 0.004166666666666667)))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	tmp = 0.0;
          	if (im <= 0.0065)
          		tmp = sin(re);
          	else
          		tmp = (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := If[LessEqual[im, 0.0065], N[Sin[re], $MachinePrecision], N[(N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * N[(-0.08333333333333333 + N[(re * N[(re * 0.004166666666666667), $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]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;im \leq 0.0065:\\
          \;\;\;\;\sin re\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\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)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if im < 0.0064999999999999997

            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.f6463.9%

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

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

            if 0.0064999999999999997 < 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} \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-*.f6474.6%

                \[\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. Simplified74.6%

              \[\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(\frac{1}{240} \cdot {re}^{2} - \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(\frac{1}{240} \cdot {re}^{2} - \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(\frac{1}{240} \cdot {re}^{2} - \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. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{240} \cdot {re}^{2} - \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. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{240} \cdot {re}^{2} - \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) \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{240} \cdot {re}^{2} - \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) \]
              6. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{240} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{12}\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) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{240} \cdot {re}^{2} + \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) \]
              8. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{12} + \frac{1}{240} \cdot {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) \]
              9. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(\frac{1}{240} \cdot {re}^{2}\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. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left({re}^{2} \cdot \frac{1}{240}\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. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(\left(re \cdot re\right) \cdot \frac{1}{240}\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. associate-*l*N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(re \cdot \left(re \cdot \frac{1}{240}\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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{240}\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-*.f6464.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{240}\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. Simplified64.4%

              \[\leadsto \color{blue}{\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\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) \]
          3. Recombined 2 regimes into one program.
          4. Add Preprocessing

          Alternative 7: 58.0% accurate, 8.8× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\\ \mathbf{if}\;re \leq 4.5 \cdot 10^{+24}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\ \;\;\;\;t\_0 \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \cdot t\_0\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664)))))))
             (if (<= re 4.5e+24)
               (*
                re
                (+
                 1.0
                 (*
                  im
                  (*
                   im
                   (+
                    0.5
                    (*
                     (* im im)
                     (+ (* (* im im) 0.001388888888888889) 0.041666666666666664)))))))
               (if (<= re 1.12e+150)
                 (* t_0 (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
                 (* (* re (* 0.008333333333333333 (* (* re re) (* re re)))) t_0)))))
          double code(double re, double im) {
          	double t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))));
          	double tmp;
          	if (re <= 4.5e+24) {
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
          	} else if (re <= 1.12e+150) {
          		tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666)));
          	} else {
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0;
          	}
          	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 = 1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0))))
              if (re <= 4.5d+24) then
                  tmp = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0))))))
              else if (re <= 1.12d+150) then
                  tmp = t_0 * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
              else
                  tmp = (re * (0.008333333333333333d0 * ((re * re) * (re * re)))) * t_0
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))));
          	double tmp;
          	if (re <= 4.5e+24) {
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
          	} else if (re <= 1.12e+150) {
          		tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666)));
          	} else {
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0;
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))))
          	tmp = 0
          	if re <= 4.5e+24:
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))
          	elif re <= 1.12e+150:
          		tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666)))
          	else:
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))))
          	tmp = 0.0
          	if (re <= 4.5e+24)
          		tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664)))))));
          	elseif (re <= 1.12e+150)
          		tmp = Float64(t_0 * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
          	else
          		tmp = Float64(Float64(re * Float64(0.008333333333333333 * Float64(Float64(re * re) * Float64(re * re)))) * t_0);
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = 1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664))));
          	tmp = 0.0;
          	if (re <= 4.5e+24)
          		tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
          	elseif (re <= 1.12e+150)
          		tmp = t_0 * (re * (1.0 + ((re * re) * -0.16666666666666666)));
          	else
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * t_0;
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 4.5e+24], N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.12e+150], N[(t$95$0 * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(0.008333333333333333 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := 1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\\
          \mathbf{if}\;re \leq 4.5 \cdot 10^{+24}:\\
          \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\\
          
          \mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\
          \;\;\;\;t\_0 \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \cdot t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if re < 4.50000000000000019e24

            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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
              2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
              4. *-lft-identityN/A

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

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

              \[\leadsto \color{blue}{\sin re \cdot \cosh im} \]
            7. 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) \]
            8. 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-*.f6490.5%

                \[\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) \]
            9. Simplified90.5%

              \[\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)} \]
            10. 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)} \]
            11. 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. *-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}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
              9. 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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\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(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\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(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
              12. *-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(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
              13. *-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(\mathsf{*.f64}\left(im, im\right), \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) \]
              14. 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(\mathsf{*.f64}\left(im, im\right), \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) \]
              15. *-lowering-*.f6468.2%

                \[\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), \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) \]
            12. Simplified68.2%

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

            if 4.50000000000000019e24 < re < 1.12e150

            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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({re}^{2}\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              5. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(re \cdot re\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f6436.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            8. Simplified36.8%

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

            if 1.12e150 < 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              2. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              3. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\frac{1}{120} \cdot {re}^{2} - \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              4. associate-*l*N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(re \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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, \mathsf{*.f64}\left(re, \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{120} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{120} \cdot {re}^{2} + \frac{-1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              9. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{6} + \frac{1}{120} \cdot {re}^{2}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              10. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\frac{1}{120} \cdot {re}^{2}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \left({re}^{2} \cdot \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              12. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left({re}^{2}\right), \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              13. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              14. *-lowering-*.f6435.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            8. Simplified35.4%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{120} \cdot {re}^{4}\right)}\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, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            10. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \left({re}^{4}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              2. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \left({re}^{\left(2 \cdot 2\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              3. pow-sqrN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \left({re}^{2} \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left({re}^{2}\right), \left({re}^{2}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              5. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left({re}^{2}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({re}^{2}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              7. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot re\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              8. *-lowering-*.f6435.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, re\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            11. Simplified35.4%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 4.5 \cdot 10^{+24}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\ \;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 58.8% accurate, 8.8× speedup?

          \[\begin{array}{l} \\ \left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\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) \end{array} \]
          (FPCore (re im)
           :precision binary64
           (*
            (*
             re
             (+
              0.5
              (* (* re re) (+ -0.08333333333333333 (* re (* re 0.004166666666666667))))))
            (+
             2.0
             (*
              (* im im)
              (+
               1.0
               (*
                (* im im)
                (+ 0.08333333333333333 (* (* im im) 0.002777777777777778))))))))
          double code(double re, double im) {
          	return (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              code = (re * (0.5d0 + ((re * re) * ((-0.08333333333333333d0) + (re * (re * 0.004166666666666667d0)))))) * (2.0d0 + ((im * im) * (1.0d0 + ((im * im) * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0))))))
          end function
          
          public static double code(double re, double im) {
          	return (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
          }
          
          def code(re, im):
          	return (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))))
          
          function code(re, im)
          	return Float64(Float64(re * Float64(0.5 + Float64(Float64(re * re) * Float64(-0.08333333333333333 + Float64(re * Float64(re * 0.004166666666666667)))))) * Float64(2.0 + Float64(Float64(im * im) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778)))))))
          end
          
          function tmp = code(re, im)
          	tmp = (re * (0.5 + ((re * re) * (-0.08333333333333333 + (re * (re * 0.004166666666666667)))))) * (2.0 + ((im * im) * (1.0 + ((im * im) * (0.08333333333333333 + ((im * im) * 0.002777777777777778))))));
          end
          
          code[re_, im_] := N[(N[(re * N[(0.5 + N[(N[(re * re), $MachinePrecision] * N[(-0.08333333333333333 + N[(re * N[(re * 0.004166666666666667), $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]
          
          \begin{array}{l}
          
          \\
          \left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\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)
          \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 \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-*.f6490.8%

              \[\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. Simplified90.8%

            \[\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(\frac{1}{240} \cdot {re}^{2} - \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(\frac{1}{240} \cdot {re}^{2} - \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(\frac{1}{240} \cdot {re}^{2} - \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. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left({re}^{2}\right), \left(\frac{1}{240} \cdot {re}^{2} - \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. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left(\frac{1}{240} \cdot {re}^{2} - \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) \]
            5. *-lowering-*.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{240} \cdot {re}^{2} - \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) \]
            6. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{240} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{12}\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) \]
            7. metadata-evalN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{1}{240} \cdot {re}^{2} + \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) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(\frac{-1}{12} + \frac{1}{240} \cdot {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) \]
            9. +-lowering-+.f64N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(\frac{1}{240} \cdot {re}^{2}\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. *-commutativeN/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left({re}^{2} \cdot \frac{1}{240}\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. unpow2N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(\left(re \cdot re\right) \cdot \frac{1}{240}\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. associate-*l*N/A

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \left(re \cdot \left(re \cdot \frac{1}{240}\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(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \left(re \cdot \frac{1}{240}\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-*.f6459.4%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{+.f64}\left(\frac{-1}{12}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \frac{1}{240}\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. Simplified59.4%

            \[\leadsto \color{blue}{\left(re \cdot \left(0.5 + \left(re \cdot re\right) \cdot \left(-0.08333333333333333 + re \cdot \left(re \cdot 0.004166666666666667\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) \]
          9. Add Preprocessing

          Alternative 9: 57.8% accurate, 9.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 1.12 \cdot 10^{+150}:\\ \;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (if (<= re 1.12e+150)
             (*
              re
              (*
               (+
                2.0
                (*
                 im
                 (*
                  im
                  (+
                   1.0
                   (*
                    (* im im)
                    (+ 0.08333333333333333 (* im (* im 0.002777777777777778))))))))
               (+ 0.5 (* (* re re) -0.08333333333333333))))
             (*
              (* re (* 0.008333333333333333 (* (* re re) (* re re))))
              (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))))
          double code(double re, double im) {
          	double tmp;
          	if (re <= 1.12e+150) {
          		tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
          	} else {
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * 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 (re <= 1.12d+150) then
                  tmp = re * ((2.0d0 + (im * (im * (1.0d0 + ((im * im) * (0.08333333333333333d0 + (im * (im * 0.002777777777777778d0)))))))) * (0.5d0 + ((re * re) * (-0.08333333333333333d0))))
              else
                  tmp = (re * (0.008333333333333333d0 * ((re * re) * (re * 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 (re <= 1.12e+150) {
          		tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
          	} else {
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	tmp = 0
          	if re <= 1.12e+150:
          		tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)))
          	else:
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))))
          	return tmp
          
          function code(re, im)
          	tmp = 0.0
          	if (re <= 1.12e+150)
          		tmp = Float64(re * Float64(Float64(2.0 + Float64(im * Float64(im * Float64(1.0 + Float64(Float64(im * im) * Float64(0.08333333333333333 + Float64(im * Float64(im * 0.002777777777777778)))))))) * Float64(0.5 + Float64(Float64(re * re) * -0.08333333333333333))));
          	else
          		tmp = Float64(Float64(re * Float64(0.008333333333333333 * Float64(Float64(re * re) * Float64(re * re)))) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	tmp = 0.0;
          	if (re <= 1.12e+150)
          		tmp = re * ((2.0 + (im * (im * (1.0 + ((im * im) * (0.08333333333333333 + (im * (im * 0.002777777777777778)))))))) * (0.5 + ((re * re) * -0.08333333333333333)));
          	else
          		tmp = (re * (0.008333333333333333 * ((re * re) * (re * re)))) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := If[LessEqual[re, 1.12e+150], N[(re * N[(N[(2.0 + N[(im * N[(im * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.08333333333333333 + N[(im * N[(im * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 + N[(N[(re * re), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(re * N[(0.008333333333333333 * N[(N[(re * re), $MachinePrecision] * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;re \leq 1.12 \cdot 10^{+150}:\\
          \;\;\;\;re \cdot \left(\left(2 + im \cdot \left(im \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.08333333333333333 + im \cdot \left(im \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 + \left(re \cdot re\right) \cdot -0.08333333333333333\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(re \cdot \left(0.008333333333333333 \cdot \left(\left(re \cdot re\right) \cdot \left(re \cdot re\right)\right)\right)\right) \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if re < 1.12e150

            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-*.f6490.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. Simplified90.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 \color{blue}{re \cdot \left(\frac{-1}{12} \cdot \left({re}^{2} \cdot \left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right)\right) + \frac{1}{2} \cdot \left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right)\right)} \]
            7. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

                \[\leadsto re \cdot \left(\frac{1}{2} \cdot \left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right) + {re}^{2} \cdot \color{blue}{\left(\frac{-1}{12} \cdot \left(2 + {im}^{2} \cdot \left(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(re, \color{blue}{\left(\frac{1}{2} \cdot \left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right) + {re}^{2} \cdot \left(\frac{-1}{12} \cdot \left(2 + {im}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{12} + \frac{1}{360} \cdot {im}^{2}\right)\right)\right)\right)\right)}\right) \]
            8. Simplified62.4%

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

            if 1.12e150 < 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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \left(1 + {re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              2. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left({re}^{2} \cdot \left(\frac{1}{120} \cdot {re}^{2} - \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              3. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(\left(re \cdot re\right) \cdot \left(\frac{1}{120} \cdot {re}^{2} - \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              4. associate-*l*N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \left(re \cdot \left(re \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              5. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \left(re \cdot \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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, \mathsf{*.f64}\left(re, \left(\frac{1}{120} \cdot {re}^{2} - \frac{1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{120} \cdot {re}^{2} + \left(\mathsf{neg}\left(\frac{1}{6}\right)\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              8. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{1}{120} \cdot {re}^{2} + \frac{-1}{6}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              9. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left(\frac{-1}{6} + \frac{1}{120} \cdot {re}^{2}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              10. +-lowering-+.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \left(\frac{1}{120} \cdot {re}^{2}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              11. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \left({re}^{2} \cdot \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              12. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left({re}^{2}\right), \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              13. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              14. *-lowering-*.f6435.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{1}{120}\right)\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            8. Simplified35.4%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{120} \cdot {re}^{4}\right)}\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, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            10. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \left({re}^{4}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              2. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \left({re}^{\left(2 \cdot 2\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              3. pow-sqrN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \left({re}^{2} \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left({re}^{2}\right), \left({re}^{2}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              5. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left(re \cdot re\right), \left({re}^{2}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left({re}^{2}\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              7. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \left(re \cdot re\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              8. *-lowering-*.f6435.4%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{*.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(re, re\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            11. Simplified35.4%

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

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

          Alternative 10: 58.0% accurate, 9.4× speedup?

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

            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(e^{0 - im} + e^{im}\right) \cdot \color{blue}{\left(\frac{1}{2} \cdot \sin re\right)} \]
              2. associate-*r*N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
              4. *-lft-identityN/A

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

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

              \[\leadsto \color{blue}{\sin re \cdot \cosh im} \]
            7. 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) \]
            8. 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-*.f6490.5%

                \[\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) \]
            9. Simplified90.5%

              \[\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)} \]
            10. 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)} \]
            11. 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. *-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}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
              9. 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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\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(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\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(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
              12. *-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(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
              13. *-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(\mathsf{*.f64}\left(im, im\right), \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) \]
              14. 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(\mathsf{*.f64}\left(im, im\right), \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) \]
              15. *-lowering-*.f6468.2%

                \[\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), \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) \]
            12. Simplified68.2%

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

            if 4.50000000000000019e24 < re < 1.12e150

            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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left({re}^{2}\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              5. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(re \cdot re\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
              6. *-lowering-*.f6436.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \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(im, \mathsf{*.f64}\left(im, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            8. Simplified36.8%

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

            if 1.12e150 < 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} \]
            4. Step-by-step derivation
              1. sin-lowering-sin.f6451.6%

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

              \[\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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 4.5 \cdot 10^{+24}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\ \;\;\;\;\left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 11: 55.8% accurate, 12.3× speedup?

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

            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-*.f6491.3%

                \[\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. Simplified91.3%

              \[\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(\frac{1}{2} \cdot re\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. *-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \frac{1}{2}\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-*.f6464.5%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{1}{2}\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) \]
            8. Simplified64.5%

              \[\leadsto \color{blue}{\left(re \cdot 0.5\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) \]
            9. Taylor expanded in im around 0

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{1}{2}\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}{\frac{1}{12}}\right)\right)\right)\right)\right) \]
              8. unpow2N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{1}{2}\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), \frac{1}{12}\right)\right)\right)\right)\right) \]
              9. *-lowering-*.f6462.8%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{1}{2}\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), \frac{1}{12}\right)\right)\right)\right)\right) \]
            11. Simplified62.8%

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

            if 1.35000000000000005e110 < re < 1.12e150

            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.f6439.5%

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

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

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

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

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

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

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

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

              \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
            10. Step-by-step derivation
              1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

            if 1.12e150 < 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} \]
            4. Step-by-step derivation
              1. sin-lowering-sin.f6451.6%

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

              \[\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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 12: 55.8% accurate, 12.3× speedup?

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

            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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\color{blue}{re}, \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, \frac{1}{24}\right)\right)\right)\right)\right)\right) \]
            7. Step-by-step derivation
              1. Simplified62.3%

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

              if 1.35000000000000005e110 < re < 1.12e150

              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.f6439.5%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
              10. Step-by-step derivation
                1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

              if 1.12e150 < 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} \]
              4. Step-by-step derivation
                1. sin-lowering-sin.f6451.6%

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

                \[\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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 13: 48.9% accurate, 12.3× speedup?

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

              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-*.f6491.3%

                  \[\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. Simplified91.3%

                \[\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(\frac{1}{2} \cdot re\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. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \frac{1}{2}\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-*.f6464.5%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{1}{2}\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) \]
              8. Simplified64.5%

                \[\leadsto \color{blue}{\left(re \cdot 0.5\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) \]
              9. Taylor expanded in im around 0

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

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

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

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

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

              if 1.35000000000000005e110 < re < 1.12e150

              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.f6439.5%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
              10. Step-by-step derivation
                1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

              if 1.12e150 < 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} \]
              4. Step-by-step derivation
                1. sin-lowering-sin.f6451.6%

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

                \[\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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\ \;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\ \mathbf{elif}\;re \leq 1.12 \cdot 10^{+150}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 14: 58.2% accurate, 14.7× speedup?

            \[\begin{array}{l} \\ re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right) \end{array} \]
            (FPCore (re im)
             :precision binary64
             (*
              re
              (+
               1.0
               (*
                im
                (*
                 im
                 (+
                  0.5
                  (*
                   (* im im)
                   (+ (* (* im im) 0.001388888888888889) 0.041666666666666664))))))))
            double code(double re, double im) {
            	return re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
            }
            
            real(8) function code(re, im)
                real(8), intent (in) :: re
                real(8), intent (in) :: im
                code = re * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (((im * im) * 0.001388888888888889d0) + 0.041666666666666664d0))))))
            end function
            
            public static double code(double re, double im) {
            	return re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
            }
            
            def code(re, im):
            	return re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))))
            
            function code(re, im)
            	return Float64(re * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(Float64(Float64(im * im) * 0.001388888888888889) + 0.041666666666666664)))))))
            end
            
            function tmp = code(re, im)
            	tmp = re * (1.0 + (im * (im * (0.5 + ((im * im) * (((im * im) * 0.001388888888888889) + 0.041666666666666664))))));
            end
            
            code[re_, im_] := N[(re * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision] + 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\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. Step-by-step derivation
              1. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \left(\color{blue}{1} \cdot \cosh im\right)\right) \]
              4. *-lft-identityN/A

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

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

              \[\leadsto \color{blue}{\sin re \cdot \cosh im} \]
            7. 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) \]
            8. 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-*.f6490.8%

                \[\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) \]
            9. Simplified90.8%

              \[\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)} \]
            10. 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)} \]
            11. 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. *-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}{\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
              9. 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), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\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(\mathsf{*.f64}\left(im, im\right), \left(\color{blue}{\frac{1}{24}} + \frac{1}{720} \cdot {im}^{2}\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(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \color{blue}{\left(\frac{1}{720} \cdot {im}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
              12. *-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(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{24}, \left({im}^{2} \cdot \color{blue}{\frac{1}{720}}\right)\right)\right)\right)\right)\right)\right)\right) \]
              13. *-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(\mathsf{*.f64}\left(im, im\right), \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) \]
              14. 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(\mathsf{*.f64}\left(im, im\right), \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) \]
              15. *-lowering-*.f6458.2%

                \[\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), \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) \]
            12. Simplified58.2%

              \[\leadsto \color{blue}{re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right)\right)\right)\right)} \]
            13. Final simplification58.2%

              \[\leadsto re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot 0.001388888888888889 + 0.041666666666666664\right)\right)\right)\right) \]
            14. Add Preprocessing

            Alternative 15: 48.7% accurate, 16.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\ \mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;re \leq 2.8 \cdot 10^{+227}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (let* ((t_0 (* (+ 2.0 (* im im)) (* re 0.5))))
               (if (<= re 1.35e+110)
                 t_0
                 (if (<= re 2.8e+227) (* -0.16666666666666666 (* re (* re re))) t_0))))
            double code(double re, double im) {
            	double t_0 = (2.0 + (im * im)) * (re * 0.5);
            	double tmp;
            	if (re <= 1.35e+110) {
            		tmp = t_0;
            	} else if (re <= 2.8e+227) {
            		tmp = -0.16666666666666666 * (re * (re * re));
            	} else {
            		tmp = t_0;
            	}
            	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 = (2.0d0 + (im * im)) * (re * 0.5d0)
                if (re <= 1.35d+110) then
                    tmp = t_0
                else if (re <= 2.8d+227) then
                    tmp = (-0.16666666666666666d0) * (re * (re * re))
                else
                    tmp = t_0
                end if
                code = tmp
            end function
            
            public static double code(double re, double im) {
            	double t_0 = (2.0 + (im * im)) * (re * 0.5);
            	double tmp;
            	if (re <= 1.35e+110) {
            		tmp = t_0;
            	} else if (re <= 2.8e+227) {
            		tmp = -0.16666666666666666 * (re * (re * re));
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(re, im):
            	t_0 = (2.0 + (im * im)) * (re * 0.5)
            	tmp = 0
            	if re <= 1.35e+110:
            		tmp = t_0
            	elif re <= 2.8e+227:
            		tmp = -0.16666666666666666 * (re * (re * re))
            	else:
            		tmp = t_0
            	return tmp
            
            function code(re, im)
            	t_0 = Float64(Float64(2.0 + Float64(im * im)) * Float64(re * 0.5))
            	tmp = 0.0
            	if (re <= 1.35e+110)
            		tmp = t_0;
            	elseif (re <= 2.8e+227)
            		tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re)));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(re, im)
            	t_0 = (2.0 + (im * im)) * (re * 0.5);
            	tmp = 0.0;
            	if (re <= 1.35e+110)
            		tmp = t_0;
            	elseif (re <= 2.8e+227)
            		tmp = -0.16666666666666666 * (re * (re * re));
            	else
            		tmp = t_0;
            	end
            	tmp_2 = tmp;
            end
            
            code[re_, im_] := Block[{t$95$0 = N[(N[(2.0 + N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(re * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, 1.35e+110], t$95$0, If[LessEqual[re, 2.8e+227], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\
            \mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;re \leq 2.8 \cdot 10^{+227}:\\
            \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if re < 1.35000000000000005e110 or 2.79999999999999984e227 < 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 \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-*.f6491.5%

                  \[\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. Simplified91.5%

                \[\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(\frac{1}{2} \cdot re\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. *-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(re \cdot \frac{1}{2}\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-*.f6462.2%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{1}{2}\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) \]
              8. Simplified62.2%

                \[\leadsto \color{blue}{\left(re \cdot 0.5\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) \]
              9. Taylor expanded in im around 0

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

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

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

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

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

              if 1.35000000000000005e110 < re < 2.79999999999999984e227

              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.f6442.8%

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
              10. Step-by-step derivation
                1. *-lowering-*.f64N/A

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 1.35 \cdot 10^{+110}:\\ \;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\ \mathbf{elif}\;re \leq 2.8 \cdot 10^{+227}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\ \end{array} \]
            5. Add Preprocessing

            Alternative 16: 30.2% accurate, 25.7× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 14500000000000:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (if (<= im 14500000000000.0) re (* -0.16666666666666666 (* re (* re re)))))
            double code(double re, double im) {
            	double tmp;
            	if (im <= 14500000000000.0) {
            		tmp = re;
            	} else {
            		tmp = -0.16666666666666666 * (re * (re * re));
            	}
            	return tmp;
            }
            
            real(8) function code(re, im)
                real(8), intent (in) :: re
                real(8), intent (in) :: im
                real(8) :: tmp
                if (im <= 14500000000000.0d0) then
                    tmp = re
                else
                    tmp = (-0.16666666666666666d0) * (re * (re * re))
                end if
                code = tmp
            end function
            
            public static double code(double re, double im) {
            	double tmp;
            	if (im <= 14500000000000.0) {
            		tmp = re;
            	} else {
            		tmp = -0.16666666666666666 * (re * (re * re));
            	}
            	return tmp;
            }
            
            def code(re, im):
            	tmp = 0
            	if im <= 14500000000000.0:
            		tmp = re
            	else:
            		tmp = -0.16666666666666666 * (re * (re * re))
            	return tmp
            
            function code(re, im)
            	tmp = 0.0
            	if (im <= 14500000000000.0)
            		tmp = re;
            	else
            		tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re)));
            	end
            	return tmp
            end
            
            function tmp_2 = code(re, im)
            	tmp = 0.0;
            	if (im <= 14500000000000.0)
            		tmp = re;
            	else
            		tmp = -0.16666666666666666 * (re * (re * re));
            	end
            	tmp_2 = tmp;
            end
            
            code[re_, im_] := If[LessEqual[im, 14500000000000.0], re, N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;im \leq 14500000000000:\\
            \;\;\;\;re\\
            
            \mathbf{else}:\\
            \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if im < 1.45e13

              1. Initial program 100.0%

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

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

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

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

                \[\leadsto \color{blue}{re} \]
              7. Step-by-step derivation
                1. Simplified32.7%

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

                if 1.45e13 < im

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{-1}{6} \cdot {re}^{3}} \]
                10. Step-by-step derivation
                  1. *-lowering-*.f64N/A

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

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

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

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

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

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

                  \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)} \]
              8. Recombined 2 regimes into one program.
              9. Add Preprocessing

              Alternative 17: 34.1% accurate, 34.3× speedup?

              \[\begin{array}{l} \\ re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right) \end{array} \]
              (FPCore (re im)
               :precision binary64
               (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
              double code(double re, double im) {
              	return re * (1.0 + ((re * re) * -0.16666666666666666));
              }
              
              real(8) function code(re, im)
                  real(8), intent (in) :: re
                  real(8), intent (in) :: im
                  code = re * (1.0d0 + ((re * re) * (-0.16666666666666666d0)))
              end function
              
              public static double code(double re, double im) {
              	return re * (1.0 + ((re * re) * -0.16666666666666666));
              }
              
              def code(re, im):
              	return re * (1.0 + ((re * re) * -0.16666666666666666))
              
              function code(re, im)
              	return Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666)))
              end
              
              function tmp = code(re, im)
              	tmp = re * (1.0 + ((re * re) * -0.16666666666666666));
              end
              
              code[re_, im_] := N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)
              \end{array}
              
              Derivation
              1. Initial program 100.0%

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

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

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

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

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

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

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

              Alternative 18: 27.0% 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.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. Simplified26.0%

                  \[\leadsto \color{blue}{re} \]
                2. Add Preprocessing

                Reproduce

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