math.cos on complex, imaginary part

Percentage Accurate: 65.1% → 99.9%
Time: 16.3s
Alternatives: 23
Speedup: 2.8×

Specification

?
\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-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(-im) - exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-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 23 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: 65.1% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \end{array} \]
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-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(-im) - exp(im))
end function
public static double code(double re, double im) {
	return (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
}
def code(re, im):
	return (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
function code(re, im)
	return Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)))
end
function tmp = code(re, im)
	tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
end
code[re_, im_] := N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

Alternative 1: 99.9% accurate, 0.6× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := e^{-im\_m} - e^{im\_m}\\ t_1 := 0.5 \cdot \sin re\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;t\_0 \leq -0.4:\\ \;\;\;\;t\_0 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (- (exp (- im_m)) (exp im_m))) (t_1 (* 0.5 (sin re))))
   (*
    im_s
    (if (<= t_0 -0.4)
      (* t_0 t_1)
      (*
       t_1
       (*
        im_m
        (+
         -2.0
         (*
          (* im_m im_m)
          (+
           -0.3333333333333333
           (*
            im_m
            (*
             im_m
             (+
              -0.016666666666666666
              (* im_m (* im_m -0.0003968253968253968))))))))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = exp(-im_m) - exp(im_m);
	double t_1 = 0.5 * sin(re);
	double tmp;
	if (t_0 <= -0.4) {
		tmp = t_0 * t_1;
	} else {
		tmp = t_1 * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = exp(-im_m) - exp(im_m)
    t_1 = 0.5d0 * sin(re)
    if (t_0 <= (-0.4d0)) then
        tmp = t_0 * t_1
    else
        tmp = t_1 * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * ((-0.016666666666666666d0) + (im_m * (im_m * (-0.0003968253968253968d0))))))))))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = Math.exp(-im_m) - Math.exp(im_m);
	double t_1 = 0.5 * Math.sin(re);
	double tmp;
	if (t_0 <= -0.4) {
		tmp = t_0 * t_1;
	} else {
		tmp = t_1 * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = math.exp(-im_m) - math.exp(im_m)
	t_1 = 0.5 * math.sin(re)
	tmp = 0
	if t_0 <= -0.4:
		tmp = t_0 * t_1
	else:
		tmp = t_1 * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(exp(Float64(-im_m)) - exp(im_m))
	t_1 = Float64(0.5 * sin(re))
	tmp = 0.0
	if (t_0 <= -0.4)
		tmp = Float64(t_0 * t_1);
	else
		tmp = Float64(t_1 * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * Float64(-0.016666666666666666 + Float64(im_m * Float64(im_m * -0.0003968253968253968))))))))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = exp(-im_m) - exp(im_m);
	t_1 = 0.5 * sin(re);
	tmp = 0.0;
	if (t_0 <= -0.4)
		tmp = t_0 * t_1;
	else
		tmp = t_1 * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(N[Exp[(-im$95$m)], $MachinePrecision] - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[t$95$0, -0.4], N[(t$95$0 * t$95$1), $MachinePrecision], N[(t$95$1 * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * N[(-0.016666666666666666 + N[(im$95$m * N[(im$95$m * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := e^{-im\_m} - e^{im\_m}\\
t_1 := 0.5 \cdot \sin re\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;t\_0 \leq -0.4:\\
\;\;\;\;t\_0 \cdot t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -0.40000000000000002

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right) \]
    2. Add Preprocessing

    if -0.40000000000000002 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

    1. Initial program 58.0%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)}\right) \]
      4. unpow297.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + {im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right) \]
      8. unpow297.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)\right)\right) \]
      9. associate-*l*97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right)\right) \]
      10. sub-neg97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.0003968253968253968 \cdot {im}^{2} + \left(-0.016666666666666666\right)\right)}\right)\right)\right)\right) \]
      11. metadata-eval97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} + \color{blue}{-0.016666666666666666}\right)\right)\right)\right)\right) \]
      12. +-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.016666666666666666 + -0.0003968253968253968 \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
      13. *-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{{im}^{2} \cdot -0.0003968253968253968}\right)\right)\right)\right)\right) \]
      14. unpow297.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{\left(im \cdot im\right)} \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]
      15. associate-*l*97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{im \cdot \left(im \cdot -0.0003968253968253968\right)}\right)\right)\right)\right)\right) \]
    5. Simplified97.7%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + im \cdot \left(im \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{-im} - e^{im} \leq -0.4:\\ \;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + im \cdot \left(im \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 97.8% accurate, 1.4× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 1.46:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;im\_m \leq 5.2 \cdot 10^{+46}:\\ \;\;\;\;\left(e^{-im\_m} - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= im_m 1.46)
    (*
     (* 0.5 (sin re))
     (*
      im_m
      (+
       -2.0
       (*
        (* im_m im_m)
        (+
         -0.3333333333333333
         (*
          im_m
          (*
           im_m
           (+
            -0.016666666666666666
            (* im_m (* im_m -0.0003968253968253968))))))))))
    (if (<= im_m 5.2e+46)
      (* (- (exp (- im_m)) (exp im_m)) (* 0.5 re))
      (*
       im_m
       (*
        (sin re)
        (+
         -1.0
         (*
          (* im_m im_m)
          (+
           (*
            (* im_m im_m)
            (+ -0.008333333333333333 (* im_m (* im_m -0.0001984126984126984))))
           -0.16666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 1.46) {
		tmp = (0.5 * sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))));
	} else if (im_m <= 5.2e+46) {
		tmp = (exp(-im_m) - exp(im_m)) * (0.5 * re);
	} else {
		tmp = im_m * (sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (im_m <= 1.46d0) then
        tmp = (0.5d0 * sin(re)) * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * ((-0.016666666666666666d0) + (im_m * (im_m * (-0.0003968253968253968d0))))))))))
    else if (im_m <= 5.2d+46) then
        tmp = (exp(-im_m) - exp(im_m)) * (0.5d0 * re)
    else
        tmp = im_m * (sin(re) * ((-1.0d0) + ((im_m * im_m) * (((im_m * im_m) * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0))))) + (-0.16666666666666666d0)))))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 1.46) {
		tmp = (0.5 * Math.sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))));
	} else if (im_m <= 5.2e+46) {
		tmp = (Math.exp(-im_m) - Math.exp(im_m)) * (0.5 * re);
	} else {
		tmp = im_m * (Math.sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if im_m <= 1.46:
		tmp = (0.5 * math.sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))))
	elif im_m <= 5.2e+46:
		tmp = (math.exp(-im_m) - math.exp(im_m)) * (0.5 * re)
	else:
		tmp = im_m * (math.sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (im_m <= 1.46)
		tmp = Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * Float64(-0.016666666666666666 + Float64(im_m * Float64(im_m * -0.0003968253968253968))))))))));
	elseif (im_m <= 5.2e+46)
		tmp = Float64(Float64(exp(Float64(-im_m)) - exp(im_m)) * Float64(0.5 * re));
	else
		tmp = Float64(im_m * Float64(sin(re) * Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(Float64(Float64(im_m * im_m) * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))) + -0.16666666666666666)))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (im_m <= 1.46)
		tmp = (0.5 * sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968)))))))));
	elseif (im_m <= 5.2e+46)
		tmp = (exp(-im_m) - exp(im_m)) * (0.5 * re);
	else
		tmp = im_m * (sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 1.46], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * N[(-0.016666666666666666 + N[(im$95$m * N[(im$95$m * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 5.2e+46], N[(N[(N[Exp[(-im$95$m)], $MachinePrecision] - N[Exp[im$95$m], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(N[Sin[re], $MachinePrecision] * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 1.46:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;im\_m \leq 5.2 \cdot 10^{+46}:\\
\;\;\;\;\left(e^{-im\_m} - e^{im\_m}\right) \cdot \left(0.5 \cdot re\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)\\


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

    1. Initial program 58.0%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)}\right) \]
      4. unpow297.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + {im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right) \]
      8. unpow297.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)\right)\right) \]
      9. associate-*l*97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right)\right) \]
      10. sub-neg97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.0003968253968253968 \cdot {im}^{2} + \left(-0.016666666666666666\right)\right)}\right)\right)\right)\right) \]
      11. metadata-eval97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} + \color{blue}{-0.016666666666666666}\right)\right)\right)\right)\right) \]
      12. +-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.016666666666666666 + -0.0003968253968253968 \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
      13. *-commutative97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{{im}^{2} \cdot -0.0003968253968253968}\right)\right)\right)\right)\right) \]
      14. unpow297.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{\left(im \cdot im\right)} \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]
      15. associate-*l*97.7%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{im \cdot \left(im \cdot -0.0003968253968253968\right)}\right)\right)\right)\right)\right) \]
    5. Simplified97.7%

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

    if 1.46 < im < 5.20000000000000027e46

    1. Initial program 99.9%

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

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

    if 5.20000000000000027e46 < im

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative96.5%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
      2. +-commutative96.5%

        \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
      3. distribute-rgt-in96.5%

        \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
      4. *-commutative96.5%

        \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
      5. associate-+l+96.5%

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

      \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
      2. associate-*l*100.0%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      3. associate-*l*100.0%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      4. associate-*l*100.0%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
    7. Applied egg-rr100.0%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
    8. Taylor expanded in re around inf 100.0%

      \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right)} \]
    9. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) + \left(-1\right)\right)}\right) \]
      2. metadata-eval100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) + \color{blue}{-1}\right)\right) \]
      3. +-commutative100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \color{blue}{\left(-1 + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right)}\right) \]
      4. +-commutative100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{\left({im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) + -0.16666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
      5. *-commutative100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) \cdot {im}^{4}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      6. sub-neg100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} + \left(-0.008333333333333333\right)\right)} \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      7. *-commutative100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{{im}^{2} \cdot -0.0001984126984126984} + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      8. unpow2100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot -0.0001984126984126984 + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      9. associate-*r*100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)} + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      10. metadata-eval100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(im \cdot \left(im \cdot -0.0001984126984126984\right) + \color{blue}{-0.008333333333333333}\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      11. +-commutative100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)} \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      12. metadata-eval100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      13. pow-sqr100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      14. associate-*r*100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2}\right) \cdot {im}^{2}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      15. distribute-rgt-out100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{{im}^{2} \cdot \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2} + -0.16666666666666666\right)}\right)\right) \]
      16. unpow2100.0%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{\left(im \cdot im\right)} \cdot \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2} + -0.16666666666666666\right)\right)\right) \]
    10. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.46:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + im \cdot \left(im \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 5.2 \cdot 10^{+46}:\\ \;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 92.2% accurate, 2.4× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 1.5 \cdot 10^{+19} \lor \neg \left(im\_m \leq 1.25 \cdot 10^{+77}\right):\\ \;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.16666666666666666 + im\_m \cdot \left(im\_m \cdot -0.008333333333333333\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (or (<= im_m 1.5e+19) (not (<= im_m 1.25e+77)))
    (*
     im_m
     (*
      (sin re)
      (+
       -1.0
       (*
        (* im_m im_m)
        (+ -0.16666666666666666 (* im_m (* im_m -0.008333333333333333)))))))
    (*
     im_m
     (*
      re
      (*
       (+
        -1.0
        (*
         (* im_m im_m)
         (+
          (*
           (* im_m im_m)
           (+ -0.008333333333333333 (* im_m (* im_m -0.0001984126984126984))))
          -0.16666666666666666)))
       (+ (* re (* re -0.16666666666666666)) 1.0)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if ((im_m <= 1.5e+19) || !(im_m <= 1.25e+77)) {
		tmp = im_m * (sin(re) * (-1.0 + ((im_m * im_m) * (-0.16666666666666666 + (im_m * (im_m * -0.008333333333333333))))));
	} else {
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if ((im_m <= 1.5d+19) .or. (.not. (im_m <= 1.25d+77))) then
        tmp = im_m * (sin(re) * ((-1.0d0) + ((im_m * im_m) * ((-0.16666666666666666d0) + (im_m * (im_m * (-0.008333333333333333d0)))))))
    else
        tmp = im_m * (re * (((-1.0d0) + ((im_m * im_m) * (((im_m * im_m) * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0))))) + (-0.16666666666666666d0)))) * ((re * (re * (-0.16666666666666666d0))) + 1.0d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if ((im_m <= 1.5e+19) || !(im_m <= 1.25e+77)) {
		tmp = im_m * (Math.sin(re) * (-1.0 + ((im_m * im_m) * (-0.16666666666666666 + (im_m * (im_m * -0.008333333333333333))))));
	} else {
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if (im_m <= 1.5e+19) or not (im_m <= 1.25e+77):
		tmp = im_m * (math.sin(re) * (-1.0 + ((im_m * im_m) * (-0.16666666666666666 + (im_m * (im_m * -0.008333333333333333))))))
	else:
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if ((im_m <= 1.5e+19) || !(im_m <= 1.25e+77))
		tmp = Float64(im_m * Float64(sin(re) * Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(-0.16666666666666666 + Float64(im_m * Float64(im_m * -0.008333333333333333)))))));
	else
		tmp = Float64(im_m * Float64(re * Float64(Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(Float64(Float64(im_m * im_m) * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * Float64(Float64(re * Float64(re * -0.16666666666666666)) + 1.0))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if ((im_m <= 1.5e+19) || ~((im_m <= 1.25e+77)))
		tmp = im_m * (sin(re) * (-1.0 + ((im_m * im_m) * (-0.16666666666666666 + (im_m * (im_m * -0.008333333333333333))))));
	else
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[Or[LessEqual[im$95$m, 1.5e+19], N[Not[LessEqual[im$95$m, 1.25e+77]], $MachinePrecision]], N[(im$95$m * N[(N[Sin[re], $MachinePrecision] * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.16666666666666666 + N[(im$95$m * N[(im$95$m * -0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 1.5 \cdot 10^{+19} \lor \neg \left(im\_m \leq 1.25 \cdot 10^{+77}\right):\\
\;\;\;\;im\_m \cdot \left(\sin re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.16666666666666666 + im\_m \cdot \left(im\_m \cdot -0.008333333333333333\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < 1.5e19 or 1.25000000000000001e77 < im

    1. Initial program 67.2%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + -0.008333333333333333 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutative93.4%

        \[\leadsto im \cdot \left(\color{blue}{\sin re \cdot -1} + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + -0.008333333333333333 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \]
      2. +-commutative93.4%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + {im}^{2} \cdot \color{blue}{\left(-0.008333333333333333 \cdot \left({im}^{2} \cdot \sin re\right) + -0.16666666666666666 \cdot \sin re\right)}\right) \]
      3. distribute-lft-in93.4%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \left({im}^{2} \cdot \sin re\right)\right) + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re\right)\right)}\right) \]
      4. associate-*r*93.4%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + \left({im}^{2} \cdot \color{blue}{\left(\left(-0.008333333333333333 \cdot {im}^{2}\right) \cdot \sin re\right)} + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re\right)\right)\right) \]
      5. associate-*r*94.6%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + \left(\color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2}\right)\right) \cdot \sin re} + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re\right)\right)\right) \]
      6. associate-*r*94.6%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + \left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right) \cdot \sin re}\right)\right) \]
      7. *-commutative94.6%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + \left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2}\right)\right) \cdot \sin re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right)} \cdot \sin re\right)\right) \]
      8. distribute-rgt-out94.6%

        \[\leadsto im \cdot \left(\sin re \cdot -1 + \color{blue}{\sin re \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2}\right) + -0.16666666666666666 \cdot {im}^{2}\right)}\right) \]
      9. distribute-lft-out94.6%

        \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(-1 + \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2}\right) + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right)} \]
      10. *-commutative94.6%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2}\right) + \color{blue}{{im}^{2} \cdot -0.16666666666666666}\right)\right)\right) \]
      11. distribute-lft-out94.6%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{{im}^{2} \cdot \left(-0.008333333333333333 \cdot {im}^{2} + -0.16666666666666666\right)}\right)\right) \]
    5. Simplified94.6%

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

    if 1.5e19 < im < 1.25000000000000001e77

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative40.0%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
      2. +-commutative40.0%

        \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
      3. distribute-rgt-in40.0%

        \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
      4. *-commutative40.0%

        \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
      5. associate-+l+40.0%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + \left(\left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2} + -1 \cdot \sin re\right)\right)} \]
    5. Simplified48.6%

      \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative48.6%

        \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
      2. associate-*l*48.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      3. associate-*l*48.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      4. associate-*l*48.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
    7. Applied egg-rr48.6%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
    8. Taylor expanded in re around 0 37.5%

      \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(\left(-0.16666666666666666 \cdot \left({re}^{2} \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right) + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right) - 1\right)\right)} \]
    9. Simplified73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.5 \cdot 10^{+19} \lor \neg \left(im \leq 1.25 \cdot 10^{+77}\right):\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot -0.008333333333333333\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(\left(-1 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 93.3% accurate, 2.5× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\right) \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (*
   (* 0.5 (sin re))
   (*
    im_m
    (+
     -2.0
     (*
      (* im_m im_m)
      (+
       -0.3333333333333333
       (*
        im_m
        (*
         im_m
         (+
          -0.016666666666666666
          (* im_m (* im_m -0.0003968253968253968))))))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	return im_s * ((0.5 * sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))));
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    code = im_s * ((0.5d0 * sin(re)) * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * ((-0.016666666666666666d0) + (im_m * (im_m * (-0.0003968253968253968d0)))))))))))
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	return im_s * ((0.5 * Math.sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))));
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	return im_s * ((0.5 * math.sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))))
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	return Float64(im_s * Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * Float64(-0.016666666666666666 + Float64(im_m * Float64(im_m * -0.0003968253968253968)))))))))))
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp = code(im_s, re, im_m)
	tmp = im_s * ((0.5 * sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))));
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * N[(-0.016666666666666666 + N[(im$95$m * N[(im$95$m * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 68.6%

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

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) - 2\right)\right)} \]
  4. Step-by-step derivation
    1. sub-neg94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
    2. metadata-eval94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
    3. +-commutative94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)}\right) \]
    4. unpow294.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)\right) \]
    5. sub-neg94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \left(-0.3333333333333333\right)\right)}\right)\right) \]
    6. metadata-eval94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
    7. +-commutative94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + {im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right) \]
    8. unpow294.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)\right)\right) \]
    9. associate-*l*94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right)\right) \]
    10. sub-neg94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.0003968253968253968 \cdot {im}^{2} + \left(-0.016666666666666666\right)\right)}\right)\right)\right)\right) \]
    11. metadata-eval94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} + \color{blue}{-0.016666666666666666}\right)\right)\right)\right)\right) \]
    12. +-commutative94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.016666666666666666 + -0.0003968253968253968 \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
    13. *-commutative94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{{im}^{2} \cdot -0.0003968253968253968}\right)\right)\right)\right)\right) \]
    14. unpow294.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{\left(im \cdot im\right)} \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]
    15. associate-*l*94.2%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{im \cdot \left(im \cdot -0.0003968253968253968\right)}\right)\right)\right)\right)\right) \]
  5. Simplified94.2%

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + im \cdot \left(im \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right)} \]
  6. Add Preprocessing

