math.sin on complex, real part

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.5× speedup?

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

\\
\cosh im \cdot \sin 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. 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. Final simplification100.0%

    \[\leadsto \cosh im \cdot \sin re \]
  6. Add Preprocessing

Alternative 2: 73.8% accurate, 2.3× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \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)\\


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

    1. Initial program 100.0%

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

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

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

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

    if 9.49999999999999991e-13 < im < 1.80000000000000005e51

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

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

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

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

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

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

      if 1.80000000000000005e51 < im

      1. Initial program 100.0%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{sin.f64}\left(re\right)\right), \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \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)\right)\right) \]
        14. 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(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{12}, \mathsf{*.f64}\left(\left(im \cdot im\right), \frac{1}{360}\right)\right)\right)\right)\right)\right)\right)\right)\right) \]
        15. *-lowering-*.f64100.0%

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \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)} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification75.4%

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

    Alternative 3: 73.4% accurate, 2.5× speedup?

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

      1. Initial program 100.0%

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

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

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

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

      if 9.49999999999999991e-13 < 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. Taylor expanded in re around 0

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

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

            \[\leadsto \mathsf{*.f64}\left(\cosh im, re\right) \]
          2. cosh-lowering-cosh.f6483.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 4: 71.6% accurate, 2.6× speedup?

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

        1. Initial program 100.0%

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

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

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

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

        if 9.49999999999999991e-13 < im < 2.1000000000000001e146

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\cosh im, re\right) \]
            2. cosh-lowering-cosh.f6485.7%

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

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

          if 2.1000000000000001e146 < im

          1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.1 \cdot 10^{+146}:\\ \;\;\;\;\cosh im \cdot re\\ \mathbf{else}:\\ \;\;\;\;\left(\sin re \cdot 0.5\right) \cdot \left(2 + im \cdot im\right)\\ \end{array} \]
        9. Add Preprocessing

        Alternative 5: 68.9% accurate, 2.9× speedup?

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

          1. Initial program 100.0%

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

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

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

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

          if 9.49999999999999991e-13 < 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 re around 0

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

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

                \[\leadsto \mathsf{*.f64}\left(\cosh im, re\right) \]
              2. cosh-lowering-cosh.f6474.1%

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

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

          Alternative 6: 67.0% accurate, 2.9× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\ t_1 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\ \mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3.4 \cdot 10^{+38}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(\left(im \cdot im\right) \cdot t\_0\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + t\_0 \cdot \left(t\_0 + 4\right)}\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\ \;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_1\right)}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
          (FPCore (re im)
           :precision binary64
           (let* ((t_0 (* im (* im (* im im))))
                  (t_1 (* im (+ 0.5 (* (* im im) -0.041666666666666664)))))
             (if (<= im 9.5e-13)
               (sin re)
               (if (<= im 3.4e+38)
                 (*
                  (* re 0.5)
                  (/
                   (*
                    (- 64.0 (* (* im im) (* t_0 (* (* im im) t_0))))
                    (/ 1.0 (- 2.0 (* im im))))
                   (+ 16.0 (* t_0 (+ t_0 4.0)))))
                 (if (<= im 3e+99)
                   (*
                    re
                    (+
                     1.0
                     (/
                      (* im (* (* im (+ 0.5 (* im (* im 0.041666666666666664)))) t_1))
                      t_1)))
                   (* re (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664))))))))))
          double code(double re, double im) {
          	double t_0 = im * (im * (im * im));
          	double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
          	double tmp;
          	if (im <= 9.5e-13) {
          		tmp = sin(re);
          	} else if (im <= 3.4e+38) {
          		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
          	} else if (im <= 3e+99) {
          		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
          	} else {
          		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
          	}
          	return tmp;
          }
          
          real(8) function code(re, im)
              real(8), intent (in) :: re
              real(8), intent (in) :: im
              real(8) :: t_0
              real(8) :: t_1
              real(8) :: tmp
              t_0 = im * (im * (im * im))
              t_1 = im * (0.5d0 + ((im * im) * (-0.041666666666666664d0)))
              if (im <= 9.5d-13) then
                  tmp = sin(re)
              else if (im <= 3.4d+38) then
                  tmp = (re * 0.5d0) * (((64.0d0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0d0 / (2.0d0 - (im * im)))) / (16.0d0 + (t_0 * (t_0 + 4.0d0))))
              else if (im <= 3d+99) then
                  tmp = re * (1.0d0 + ((im * ((im * (0.5d0 + (im * (im * 0.041666666666666664d0)))) * t_1)) / t_1))
              else
                  tmp = re * (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
              end if
              code = tmp
          end function
          
          public static double code(double re, double im) {
          	double t_0 = im * (im * (im * im));
          	double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
          	double tmp;
          	if (im <= 9.5e-13) {
          		tmp = Math.sin(re);
          	} else if (im <= 3.4e+38) {
          		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
          	} else if (im <= 3e+99) {
          		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
          	} else {
          		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
          	}
          	return tmp;
          }
          
          def code(re, im):
          	t_0 = im * (im * (im * im))
          	t_1 = im * (0.5 + ((im * im) * -0.041666666666666664))
          	tmp = 0
          	if im <= 9.5e-13:
          		tmp = math.sin(re)
          	elif im <= 3.4e+38:
          		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))))
          	elif im <= 3e+99:
          		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1))
          	else:
          		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))
          	return tmp
          
          function code(re, im)
          	t_0 = Float64(im * Float64(im * Float64(im * im)))
          	t_1 = Float64(im * Float64(0.5 + Float64(Float64(im * im) * -0.041666666666666664)))
          	tmp = 0.0
          	if (im <= 9.5e-13)
          		tmp = sin(re);
          	elseif (im <= 3.4e+38)
          		tmp = Float64(Float64(re * 0.5) * Float64(Float64(Float64(64.0 - Float64(Float64(im * im) * Float64(t_0 * Float64(Float64(im * im) * t_0)))) * Float64(1.0 / Float64(2.0 - Float64(im * im)))) / Float64(16.0 + Float64(t_0 * Float64(t_0 + 4.0)))));
          	elseif (im <= 3e+99)
          		tmp = Float64(re * Float64(1.0 + Float64(Float64(im * Float64(Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))) * t_1)) / t_1)));
          	else
          		tmp = Float64(re * Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))));
          	end
          	return tmp
          end
          
          function tmp_2 = code(re, im)
          	t_0 = im * (im * (im * im));
          	t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
          	tmp = 0.0;
          	if (im <= 9.5e-13)
          		tmp = sin(re);
          	elseif (im <= 3.4e+38)
          		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
          	elseif (im <= 3e+99)
          		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
          	else
          		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
          	end
          	tmp_2 = tmp;
          end
          
          code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 9.5e-13], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3.4e+38], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(N[(64.0 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(16.0 + N[(t$95$0 * N[(t$95$0 + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3e+99], N[(re * N[(1.0 + N[(N[(im * N[(N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
          t_1 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\
          \mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\
          \;\;\;\;\sin re\\
          
          \mathbf{elif}\;im \leq 3.4 \cdot 10^{+38}:\\
          \;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(\left(im \cdot im\right) \cdot t\_0\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + t\_0 \cdot \left(t\_0 + 4\right)}\\
          
          \mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\
          \;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_1\right)}{t\_1}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if im < 9.49999999999999991e-13

            1. Initial program 100.0%

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

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

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

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

            if 9.49999999999999991e-13 < im < 3.39999999999999996e38

            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-*.f642.8%

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

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

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

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

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

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

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

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

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

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

              if 3.39999999999999996e38 < im < 3.00000000000000014e99

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                  \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                2. *-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}{re}\right) \]
              8. Simplified20.6%

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\left(\frac{1}{2} \cdot im\right) \cdot \left(\frac{1}{2} \cdot im\right) - \left(\left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) \cdot im\right)\right) \cdot im\right), \left(\frac{1}{2} \cdot im - \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) \cdot im\right)\right)\right), re\right) \]
              10. Applied egg-rr81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                  \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                2. *-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}{re}\right) \]
              8. Simplified70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 9.5 \cdot 10^{-13}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3.4 \cdot 10^{+38}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right) + 4\right)}\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\ \;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\right)\right)}{im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \]
            10. Add Preprocessing

            Alternative 7: 43.8% accurate, 5.0× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\ t_1 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\ \mathbf{if}\;im \leq 3.4 \cdot 10^{+38}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(\left(im \cdot im\right) \cdot t\_0\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + t\_0 \cdot \left(t\_0 + 4\right)}\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\ \;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_1\right)}{t\_1}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \end{array} \]
            (FPCore (re im)
             :precision binary64
             (let* ((t_0 (* im (* im (* im im))))
                    (t_1 (* im (+ 0.5 (* (* im im) -0.041666666666666664)))))
               (if (<= im 3.4e+38)
                 (*
                  (* re 0.5)
                  (/
                   (*
                    (- 64.0 (* (* im im) (* t_0 (* (* im im) t_0))))
                    (/ 1.0 (- 2.0 (* im im))))
                   (+ 16.0 (* t_0 (+ t_0 4.0)))))
                 (if (<= im 3e+99)
                   (*
                    re
                    (+
                     1.0
                     (/
                      (* im (* (* im (+ 0.5 (* im (* im 0.041666666666666664)))) t_1))
                      t_1)))
                   (* re (* im (* im (+ 0.5 (* (* im im) 0.041666666666666664)))))))))
            double code(double re, double im) {
            	double t_0 = im * (im * (im * im));
            	double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
            	double tmp;
            	if (im <= 3.4e+38) {
            		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
            	} else if (im <= 3e+99) {
            		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
            	} else {
            		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
            	}
            	return tmp;
            }
            
            real(8) function code(re, im)
                real(8), intent (in) :: re
                real(8), intent (in) :: im
                real(8) :: t_0
                real(8) :: t_1
                real(8) :: tmp
                t_0 = im * (im * (im * im))
                t_1 = im * (0.5d0 + ((im * im) * (-0.041666666666666664d0)))
                if (im <= 3.4d+38) then
                    tmp = (re * 0.5d0) * (((64.0d0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0d0 / (2.0d0 - (im * im)))) / (16.0d0 + (t_0 * (t_0 + 4.0d0))))
                else if (im <= 3d+99) then
                    tmp = re * (1.0d0 + ((im * ((im * (0.5d0 + (im * (im * 0.041666666666666664d0)))) * t_1)) / t_1))
                else
                    tmp = re * (im * (im * (0.5d0 + ((im * im) * 0.041666666666666664d0))))
                end if
                code = tmp
            end function
            
            public static double code(double re, double im) {
            	double t_0 = im * (im * (im * im));
            	double t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
            	double tmp;
            	if (im <= 3.4e+38) {
            		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
            	} else if (im <= 3e+99) {
            		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
            	} else {
            		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
            	}
            	return tmp;
            }
            
            def code(re, im):
            	t_0 = im * (im * (im * im))
            	t_1 = im * (0.5 + ((im * im) * -0.041666666666666664))
            	tmp = 0
            	if im <= 3.4e+38:
            		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))))
            	elif im <= 3e+99:
            		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1))
            	else:
            		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))))
            	return tmp
            
            function code(re, im)
            	t_0 = Float64(im * Float64(im * Float64(im * im)))
            	t_1 = Float64(im * Float64(0.5 + Float64(Float64(im * im) * -0.041666666666666664)))
            	tmp = 0.0
            	if (im <= 3.4e+38)
            		tmp = Float64(Float64(re * 0.5) * Float64(Float64(Float64(64.0 - Float64(Float64(im * im) * Float64(t_0 * Float64(Float64(im * im) * t_0)))) * Float64(1.0 / Float64(2.0 - Float64(im * im)))) / Float64(16.0 + Float64(t_0 * Float64(t_0 + 4.0)))));
            	elseif (im <= 3e+99)
            		tmp = Float64(re * Float64(1.0 + Float64(Float64(im * Float64(Float64(im * Float64(0.5 + Float64(im * Float64(im * 0.041666666666666664)))) * t_1)) / t_1)));
            	else
            		tmp = Float64(re * Float64(im * Float64(im * Float64(0.5 + Float64(Float64(im * im) * 0.041666666666666664)))));
            	end
            	return tmp
            end
            
            function tmp_2 = code(re, im)
            	t_0 = im * (im * (im * im));
            	t_1 = im * (0.5 + ((im * im) * -0.041666666666666664));
            	tmp = 0.0;
            	if (im <= 3.4e+38)
            		tmp = (re * 0.5) * (((64.0 - ((im * im) * (t_0 * ((im * im) * t_0)))) * (1.0 / (2.0 - (im * im)))) / (16.0 + (t_0 * (t_0 + 4.0))));
            	elseif (im <= 3e+99)
            		tmp = re * (1.0 + ((im * ((im * (0.5 + (im * (im * 0.041666666666666664)))) * t_1)) / t_1));
            	else
            		tmp = re * (im * (im * (0.5 + ((im * im) * 0.041666666666666664))));
            	end
            	tmp_2 = tmp;
            end
            
            code[re_, im_] := Block[{t$95$0 = N[(im * N[(im * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * -0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 3.4e+38], N[(N[(re * 0.5), $MachinePrecision] * N[(N[(N[(64.0 - N[(N[(im * im), $MachinePrecision] * N[(t$95$0 * N[(N[(im * im), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(2.0 - N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(16.0 + N[(t$95$0 * N[(t$95$0 + 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3e+99], N[(re * N[(1.0 + N[(N[(im * N[(N[(im * N[(0.5 + N[(im * N[(im * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(im * N[(im * N[(0.5 + N[(N[(im * im), $MachinePrecision] * 0.041666666666666664), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := im \cdot \left(im \cdot \left(im \cdot im\right)\right)\\
            t_1 := im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\\
            \mathbf{if}\;im \leq 3.4 \cdot 10^{+38}:\\
            \;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(t\_0 \cdot \left(\left(im \cdot im\right) \cdot t\_0\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + t\_0 \cdot \left(t\_0 + 4\right)}\\
            
            \mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\
            \;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot t\_1\right)}{t\_1}\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \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 < 3.39999999999999996e38

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

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

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

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

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

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

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

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

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

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

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

                if 3.39999999999999996e38 < im < 3.00000000000000014e99

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                    \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                  2. *-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}{re}\right) \]
                8. Simplified20.6%

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\left(\frac{1}{2} \cdot im\right) \cdot \left(\frac{1}{2} \cdot im\right) - \left(\left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) \cdot im\right)\right) \cdot im\right), \left(\frac{1}{2} \cdot im - \left(im \cdot \left(im \cdot \frac{1}{24}\right)\right) \cdot im\right)\right)\right), re\right) \]
                10. Applied egg-rr81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                    \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                  2. *-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}{re}\right) \]
                8. Simplified70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.4 \cdot 10^{+38}:\\ \;\;\;\;\left(re \cdot 0.5\right) \cdot \frac{\left(64 - \left(im \cdot im\right) \cdot \left(\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\right) \cdot \frac{1}{2 - im \cdot im}}{16 + \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right) + 4\right)}\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+99}:\\ \;\;\;\;re \cdot \left(1 + \frac{im \cdot \left(\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)\right)\right)}{im \cdot \left(0.5 + \left(im \cdot im\right) \cdot -0.041666666666666664\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot \left(0.5 + \left(im \cdot im\right) \cdot 0.041666666666666664\right)\right)\right)\\ \end{array} \]
              10. Add Preprocessing

              Alternative 8: 45.9% accurate, 7.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                    \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                  2. *-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}{re}\right) \]
                8. Simplified53.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                    \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                  2. *-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}{re}\right) \]
                8. Simplified70.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 9: 58.1% accurate, 11.9× speedup?

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

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

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

                    \[\leadsto \left(1 \cdot \cosh im\right) \cdot \color{blue}{re} \]
                  2. 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)}, re\right) \]
                  3. 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), re\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), re\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), re\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), re\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), re\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), re\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), re\right) \]
                    8. *-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}, \left(im \cdot \left(\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) \cdot im\right)\right)\right)\right)\right), re\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, \left(\left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right) \cdot im\right)\right)\right)\right)\right), re\right) \]
                    10. *-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, \left(im \cdot \left(\frac{1}{24} + \frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)\right), re\right) \]
                    11. *-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), re\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}, \left(\frac{1}{720} \cdot {im}^{2}\right)\right)\right)\right)\right)\right)\right), re\right) \]
                    13. *-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), re\right) \]
                    14. 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}, \left(\left(im \cdot im\right) \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right), re\right) \]
                    15. 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}, \mathsf{*.f64}\left(im, \mathsf{*.f64}\left(im, \mathsf{+.f64}\left(\frac{1}{24}, \left(im \cdot \left(im \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right), re\right) \]
                    16. *-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(im, \left(im \cdot \frac{1}{720}\right)\right)\right)\right)\right)\right)\right)\right), re\right) \]
                    17. *-lowering-*.f6466.4%

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

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

                  if 5.5999999999999996e58 < re < 9.80000000000000027e216

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 5.6 \cdot 10^{+58}:\\ \;\;\;\;re \cdot \left(1 + \left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot \left(0.041666666666666664 + im \cdot \left(im \cdot 0.001388888888888889\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 9.8 \cdot 10^{+216}:\\ \;\;\;\;\left(2 + im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right)\right) \cdot \left(im \cdot re\right)\\ \end{array} \]
                  10. Add Preprocessing

                  Alternative 10: 55.8% accurate, 12.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 5.5999999999999996e58 < re < 9.80000000000000027e216

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 11: 45.0% accurate, 19.3× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 3.1 \cdot 10^{+78}:\\ \;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;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 3.1e+78)
                         (* re (+ 1.0 (* re (* re -0.16666666666666666))))
                         (* re (* im (* im (* (* im im) 0.041666666666666664))))))
                      double code(double re, double im) {
                      	double tmp;
                      	if (im <= 3.1e+78) {
                      		tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
                      	} else {
                      		tmp = 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 <= 3.1d+78) then
                              tmp = re * (1.0d0 + (re * (re * (-0.16666666666666666d0))))
                          else
                              tmp = 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 <= 3.1e+78) {
                      		tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
                      	} else {
                      		tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
                      	}
                      	return tmp;
                      }
                      
                      def code(re, im):
                      	tmp = 0
                      	if im <= 3.1e+78:
                      		tmp = re * (1.0 + (re * (re * -0.16666666666666666)))
                      	else:
                      		tmp = re * (im * (im * ((im * im) * 0.041666666666666664)))
                      	return tmp
                      
                      function code(re, im)
                      	tmp = 0.0
                      	if (im <= 3.1e+78)
                      		tmp = Float64(re * Float64(1.0 + Float64(re * Float64(re * -0.16666666666666666))));
                      	else
                      		tmp = Float64(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 <= 3.1e+78)
                      		tmp = re * (1.0 + (re * (re * -0.16666666666666666)));
                      	else
                      		tmp = re * (im * (im * ((im * im) * 0.041666666666666664)));
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[re_, im_] := If[LessEqual[im, 3.1e+78], N[(re * N[(1.0 + N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * 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 3.1 \cdot 10^{+78}:\\
                      \;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;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 2 regimes
                      2. if im < 3.1e78

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\sin re \cdot \left(\left(im \cdot im\right) \cdot \left(0.5 + im \cdot \left(im \cdot 0.041666666666666664\right)\right) + 1\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. *-commutativeN/A

                            \[\leadsto \left(1 + {im}^{2} \cdot \left(\frac{1}{2} + \frac{1}{24} \cdot {im}^{2}\right)\right) \cdot \color{blue}{re} \]
                          2. *-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}{re}\right) \]
                        8. Simplified70.0%

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

                          \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(\frac{1}{24} \cdot {im}^{4}\right)}, re\right) \]
                        10. Step-by-step derivation
                          1. metadata-evalN/A

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(im, \left(\frac{1}{24} \cdot \left(\left(im \cdot im\right) \cdot im\right)\right)\right), re\right) \]
                          7. unpow2N/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.1 \cdot 10^{+78}:\\ \;\;\;\;re \cdot \left(1 + re \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;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 12: 43.7% accurate, 19.3× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 13: 55.7% accurate, 20.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          Alternative 14: 41.5% accurate, 22.0× speedup?

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

                            1. Initial program 100.0%

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

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

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

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

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

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

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

                            if 9.599999999999999e105 < im

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            Alternative 15: 37.4% accurate, 25.7× speedup?

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

                              1. Initial program 100.0%

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

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

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

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

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

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

                                if 1.3999999999999999 < im

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \left(re \cdot \color{blue}{im}\right)\right)\right) \]
                                    5. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(\left(re \cdot im\right) \cdot 1\right)\right)\right) \]
                                    19. *-rgt-identityN/A

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

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

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

                                    \[\leadsto \color{blue}{0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)} \]
                                  5. Step-by-step derivation
                                    1. associate-*r*N/A

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

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

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

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

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

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

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

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

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.4:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(im \cdot \left(im \cdot 0.5\right)\right)\\ \end{array} \]
                                10. Add Preprocessing

                                Alternative 16: 37.4% accurate, 25.7× speedup?

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

                                  1. Initial program 100.0%

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

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

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

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

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

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

                                    if 1.3999999999999999 < im

                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.4:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot im\right) \cdot \left(re \cdot 0.5\right)\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 17: 34.4% accurate, 25.7× speedup?

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

                                      1. Initial program 100.0%

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

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

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

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

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

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

                                        if 1.3999999999999999 < im

                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(im \cdot \left(re \cdot \color{blue}{im}\right)\right)\right) \]
                                            5. *-rgt-identityN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(im, \left(\left(re \cdot im\right) \cdot 1\right)\right)\right) \]
                                            19. *-rgt-identityN/A

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

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

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

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

                                        Alternative 18: 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.f6454.5%

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

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

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

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

                                          Reproduce

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