math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 12.0s
Alternatives: 27
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 27 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, 0.8× speedup?

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

\\
\frac{0.5 \cdot \sin re}{e^{im}} + \sin re \cdot \left(0.5 \cdot e^{im}\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. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 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 3: 76.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\\ t_1 := \left(im \cdot im\right) \cdot \left(-1 - t\_0\right)\\ \mathbf{if}\;im \leq 1:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(4 + \left(im \cdot im\right) \cdot \left(\left(1 + t\_0\right) \cdot t\_1\right)\right) \cdot \frac{1}{2 + t\_1}\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin 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)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0
         (*
          im
          (* im (+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))
        (t_1 (* (* im im) (- -1.0 t_0))))
   (if (<= im 1.0)
     (*
      (* 0.5 (sin re))
      (* (+ 4.0 (* (* im im) (* (+ 1.0 t_0) t_1))) (/ 1.0 (+ 2.0 t_1))))
     (if (<= im 7.2e+51)
       (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
       (*
        (sin re)
        (+
         1.0
         (*
          im
          (*
           im
           (+
            0.5
            (*
             (* im im)
             (+
              0.041666666666666664
              (* (* im im) 0.001388888888888889))))))))))))
double code(double re, double im) {
	double t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)));
	double t_1 = (im * im) * (-1.0 - t_0);
	double tmp;
	if (im <= 1.0) {
		tmp = (0.5 * sin(re)) * ((4.0 + ((im * im) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + t_1)));
	} else if (im <= 7.2e+51) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = im * (im * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))
    t_1 = (im * im) * ((-1.0d0) - t_0)
    if (im <= 1.0d0) then
        tmp = (0.5d0 * sin(re)) * ((4.0d0 + ((im * im) * ((1.0d0 + t_0) * t_1))) * (1.0d0 / (2.0d0 + t_1)))
    else if (im <= 7.2d+51) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    else
        tmp = sin(re) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)));
	double t_1 = (im * im) * (-1.0 - t_0);
	double tmp;
	if (im <= 1.0) {
		tmp = (0.5 * Math.sin(re)) * ((4.0 + ((im * im) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + t_1)));
	} else if (im <= 7.2e+51) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = Math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	}
	return tmp;
}
def code(re, im):
	t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))
	t_1 = (im * im) * (-1.0 - t_0)
	tmp = 0
	if im <= 1.0:
		tmp = (0.5 * math.sin(re)) * ((4.0 + ((im * im) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + t_1)))
	elif im <= 7.2e+51:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))
	return tmp
function code(re, im)
	t_0 = Float64(im * Float64(im * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))
	t_1 = Float64(Float64(im * im) * Float64(-1.0 - t_0))
	tmp = 0.0
	if (im <= 1.0)
		tmp = Float64(Float64(0.5 * sin(re)) * Float64(Float64(4.0 + Float64(Float64(im * im) * Float64(Float64(1.0 + t_0) * t_1))) * Float64(1.0 / Float64(2.0 + t_1))));
	elseif (im <= 7.2e+51)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = Float64(sin(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)));
	t_1 = (im * im) * (-1.0 - t_0);
	tmp = 0.0;
	if (im <= 1.0)
		tmp = (0.5 * sin(re)) * ((4.0 + ((im * im) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + t_1)));
	elseif (im <= 7.2e+51)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(im * im), $MachinePrecision] * N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1.0], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[(4.0 + N[(N[(im * im), $MachinePrecision] * N[(N[(1.0 + t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(2.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\\
t_1 := \left(im \cdot im\right) \cdot \left(-1 - t\_0\right)\\
\mathbf{if}\;im \leq 1:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(4 + \left(im \cdot im\right) \cdot \left(\left(1 + t\_0\right) \cdot t\_1\right)\right) \cdot \frac{1}{2 + t\_1}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\sin 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)\\


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

    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.2%

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

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

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

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

      \[\leadsto \color{blue}{\left(2 + im \cdot \left(im \cdot \left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot \sin re\right)} \]
    8. Step-by-step derivation
      1. flip-+N/A

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

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

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

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

    if 1 < 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}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{cosh.f64}\left(im\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified78.6%

      \[\leadsto \color{blue}{\left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)} \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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      7. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      14. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
    9. Simplified100.0%

      \[\leadsto \sin re \cdot \color{blue}{\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(4 + \left(im \cdot im\right) \cdot \left(\left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-1 - im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right)\right) \cdot \frac{1}{2 + \left(im \cdot im\right) \cdot \left(-1 - im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)}\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.2% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\\ t_1 := -1 - t\_0\\ \mathbf{if}\;im \leq 0.99:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(4 + \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(1 + t\_0\right) \cdot t\_1\right)\right) \cdot \frac{1}{2 + im \cdot \left(im \cdot t\_1\right)}\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin 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)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0
         (*
          im
          (* im (+ 0.08333333333333333 (* (* im im) 0.002777777777777778)))))
        (t_1 (- -1.0 t_0)))
   (if (<= im 0.99)
     (*
      (* 0.5 (sin re))
      (*
       (+ 4.0 (* (* (* im im) (* im im)) (* (+ 1.0 t_0) t_1)))
       (/ 1.0 (+ 2.0 (* im (* im t_1))))))
     (if (<= im 7.2e+51)
       (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
       (*
        (sin re)
        (+
         1.0
         (*
          im
          (*
           im
           (+
            0.5
            (*
             (* im im)
             (+
              0.041666666666666664
              (* (* im im) 0.001388888888888889))))))))))))
double code(double re, double im) {
	double t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)));
	double t_1 = -1.0 - t_0;
	double tmp;
	if (im <= 0.99) {
		tmp = (0.5 * sin(re)) * ((4.0 + (((im * im) * (im * im)) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + (im * (im * t_1)))));
	} else if (im <= 7.2e+51) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = im * (im * (0.08333333333333333d0 + ((im * im) * 0.002777777777777778d0)))
    t_1 = (-1.0d0) - t_0
    if (im <= 0.99d0) then
        tmp = (0.5d0 * sin(re)) * ((4.0d0 + (((im * im) * (im * im)) * ((1.0d0 + t_0) * t_1))) * (1.0d0 / (2.0d0 + (im * (im * t_1)))))
    else if (im <= 7.2d+51) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    else
        tmp = sin(re) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)));
	double t_1 = -1.0 - t_0;
	double tmp;
	if (im <= 0.99) {
		tmp = (0.5 * Math.sin(re)) * ((4.0 + (((im * im) * (im * im)) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + (im * (im * t_1)))));
	} else if (im <= 7.2e+51) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = Math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	}
	return tmp;
}
def code(re, im):
	t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)))
	t_1 = -1.0 - t_0
	tmp = 0
	if im <= 0.99:
		tmp = (0.5 * math.sin(re)) * ((4.0 + (((im * im) * (im * im)) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + (im * (im * t_1)))))
	elif im <= 7.2e+51:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))
	return tmp