Alternative 5: 91.3% accurate, 2.5× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 1.5 \cdot 10^{+19}:\\ \;\;\;\;\left(im\_m \cdot \sin re\right) \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\\ \mathbf{elif}\;im\_m \leq 8 \cdot 10^{+102}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= im_m 1.5e+19)
    (* (* im_m (sin re)) (+ -1.0 (* (* im_m im_m) -0.16666666666666666)))
    (if (<= im_m 8e+102)
      (*
       im_m
       (*
        re
        (*
         (+
          -1.0
          (*
           (* im_m im_m)
           (+
            (*
             (* im_m im_m)
             (+
              -0.008333333333333333
              (* im_m (* im_m -0.0001984126984126984))))
            -0.16666666666666666)))
         (+ (* re (* re -0.16666666666666666)) 1.0))))
      (*
       (* 0.5 (sin re))
       (* im_m (+ -2.0 (* im_m (* im_m -0.3333333333333333)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 1.5e+19) {
		tmp = (im_m * sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666));
	} else if (im_m <= 8e+102) {
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	} else {
		tmp = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (im_m <= 1.5d+19) then
        tmp = (im_m * sin(re)) * ((-1.0d0) + ((im_m * im_m) * (-0.16666666666666666d0)))
    else if (im_m <= 8d+102) then
        tmp = im_m * (re * (((-1.0d0) + ((im_m * im_m) * (((im_m * im_m) * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0))))) + (-0.16666666666666666d0)))) * ((re * (re * (-0.16666666666666666d0))) + 1.0d0)))
    else
        tmp = (0.5d0 * sin(re)) * (im_m * ((-2.0d0) + (im_m * (im_m * (-0.3333333333333333d0)))))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 1.5e+19) {
		tmp = (im_m * Math.sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666));
	} else if (im_m <= 8e+102) {
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	} else {
		tmp = (0.5 * Math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if im_m <= 1.5e+19:
		tmp = (im_m * math.sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666))
	elif im_m <= 8e+102:
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)))
	else:
		tmp = (0.5 * math.sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (im_m <= 1.5e+19)
		tmp = Float64(Float64(im_m * sin(re)) * Float64(-1.0 + Float64(Float64(im_m * im_m) * -0.16666666666666666)));
	elseif (im_m <= 8e+102)
		tmp = Float64(im_m * Float64(re * Float64(Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(Float64(Float64(im_m * im_m) * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * Float64(Float64(re * Float64(re * -0.16666666666666666)) + 1.0))));
	else
		tmp = Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * -0.3333333333333333)))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (im_m <= 1.5e+19)
		tmp = (im_m * sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666));
	elseif (im_m <= 8e+102)
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	else
		tmp = (0.5 * sin(re)) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 1.5e+19], N[(N[(im$95$m * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 8e+102], N[(im$95$m * N[(re * N[(N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;\left(im\_m \cdot \sin re\right) \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\\

\mathbf{elif}\;im\_m \leq 8 \cdot 10^{+102}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\\


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

    1. Initial program 59.0%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + -0.16666666666666666 \cdot \left({im}^{2} \cdot \sin re\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*87.2%

        \[\leadsto im \cdot \left(-1 \cdot \sin re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot \sin re}\right) \]
      2. distribute-rgt-out87.2%

        \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(-1 + -0.16666666666666666 \cdot {im}^{2}\right)\right)} \]
      3. associate-*r*87.2%

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

        \[\leadsto \left(im \cdot \sin re\right) \cdot \left(-1 + \color{blue}{{im}^{2} \cdot -0.16666666666666666}\right) \]
      5. unpow287.2%

        \[\leadsto \left(im \cdot \sin re\right) \cdot \left(-1 + \color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \]
    5. Simplified87.2%

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

    if 1.5e19 < im < 7.99999999999999982e102

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative46.3%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
      2. +-commutative46.3%

        \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
      3. distribute-rgt-in46.3%

        \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
      4. *-commutative46.3%

        \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
      5. associate-+l+46.3%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + \left(\left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2} + -1 \cdot \sin re\right)\right)} \]
    5. Simplified59.6%

      \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative59.6%

        \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
      2. associate-*l*59.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      3. associate-*l*59.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      4. associate-*l*59.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
    7. Applied egg-rr59.6%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
    8. Taylor expanded in re around 0 29.5%

      \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(\left(-0.16666666666666666 \cdot \left({re}^{2} \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right) + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right) - 1\right)\right)} \]
    9. Simplified79.5%

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

    if 7.99999999999999982e102 < im

    1. Initial program 100.0%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow2100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified100.0%

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

Alternative 6: 92.8% accurate, 2.5× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(im\_m \cdot \left(\sin re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)\right) \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (*
   im_m
   (*
    (sin re)
    (+
     -1.0
     (*
      (* im_m im_m)
      (+
       (*
        (* im_m im_m)
        (+ -0.008333333333333333 (* im_m (* im_m -0.0001984126984126984))))
       -0.16666666666666666)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	return im_s * (im_m * (sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666)))));
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    code = im_s * (im_m * (sin(re) * ((-1.0d0) + ((im_m * im_m) * (((im_m * im_m) * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0))))) + (-0.16666666666666666d0))))))
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	return im_s * (im_m * (Math.sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666)))));
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	return im_s * (im_m * (math.sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666)))))
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	return Float64(im_s * Float64(im_m * Float64(sin(re) * Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(Float64(Float64(im_m * im_m) * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))) + -0.16666666666666666))))))
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp = code(im_s, re, im_m)
	tmp = im_s * (im_m * (sin(re) * (-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666)))));
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(im$95$m * N[(N[Sin[re], $MachinePrecision] * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \left(im\_m \cdot \left(\sin re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 68.6%

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

    \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
  4. Step-by-step derivation
    1. +-commutative92.7%

      \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
    2. +-commutative92.7%

      \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
    3. distribute-rgt-in92.7%

      \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
    4. *-commutative92.7%

      \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
    5. associate-+l+92.7%

      \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + \left(\left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2} + -1 \cdot \sin re\right)\right)} \]
  5. Simplified94.2%

    \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
  6. Step-by-step derivation
    1. *-commutative94.2%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
    2. associate-*l*94.2%

      \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
    3. associate-*l*94.2%

      \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
    4. associate-*l*94.2%

      \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
  7. Applied egg-rr94.2%

    \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
  8. Taylor expanded in re around inf 94.2%

    \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right)} \]
  9. Step-by-step derivation
    1. sub-neg94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) + \left(-1\right)\right)}\right) \]
    2. metadata-eval94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) + \color{blue}{-1}\right)\right) \]
    3. +-commutative94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \color{blue}{\left(-1 + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right)}\right) \]
    4. +-commutative94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{\left({im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) + -0.16666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
    5. *-commutative94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) \cdot {im}^{4}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    6. sub-neg94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} + \left(-0.008333333333333333\right)\right)} \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    7. *-commutative94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{{im}^{2} \cdot -0.0001984126984126984} + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    8. unpow294.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot -0.0001984126984126984 + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    9. associate-*r*94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)} + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    10. metadata-eval94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(im \cdot \left(im \cdot -0.0001984126984126984\right) + \color{blue}{-0.008333333333333333}\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    11. +-commutative94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)} \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    12. metadata-eval94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    13. pow-sqr94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    14. associate-*r*94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2}\right) \cdot {im}^{2}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
    15. distribute-rgt-out94.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{{im}^{2} \cdot \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2} + -0.16666666666666666\right)}\right)\right) \]
    16. unpow294.2%

      \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{\left(im \cdot im\right)} \cdot \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2} + -0.16666666666666666\right)\right)\right) \]
  10. Simplified94.2%

    \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)} \]
  11. Add Preprocessing

Alternative 7: 90.5% accurate, 2.6× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot -0.016666666666666666\right)\right)\right)\right)\right) \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (*
   (* 0.5 (sin re))
   (*
    im_m
    (+
     -2.0
     (*
      (* im_m im_m)
      (+ -0.3333333333333333 (* im_m (* im_m -0.016666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	return im_s * ((0.5 * sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666)))))));
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    code = im_s * ((0.5d0 * sin(re)) * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * (-0.016666666666666666d0))))))))
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	return im_s * ((0.5 * Math.sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666)))))));
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	return im_s * ((0.5 * math.sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666)))))))
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	return Float64(im_s * Float64(Float64(0.5 * sin(re)) * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * -0.016666666666666666))))))))
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp = code(im_s, re, im_m)
	tmp = im_s * ((0.5 * sin(re)) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666)))))));
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot -0.016666666666666666\right)\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 68.6%

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

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) - 2\right)\right)} \]
  4. Step-by-step derivation
    1. sub-neg92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
    2. metadata-eval92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
    3. +-commutative92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)}\right) \]
    4. unpow292.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)\right) \]
    5. sub-neg92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.016666666666666666 \cdot {im}^{2} + \left(-0.3333333333333333\right)\right)}\right)\right) \]
    6. metadata-eval92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 \cdot {im}^{2} + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
    7. +-commutative92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + -0.016666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
    8. *-commutative92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{{im}^{2} \cdot -0.016666666666666666}\right)\right)\right) \]
    9. unpow292.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot -0.016666666666666666\right)\right)\right) \]
    10. associate-*l*92.6%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.016666666666666666\right)}\right)\right)\right) \]
  5. Simplified92.6%

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot -0.016666666666666666\right)\right)\right)\right)} \]
  6. Add Preprocessing