function code(re, im)
	t_0 = Float64(im * Float64(im * Float64(0.08333333333333333 + Float64(Float64(im * im) * 0.002777777777777778))))
	t_1 = Float64(-1.0 - t_0)
	tmp = 0.0
	if (im <= 0.99)
		tmp = Float64(Float64(0.5 * sin(re)) * Float64(Float64(4.0 + Float64(Float64(Float64(im * im) * Float64(im * im)) * Float64(Float64(1.0 + t_0) * t_1))) * Float64(1.0 / Float64(2.0 + Float64(im * Float64(im * t_1))))));
	elseif (im <= 7.2e+51)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = Float64(sin(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = im * (im * (0.08333333333333333 + ((im * im) * 0.002777777777777778)));
	t_1 = -1.0 - t_0;
	tmp = 0.0;
	if (im <= 0.99)
		tmp = (0.5 * sin(re)) * ((4.0 + (((im * im) * (im * im)) * ((1.0 + t_0) * t_1))) * (1.0 / (2.0 + (im * (im * t_1)))));
	elseif (im <= 7.2e+51)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(0.08333333333333333 + N[(N[(im * im), $MachinePrecision] * 0.002777777777777778), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 - t$95$0), $MachinePrecision]}, If[LessEqual[im, 0.99], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[(4.0 + N[(N[(N[(im * im), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision] * N[(N[(1.0 + t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(2.0 + N[(im * N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\\
t_1 := -1 - t\_0\\
\mathbf{if}\;im \leq 0.99:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(4 + \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(1 + t\_0\right) \cdot t\_1\right)\right) \cdot \frac{1}{2 + im \cdot \left(im \cdot t\_1\right)}\right)\\

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

\mathbf{else}:\\
\;\;\;\;\sin 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)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 0.98999999999999999

    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.2%

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

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

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

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

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

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

    if 0.98999999999999999 < 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}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{cosh.f64}\left(im\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified78.6%

      \[\leadsto \color{blue}{\left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)} \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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      7. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      14. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
    9. Simplified100.0%

      \[\leadsto \sin re \cdot \color{blue}{\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 0.99:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(\left(4 + \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) \cdot \left(\left(1 + im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right) \cdot \left(-1 - im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)\right) \cdot \frac{1}{2 + im \cdot \left(im \cdot \left(-1 - im \cdot \left(im \cdot \left(0.08333333333333333 + \left(im \cdot im\right) \cdot 0.002777777777777778\right)\right)\right)\right)}\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 94.9% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ \mathbf{if}\;im \leq 1.16:\\ \;\;\;\;\sin re \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))
   (if (<= im 1.16)
     (* (sin re) (+ (* t_0 (* im (* im (* im im)))) (+ 1.0 (* 0.5 (* im im)))))
     (if (<= im 7.2e+51)
       (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
       (* (sin re) (+ 1.0 (* im (* im (+ 0.5 (* (* im im) t_0))))))))))
double code(double re, double im) {
	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	double tmp;
	if (im <= 1.16) {
		tmp = sin(re) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
	} else if (im <= 7.2e+51) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * 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 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
    if (im <= 1.16d0) then
        tmp = sin(re) * ((t_0 * (im * (im * (im * im)))) + (1.0d0 + (0.5d0 * (im * im))))
    else if (im <= 7.2d+51) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    else
        tmp = sin(re) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * t_0)))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	double tmp;
	if (im <= 1.16) {
		tmp = Math.sin(re) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
	} else if (im <= 7.2e+51) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = Math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
	tmp = 0
	if im <= 1.16:
		tmp = math.sin(re) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))))
	elif im <= 7.2e+51:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))))
	return tmp
function code(re, im)
	t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
	tmp = 0.0
	if (im <= 1.16)
		tmp = Float64(sin(re) * Float64(Float64(t_0 * Float64(im * Float64(im * Float64(im * im)))) + Float64(1.0 + Float64(0.5 * Float64(im * im)))));
	elseif (im <= 7.2e+51)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = Float64(sin(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * t_0))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	tmp = 0.0;
	if (im <= 1.16)
		tmp = sin(re) * ((t_0 * (im * (im * (im * im)))) + (1.0 + (0.5 * (im * im))));
	elseif (im <= 7.2e+51)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1.16], N[(N[Sin[re], $MachinePrecision] * N[(N[(t$95$0 * N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
\mathbf{if}\;im \leq 1.16:\\
\;\;\;\;\sin re \cdot \left(t\_0 \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 1.15999999999999992

    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}{2} \cdot \sin re + {im}^{2} \cdot \left(\frac{1}{720} \cdot \left({im}^{2} \cdot \sin re\right) + \frac{1}{24} \cdot \sin re\right)\right)} \]
    4. Simplified91.2%

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

    if 1.15999999999999992 < 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}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{cosh.f64}\left(im\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified78.6%

      \[\leadsto \color{blue}{\left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)} \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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      7. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      14. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
    9. Simplified100.0%

      \[\leadsto \sin re \cdot \color{blue}{\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.16:\\ \;\;\;\;\sin re \cdot \left(\left(0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 95.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\ \mathbf{if}\;im \leq 2.3:\\ \;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot t\_0\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ 0.041666666666666664 (* (* im im) 0.001388888888888889))))
   (if (<= im 2.3)
     (* (sin re) (+ 1.0 (* (* im im) (+ 0.5 (* im (* im t_0))))))
     (if (<= im 7.2e+51)
       (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
       (* (sin re) (+ 1.0 (* im (* im (+ 0.5 (* (* im im) t_0))))))))))
double code(double re, double im) {
	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	double tmp;
	if (im <= 2.3) {
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * t_0)))));
	} else if (im <= 7.2e+51) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * 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 = 0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)
    if (im <= 2.3d0) then
        tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * t_0)))))
    else if (im <= 7.2d+51) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    else
        tmp = sin(re) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * t_0)))))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	double tmp;
	if (im <= 2.3) {
		tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * t_0)))));
	} else if (im <= 7.2e+51) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = Math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889)
	tmp = 0
	if im <= 2.3:
		tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * t_0)))))
	elif im <= 7.2e+51:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))))
	return tmp