Alternative 8: 73.8% accurate, 2.7× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 0.00027:\\ \;\;\;\;\left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im\_m \cdot \sin re\right) \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= re 0.00027)
    (*
     (*
      im_m
      (+
       -2.0
       (*
        (* im_m im_m)
        (+
         -0.3333333333333333
         (*
          im_m
          (*
           im_m
           (+
            -0.016666666666666666
            (* im_m (* im_m -0.0003968253968253968)))))))))
     (* 0.5 re))
    (* (* im_m (sin re)) (+ -1.0 (* (* im_m im_m) -0.16666666666666666))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 0.00027) {
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re);
	} else {
		tmp = (im_m * sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (re <= 0.00027d0) then
        tmp = (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * ((-0.016666666666666666d0) + (im_m * (im_m * (-0.0003968253968253968d0)))))))))) * (0.5d0 * re)
    else
        tmp = (im_m * sin(re)) * ((-1.0d0) + ((im_m * im_m) * (-0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 0.00027) {
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re);
	} else {
		tmp = (im_m * Math.sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if re <= 0.00027:
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re)
	else:
		tmp = (im_m * math.sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (re <= 0.00027)
		tmp = Float64(Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * Float64(-0.016666666666666666 + Float64(im_m * Float64(im_m * -0.0003968253968253968))))))))) * Float64(0.5 * re));
	else
		tmp = Float64(Float64(im_m * sin(re)) * Float64(-1.0 + Float64(Float64(im_m * im_m) * -0.16666666666666666)));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (re <= 0.00027)
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re);
	else
		tmp = (im_m * sin(re)) * (-1.0 + ((im_m * im_m) * -0.16666666666666666));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 0.00027], N[(N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * N[(-0.016666666666666666 + N[(im$95$m * N[(im$95$m * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(N[(im$95$m * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 0.00027:\\
\;\;\;\;\left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot re\right)\\

\mathbf{else}:\\
\;\;\;\;\left(im\_m \cdot \sin re\right) \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if re < 2.70000000000000003e-4

    1. Initial program 73.1%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 69.1%

      \[\leadsto \left(0.5 \cdot re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) - 2\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)}\right) \]
      4. unpow293.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + {im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right) \]
      8. unpow293.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)\right)\right) \]
      9. associate-*l*93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right)\right) \]
      10. sub-neg93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.0003968253968253968 \cdot {im}^{2} + \left(-0.016666666666666666\right)\right)}\right)\right)\right)\right) \]
      11. metadata-eval93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} + \color{blue}{-0.016666666666666666}\right)\right)\right)\right)\right) \]
      12. +-commutative93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.016666666666666666 + -0.0003968253968253968 \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
      13. *-commutative93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{{im}^{2} \cdot -0.0003968253968253968}\right)\right)\right)\right)\right) \]
      14. unpow293.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{\left(im \cdot im\right)} \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]
      15. associate-*l*93.6%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{im \cdot \left(im \cdot -0.0003968253968253968\right)}\right)\right)\right)\right)\right) \]
    6. Simplified69.1%

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

    if 2.70000000000000003e-4 < re

    1. Initial program 56.7%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + -0.16666666666666666 \cdot \left({im}^{2} \cdot \sin re\right)\right)} \]
    4. Step-by-step derivation
      1. associate-*r*88.4%

        \[\leadsto im \cdot \left(-1 \cdot \sin re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot \sin re}\right) \]
      2. distribute-rgt-out88.4%

        \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(-1 + -0.16666666666666666 \cdot {im}^{2}\right)\right)} \]
      3. associate-*r*88.4%

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

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

        \[\leadsto \left(im \cdot \sin re\right) \cdot \left(-1 + \color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \]
    5. Simplified88.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 0.00027:\\ \;\;\;\;\left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + im \cdot \left(im \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\left(im \cdot \sin re\right) \cdot \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 82.8% accurate, 2.8× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 1.5 \cdot 10^{+19}:\\ \;\;\;\;\left(-im\_m\right) \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= im_m 1.5e+19)
    (* (- im_m) (sin re))
    (*
     im_m
     (*
      re
      (*
       (+
        -1.0
        (*
         (* im_m im_m)
         (+
          (*
           (* im_m im_m)
           (+ -0.008333333333333333 (* im_m (* im_m -0.0001984126984126984))))
          -0.16666666666666666)))
       (+ (* re (* re -0.16666666666666666)) 1.0)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 1.5e+19) {
		tmp = -im_m * sin(re);
	} else {
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (im_m <= 1.5d+19) then
        tmp = -im_m * sin(re)
    else
        tmp = im_m * (re * (((-1.0d0) + ((im_m * im_m) * (((im_m * im_m) * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0))))) + (-0.16666666666666666d0)))) * ((re * (re * (-0.16666666666666666d0))) + 1.0d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 1.5e+19) {
		tmp = -im_m * Math.sin(re);
	} else {
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if im_m <= 1.5e+19:
		tmp = -im_m * math.sin(re)
	else:
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (im_m <= 1.5e+19)
		tmp = Float64(Float64(-im_m) * sin(re));
	else
		tmp = Float64(im_m * Float64(re * Float64(Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(Float64(Float64(im_m * im_m) * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * Float64(Float64(re * Float64(re * -0.16666666666666666)) + 1.0))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (im_m <= 1.5e+19)
		tmp = -im_m * sin(re);
	else
		tmp = im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 1.5e+19], N[((-im$95$m) * N[Sin[re], $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 1.5 \cdot 10^{+19}:\\
\;\;\;\;\left(-im\_m\right) \cdot \sin re\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\


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

    1. Initial program 59.0%

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

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

        \[\leadsto \color{blue}{-im \cdot \sin re} \]
      2. neg-sub060.1%

        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    5. Simplified60.1%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]

    if 1.5e19 < im

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative87.5%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
      2. +-commutative87.5%

        \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
      3. distribute-rgt-in87.5%

        \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
      4. *-commutative87.5%

        \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
      5. associate-+l+87.5%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + \left(\left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2} + -1 \cdot \sin re\right)\right)} \]
    5. Simplified90.6%

      \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative90.6%

        \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
      2. associate-*l*90.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      3. associate-*l*90.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      4. associate-*l*90.6%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
    7. Applied egg-rr90.6%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
    8. Taylor expanded in re around 0 6.9%

      \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(\left(-0.16666666666666666 \cdot \left({re}^{2} \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right) + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right) - 1\right)\right)} \]
    9. Simplified81.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1.5 \cdot 10^{+19}:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(\left(-1 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 58.7% accurate, 9.6× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= re 2.5e+69)
    (*
     (*
      im_m
      (+
       -2.0
       (*
        (* im_m im_m)
        (+
         -0.3333333333333333
         (*
          im_m
          (*
           im_m
           (+
            -0.016666666666666666
            (* im_m (* im_m -0.0003968253968253968)))))))))
     (* 0.5 re))
    (if (<= re 1.9e+263)
      (*
       re
       (*
        (* im_m (* im_m im_m))
        (+ -0.16666666666666666 (* (* re re) 0.027777777777777776))))
      (if (<= re 1.15e+293)
        (*
         im_m
         (*
          re
          (-
           -1.0
           (*
            (* re re)
            (+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))
        (* im_m (* re (+ -1.0 (* (* re re) 0.16666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re);
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (re <= 2.5d+69) then
        tmp = (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * ((-0.016666666666666666d0) + (im_m * (im_m * (-0.0003968253968253968d0)))))))))) * (0.5d0 * re)
    else if (re <= 1.9d+263) then
        tmp = re * ((im_m * (im_m * im_m)) * ((-0.16666666666666666d0) + ((re * re) * 0.027777777777777776d0)))
    else if (re <= 1.15d+293) then
        tmp = im_m * (re * ((-1.0d0) - ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
    else
        tmp = im_m * (re * ((-1.0d0) + ((re * re) * 0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re);
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if re <= 2.5e+69:
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re)
	elif re <= 1.9e+263:
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)))
	elif re <= 1.15e+293:
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))))
	else:
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * Float64(-0.016666666666666666 + Float64(im_m * Float64(im_m * -0.0003968253968253968))))))))) * Float64(0.5 * re));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(Float64(im_m * Float64(im_m * im_m)) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.027777777777777776))));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 - Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))));
	else
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * (-0.016666666666666666 + (im_m * (im_m * -0.0003968253968253968))))))))) * (0.5 * re);
	elseif (re <= 1.9e+263)
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	elseif (re <= 1.15e+293)
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	else
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * N[(-0.016666666666666666 + N[(im$95$m * N[(im$95$m * -0.0003968253968253968), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(re * N[(-1.0 - N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;\left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot \left(-0.016666666666666666 + im\_m \cdot \left(im\_m \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot re\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if re < 2.50000000000000018e69

    1. Initial program 71.4%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 65.5%

      \[\leadsto \left(0.5 \cdot re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) - 2\right)\right)} \]
    5. Step-by-step derivation
      1. sub-neg93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)}\right) \]
      4. unpow293.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left({im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right) + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + {im}^{2} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right) \]
      8. unpow293.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)\right)\right) \]
      9. associate-*l*93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} - 0.016666666666666666\right)\right)}\right)\right)\right) \]
      10. sub-neg93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.0003968253968253968 \cdot {im}^{2} + \left(-0.016666666666666666\right)\right)}\right)\right)\right)\right) \]
      11. metadata-eval93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.0003968253968253968 \cdot {im}^{2} + \color{blue}{-0.016666666666666666}\right)\right)\right)\right)\right) \]
      12. +-commutative93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \color{blue}{\left(-0.016666666666666666 + -0.0003968253968253968 \cdot {im}^{2}\right)}\right)\right)\right)\right) \]
      13. *-commutative93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{{im}^{2} \cdot -0.0003968253968253968}\right)\right)\right)\right)\right) \]
      14. unpow293.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{\left(im \cdot im\right)} \cdot -0.0003968253968253968\right)\right)\right)\right)\right) \]
      15. associate-*l*93.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + \color{blue}{im \cdot \left(im \cdot -0.0003968253968253968\right)}\right)\right)\right)\right)\right) \]
    6. Simplified65.5%

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left({im}^{3} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right)} \]
    10. Step-by-step derivation
      1. cube-mult49.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot \left(im \cdot im\right)\right)} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right) \]
      2. sub-neg49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.027777777777777776 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right) \]
      3. *-commutative49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{{re}^{2} \cdot 0.027777777777777776} + \left(-0.16666666666666666\right)\right)\right) \]
      4. unpow249.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot 0.027777777777777776 + \left(-0.16666666666666666\right)\right)\right) \]
      5. metadata-eval49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot 0.027777777777777776 + \color{blue}{-0.16666666666666666}\right)\right) \]
    11. Simplified49.2%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg52.0%

        \[\leadsto \color{blue}{-im \cdot \sin re} \]
      2. neg-sub052.0%

        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    5. Simplified52.0%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    6. Taylor expanded in re around 0 50.8%

      \[\leadsto 0 - im \cdot \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(0.008333333333333333 \cdot {re}^{2} - 0.16666666666666666\right)\right)\right)} \]
    7. Step-by-step derivation
      1. unpow250.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \color{blue}{\left(re \cdot re\right)} \cdot \left(0.008333333333333333 \cdot {re}^{2} - 0.16666666666666666\right)\right)\right) \]
      2. sub-neg50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \color{blue}{\left(0.008333333333333333 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right)\right) \]
      3. metadata-eval50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(0.008333333333333333 \cdot {re}^{2} + \color{blue}{-0.16666666666666666}\right)\right)\right) \]
      4. +-commutative50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \color{blue}{\left(-0.16666666666666666 + 0.008333333333333333 \cdot {re}^{2}\right)}\right)\right) \]
      5. *-commutative50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \color{blue}{{re}^{2} \cdot 0.008333333333333333}\right)\right)\right) \]
      6. unpow250.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \color{blue}{\left(re \cdot re\right)} \cdot 0.008333333333333333\right)\right)\right) \]
    8. Simplified50.8%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot \left(-0.016666666666666666 + im \cdot \left(im \cdot -0.0003968253968253968\right)\right)\right)\right)\right)\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.2% accurate, 9.6× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot \left(-0.16666666666666666 + im\_m \cdot \left(im\_m \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= re 2.5e+69)
    (*
     im_m
     (*
      re
      (+
       -1.0
       (*
        im_m
        (*
         im_m
         (+
          -0.16666666666666666
          (*
           im_m
           (*
            im_m
            (+
             -0.008333333333333333
             (* im_m (* im_m -0.0001984126984126984)))))))))))
    (if (<= re 1.9e+263)
      (*
       re
       (*
        (* im_m (* im_m im_m))
        (+ -0.16666666666666666 (* (* re re) 0.027777777777777776))))
      (if (<= re 1.15e+293)
        (*
         im_m
         (*
          re
          (-
           -1.0
           (*
            (* re re)
            (+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))
        (* im_m (* re (+ -1.0 (* (* re re) 0.16666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + (im_m * (im_m * (-0.16666666666666666 + (im_m * (im_m * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984))))))))));
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (re <= 2.5d+69) then
        tmp = im_m * (re * ((-1.0d0) + (im_m * (im_m * ((-0.16666666666666666d0) + (im_m * (im_m * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0)))))))))))
    else if (re <= 1.9d+263) then
        tmp = re * ((im_m * (im_m * im_m)) * ((-0.16666666666666666d0) + ((re * re) * 0.027777777777777776d0)))
    else if (re <= 1.15d+293) then
        tmp = im_m * (re * ((-1.0d0) - ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
    else
        tmp = im_m * (re * ((-1.0d0) + ((re * re) * 0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + (im_m * (im_m * (-0.16666666666666666 + (im_m * (im_m * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984))))))))));
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if re <= 2.5e+69:
		tmp = im_m * (re * (-1.0 + (im_m * (im_m * (-0.16666666666666666 + (im_m * (im_m * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984))))))))))
	elif re <= 1.9e+263:
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)))
	elif re <= 1.15e+293:
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))))
	else:
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(im_m * Float64(im_m * Float64(-0.16666666666666666 + Float64(im_m * Float64(im_m * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))))))))));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(Float64(im_m * Float64(im_m * im_m)) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.027777777777777776))));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 - Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))));
	else
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = im_m * (re * (-1.0 + (im_m * (im_m * (-0.16666666666666666 + (im_m * (im_m * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984))))))))));
	elseif (re <= 1.9e+263)
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	elseif (re <= 1.15e+293)
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	else
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(im$95$m * N[(re * N[(-1.0 + N[(im$95$m * N[(im$95$m * N[(-0.16666666666666666 + N[(im$95$m * N[(im$95$m * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(re * N[(-1.0 - N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + im\_m \cdot \left(im\_m \cdot \left(-0.16666666666666666 + im\_m \cdot \left(im\_m \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if re < 2.50000000000000018e69

    1. Initial program 71.4%

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

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. +-commutative91.4%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
      2. +-commutative91.4%

        \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
      3. distribute-rgt-in91.4%

        \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
      4. *-commutative91.4%

        \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
      5. associate-+l+91.4%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + \left(\left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2} + -1 \cdot \sin re\right)\right)} \]
    5. Simplified93.2%

      \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
    6. Step-by-step derivation
      1. *-commutative93.2%

        \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
      2. associate-*l*93.2%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      3. associate-*l*93.2%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
      4. associate-*l*93.2%

        \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
    7. Applied egg-rr93.2%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
    8. Taylor expanded in re around inf 93.2%

      \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right)} \]
    9. Step-by-step derivation
      1. sub-neg93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) + \left(-1\right)\right)}\right) \]
      2. metadata-eval93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) + \color{blue}{-1}\right)\right) \]
      3. +-commutative93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \color{blue}{\left(-1 + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right)}\right) \]
      4. +-commutative93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{\left({im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) + -0.16666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
      5. *-commutative93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) \cdot {im}^{4}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      6. sub-neg93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} + \left(-0.008333333333333333\right)\right)} \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      7. *-commutative93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{{im}^{2} \cdot -0.0001984126984126984} + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      8. unpow293.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{\left(im \cdot im\right)} \cdot -0.0001984126984126984 + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      9. associate-*r*93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(\color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)} + \left(-0.008333333333333333\right)\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      10. metadata-eval93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(im \cdot \left(im \cdot -0.0001984126984126984\right) + \color{blue}{-0.008333333333333333}\right) \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      11. +-commutative93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)} \cdot {im}^{4} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      12. metadata-eval93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{\color{blue}{\left(2 \cdot 2\right)}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      13. pow-sqr93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left({im}^{2} \cdot {im}^{2}\right)} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      14. associate-*r*93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \left(\color{blue}{\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2}\right) \cdot {im}^{2}} + -0.16666666666666666 \cdot {im}^{2}\right)\right)\right) \]
      15. distribute-rgt-out93.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{{im}^{2} \cdot \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2} + -0.16666666666666666\right)}\right)\right) \]
      16. unpow293.2%

        \[\leadsto im \cdot \left(\sin re \cdot \left(-1 + \color{blue}{\left(im \cdot im\right)} \cdot \left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot {im}^{2} + -0.16666666666666666\right)\right)\right) \]
    10. Simplified93.2%

      \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(-1 + \left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right)\right)} \]
    11. Taylor expanded in re around 0 65.5%

      \[\leadsto im \cdot \color{blue}{\left(re \cdot \left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) - 0.16666666666666666\right) - 1\right)\right)} \]
    12. Step-by-step derivation
      1. sub-neg65.5%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) - 0.16666666666666666\right) + \left(-1\right)\right)}\right) \]
      2. unpow265.5%

        \[\leadsto im \cdot \left(re \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left({im}^{2} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) - 0.16666666666666666\right) + \left(-1\right)\right)\right) \]
      3. sub-neg65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) + \left(-0.16666666666666666\right)\right)} + \left(-1\right)\right)\right) \]
      4. unpow265.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right) + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      5. sub-neg65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(-0.0001984126984126984 \cdot {im}^{2} + \left(-0.008333333333333333\right)\right)} + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      6. *-commutative65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.0001984126984126984} + \left(-0.008333333333333333\right)\right) + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      7. unpow265.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.0001984126984126984 + \left(-0.008333333333333333\right)\right) + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      8. associate-*r*65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)} + \left(-0.008333333333333333\right)\right) + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      9. metadata-eval65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.0001984126984126984\right) + \color{blue}{-0.008333333333333333}\right) + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      10. +-commutative65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)} + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      11. associate-*r*65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right)} + \left(-0.16666666666666666\right)\right) + \left(-1\right)\right)\right) \]
      12. metadata-eval65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right) + \color{blue}{-0.16666666666666666}\right) + \left(-1\right)\right)\right) \]
      13. metadata-eval65.5%

        \[\leadsto im \cdot \left(re \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right) + -0.16666666666666666\right) + \color{blue}{-1}\right)\right) \]
      14. +-commutative65.5%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(-1 + \left(im \cdot im\right) \cdot \left(im \cdot \left(im \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right) + -0.16666666666666666\right)\right)}\right) \]
      15. associate-*r*65.5%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{im \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right) + -0.16666666666666666\right)\right)}\right)\right) \]
    13. Simplified65.5%

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left({im}^{3} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right)} \]
    10. Step-by-step derivation
      1. cube-mult49.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot \left(im \cdot im\right)\right)} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right) \]
      2. sub-neg49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.027777777777777776 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right) \]
      3. *-commutative49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{{re}^{2} \cdot 0.027777777777777776} + \left(-0.16666666666666666\right)\right)\right) \]
      4. unpow249.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot 0.027777777777777776 + \left(-0.16666666666666666\right)\right)\right) \]
      5. metadata-eval49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot 0.027777777777777776 + \color{blue}{-0.16666666666666666}\right)\right) \]
    11. Simplified49.2%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg52.0%

        \[\leadsto \color{blue}{-im \cdot \sin re} \]
      2. neg-sub052.0%

        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    5. Simplified52.0%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    6. Taylor expanded in re around 0 50.8%

      \[\leadsto 0 - im \cdot \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(0.008333333333333333 \cdot {re}^{2} - 0.16666666666666666\right)\right)\right)} \]
    7. Step-by-step derivation
      1. unpow250.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \color{blue}{\left(re \cdot re\right)} \cdot \left(0.008333333333333333 \cdot {re}^{2} - 0.16666666666666666\right)\right)\right) \]
      2. sub-neg50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \color{blue}{\left(0.008333333333333333 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right)\right) \]
      3. metadata-eval50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(0.008333333333333333 \cdot {re}^{2} + \color{blue}{-0.16666666666666666}\right)\right)\right) \]
      4. +-commutative50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \color{blue}{\left(-0.16666666666666666 + 0.008333333333333333 \cdot {re}^{2}\right)}\right)\right) \]
      5. *-commutative50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \color{blue}{{re}^{2} \cdot 0.008333333333333333}\right)\right)\right) \]
      6. unpow250.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \color{blue}{\left(re \cdot re\right)} \cdot 0.008333333333333333\right)\right)\right) \]
    8. Simplified50.8%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + im \cdot \left(im \cdot \left(-0.16666666666666666 + im \cdot \left(im \cdot \left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right)\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 57.0% accurate, 9.6× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot -0.016666666666666666\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= re 2.5e+69)
    (*
     (* 0.5 re)
     (*
      im_m
      (+
       -2.0
       (*
        (* im_m im_m)
        (+ -0.3333333333333333 (* im_m (* im_m -0.016666666666666666)))))))
    (if (<= re 1.9e+263)
      (*
       re
       (*
        (* im_m (* im_m im_m))
        (+ -0.16666666666666666 (* (* re re) 0.027777777777777776))))
      (if (<= re 1.15e+293)
        (*
         im_m
         (*
          re
          (-
           -1.0
           (*
            (* re re)
            (+ -0.16666666666666666 (* (* re re) 0.008333333333333333))))))
        (* im_m (* re (+ -1.0 (* (* re re) 0.16666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))));
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (re <= 2.5d+69) then
        tmp = (0.5d0 * re) * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * (-0.016666666666666666d0)))))))
    else if (re <= 1.9d+263) then
        tmp = re * ((im_m * (im_m * im_m)) * ((-0.16666666666666666d0) + ((re * re) * 0.027777777777777776d0)))
    else if (re <= 1.15d+293) then
        tmp = im_m * (re * ((-1.0d0) - ((re * re) * ((-0.16666666666666666d0) + ((re * re) * 0.008333333333333333d0)))))
    else
        tmp = im_m * (re * ((-1.0d0) + ((re * re) * 0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))));
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if re <= 2.5e+69:
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))))
	elif re <= 1.9e+263:
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)))
	elif re <= 1.15e+293:
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))))
	else:
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(Float64(0.5 * re) * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * -0.016666666666666666)))))));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(Float64(im_m * Float64(im_m * im_m)) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.027777777777777776))));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 - Float64(Float64(re * re) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.008333333333333333))))));
	else
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))));
	elseif (re <= 1.9e+263)
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	elseif (re <= 1.15e+293)
		tmp = im_m * (re * (-1.0 - ((re * re) * (-0.16666666666666666 + ((re * re) * 0.008333333333333333)))));
	else
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(N[(0.5 * re), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(re * N[(-1.0 - N[(N[(re * re), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.008333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot -0.016666666666666666\right)\right)\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if re < 2.50000000000000018e69

    1. Initial program 71.4%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)}\right) \]
      4. unpow291.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.016666666666666666 \cdot {im}^{2} + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 \cdot {im}^{2} + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + -0.016666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
      8. *-commutative91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{{im}^{2} \cdot -0.016666666666666666}\right)\right)\right) \]
      9. unpow291.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot -0.016666666666666666\right)\right)\right) \]
      10. associate-*l*91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.016666666666666666\right)}\right)\right)\right) \]
    5. Simplified91.3%

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

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left({im}^{3} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right)} \]
    10. Step-by-step derivation
      1. cube-mult49.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot \left(im \cdot im\right)\right)} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right) \]
      2. sub-neg49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.027777777777777776 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right) \]
      3. *-commutative49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{{re}^{2} \cdot 0.027777777777777776} + \left(-0.16666666666666666\right)\right)\right) \]
      4. unpow249.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot 0.027777777777777776 + \left(-0.16666666666666666\right)\right)\right) \]
      5. metadata-eval49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot 0.027777777777777776 + \color{blue}{-0.16666666666666666}\right)\right) \]
    11. Simplified49.2%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg52.0%

        \[\leadsto \color{blue}{-im \cdot \sin re} \]
      2. neg-sub052.0%

        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    5. Simplified52.0%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    6. Taylor expanded in re around 0 50.8%

      \[\leadsto 0 - im \cdot \color{blue}{\left(re \cdot \left(1 + {re}^{2} \cdot \left(0.008333333333333333 \cdot {re}^{2} - 0.16666666666666666\right)\right)\right)} \]
    7. Step-by-step derivation
      1. unpow250.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \color{blue}{\left(re \cdot re\right)} \cdot \left(0.008333333333333333 \cdot {re}^{2} - 0.16666666666666666\right)\right)\right) \]
      2. sub-neg50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \color{blue}{\left(0.008333333333333333 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right)\right) \]
      3. metadata-eval50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(0.008333333333333333 \cdot {re}^{2} + \color{blue}{-0.16666666666666666}\right)\right)\right) \]
      4. +-commutative50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \color{blue}{\left(-0.16666666666666666 + 0.008333333333333333 \cdot {re}^{2}\right)}\right)\right) \]
      5. *-commutative50.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \color{blue}{{re}^{2} \cdot 0.008333333333333333}\right)\right)\right) \]
      6. unpow250.8%

        \[\leadsto 0 - im \cdot \left(re \cdot \left(1 + \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \color{blue}{\left(re \cdot re\right)} \cdot 0.008333333333333333\right)\right)\right) \]
    8. Simplified50.8%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot -0.016666666666666666\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 - \left(re \cdot re\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.008333333333333333\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 48.7% accurate, 9.9× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := -1 + \left(re \cdot re\right) \cdot 0.16666666666666666\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 7.8 \cdot 10^{-231}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(re \cdot \left(im\_m \cdot \left(im\_m \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(im\_m \cdot t\_0\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot t\_0\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (+ -1.0 (* (* re re) 0.16666666666666666))))
   (*
    im_s
    (if (<= re 7.8e-231)
      (* -0.008333333333333333 (* re (* im_m (* im_m (* im_m (* im_m im_m))))))
      (if (<= re 2.5e+69)
        (* im_m (* re (+ -1.0 (* (* im_m im_m) -0.16666666666666666))))
        (if (<= re 1.9e+263)
          (* re (* im_m t_0))
          (if (<= re 1.15e+293)
            (* im_m (* (* im_m im_m) (* re -0.16666666666666666)))
            (* im_m (* re t_0)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	double tmp;
	if (re <= 7.8e-231) {
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * (im_m * (im_m * im_m)))));
	} else if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else if (re <= 1.9e+263) {
		tmp = re * (im_m * t_0);
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * t_0);
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-1.0d0) + ((re * re) * 0.16666666666666666d0)
    if (re <= 7.8d-231) then
        tmp = (-0.008333333333333333d0) * (re * (im_m * (im_m * (im_m * (im_m * im_m)))))
    else if (re <= 2.5d+69) then
        tmp = im_m * (re * ((-1.0d0) + ((im_m * im_m) * (-0.16666666666666666d0))))
    else if (re <= 1.9d+263) then
        tmp = re * (im_m * t_0)
    else if (re <= 1.15d+293) then
        tmp = im_m * ((im_m * im_m) * (re * (-0.16666666666666666d0)))
    else
        tmp = im_m * (re * t_0)
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	double tmp;
	if (re <= 7.8e-231) {
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * (im_m * (im_m * im_m)))));
	} else if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else if (re <= 1.9e+263) {
		tmp = re * (im_m * t_0);
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * t_0);
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = -1.0 + ((re * re) * 0.16666666666666666)
	tmp = 0
	if re <= 7.8e-231:
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * (im_m * (im_m * im_m)))))
	elif re <= 2.5e+69:
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)))
	elif re <= 1.9e+263:
		tmp = re * (im_m * t_0)
	elif re <= 1.15e+293:
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666))
	else:
		tmp = im_m * (re * t_0)
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))
	tmp = 0.0
	if (re <= 7.8e-231)
		tmp = Float64(-0.008333333333333333 * Float64(re * Float64(im_m * Float64(im_m * Float64(im_m * Float64(im_m * im_m))))));
	elseif (re <= 2.5e+69)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(im_m * im_m) * -0.16666666666666666))));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(im_m * t_0));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(Float64(im_m * im_m) * Float64(re * -0.16666666666666666)));
	else
		tmp = Float64(im_m * Float64(re * t_0));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	tmp = 0.0;
	if (re <= 7.8e-231)
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * (im_m * (im_m * im_m)))));
	elseif (re <= 2.5e+69)
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	elseif (re <= 1.9e+263)
		tmp = re * (im_m * t_0);
	elseif (re <= 1.15e+293)
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	else
		tmp = im_m * (re * t_0);
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[re, 7.8e-231], N[(-0.008333333333333333 * N[(re * N[(im$95$m * N[(im$95$m * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 2.5e+69], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * t$95$0), $MachinePrecision]), $MachinePrecision]]]]]), $MachinePrecision]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := -1 + \left(re \cdot re\right) \cdot 0.16666666666666666\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 7.8 \cdot 10^{-231}:\\
\;\;\;\;-0.008333333333333333 \cdot \left(re \cdot \left(im\_m \cdot \left(im\_m \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right)\right)\right)\\

\mathbf{elif}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(im\_m \cdot t\_0\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot t\_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if re < 7.7999999999999995e-231

    1. Initial program 69.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)}\right) \]
      4. unpow292.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.016666666666666666 \cdot {im}^{2} + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 \cdot {im}^{2} + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + -0.016666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
      8. *-commutative92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{{im}^{2} \cdot -0.016666666666666666}\right)\right)\right) \]
      9. unpow292.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot -0.016666666666666666\right)\right)\right) \]
      10. associate-*l*92.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.016666666666666666\right)}\right)\right)\right) \]
    5. Simplified92.0%

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

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

      \[\leadsto \color{blue}{-0.008333333333333333 \cdot \left({im}^{5} \cdot re\right)} \]
    8. Step-by-step derivation
      1. *-commutative47.9%

        \[\leadsto -0.008333333333333333 \cdot \color{blue}{\left(re \cdot {im}^{5}\right)} \]
      2. metadata-eval47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot {im}^{\color{blue}{\left(4 + 1\right)}}\right) \]
      3. pow-plus47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \color{blue}{\left({im}^{4} \cdot im\right)}\right) \]
      4. *-commutative47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \color{blue}{\left(im \cdot {im}^{4}\right)}\right) \]
      5. metadata-eval47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot {im}^{\color{blue}{\left(3 + 1\right)}}\right)\right) \]
      6. pow-plus47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \color{blue}{\left({im}^{3} \cdot im\right)}\right)\right) \]
      7. *-commutative47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \color{blue}{\left(im \cdot {im}^{3}\right)}\right)\right) \]
      8. cube-mult47.9%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot \left(im \cdot im\right)\right)}\right)\right)\right) \]
    9. Simplified47.9%

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

    if 7.7999999999999995e-231 < re < 2.50000000000000018e69

    1. Initial program 75.2%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 67.1%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*67.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative67.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow267.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*67.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out67.1%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative67.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative67.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*67.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified67.1%

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left(im \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg48.6%

        \[\leadsto re \cdot \left(im \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow248.6%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval48.6%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified48.6%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 51.1%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow251.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out51.1%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified51.1%

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

      \[\leadsto im \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*52.2%

        \[\leadsto im \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re\right)} \]
      2. *-commutative52.2%

        \[\leadsto im \cdot \left(\color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. associate-*l*52.2%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot re\right)\right)} \]
      4. unpow252.2%

        \[\leadsto im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.16666666666666666 \cdot re\right)\right) \]
      5. *-commutative52.2%

        \[\leadsto im \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}\right) \]
    9. Simplified52.2%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 7.8 \cdot 10^{-231}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(im \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 58.4% accurate, 9.9× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\right) \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (*
   im_m
   (*
    re
    (*
     (+
      -1.0
      (*
       (* im_m im_m)
       (+
        (*
         (* im_m im_m)
         (+ -0.008333333333333333 (* im_m (* im_m -0.0001984126984126984))))
        -0.16666666666666666)))
     (+ (* re (* re -0.16666666666666666)) 1.0))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	return im_s * (im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0))));
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    code = im_s * (im_m * (re * (((-1.0d0) + ((im_m * im_m) * (((im_m * im_m) * ((-0.008333333333333333d0) + (im_m * (im_m * (-0.0001984126984126984d0))))) + (-0.16666666666666666d0)))) * ((re * (re * (-0.16666666666666666d0))) + 1.0d0))))
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	return im_s * (im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0))));
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	return im_s * (im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0))))
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	return Float64(im_s * Float64(im_m * Float64(re * Float64(Float64(-1.0 + Float64(Float64(im_m * im_m) * Float64(Float64(Float64(im_m * im_m) * Float64(-0.008333333333333333 + Float64(im_m * Float64(im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * Float64(Float64(re * Float64(re * -0.16666666666666666)) + 1.0)))))
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp = code(im_s, re, im_m)
	tmp = im_s * (im_m * (re * ((-1.0 + ((im_m * im_m) * (((im_m * im_m) * (-0.008333333333333333 + (im_m * (im_m * -0.0001984126984126984)))) + -0.16666666666666666))) * ((re * (re * -0.16666666666666666)) + 1.0))));
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[(im$95$m * N[(re * N[(N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.008333333333333333 + N[(im$95$m * N[(im$95$m * -0.0001984126984126984), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[(re * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \left(im\_m \cdot \left(re \cdot \left(\left(-1 + \left(im\_m \cdot im\_m\right) \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(-0.008333333333333333 + im\_m \cdot \left(im\_m \cdot -0.0001984126984126984\right)\right) + -0.16666666666666666\right)\right) \cdot \left(re \cdot \left(re \cdot -0.16666666666666666\right) + 1\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 68.6%

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

    \[\leadsto \color{blue}{im \cdot \left(-1 \cdot \sin re + {im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)\right)} \]
  4. Step-by-step derivation
    1. +-commutative92.7%

      \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot \sin re + {im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + -1 \cdot \sin re\right)} \]
    2. +-commutative92.7%

      \[\leadsto im \cdot \left({im}^{2} \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right) + -0.16666666666666666 \cdot \sin re\right)} + -1 \cdot \sin re\right) \]
    3. distribute-rgt-in92.7%

      \[\leadsto im \cdot \left(\color{blue}{\left(\left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) \cdot {im}^{2} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right)} + -1 \cdot \sin re\right) \]
    4. *-commutative92.7%

      \[\leadsto im \cdot \left(\left(\color{blue}{{im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right)} + \left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2}\right) + -1 \cdot \sin re\right) \]
    5. associate-+l+92.7%

      \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left({im}^{2} \cdot \left(-0.008333333333333333 \cdot \sin re + -0.0001984126984126984 \cdot \left({im}^{2} \cdot \sin re\right)\right)\right) + \left(\left(-0.16666666666666666 \cdot \sin re\right) \cdot {im}^{2} + -1 \cdot \sin re\right)\right)} \]
  5. Simplified94.2%

    \[\leadsto \color{blue}{im \cdot \left(\sin re \cdot \left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\right)} \]
  6. Step-by-step derivation
    1. *-commutative94.2%

      \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + \left(im \cdot im\right) \cdot -0.0001984126984126984\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right)} \]
    2. associate-*l*94.2%

      \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.0001984126984126984\right)}\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right) + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
    3. associate-*l*94.2%

      \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \color{blue}{\left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)} + \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right) \cdot \sin re\right) \]
    4. associate-*l*94.2%

      \[\leadsto im \cdot \left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + \color{blue}{im \cdot \left(im \cdot -0.16666666666666666\right)}\right)\right) \cdot \sin re\right) \]
  7. Applied egg-rr94.2%

    \[\leadsto im \cdot \color{blue}{\left(\left(\left(-0.008333333333333333 + im \cdot \left(im \cdot -0.0001984126984126984\right)\right) \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right) + \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right) \cdot \sin re\right)} \]
  8. Taylor expanded in re around 0 23.7%

    \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(\left(-0.16666666666666666 \cdot \left({re}^{2} \cdot \left(\left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right) - 1\right)\right) + \left(-0.16666666666666666 \cdot {im}^{2} + {im}^{4} \cdot \left(-0.0001984126984126984 \cdot {im}^{2} - 0.008333333333333333\right)\right)\right) - 1\right)\right)} \]
  9. Simplified62.0%

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