function code(re, im)
	t_0 = Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))
	tmp = 0.0
	if (im <= 2.3)
		tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * t_0))))));
	elseif (im <= 7.2e+51)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = Float64(sin(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * t_0))))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.041666666666666664 + ((im * im) * 0.001388888888888889);
	tmp = 0.0;
	if (im <= 2.3)
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * t_0)))));
	elseif (im <= 7.2e+51)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * t_0)))));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 2.3], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(N[(im * im), $MachinePrecision] * N[(0.5 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.041666666666666664 + \left(im \cdot im\right) \cdot 0.001388888888888889\\
\mathbf{if}\;im \leq 2.3:\\
\;\;\;\;\sin re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot t\_0\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 2.2999999999999998

    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. Taylor expanded in im around 0

      \[\leadsto \mathsf{*.f64}\left(\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)}, \mathsf{sin.f64}\left(re\right)\right) \]
    6. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\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), \mathsf{sin.f64}\left(re\right)\right) \]
      14. *-lowering-*.f6491.2%

        \[\leadsto \mathsf{*.f64}\left(\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), \mathsf{sin.f64}\left(re\right)\right) \]
    7. Simplified91.2%

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

    if 2.2999999999999998 < 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}{\left(re \cdot \left(1 + \frac{-1}{6} \cdot {re}^{2}\right)\right)}, \mathsf{cosh.f64}\left(im\right)\right) \]
    8. Step-by-step derivation
      1. *-lowering-*.f64N/A

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified78.6%

      \[\leadsto \color{blue}{\left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)} \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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      7. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      14. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
    9. Simplified100.0%

      \[\leadsto \sin re \cdot \color{blue}{\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)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification92.2%

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

Alternative 7: 94.9% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin 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)\\ \mathbf{if}\;im \leq 0.98:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+51}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0
         (*
          (sin re)
          (+
           1.0
           (*
            im
            (*
             im
             (+
              0.5
              (*
               (* im im)
               (+
                0.041666666666666664
                (* (* im im) 0.001388888888888889))))))))))
   (if (<= im 0.98)
     t_0
     (if (<= im 7.2e+51)
       (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
       t_0))))