Alternative 15: 50.2% accurate, 11.8× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= re 2.5e+69)
    (* im_m (* re (+ -1.0 (* (* im_m im_m) -0.16666666666666666))))
    (if (or (<= re 1.9e+263) (not (<= re 1.15e+293)))
      (* im_m (* re (+ -1.0 (* (* re re) 0.16666666666666666))))
      (* im_m (* (* im_m im_m) (* re -0.16666666666666666)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	} else {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (re <= 2.5d+69) then
        tmp = im_m * (re * ((-1.0d0) + ((im_m * im_m) * (-0.16666666666666666d0))))
    else if ((re <= 1.9d+263) .or. (.not. (re <= 1.15d+293))) then
        tmp = im_m * (re * ((-1.0d0) + ((re * re) * 0.16666666666666666d0)))
    else
        tmp = im_m * ((im_m * im_m) * (re * (-0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else if ((re <= 1.9e+263) || !(re <= 1.15e+293)) {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	} else {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if re <= 2.5e+69:
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)))
	elif (re <= 1.9e+263) or not (re <= 1.15e+293):
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)))
	else:
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(im_m * im_m) * -0.16666666666666666))));
	elseif ((re <= 1.9e+263) || !(re <= 1.15e+293))
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))));
	else
		tmp = Float64(im_m * Float64(Float64(im_m * im_m) * Float64(re * -0.16666666666666666)));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	elseif ((re <= 1.9e+263) || ~((re <= 1.15e+293)))
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	else
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e+263], N[Not[LessEqual[re, 1.15e+293]], $MachinePrecision]], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\


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

    1. Initial program 71.4%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 56.6%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*56.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative56.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow256.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*56.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out56.6%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative56.6%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative56.6%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*56.6%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified56.6%

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

    if 2.50000000000000018e69 < re < 1.9e263 or 1.14999999999999995e293 < re

    1. Initial program 57.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg91.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval91.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative91.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative91.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow291.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*91.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified91.0%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*7.4%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative7.4%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow27.4%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow27.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow27.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative7.4%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \]
    8. Simplified7.4%

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg45.7%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow245.7%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval45.7%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified45.7%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 51.1%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow251.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out51.1%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified51.1%

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

      \[\leadsto im \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*52.2%

        \[\leadsto im \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re\right)} \]
      2. *-commutative52.2%

        \[\leadsto im \cdot \left(\color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. associate-*l*52.2%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot re\right)\right)} \]
      4. unpow252.2%

        \[\leadsto im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.16666666666666666 \cdot re\right)\right) \]
      5. *-commutative52.2%

        \[\leadsto im \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}\right) \]
    9. Simplified52.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263} \lor \neg \left(re \leq 1.15 \cdot 10^{+293}\right):\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 57.1% accurate, 11.8× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot -0.016666666666666666\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= re 2.5e+69)
    (*
     (* 0.5 re)
     (*
      im_m
      (+
       -2.0
       (*
        (* im_m im_m)
        (+ -0.3333333333333333 (* im_m (* im_m -0.016666666666666666)))))))
    (if (<= re 1.9e+263)
      (*
       re
       (*
        (* im_m (* im_m im_m))
        (+ -0.16666666666666666 (* (* re re) 0.027777777777777776))))
      (if (<= re 1.15e+293)
        (* im_m (* (* im_m im_m) (* re -0.16666666666666666)))
        (* im_m (* re (+ -1.0 (* (* re re) 0.16666666666666666)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))));
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (re <= 2.5d+69) then
        tmp = (0.5d0 * re) * (im_m * ((-2.0d0) + ((im_m * im_m) * ((-0.3333333333333333d0) + (im_m * (im_m * (-0.016666666666666666d0)))))))
    else if (re <= 1.9d+263) then
        tmp = re * ((im_m * (im_m * im_m)) * ((-0.16666666666666666d0) + ((re * re) * 0.027777777777777776d0)))
    else if (re <= 1.15d+293) then
        tmp = im_m * ((im_m * im_m) * (re * (-0.16666666666666666d0)))
    else
        tmp = im_m * (re * ((-1.0d0) + ((re * re) * 0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))));
	} else if (re <= 1.9e+263) {
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if re <= 2.5e+69:
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))))
	elif re <= 1.9e+263:
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)))
	elif re <= 1.15e+293:
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666))
	else:
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(Float64(0.5 * re) * Float64(im_m * Float64(-2.0 + Float64(Float64(im_m * im_m) * Float64(-0.3333333333333333 + Float64(im_m * Float64(im_m * -0.016666666666666666)))))));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(Float64(im_m * Float64(im_m * im_m)) * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.027777777777777776))));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(Float64(im_m * im_m) * Float64(re * -0.16666666666666666)));
	else
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = (0.5 * re) * (im_m * (-2.0 + ((im_m * im_m) * (-0.3333333333333333 + (im_m * (im_m * -0.016666666666666666))))));
	elseif (re <= 1.9e+263)
		tmp = re * ((im_m * (im_m * im_m)) * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	elseif (re <= 1.15e+293)
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	else
		tmp = im_m * (re * (-1.0 + ((re * re) * 0.16666666666666666)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(N[(0.5 * re), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(-0.3333333333333333 + N[(im$95$m * N[(im$95$m * -0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision] * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + \left(im\_m \cdot im\_m\right) \cdot \left(-0.3333333333333333 + im\_m \cdot \left(im\_m \cdot -0.016666666666666666\right)\right)\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(\left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if re < 2.50000000000000018e69

    1. Initial program 71.4%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)}\right) \]
      4. unpow291.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.016666666666666666 \cdot {im}^{2} + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 \cdot {im}^{2} + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + -0.016666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
      8. *-commutative91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{{im}^{2} \cdot -0.016666666666666666}\right)\right)\right) \]
      9. unpow291.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot -0.016666666666666666\right)\right)\right) \]
      10. associate-*l*91.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.016666666666666666\right)}\right)\right)\right) \]
    5. Simplified91.3%

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

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left({im}^{3} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right)} \]
    10. Step-by-step derivation
      1. cube-mult49.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot \left(im \cdot im\right)\right)} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right) \]
      2. sub-neg49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.027777777777777776 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right) \]
      3. *-commutative49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{{re}^{2} \cdot 0.027777777777777776} + \left(-0.16666666666666666\right)\right)\right) \]
      4. unpow249.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot 0.027777777777777776 + \left(-0.16666666666666666\right)\right)\right) \]
      5. metadata-eval49.2%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot 0.027777777777777776 + \color{blue}{-0.16666666666666666}\right)\right) \]
    11. Simplified49.2%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 51.1%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow251.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out51.1%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified51.1%

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

      \[\leadsto im \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*52.2%

        \[\leadsto im \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re\right)} \]
      2. *-commutative52.2%

        \[\leadsto im \cdot \left(\color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. associate-*l*52.2%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot re\right)\right)} \]
      4. unpow252.2%

        \[\leadsto im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.16666666666666666 \cdot re\right)\right) \]
      5. *-commutative52.2%

        \[\leadsto im \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}\right) \]
    9. Simplified52.2%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + im \cdot \left(im \cdot -0.016666666666666666\right)\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 53.1% accurate, 11.8× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := -1 + \left(re \cdot re\right) \cdot 0.16666666666666666\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(im\_m \cdot t\_0\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot t\_0\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (+ -1.0 (* (* re re) 0.16666666666666666))))
   (*
    im_s
    (if (<= re 2.5e+69)
      (* (* 0.5 re) (* im_m (+ -2.0 (* im_m (* im_m -0.3333333333333333)))))
      (if (<= re 1.9e+263)
        (* re (* im_m t_0))
        (if (<= re 1.15e+293)
          (* im_m (* (* im_m im_m) (* re -0.16666666666666666)))
          (* im_m (* re t_0))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
	} else if (re <= 1.9e+263) {
		tmp = re * (im_m * t_0);
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * t_0);
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-1.0d0) + ((re * re) * 0.16666666666666666d0)
    if (re <= 2.5d+69) then
        tmp = (0.5d0 * re) * (im_m * ((-2.0d0) + (im_m * (im_m * (-0.3333333333333333d0)))))
    else if (re <= 1.9d+263) then
        tmp = re * (im_m * t_0)
    else if (re <= 1.15d+293) then
        tmp = im_m * ((im_m * im_m) * (re * (-0.16666666666666666d0)))
    else
        tmp = im_m * (re * t_0)
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	double tmp;
	if (re <= 2.5e+69) {
		tmp = (0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
	} else if (re <= 1.9e+263) {
		tmp = re * (im_m * t_0);
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * t_0);
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = -1.0 + ((re * re) * 0.16666666666666666)
	tmp = 0
	if re <= 2.5e+69:
		tmp = (0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))))
	elif re <= 1.9e+263:
		tmp = re * (im_m * t_0)
	elif re <= 1.15e+293:
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666))
	else:
		tmp = im_m * (re * t_0)
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(Float64(0.5 * re) * Float64(im_m * Float64(-2.0 + Float64(im_m * Float64(im_m * -0.3333333333333333)))));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(im_m * t_0));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(Float64(im_m * im_m) * Float64(re * -0.16666666666666666)));
	else
		tmp = Float64(im_m * Float64(re * t_0));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = (0.5 * re) * (im_m * (-2.0 + (im_m * (im_m * -0.3333333333333333))));
	elseif (re <= 1.9e+263)
		tmp = re * (im_m * t_0);
	elseif (re <= 1.15e+293)
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	else
		tmp = im_m * (re * t_0);
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(N[(0.5 * re), $MachinePrecision] * N[(im$95$m * N[(-2.0 + N[(im$95$m * N[(im$95$m * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * t$95$0), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := -1 + \left(re \cdot re\right) \cdot 0.16666666666666666\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im\_m \cdot \left(-2 + im\_m \cdot \left(im\_m \cdot -0.3333333333333333\right)\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(im\_m \cdot t\_0\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot t\_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if re < 2.50000000000000018e69

    1. Initial program 71.4%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg87.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval87.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative87.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative87.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow287.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*87.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified87.0%

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

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left(im \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg48.6%

        \[\leadsto re \cdot \left(im \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow248.6%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval48.6%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified48.6%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 51.1%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow251.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out51.1%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified51.1%

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

      \[\leadsto im \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*52.2%

        \[\leadsto im \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re\right)} \]
      2. *-commutative52.2%

        \[\leadsto im \cdot \left(\color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. associate-*l*52.2%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot re\right)\right)} \]
      4. unpow252.2%

        \[\leadsto im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.16666666666666666 \cdot re\right)\right) \]
      5. *-commutative52.2%

        \[\leadsto im \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}\right) \]
    9. Simplified52.2%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(im \cdot \left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(im \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 18: 50.2% accurate, 11.8× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := -1 + \left(re \cdot re\right) \cdot 0.16666666666666666\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(im\_m \cdot t\_0\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(re \cdot t\_0\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (+ -1.0 (* (* re re) 0.16666666666666666))))
   (*
    im_s
    (if (<= re 2.5e+69)
      (* im_m (* re (+ -1.0 (* (* im_m im_m) -0.16666666666666666))))
      (if (<= re 1.9e+263)
        (* re (* im_m t_0))
        (if (<= re 1.15e+293)
          (* im_m (* (* im_m im_m) (* re -0.16666666666666666)))
          (* im_m (* re t_0))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	double tmp;
	if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else if (re <= 1.9e+263) {
		tmp = re * (im_m * t_0);
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * t_0);
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-1.0d0) + ((re * re) * 0.16666666666666666d0)
    if (re <= 2.5d+69) then
        tmp = im_m * (re * ((-1.0d0) + ((im_m * im_m) * (-0.16666666666666666d0))))
    else if (re <= 1.9d+263) then
        tmp = re * (im_m * t_0)
    else if (re <= 1.15d+293) then
        tmp = im_m * ((im_m * im_m) * (re * (-0.16666666666666666d0)))
    else
        tmp = im_m * (re * t_0)
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	double tmp;
	if (re <= 2.5e+69) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else if (re <= 1.9e+263) {
		tmp = re * (im_m * t_0);
	} else if (re <= 1.15e+293) {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	} else {
		tmp = im_m * (re * t_0);
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = -1.0 + ((re * re) * 0.16666666666666666)
	tmp = 0
	if re <= 2.5e+69:
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)))
	elif re <= 1.9e+263:
		tmp = re * (im_m * t_0)
	elif re <= 1.15e+293:
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666))
	else:
		tmp = im_m * (re * t_0)
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))
	tmp = 0.0
	if (re <= 2.5e+69)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(im_m * im_m) * -0.16666666666666666))));
	elseif (re <= 1.9e+263)
		tmp = Float64(re * Float64(im_m * t_0));
	elseif (re <= 1.15e+293)
		tmp = Float64(im_m * Float64(Float64(im_m * im_m) * Float64(re * -0.16666666666666666)));
	else
		tmp = Float64(im_m * Float64(re * t_0));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = -1.0 + ((re * re) * 0.16666666666666666);
	tmp = 0.0;
	if (re <= 2.5e+69)
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	elseif (re <= 1.9e+263)
		tmp = re * (im_m * t_0);
	elseif (re <= 1.15e+293)
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	else
		tmp = im_m * (re * t_0);
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[re, 2.5e+69], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.9e+263], N[(re * N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, 1.15e+293], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(im$95$m * N[(re * t$95$0), $MachinePrecision]), $MachinePrecision]]]]), $MachinePrecision]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := -1 + \left(re \cdot re\right) \cdot 0.16666666666666666\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\
\;\;\;\;re \cdot \left(im\_m \cdot t\_0\right)\\

\mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\
\;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(re \cdot t\_0\right)\\