double code(double re, double im) {
	double t_0 = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	double tmp;
	if (im <= 0.98) {
		tmp = t_0;
	} else if (im <= 7.2e+51) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} 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) * (1.0d0 + (im * (im * (0.5d0 + ((im * im) * (0.041666666666666664d0 + ((im * im) * 0.001388888888888889d0)))))))
    if (im <= 0.98d0) then
        tmp = t_0
    else if (im <= 7.2d+51) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = Math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	double tmp;
	if (im <= 0.98) {
		tmp = t_0;
	} else if (im <= 7.2e+51) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = math.sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))))
	tmp = 0
	if im <= 0.98:
		tmp = t_0
	elif im <= 7.2e+51:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(sin(re) * Float64(1.0 + Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * Float64(0.041666666666666664 + Float64(Float64(im * im) * 0.001388888888888889))))))))
	tmp = 0.0
	if (im <= 0.98)
		tmp = t_0;
	elseif (im <= 7.2e+51)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = sin(re) * (1.0 + (im * (im * (0.5 + ((im * im) * (0.041666666666666664 + ((im * im) * 0.001388888888888889)))))));
	tmp = 0.0;
	if (im <= 0.98)
		tmp = t_0;
	elseif (im <= 7.2e+51)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Sin[re], $MachinePrecision] * N[(1.0 + N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * N[(0.041666666666666664 + N[(N[(im * im), $MachinePrecision] * 0.001388888888888889), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 0.98], t$95$0, If[LessEqual[im, 7.2e+51], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin 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)\\
\mathbf{if}\;im \leq 0.98:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < 0.97999999999999998 or 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. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      3. associate-*l*N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      7. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      11. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      12. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      13. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
      14. *-lowering-*.f6493.0%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \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) \]
    9. Simplified93.0%

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

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified78.6%

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

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

Alternative 8: 92.0% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.99:\\ \;\;\;\;\sin re \cdot \left(\left(1 + 0.5 \cdot \left(im \cdot im\right)\right) + im \cdot \left(im \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 0.99)
   (*
    (sin re)
    (+
     (+ 1.0 (* 0.5 (* im im)))
     (* im (* im (* im (* im 0.041666666666666664))))))
   (if (<= im 3.2e+71)
     (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
     (* (sin re) (* im (* im (* (* im im) 0.041666666666666664)))))))
double code(double re, double im) {
	double tmp;
	if (im <= 0.99) {
		tmp = sin(re) * ((1.0 + (0.5 * (im * im))) + (im * (im * (im * (im * 0.041666666666666664)))));
	} else if (im <= 3.2e+71) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} 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.99d0) then
        tmp = sin(re) * ((1.0d0 + (0.5d0 * (im * im))) + (im * (im * (im * (im * 0.041666666666666664d0)))))
    else if (im <= 3.2d+71) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    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.99) {
		tmp = Math.sin(re) * ((1.0 + (0.5 * (im * im))) + (im * (im * (im * (im * 0.041666666666666664)))));
	} else if (im <= 3.2e+71) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = Math.sin(re) * (im * (im * ((im * im) * 0.041666666666666664)));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 0.99:
		tmp = math.sin(re) * ((1.0 + (0.5 * (im * im))) + (im * (im * (im * (im * 0.041666666666666664)))))
	elif im <= 3.2e+71:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = math.sin(re) * (im * (im * ((im * im) * 0.041666666666666664)))
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 0.99)
		tmp = Float64(sin(re) * Float64(Float64(1.0 + Float64(0.5 * Float64(im * im))) + Float64(im * Float64(im * Float64(im * Float64(im * 0.041666666666666664))))));
	elseif (im <= 3.2e+71)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = Float64(sin(re) * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 0.99)
		tmp = sin(re) * ((1.0 + (0.5 * (im * im))) + (im * (im * (im * (im * 0.041666666666666664)))));
	elseif (im <= 3.2e+71)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = sin(re) * (im * (im * ((im * im) * 0.041666666666666664)));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 0.99], N[(N[Sin[re], $MachinePrecision] * N[(N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(im * N[(im * N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.2e+71], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.99:\\
\;\;\;\;\sin re \cdot \left(\left(1 + 0.5 \cdot \left(im \cdot im\right)\right) + im \cdot \left(im \cdot \left(im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 0.98999999999999999

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

      \[\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. Step-by-step derivation
      1. distribute-rgt-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 0.98999999999999999 < im < 3.20000000000000023e71

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

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified85.7%

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

    if 3.20000000000000023e71 < 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. Simplified97.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
      16. *-lowering-*.f6497.8%

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

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

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

Alternative 9: 92.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.98:\\ \;\;\;\;\sin 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}\;im \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 0.98)
   (*
    (sin re)
    (+ 1.0 (* (* im im) (+ 0.5 (* im (* im 0.041666666666666664))))))
   (if (<= im 3.2e+71)
     (* (cosh im) (* re (+ 1.0 (* (* re re) -0.16666666666666666))))
     (* (sin re) (* im (* im (* (* im im) 0.041666666666666664)))))))
double code(double re, double im) {
	double tmp;
	if (im <= 0.98) {
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
	} else if (im <= 3.2e+71) {
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} 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.98d0) then
        tmp = sin(re) * (1.0d0 + ((im * im) * (0.5d0 + (im * (im * 0.041666666666666664d0)))))
    else if (im <= 3.2d+71) then
        tmp = cosh(im) * (re * (1.0d0 + ((re * re) * (-0.16666666666666666d0))))
    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.98) {
		tmp = Math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
	} else if (im <= 3.2e+71) {
		tmp = Math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	} else {
		tmp = Math.sin(re) * (im * (im * ((im * im) * 0.041666666666666664)));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 0.98:
		tmp = math.sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))))
	elif im <= 3.2e+71:
		tmp = math.cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)))
	else:
		tmp = math.sin(re) * (im * (im * ((im * im) * 0.041666666666666664)))
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 0.98)
		tmp = Float64(sin(re) * Float64(1.0 + Float64(Float64(im * im) * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664))))));
	elseif (im <= 3.2e+71)
		tmp = Float64(cosh(im) * Float64(re * Float64(1.0 + Float64(Float64(re * re) * -0.16666666666666666))));
	else
		tmp = Float64(sin(re) * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 0.98)
		tmp = sin(re) * (1.0 + ((im * im) * (0.5 + (im * (im * 0.041666666666666664)))));
	elseif (im <= 3.2e+71)
		tmp = cosh(im) * (re * (1.0 + ((re * re) * -0.16666666666666666)));
	else
		tmp = sin(re) * (im * (im * ((im * im) * 0.041666666666666664)));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 0.98], N[(N[Sin[re], $MachinePrecision] * 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[im, 3.2e+71], N[(N[Cosh[im], $MachinePrecision] * N[(re * N[(1.0 + N[(N[(re * re), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.98:\\
\;\;\;\;\sin 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}\;im \leq 3.2 \cdot 10^{+71}:\\
\;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 0.97999999999999998

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

      \[\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)} \]

    if 0.97999999999999998 < im < 3.20000000000000023e71

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

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified85.7%

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

    if 3.20000000000000023e71 < 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. Simplified97.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
      16. *-lowering-*.f6497.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 0.98:\\ \;\;\;\;\sin 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}\;im \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;\cosh im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 85.8% accurate, 2.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.98:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im + 2\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 0.97999999999999998

    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-*.f6479.9%

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

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

    if 0.97999999999999998 < im < 3.20000000000000023e71

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

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

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

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

        \[\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{cosh.f64}\left(im\right)\right) \]
    9. Simplified85.7%

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

    if 3.20000000000000023e71 < 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. Simplified97.8%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{24}\right)\right)\right)\right) \]
      16. *-lowering-*.f6497.8%

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

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

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

Alternative 11: 86.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.98:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im + 2\right)\\ \mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\ \;\;\;\;re \cdot \cosh im\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 0.98)
   (* (* 0.5 (sin re)) (+ (* im im) 2.0))
   (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.98) {
		tmp = (0.5 * sin(re)) * ((im * im) + 2.0);
	} 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.98d0) then
        tmp = (0.5d0 * sin(re)) * ((im * im) + 2.0d0)
    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.98) {
		tmp = (0.5 * Math.sin(re)) * ((im * im) + 2.0);
	} 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.98:
		tmp = (0.5 * math.sin(re)) * ((im * im) + 2.0)
	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.98)
		tmp = Float64(Float64(0.5 * sin(re)) * Float64(Float64(im * im) + 2.0));
	elseif (im <= 2.6e+77)
		tmp = Float64(re * cosh(im));
	else
		tmp = Float64(sin(re) * Float64(im * Float64(im * Float64(Float64(im * im) * 0.041666666666666664))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 0.98)
		tmp = (0.5 * sin(re)) * ((im * im) + 2.0);
	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.98], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[(im * im), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.6e+77], N[(re * N[Cosh[im], $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(im * N[(im * N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.98:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im + 2\right)\\

\mathbf{elif}\;im \leq 2.6 \cdot 10^{+77}:\\
\;\;\;\;re \cdot \cosh im\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < 0.97999999999999998

    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-*.f6479.9%

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

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

    if 0.97999999999999998 < 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. Simplified68.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. unpow2N/A

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

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

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

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

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

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

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

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

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

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

    Alternative 12: 84.6% accurate, 2.6× speedup?

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

      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-*.f6479.9%

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

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

      if 0.97999999999999998 < im < 4e153

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

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

        if 4e153 < 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. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 13: 72.1% accurate, 2.6× speedup?

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

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

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

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

        if 0.97999999999999998 < im < 4e153

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

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

          if 4e153 < 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. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

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

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

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

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

        Alternative 14: 68.9% accurate, 2.9× speedup?

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

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

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

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

          if 0.97999999999999998 < 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. Simplified74.2%

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

          Alternative 15: 67.6% accurate, 2.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(im \cdot im\right) \cdot 0.041666666666666664\\ t_1 := 0.5 + t\_0\\ \mathbf{if}\;im \leq 145000:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;re \cdot \left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot t\_1\right)\right)\right)\right) + re \cdot \left(re \cdot \frac{\left(im \cdot im\right) \cdot t\_1}{re \cdot re}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot t\_0\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* (* im im) 0.041666666666666664)) (t_1 (+ 0.5 t_0)))
             (if (<= im 145000.0)
               (sin re)
               (if (<= im 3.2e+71)
                 (*
                  re
                  (+
                   (+
                    1.0
                    (* (* re re) (* -0.16666666666666666 (+ 1.0 (* im (* im t_1))))))
                   (* re (* re (/ (* (* im im) t_1) (* re re))))))
                 (* re (+ 1.0 (* im (* im t_0))))))))
          double code(double re, double im) {
          	double t_0 = (im * im) * 0.041666666666666664;
          	double t_1 = 0.5 + t_0;
          	double tmp;
          	if (im <= 145000.0) {
          		tmp = sin(re);
          	} else if (im <= 3.2e+71) {
          		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (re * (((im * im) * t_1) / (re * re)))));
          	} else {
          		tmp = re * (1.0 + (im * (im * 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) :: t_1
              real(8) :: tmp
              t_0 = (im * im) * 0.041666666666666664d0
              t_1 = 0.5d0 + t_0
              if (im <= 145000.0d0) then
                  tmp = sin(re)
              else if (im <= 3.2d+71) then
                  tmp = re * ((1.0d0 + ((re * re) * ((-0.16666666666666666d0) * (1.0d0 + (im * (im * t_1)))))) + (re * (re * (((im * im) * t_1) / (re * re)))))
              else
                  tmp = re * (1.0d0 + (im * (im * t_0)))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = (im * im) * 0.041666666666666664;
          	double t_1 = 0.5 + t_0;
          	double tmp;
          	if (im <= 145000.0) {
          		tmp = Math.sin(re);
          	} else if (im <= 3.2e+71) {
          		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (re * (((im * im) * t_1) / (re * re)))));
          	} else {
          		tmp = re * (1.0 + (im * (im * t_0)));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = (im * im) * 0.041666666666666664
          	t_1 = 0.5 + t_0
          	tmp = 0
          	if im <= 145000.0:
          		tmp = math.sin(re)
          	elif im <= 3.2e+71:
          		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (re * (((im * im) * t_1) / (re * re)))))
          	else:
          		tmp = re * (1.0 + (im * (im * t_0)))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(Float64(im * im) * 0.041666666666666664)
          	t_1 = Float64(0.5 + t_0)
          	tmp = 0.0
          	if (im <= 145000.0)
          		tmp = sin(re);
          	elseif (im <= 3.2e+71)
          		tmp = Float64(re * Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 * Float64(1.0 + Float64(im * Float64(im * t_1)))))) + Float64(re * Float64(re * Float64(Float64(Float64(im * im) * t_1) / Float64(re * re))))));
          	else
          		tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * t_0))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = (im * im) * 0.041666666666666664;
          	t_1 = 0.5 + t_0;
          	tmp = 0.0;
          	if (im <= 145000.0)
          		tmp = sin(re);
          	elseif (im <= 3.2e+71)
          		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (re * (((im * im) * t_1) / (re * re)))));
          	else
          		tmp = re * (1.0 + (im * (im * t_0)));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + t$95$0), $MachinePrecision]}, If[LessEqual[im, 145000.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3.2e+71], N[(re * N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 * N[(1.0 + N[(im * N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(re * N[(re * N[(N[(N[(im * im), $MachinePrecision] * t$95$1), $MachinePrecision] / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := \left(im \cdot im\right) \cdot 0.041666666666666664\\
          t_1 := 0.5 + t\_0\\
          \mathbf{if}\;im \leq 145000:\\
          \;\;\;\;\sin re\\
          
          \mathbf{elif}\;im \leq 3.2 \cdot 10^{+71}:\\
          \;\;\;\;re \cdot \left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot t\_1\right)\right)\right)\right) + re \cdot \left(re \cdot \frac{\left(im \cdot im\right) \cdot t\_1}{re \cdot re}\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot t\_0\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if im < 145000

            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.f6459.6%

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

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

            if 145000 < im < 3.20000000000000023e71

            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. Simplified4.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 re around 0

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left({re}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) + \left(\frac{1}{{re}^{2}} + \frac{{im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)}{{re}^{2}}\right)\right)\right)}\right) \]
            10. Simplified20.7%

              \[\leadsto re \cdot \color{blue}{\left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right) + \frac{\left(re \cdot re\right) \cdot \frac{im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)}{re}}{re}\right)} \]
            11. Step-by-step derivation
              1. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right), \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
            12. Applied egg-rr70.7%

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

            if 3.20000000000000023e71 < 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. Simplified97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

            Alternative 16: 48.4% accurate, 5.8× speedup?

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

              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.f6459.6%

                  \[\leadsto \mathsf{sin.f64}\left(re\right) \]
              5. Simplified59.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. *-lowering-*.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

              if 165000 < im < 3.20000000000000023e71

              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. Simplified4.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 re around 0

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

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

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

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

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

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

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

                \[\leadsto \mathsf{*.f64}\left(re, \color{blue}{\left({re}^{2} \cdot \left(\frac{-1}{6} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) + \left(\frac{1}{{re}^{2}} + \frac{{im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)}{{re}^{2}}\right)\right)\right)}\right) \]
              10. Simplified20.7%

                \[\leadsto re \cdot \color{blue}{\left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right) + \frac{\left(re \cdot re\right) \cdot \frac{im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)}{re}}{re}\right)} \]
              11. Step-by-step derivation
                1. associate-/l*N/A

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right), \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right)\right)\right)\right) \]
              12. Applied egg-rr70.7%

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

              if 3.20000000000000023e71 < 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. Simplified97.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 17: 45.4% accurate, 7.0× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(im \cdot im\right) \cdot 0.041666666666666664\\ t_1 := 0.5 + t\_0\\ \mathbf{if}\;im \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;re \cdot \left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot t\_1\right)\right)\right)\right) + re \cdot \frac{\left(im \cdot im\right) \cdot t\_1}{re}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot t\_0\right)\right)\\ \end{array} \end{array} \]
              (FPCore (re im)
               :precision binary64
               (let* ((t_0 (* (* im im) 0.041666666666666664)) (t_1 (+ 0.5 t_0)))
                 (if (<= im 3.2e+71)
                   (*
                    re
                    (+
                     (+ 1.0 (* (* re re) (* -0.16666666666666666 (+ 1.0 (* im (* im t_1))))))
                     (* re (/ (* (* im im) t_1) re))))
                   (* re (+ 1.0 (* im (* im t_0)))))))
              double code(double re, double im) {
              	double t_0 = (im * im) * 0.041666666666666664;
              	double t_1 = 0.5 + t_0;
              	double tmp;
              	if (im <= 3.2e+71) {
              		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (((im * im) * t_1) / re)));
              	} else {
              		tmp = re * (1.0 + (im * (im * 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) :: t_1
                  real(8) :: tmp
                  t_0 = (im * im) * 0.041666666666666664d0
                  t_1 = 0.5d0 + t_0
                  if (im <= 3.2d+71) then
                      tmp = re * ((1.0d0 + ((re * re) * ((-0.16666666666666666d0) * (1.0d0 + (im * (im * t_1)))))) + (re * (((im * im) * t_1) / re)))
                  else
                      tmp = re * (1.0d0 + (im * (im * t_0)))
                  end if
                  code = tmp
              end function
              
              public static double code(double re, double im) {
              	double t_0 = (im * im) * 0.041666666666666664;
              	double t_1 = 0.5 + t_0;
              	double tmp;
              	if (im <= 3.2e+71) {
              		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (((im * im) * t_1) / re)));
              	} else {
              		tmp = re * (1.0 + (im * (im * t_0)));
              	}
              	return tmp;
              }
              
              def code(re, im):
              	t_0 = (im * im) * 0.041666666666666664
              	t_1 = 0.5 + t_0
              	tmp = 0
              	if im <= 3.2e+71:
              		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (((im * im) * t_1) / re)))
              	else:
              		tmp = re * (1.0 + (im * (im * t_0)))
              	return tmp
              
              function code(re, im)
              	t_0 = Float64(Float64(im * im) * 0.041666666666666664)
              	t_1 = Float64(0.5 + t_0)
              	tmp = 0.0
              	if (im <= 3.2e+71)
              		tmp = Float64(re * Float64(Float64(1.0 + Float64(Float64(re * re) * Float64(-0.16666666666666666 * Float64(1.0 + Float64(im * Float64(im * t_1)))))) + Float64(re * Float64(Float64(Float64(im * im) * t_1) / re))));
              	else
              		tmp = Float64(re * Float64(1.0 + Float64(im * Float64(im * t_0))));
              	end
              	return tmp
              end
              
              function tmp_2 = code(re, im)
              	t_0 = (im * im) * 0.041666666666666664;
              	t_1 = 0.5 + t_0;
              	tmp = 0.0;
              	if (im <= 3.2e+71)
              		tmp = re * ((1.0 + ((re * re) * (-0.16666666666666666 * (1.0 + (im * (im * t_1)))))) + (re * (((im * im) * t_1) / re)));
              	else
              		tmp = re * (1.0 + (im * (im * t_0)));
              	end
              	tmp_2 = tmp;
              end
              
              code[re_, im_] := Block[{t$95$0 = N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 + t$95$0), $MachinePrecision]}, If[LessEqual[im, 3.2e+71], N[(re * N[(N[(1.0 + N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 * N[(1.0 + N[(im * N[(im * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(re * N[(N[(N[(im * im), $MachinePrecision] * t$95$1), $MachinePrecision] / re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(1.0 + N[(im * N[(im * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \left(im \cdot im\right) \cdot 0.041666666666666664\\
              t_1 := 0.5 + t\_0\\
              \mathbf{if}\;im \leq 3.2 \cdot 10^{+71}:\\
              \;\;\;\;re \cdot \left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot t\_1\right)\right)\right)\right) + re \cdot \frac{\left(im \cdot im\right) \cdot t\_1}{re}\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot t\_0\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if im < 3.20000000000000023e71

                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. Simplified80.1%

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

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

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

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

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

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

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

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

                  \[\leadsto re \cdot \color{blue}{\left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right) + \frac{\left(re \cdot re\right) \cdot \frac{im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)}{re}}{re}\right)} \]
                11. Step-by-step derivation
                  1. div-invN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right), re\right), re\right)\right)\right) \]
                12. Applied egg-rr40.1%

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

                if 3.20000000000000023e71 < 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. Simplified97.8%

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \color{blue}{re} \cdot \left(1 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right) \]
                11. Recombined 2 regimes into one program.
                12. Final simplification46.2%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.2 \cdot 10^{+71}:\\ \;\;\;\;re \cdot \left(\left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 \cdot \left(1 + im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\right)\right) + re \cdot \frac{\left(im \cdot im\right) \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)}{re}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(1 + im \cdot \left(im \cdot \left(\left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \]
                13. Add Preprocessing

                Alternative 18: 58.4% accurate, 8.1× speedup?

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

                  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-*.f6488.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. Simplified88.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(\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-*.f6468.7%

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

                    \[\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) \]

                  if 2.2e46 < re

                  1. Initial program 99.9%

                    \[\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. Simplified81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 19: 58.4% accurate, 11.0× speedup?

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

                  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-*.f6488.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. Simplified88.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(\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-*.f6468.7%

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

                    \[\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) \]

                  if 2.2e46 < re

                  1. Initial program 99.9%

                    \[\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.f6445.2%

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \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}{{re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)}\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({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
                    11. 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}, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{120}} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)\right)\right)\right)\right)\right) \]
                    12. associate-*l*N/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 \cdot \color{blue}{\left(re \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                    13. *-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(re, \color{blue}{\left(re \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                    14. *-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(re, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                    15. +-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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {re}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                    16. *-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}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \left({re}^{2} \cdot \color{blue}{\frac{-1}{5040}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    17. *-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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{5040}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    18. 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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{5040}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    19. *-lowering-*.f6427.0%

                      \[\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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{5040}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                  8. Simplified27.0%

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

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

                Alternative 20: 56.2% accurate, 11.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 2.2e46 < re

                  1. Initial program 99.9%

                    \[\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.f6445.2%

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \left({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right) + \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}{{re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)}\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({re}^{2} \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)}\right)\right)\right)\right)\right) \]
                    11. 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}, \left(\left(re \cdot re\right) \cdot \left(\color{blue}{\frac{1}{120}} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)\right)\right)\right)\right)\right) \]
                    12. associate-*l*N/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 \cdot \color{blue}{\left(re \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                    13. *-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(re, \color{blue}{\left(re \cdot \left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)\right)}\right)\right)\right)\right)\right)\right) \]
                    14. *-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(re, \mathsf{*.f64}\left(re, \color{blue}{\left(\frac{1}{120} + \frac{-1}{5040} \cdot {re}^{2}\right)}\right)\right)\right)\right)\right)\right)\right) \]
                    15. +-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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \color{blue}{\left(\frac{-1}{5040} \cdot {re}^{2}\right)}\right)\right)\right)\right)\right)\right)\right)\right) \]
                    16. *-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}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \left({re}^{2} \cdot \color{blue}{\frac{-1}{5040}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    17. *-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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left({re}^{2}\right), \color{blue}{\frac{-1}{5040}}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    18. 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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\left(re \cdot re\right), \frac{-1}{5040}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                    19. *-lowering-*.f6427.0%

                      \[\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(re, \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(\frac{1}{120}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, re\right), \frac{-1}{5040}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
                  8. Simplified27.0%

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

                Alternative 21: 56.0% accurate, 15.4× speedup?

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

                  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. Simplified83.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  if 3.5e98 < 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. Simplified82.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 \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                  7. Step-by-step derivation
                    1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right), \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot re\right)}\right) \]
                  11. Simplified30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 22: 55.8% accurate, 17.2× speedup?

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

                  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. Simplified83.1%

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{sin.f64}\left(re\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, im\right), \frac{1}{24}\right)\right)\right)\right)\right) \]
                  8. Simplified82.3%

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

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

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

                    if 3.5e98 < 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. Simplified82.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 \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                    7. Step-by-step derivation
                      1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right), \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot re\right)}\right) \]
                    11. Simplified30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{re \cdot \left(\left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\right)} \]
                  11. Recombined 2 regimes into one program.
                  12. Add Preprocessing

                  Alternative 23: 48.9% accurate, 17.2× speedup?

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

                    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. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

                      if 3.5e98 < 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. Simplified82.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 \color{blue}{re \cdot \left(1 + \left(\frac{-1}{6} \cdot \left({re}^{2} \cdot \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right) + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right)\right)} \]
                      7. Step-by-step derivation
                        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right), \color{blue}{\left(\left(\frac{-1}{6} \cdot {re}^{2}\right) \cdot re\right)}\right) \]
                      11. Simplified30.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{re \cdot \left(\left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(im \cdot im\right) \cdot -0.08333333333333333\right)\right)} \]
                    10. Recombined 2 regimes into one program.
                    11. Final simplification47.4%

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

                    Alternative 24: 48.8% accurate, 22.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 3.5 \cdot 10^{+98}:\\ \;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)\\ \end{array} \end{array} \]
                    (FPCore (re im)
                     :precision binary64
                     (if (<= re 3.5e+98)
                       (* re (+ 1.0 (* 0.5 (* im im))))
                       (* -0.16666666666666666 (* re (* re re)))))
                    double code(double re, double im) {
                    	double tmp;
                    	if (re <= 3.5e+98) {
                    		tmp = re * (1.0 + (0.5 * (im * im)));
                    	} 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 (re <= 3.5d+98) then
                            tmp = re * (1.0d0 + (0.5d0 * (im * im)))
                        else
                            tmp = (-0.16666666666666666d0) * (re * (re * re))
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double re, double im) {
                    	double tmp;
                    	if (re <= 3.5e+98) {
                    		tmp = re * (1.0 + (0.5 * (im * im)));
                    	} else {
                    		tmp = -0.16666666666666666 * (re * (re * re));
                    	}
                    	return tmp;
                    }
                    
                    def code(re, im):
                    	tmp = 0
                    	if re <= 3.5e+98:
                    		tmp = re * (1.0 + (0.5 * (im * im)))
                    	else:
                    		tmp = -0.16666666666666666 * (re * (re * re))
                    	return tmp
                    
                    function code(re, im)
                    	tmp = 0.0
                    	if (re <= 3.5e+98)
                    		tmp = Float64(re * Float64(1.0 + Float64(0.5 * Float64(im * im))));
                    	else
                    		tmp = Float64(-0.16666666666666666 * Float64(re * Float64(re * re)));
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(re, im)
                    	tmp = 0.0;
                    	if (re <= 3.5e+98)
                    		tmp = re * (1.0 + (0.5 * (im * im)));
                    	else
                    		tmp = -0.16666666666666666 * (re * (re * re));
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[re_, im_] := If[LessEqual[re, 3.5e+98], N[(re * N[(1.0 + N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;re \leq 3.5 \cdot 10^{+98}:\\
                    \;\;\;\;re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)\\
                    
                    \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 re < 3.5e98

                      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. Taylor expanded in im around 0

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

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

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

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

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

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

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

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

                        if 3.5e98 < 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.f6441.4%

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

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

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

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

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

                          \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(re \cdot \left(re \cdot re\right)\right)} \]
                      10. Recombined 2 regimes into one program.
                      11. Final simplification47.0%

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

                      Alternative 25: 30.6% accurate, 25.7× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 3.5 \cdot 10^{+98}:\\ \;\;\;\;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 (<= re 3.5e+98) re (* -0.16666666666666666 (* re (* re re)))))
                      double code(double re, double im) {
                      	double tmp;
                      	if (re <= 3.5e+98) {
                      		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 (re <= 3.5d+98) 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 (re <= 3.5e+98) {
                      		tmp = re;
                      	} else {
                      		tmp = -0.16666666666666666 * (re * (re * re));
                      	}
                      	return tmp;
                      }
                      
                      def code(re, im):
                      	tmp = 0
                      	if re <= 3.5e+98:
                      		tmp = re
                      	else:
                      		tmp = -0.16666666666666666 * (re * (re * re))
                      	return tmp
                      
                      function code(re, im)
                      	tmp = 0.0
                      	if (re <= 3.5e+98)
                      		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 (re <= 3.5e+98)
                      		tmp = re;
                      	else
                      		tmp = -0.16666666666666666 * (re * (re * re));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[re_, im_] := If[LessEqual[re, 3.5e+98], re, N[(-0.16666666666666666 * N[(re * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;re \leq 3.5 \cdot 10^{+98}:\\
                      \;\;\;\;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 re < 3.5e98

                        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.f6447.0%

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

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

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

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

                          if 3.5e98 < 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.f6441.4%

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(re, \mathsf{*.f64}\left(re, \color{blue}{re}\right)\right)\right) \]
                          11. Simplified28.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 26: 34.6% accurate, 34.3× speedup?

                        \[\begin{array}{l} \\ re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\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(re * Float64(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[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        \begin{array}{l}
                        
                        \\
                        re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)
                        \end{array}
                        
                        Derivation
                        1. Initial program 100.0%

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

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

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

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

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

                          \[\leadsto \color{blue}{re \cdot \left(1 + \left(re \cdot re\right) \cdot -0.16666666666666666\right)} \]
                        9. Step-by-step derivation
                          1. associate-*l*N/A

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(re, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(re, \frac{-1}{6}\right), re\right)\right)\right) \]
                        10. Applied egg-rr33.8%

                          \[\leadsto re \cdot \left(1 + \color{blue}{\left(re \cdot -0.16666666666666666\right) \cdot re}\right) \]
                        11. Final simplification33.8%

                          \[\leadsto re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right) \]
                        12. Add Preprocessing

                        Alternative 27: 26.8% 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.f6446.0%

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

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

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

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

                          Reproduce

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