\end{array}
\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if re < 2.50000000000000018e69

    1. Initial program 71.4%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 56.6%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*56.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative56.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow256.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*56.6%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out56.6%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative56.6%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative56.6%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*56.6%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified56.6%

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

    if 2.50000000000000018e69 < re < 1.9e263

    1. Initial program 59.6%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow292.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*92.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified92.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative5.8%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow25.8%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow25.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval5.8%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative5.8%

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

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

      \[\leadsto re \cdot \color{blue}{\left(im \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg48.6%

        \[\leadsto re \cdot \left(im \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow248.6%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval48.6%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified48.6%

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

    if 1.9e263 < re < 1.14999999999999995e293

    1. Initial program 52.0%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 51.1%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow251.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*51.1%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out51.1%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*51.1%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified51.1%

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

      \[\leadsto im \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*52.2%

        \[\leadsto im \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re\right)} \]
      2. *-commutative52.2%

        \[\leadsto im \cdot \left(\color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. associate-*l*52.2%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot re\right)\right)} \]
      4. unpow252.2%

        \[\leadsto im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.16666666666666666 \cdot re\right)\right) \]
      5. *-commutative52.2%

        \[\leadsto im \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}\right) \]
    9. Simplified52.2%

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

    if 1.14999999999999995e293 < re

    1. Initial program 42.8%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow281.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*81.2%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified81.2%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative21.2%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow221.2%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow221.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*21.2%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval21.2%

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(re \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg21.2%

        \[\leadsto im \cdot \left(re \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow221.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval21.2%

        \[\leadsto im \cdot \left(re \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified21.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2.5 \cdot 10^{+69}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(im \cdot im\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{+263}:\\ \;\;\;\;re \cdot \left(im \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;re \leq 1.15 \cdot 10^{+293}:\\ \;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(re \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 57.1% accurate, 12.3× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ \begin{array}{l} t_0 := im\_m \cdot \left(im\_m \cdot im\_m\right)\\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 3.7 \cdot 10^{+60}:\\ \;\;\;\;re \cdot \left(im\_m \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;im\_m \leq 10^{+179}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(re \cdot \left(im\_m \cdot \left(im\_m \cdot t\_0\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(t\_0 \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \end{array} \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (let* ((t_0 (* im_m (* im_m im_m))))
   (*
    im_s
    (if (<= im_m 3.7e+60)
      (* re (* im_m (+ -1.0 (* (* re re) 0.16666666666666666))))
      (if (<= im_m 1e+179)
        (* -0.008333333333333333 (* re (* im_m (* im_m t_0))))
        (*
         re
         (*
          t_0
          (+ -0.16666666666666666 (* (* re re) 0.027777777777777776)))))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double t_0 = im_m * (im_m * im_m);
	double tmp;
	if (im_m <= 3.7e+60) {
		tmp = re * (im_m * (-1.0 + ((re * re) * 0.16666666666666666)));
	} else if (im_m <= 1e+179) {
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * t_0)));
	} else {
		tmp = re * (t_0 * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = im_m * (im_m * im_m)
    if (im_m <= 3.7d+60) then
        tmp = re * (im_m * ((-1.0d0) + ((re * re) * 0.16666666666666666d0)))
    else if (im_m <= 1d+179) then
        tmp = (-0.008333333333333333d0) * (re * (im_m * (im_m * t_0)))
    else
        tmp = re * (t_0 * ((-0.16666666666666666d0) + ((re * re) * 0.027777777777777776d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double t_0 = im_m * (im_m * im_m);
	double tmp;
	if (im_m <= 3.7e+60) {
		tmp = re * (im_m * (-1.0 + ((re * re) * 0.16666666666666666)));
	} else if (im_m <= 1e+179) {
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * t_0)));
	} else {
		tmp = re * (t_0 * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	t_0 = im_m * (im_m * im_m)
	tmp = 0
	if im_m <= 3.7e+60:
		tmp = re * (im_m * (-1.0 + ((re * re) * 0.16666666666666666)))
	elif im_m <= 1e+179:
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * t_0)))
	else:
		tmp = re * (t_0 * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	t_0 = Float64(im_m * Float64(im_m * im_m))
	tmp = 0.0
	if (im_m <= 3.7e+60)
		tmp = Float64(re * Float64(im_m * Float64(-1.0 + Float64(Float64(re * re) * 0.16666666666666666))));
	elseif (im_m <= 1e+179)
		tmp = Float64(-0.008333333333333333 * Float64(re * Float64(im_m * Float64(im_m * t_0))));
	else
		tmp = Float64(re * Float64(t_0 * Float64(-0.16666666666666666 + Float64(Float64(re * re) * 0.027777777777777776))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	t_0 = im_m * (im_m * im_m);
	tmp = 0.0;
	if (im_m <= 3.7e+60)
		tmp = re * (im_m * (-1.0 + ((re * re) * 0.16666666666666666)));
	elseif (im_m <= 1e+179)
		tmp = -0.008333333333333333 * (re * (im_m * (im_m * t_0)));
	else
		tmp = re * (t_0 * (-0.16666666666666666 + ((re * re) * 0.027777777777777776)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := Block[{t$95$0 = N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]}, N[(im$95$s * If[LessEqual[im$95$m, 3.7e+60], N[(re * N[(im$95$m * N[(-1.0 + N[(N[(re * re), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im$95$m, 1e+179], N[(-0.008333333333333333 * N[(re * N[(im$95$m * N[(im$95$m * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(t$95$0 * N[(-0.16666666666666666 + N[(N[(re * re), $MachinePrecision] * 0.027777777777777776), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
\begin{array}{l}
t_0 := im\_m \cdot \left(im\_m \cdot im\_m\right)\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 3.7 \cdot 10^{+60}:\\
\;\;\;\;re \cdot \left(im\_m \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\

\mathbf{elif}\;im\_m \leq 10^{+179}:\\
\;\;\;\;-0.008333333333333333 \cdot \left(re \cdot \left(im\_m \cdot \left(im\_m \cdot t\_0\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;re \cdot \left(t\_0 \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\


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

    1. Initial program 61.0%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg86.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval86.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative86.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative86.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow286.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*86.3%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified86.3%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*34.0%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative34.0%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow234.0%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow234.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow234.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative34.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \]
    8. Simplified34.0%

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

      \[\leadsto re \cdot \color{blue}{\left(im \cdot \left(0.16666666666666666 \cdot {re}^{2} - 1\right)\right)} \]
    10. Step-by-step derivation
      1. sub-neg40.0%

        \[\leadsto re \cdot \left(im \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{2} + \left(-1\right)\right)}\right) \]
      2. unpow240.0%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \color{blue}{\left(re \cdot re\right)} + \left(-1\right)\right)\right) \]
      3. metadata-eval40.0%

        \[\leadsto re \cdot \left(im \cdot \left(0.16666666666666666 \cdot \left(re \cdot re\right) + \color{blue}{-1}\right)\right) \]
    11. Simplified40.0%

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

    if 3.69999999999999988e60 < im < 9.9999999999999998e178

    1. Initial program 100.0%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \left(-2\right)\right)}\right) \]
      2. metadata-eval100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left({im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      3. +-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + {im}^{2} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)}\right) \]
      4. unpow2100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.016666666666666666 \cdot {im}^{2} - 0.3333333333333333\right)\right)\right) \]
      5. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.016666666666666666 \cdot {im}^{2} + \left(-0.3333333333333333\right)\right)}\right)\right) \]
      6. metadata-eval100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.016666666666666666 \cdot {im}^{2} + \color{blue}{-0.3333333333333333}\right)\right)\right) \]
      7. +-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 + -0.016666666666666666 \cdot {im}^{2}\right)}\right)\right) \]
      8. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{{im}^{2} \cdot -0.016666666666666666}\right)\right)\right) \]
      9. unpow2100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{\left(im \cdot im\right)} \cdot -0.016666666666666666\right)\right)\right) \]
      10. associate-*l*100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \left(im \cdot im\right) \cdot \left(-0.3333333333333333 + \color{blue}{im \cdot \left(im \cdot -0.016666666666666666\right)}\right)\right)\right) \]
    5. Simplified100.0%

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

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

      \[\leadsto \color{blue}{-0.008333333333333333 \cdot \left({im}^{5} \cdot re\right)} \]
    8. Step-by-step derivation
      1. *-commutative72.2%

        \[\leadsto -0.008333333333333333 \cdot \color{blue}{\left(re \cdot {im}^{5}\right)} \]
      2. metadata-eval72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot {im}^{\color{blue}{\left(4 + 1\right)}}\right) \]
      3. pow-plus72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \color{blue}{\left({im}^{4} \cdot im\right)}\right) \]
      4. *-commutative72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \color{blue}{\left(im \cdot {im}^{4}\right)}\right) \]
      5. metadata-eval72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot {im}^{\color{blue}{\left(3 + 1\right)}}\right)\right) \]
      6. pow-plus72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \color{blue}{\left({im}^{3} \cdot im\right)}\right)\right) \]
      7. *-commutative72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \color{blue}{\left(im \cdot {im}^{3}\right)}\right)\right) \]
      8. cube-mult72.2%

        \[\leadsto -0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \color{blue}{\left(im \cdot \left(im \cdot im\right)\right)}\right)\right)\right) \]
    9. Simplified72.2%

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

    if 9.9999999999999998e178 < im

    1. Initial program 100.0%

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} \]
    4. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      2. metadata-eval100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} + \color{blue}{-2}\right)\right) \]
      3. +-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \color{blue}{\left(-2 + -0.3333333333333333 \cdot {im}^{2}\right)}\right) \]
      4. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{{im}^{2} \cdot -0.3333333333333333}\right)\right) \]
      5. unpow2100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333\right)\right) \]
      6. associate-*l*100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot \left(-2 + \color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)}\right)\right) \]
    5. Simplified100.0%

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

      \[\leadsto \color{blue}{re \cdot \left(-0.08333333333333333 \cdot \left(im \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right)} \]
    7. Step-by-step derivation
      1. associate-*r*0.0%

        \[\leadsto re \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot im\right) \cdot \left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      2. *-commutative0.0%

        \[\leadsto re \cdot \left(\color{blue}{\left({re}^{2} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      3. unpow20.0%

        \[\leadsto re \cdot \left(\left(\color{blue}{\left(re \cdot re\right)} \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      4. sub-neg0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      5. *-commutative0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      6. unpow20.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      7. associate-*r*0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      8. metadata-eval0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      9. +-commutative0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      10. associate-*r*0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \color{blue}{\left(im \cdot im\right) \cdot -0.3333333333333333}\right)\right) \cdot \left(-0.08333333333333333 \cdot im\right) + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      11. *-commutative0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \color{blue}{\left(im \cdot -0.08333333333333333\right)} + 0.5 \cdot \left(im \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)\right)\right) \]
      12. associate-*r*0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \color{blue}{\left(0.5 \cdot im\right) \cdot \left(-0.3333333333333333 \cdot {im}^{2} - 2\right)}\right) \]
      13. sub-neg0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-0.3333333333333333 \cdot {im}^{2} + \left(-2\right)\right)}\right) \]
      14. *-commutative0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{{im}^{2} \cdot -0.3333333333333333} + \left(-2\right)\right)\right) \]
      15. unpow20.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.3333333333333333 + \left(-2\right)\right)\right) \]
      16. associate-*r*0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(\color{blue}{im \cdot \left(im \cdot -0.3333333333333333\right)} + \left(-2\right)\right)\right) \]
      17. metadata-eval0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \left(im \cdot \left(im \cdot -0.3333333333333333\right) + \color{blue}{-2}\right)\right) \]
      18. +-commutative0.0%

        \[\leadsto re \cdot \left(\left(\left(re \cdot re\right) \cdot \left(-2 + \left(im \cdot im\right) \cdot -0.3333333333333333\right)\right) \cdot \left(im \cdot -0.08333333333333333\right) + \left(0.5 \cdot im\right) \cdot \color{blue}{\left(-2 + im \cdot \left(im \cdot -0.3333333333333333\right)\right)}\right) \]
    8. Simplified0.0%

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

      \[\leadsto re \cdot \color{blue}{\left({im}^{3} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right)} \]
    10. Step-by-step derivation
      1. cube-mult90.6%

        \[\leadsto re \cdot \left(\color{blue}{\left(im \cdot \left(im \cdot im\right)\right)} \cdot \left(0.027777777777777776 \cdot {re}^{2} - 0.16666666666666666\right)\right) \]
      2. sub-neg90.6%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(0.027777777777777776 \cdot {re}^{2} + \left(-0.16666666666666666\right)\right)}\right) \]
      3. *-commutative90.6%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{{re}^{2} \cdot 0.027777777777777776} + \left(-0.16666666666666666\right)\right)\right) \]
      4. unpow290.6%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\color{blue}{\left(re \cdot re\right)} \cdot 0.027777777777777776 + \left(-0.16666666666666666\right)\right)\right) \]
      5. metadata-eval90.6%

        \[\leadsto re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(\left(re \cdot re\right) \cdot 0.027777777777777776 + \color{blue}{-0.16666666666666666}\right)\right) \]
    11. Simplified90.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 3.7 \cdot 10^{+60}:\\ \;\;\;\;re \cdot \left(im \cdot \left(-1 + \left(re \cdot re\right) \cdot 0.16666666666666666\right)\right)\\ \mathbf{elif}\;im \leq 10^{+179}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(re \cdot \left(im \cdot \left(im \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(\left(im \cdot \left(im \cdot im\right)\right) \cdot \left(-0.16666666666666666 + \left(re \cdot re\right) \cdot 0.027777777777777776\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 20: 52.5% accurate, 19.2× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 0.056:\\ \;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(-0.16666666666666666 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= im_m 0.056)
    (* im_m (* re (+ -1.0 (* (* im_m im_m) -0.16666666666666666))))
    (* re (* -0.16666666666666666 (* im_m (* im_m im_m)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 0.056) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else {
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (im_m <= 0.056d0) then
        tmp = im_m * (re * ((-1.0d0) + ((im_m * im_m) * (-0.16666666666666666d0))))
    else
        tmp = re * ((-0.16666666666666666d0) * (im_m * (im_m * im_m)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 0.056) {
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	} else {
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if im_m <= 0.056:
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)))
	else:
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (im_m <= 0.056)
		tmp = Float64(im_m * Float64(re * Float64(-1.0 + Float64(Float64(im_m * im_m) * -0.16666666666666666))));
	else
		tmp = Float64(re * Float64(-0.16666666666666666 * Float64(im_m * Float64(im_m * im_m))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (im_m <= 0.056)
		tmp = im_m * (re * (-1.0 + ((im_m * im_m) * -0.16666666666666666)));
	else
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 0.056], N[(im$95$m * N[(re * N[(-1.0 + N[(N[(im$95$m * im$95$m), $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(re * N[(-0.16666666666666666 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 0.056:\\
\;\;\;\;im\_m \cdot \left(re \cdot \left(-1 + \left(im\_m \cdot im\_m\right) \cdot -0.16666666666666666\right)\right)\\

\mathbf{else}:\\
\;\;\;\;re \cdot \left(-0.16666666666666666 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\


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

    1. Initial program 57.8%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 50.0%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*50.0%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative50.0%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow250.0%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*50.0%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out50.0%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative50.0%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative50.0%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*50.0%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified50.0%

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

    if 0.0560000000000000012 < im

    1. Initial program 99.9%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 41.9%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow241.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out41.9%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified41.9%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left({im}^{3} \cdot re\right)} \]
    8. Step-by-step derivation
      1. associate-*r*46.2%

        \[\leadsto \color{blue}{\left(-0.16666666666666666 \cdot {im}^{3}\right) \cdot re} \]
      2. cube-mult46.2%

        \[\leadsto \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot \left(im \cdot im\right)\right)}\right) \cdot re \]
    9. Simplified46.2%

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

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

Alternative 21: 52.4% accurate, 22.0× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 0.056:\\ \;\;\;\;\left(-im\_m\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(-0.16666666666666666 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= im_m 0.056)
    (* (- im_m) re)
    (* re (* -0.16666666666666666 (* im_m (* im_m im_m)))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 0.056) {
		tmp = -im_m * re;
	} else {
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (im_m <= 0.056d0) then
        tmp = -im_m * re
    else
        tmp = re * ((-0.16666666666666666d0) * (im_m * (im_m * im_m)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 0.056) {
		tmp = -im_m * re;
	} else {
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if im_m <= 0.056:
		tmp = -im_m * re
	else:
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (im_m <= 0.056)
		tmp = Float64(Float64(-im_m) * re);
	else
		tmp = Float64(re * Float64(-0.16666666666666666 * Float64(im_m * Float64(im_m * im_m))));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (im_m <= 0.056)
		tmp = -im_m * re;
	else
		tmp = re * (-0.16666666666666666 * (im_m * (im_m * im_m)));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 0.056], N[((-im$95$m) * re), $MachinePrecision], N[(re * N[(-0.16666666666666666 * N[(im$95$m * N[(im$95$m * im$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 0.056:\\
\;\;\;\;\left(-im\_m\right) \cdot re\\

\mathbf{else}:\\
\;\;\;\;re \cdot \left(-0.16666666666666666 \cdot \left(im\_m \cdot \left(im\_m \cdot im\_m\right)\right)\right)\\


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

    1. Initial program 57.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg61.7%

        \[\leadsto \color{blue}{-im \cdot \sin re} \]
      2. neg-sub061.7%

        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    5. Simplified61.7%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    6. Taylor expanded in re around 0 35.7%

      \[\leadsto 0 - \color{blue}{im \cdot re} \]
    7. Step-by-step derivation
      1. *-commutative35.7%

        \[\leadsto 0 - \color{blue}{re \cdot im} \]
    8. Simplified35.7%

      \[\leadsto 0 - \color{blue}{re \cdot im} \]

    if 0.0560000000000000012 < im

    1. Initial program 99.9%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 41.9%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow241.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out41.9%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified41.9%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left({im}^{3} \cdot re\right)} \]
    8. Step-by-step derivation
      1. associate-*r*46.2%

        \[\leadsto \color{blue}{\left(-0.16666666666666666 \cdot {im}^{3}\right) \cdot re} \]
      2. cube-mult46.2%

        \[\leadsto \left(-0.16666666666666666 \cdot \color{blue}{\left(im \cdot \left(im \cdot im\right)\right)}\right) \cdot re \]
    9. Simplified46.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 0.056:\\ \;\;\;\;\left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(-0.16666666666666666 \cdot \left(im \cdot \left(im \cdot im\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 49.5% accurate, 22.0× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \begin{array}{l} \mathbf{if}\;im\_m \leq 0.056:\\ \;\;\;\;\left(-im\_m\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \end{array} \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m)
 :precision binary64
 (*
  im_s
  (if (<= im_m 0.056)
    (* (- im_m) re)
    (* im_m (* (* im_m im_m) (* re -0.16666666666666666))))))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 0.056) {
		tmp = -im_m * re;
	} else {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	}
	return im_s * tmp;
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    real(8) :: tmp
    if (im_m <= 0.056d0) then
        tmp = -im_m * re
    else
        tmp = im_m * ((im_m * im_m) * (re * (-0.16666666666666666d0)))
    end if
    code = im_s * tmp
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	double tmp;
	if (im_m <= 0.056) {
		tmp = -im_m * re;
	} else {
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	}
	return im_s * tmp;
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	tmp = 0
	if im_m <= 0.056:
		tmp = -im_m * re
	else:
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666))
	return im_s * tmp
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	tmp = 0.0
	if (im_m <= 0.056)
		tmp = Float64(Float64(-im_m) * re);
	else
		tmp = Float64(im_m * Float64(Float64(im_m * im_m) * Float64(re * -0.16666666666666666)));
	end
	return Float64(im_s * tmp)
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp_2 = code(im_s, re, im_m)
	tmp = 0.0;
	if (im_m <= 0.056)
		tmp = -im_m * re;
	else
		tmp = im_m * ((im_m * im_m) * (re * -0.16666666666666666));
	end
	tmp_2 = im_s * tmp;
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * If[LessEqual[im$95$m, 0.056], N[((-im$95$m) * re), $MachinePrecision], N[(im$95$m * N[(N[(im$95$m * im$95$m), $MachinePrecision] * N[(re * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \begin{array}{l}
\mathbf{if}\;im\_m \leq 0.056:\\
\;\;\;\;\left(-im\_m\right) \cdot re\\

\mathbf{else}:\\
\;\;\;\;im\_m \cdot \left(\left(im\_m \cdot im\_m\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\


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

    1. Initial program 57.8%

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

      \[\leadsto \color{blue}{-1 \cdot \left(im \cdot \sin re\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg61.7%

        \[\leadsto \color{blue}{-im \cdot \sin re} \]
      2. neg-sub061.7%

        \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    5. Simplified61.7%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
    6. Taylor expanded in re around 0 35.7%

      \[\leadsto 0 - \color{blue}{im \cdot re} \]
    7. Step-by-step derivation
      1. *-commutative35.7%

        \[\leadsto 0 - \color{blue}{re \cdot im} \]
    8. Simplified35.7%

      \[\leadsto 0 - \color{blue}{re \cdot im} \]

    if 0.0560000000000000012 < im

    1. Initial program 99.9%

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

      \[\leadsto \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(e^{-im} - e^{im}\right) \]
    4. Taylor expanded in im around 0 41.9%

      \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + -0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re}\right) \]
      2. *-commutative41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. unpow241.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \left(\color{blue}{\left(im \cdot im\right)} \cdot -0.16666666666666666\right) \cdot re\right) \]
      4. associate-*r*41.9%

        \[\leadsto im \cdot \left(-1 \cdot re + \color{blue}{\left(im \cdot \left(im \cdot -0.16666666666666666\right)\right)} \cdot re\right) \]
      5. distribute-rgt-out41.9%

        \[\leadsto im \cdot \color{blue}{\left(re \cdot \left(-1 + im \cdot \left(im \cdot -0.16666666666666666\right)\right)\right)} \]
      6. *-commutative41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(im \cdot -0.16666666666666666\right) \cdot im}\right)\right) \]
      7. *-commutative41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{\left(-0.16666666666666666 \cdot im\right)} \cdot im\right)\right) \]
      8. associate-*r*41.9%

        \[\leadsto im \cdot \left(re \cdot \left(-1 + \color{blue}{-0.16666666666666666 \cdot \left(im \cdot im\right)}\right)\right) \]
    6. Simplified41.9%

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

      \[\leadsto im \cdot \color{blue}{\left(-0.16666666666666666 \cdot \left({im}^{2} \cdot re\right)\right)} \]
    8. Step-by-step derivation
      1. associate-*r*41.9%

        \[\leadsto im \cdot \color{blue}{\left(\left(-0.16666666666666666 \cdot {im}^{2}\right) \cdot re\right)} \]
      2. *-commutative41.9%

        \[\leadsto im \cdot \left(\color{blue}{\left({im}^{2} \cdot -0.16666666666666666\right)} \cdot re\right) \]
      3. associate-*l*41.9%

        \[\leadsto im \cdot \color{blue}{\left({im}^{2} \cdot \left(-0.16666666666666666 \cdot re\right)\right)} \]
      4. unpow241.9%

        \[\leadsto im \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \left(-0.16666666666666666 \cdot re\right)\right) \]
      5. *-commutative41.9%

        \[\leadsto im \cdot \left(\left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot -0.16666666666666666\right)}\right) \]
    9. Simplified41.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 0.056:\\ \;\;\;\;\left(-im\right) \cdot re\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(\left(im \cdot im\right) \cdot \left(re \cdot -0.16666666666666666\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 23: 32.7% accurate, 77.0× speedup?

\[\begin{array}{l} im\_m = \left|im\right| \\ im\_s = \mathsf{copysign}\left(1, im\right) \\ im\_s \cdot \left(\left(-im\_m\right) \cdot re\right) \end{array} \]
im\_m = (fabs.f64 im)
im\_s = (copysign.f64 #s(literal 1 binary64) im)
(FPCore (im_s re im_m) :precision binary64 (* im_s (* (- im_m) re)))
im\_m = fabs(im);
im\_s = copysign(1.0, im);
double code(double im_s, double re, double im_m) {
	return im_s * (-im_m * re);
}
im\_m = abs(im)
im\_s = copysign(1.0d0, im)
real(8) function code(im_s, re, im_m)
    real(8), intent (in) :: im_s
    real(8), intent (in) :: re
    real(8), intent (in) :: im_m
    code = im_s * (-im_m * re)
end function
im\_m = Math.abs(im);
im\_s = Math.copySign(1.0, im);
public static double code(double im_s, double re, double im_m) {
	return im_s * (-im_m * re);
}
im\_m = math.fabs(im)
im\_s = math.copysign(1.0, im)
def code(im_s, re, im_m):
	return im_s * (-im_m * re)
im\_m = abs(im)
im\_s = copysign(1.0, im)
function code(im_s, re, im_m)
	return Float64(im_s * Float64(Float64(-im_m) * re))
end
im\_m = abs(im);
im\_s = sign(im) * abs(1.0);
function tmp = code(im_s, re, im_m)
	tmp = im_s * (-im_m * re);
end
im\_m = N[Abs[im], $MachinePrecision]
im\_s = N[With[{TMP1 = Abs[1.0], TMP2 = Sign[im]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision]
code[im$95$s_, re_, im$95$m_] := N[(im$95$s * N[((-im$95$m) * re), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
im\_m = \left|im\right|
\\
im\_s = \mathsf{copysign}\left(1, im\right)

\\
im\_s \cdot \left(\left(-im\_m\right) \cdot re\right)
\end{array}
Derivation
  1. Initial program 68.6%

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

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

      \[\leadsto \color{blue}{-im \cdot \sin re} \]
    2. neg-sub047.1%

      \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
  5. Simplified47.1%

    \[\leadsto \color{blue}{0 - im \cdot \sin re} \]
  6. Taylor expanded in re around 0 29.0%

    \[\leadsto 0 - \color{blue}{im \cdot re} \]
  7. Step-by-step derivation
    1. *-commutative29.0%

      \[\leadsto 0 - \color{blue}{re \cdot im} \]
  8. Simplified29.0%

    \[\leadsto 0 - \color{blue}{re \cdot im} \]
  9. Final simplification29.0%

    \[\leadsto \left(-im\right) \cdot re \]
  10. Add Preprocessing

Developer target: 99.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\left|im\right| < 1:\\ \;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (< (fabs im) 1.0)
   (-
    (*
     (sin re)
     (+
      (+ im (* (* (* 0.16666666666666666 im) im) im))
      (* (* (* (* (* 0.008333333333333333 im) im) im) im) im))))
   (* (* 0.5 (sin re)) (- (exp (- im)) (exp im)))))
double code(double re, double im) {
	double tmp;
	if (fabs(im) < 1.0) {
		tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
	} else {
		tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (abs(im) < 1.0d0) then
        tmp = -(sin(re) * ((im + (((0.16666666666666666d0 * im) * im) * im)) + (((((0.008333333333333333d0 * im) * im) * im) * im) * im)))
    else
        tmp = (0.5d0 * sin(re)) * (exp(-im) - exp(im))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (Math.abs(im) < 1.0) {
		tmp = -(Math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
	} else {
		tmp = (0.5 * Math.sin(re)) * (Math.exp(-im) - Math.exp(im));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if math.fabs(im) < 1.0:
		tmp = -(math.sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)))
	else:
		tmp = (0.5 * math.sin(re)) * (math.exp(-im) - math.exp(im))
	return tmp
function code(re, im)
	tmp = 0.0
	if (abs(im) < 1.0)
		tmp = Float64(-Float64(sin(re) * Float64(Float64(im + Float64(Float64(Float64(0.16666666666666666 * im) * im) * im)) + Float64(Float64(Float64(Float64(Float64(0.008333333333333333 * im) * im) * im) * im) * im))));
	else
		tmp = Float64(Float64(0.5 * sin(re)) * Float64(exp(Float64(-im)) - exp(im)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (abs(im) < 1.0)
		tmp = -(sin(re) * ((im + (((0.16666666666666666 * im) * im) * im)) + (((((0.008333333333333333 * im) * im) * im) * im) * im)));
	else
		tmp = (0.5 * sin(re)) * (exp(-im) - exp(im));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[Less[N[Abs[im], $MachinePrecision], 1.0], (-N[(N[Sin[re], $MachinePrecision] * N[(N[(im + N[(N[(N[(0.16666666666666666 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(0.008333333333333333 * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\left|im\right| < 1:\\
\;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024107 
(FPCore (re im)
  :name "math.cos on complex, imaginary part"
  :precision binary64

  :alt
  (if (< (fabs im) 1.0) (- (* (sin re) (+ (+ im (* (* (* 0.16666666666666666 im) im) im)) (* (* (* (* (* 0.008333333333333333 im) im) im) im) im)))) (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))

  (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))