math.cos on complex, imaginary part

Percentage Accurate: 65.4% → 99.7%
Time: 12.0s
Alternatives: 18
Speedup: 2.6×

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 18 alternatives:

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

Initial Program: 65.4% 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.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-im} - e^{im}\\ \mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\ \;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 - im\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (- (exp (- im)) (exp im))))
   (if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
     (* t_0 (* 0.5 (sin re)))
     (fma
      (pow im 3.0)
      (* (sin re) -0.16666666666666666)
      (* (sin re) (- (* (pow im 5.0) -0.008333333333333333) im))))))
double code(double re, double im) {
	double t_0 = exp(-im) - exp(im);
	double tmp;
	if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * sin(re));
	} else {
		tmp = fma(pow(im, 3.0), (sin(re) * -0.16666666666666666), (sin(re) * ((pow(im, 5.0) * -0.008333333333333333) - im)));
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(exp(Float64(-im)) - exp(im))
	tmp = 0.0
	if ((t_0 <= Float64(-Inf)) || !(t_0 <= 0.001))
		tmp = Float64(t_0 * Float64(0.5 * sin(re)));
	else
		tmp = fma((im ^ 3.0), Float64(sin(re) * -0.16666666666666666), Float64(sin(re) * Float64(Float64((im ^ 5.0) * -0.008333333333333333) - im)));
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[im, 3.0], $MachinePrecision] * N[(N[Sin[re], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 - im\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1e-3 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

    1. Initial program 100.0%

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

    if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 1e-3

    1. Initial program 26.4%

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

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

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

        \[\leadsto \color{blue}{{im}^{3} \cdot \left(-0.16666666666666666 \cdot \sin re\right)} + \left(-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) + -1 \cdot \left(\sin re \cdot im\right)\right) \]
      3. fma-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666 \cdot \sin re, -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) + -1 \cdot \left(\sin re \cdot im\right)\right)} \]
      4. *-commutative99.9%

        \[\leadsto \mathsf{fma}\left({im}^{3}, \color{blue}{\sin re \cdot -0.16666666666666666}, -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) + -1 \cdot \left(\sin re \cdot im\right)\right) \]
      5. mul-1-neg99.9%

        \[\leadsto \mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) + \color{blue}{\left(-\sin re \cdot im\right)}\right) \]
      6. unsub-neg99.9%

        \[\leadsto \mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \color{blue}{-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) - \sin re \cdot im}\right) \]
      7. *-commutative99.9%

        \[\leadsto \mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \color{blue}{\left(\sin re \cdot {im}^{5}\right) \cdot -0.008333333333333333} - \sin re \cdot im\right) \]
      8. associate-*l*99.9%

        \[\leadsto \mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \color{blue}{\sin re \cdot \left({im}^{5} \cdot -0.008333333333333333\right)} - \sin re \cdot im\right) \]
      9. distribute-lft-out--99.9%

        \[\leadsto \mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \color{blue}{\sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 - im\right)}\right) \]
    4. Simplified99.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 - im\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification99.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{-im} - e^{im} \leq -\infty \lor \neg \left(e^{-im} - e^{im} \leq 0.001\right):\\ \;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left({im}^{3}, \sin re \cdot -0.16666666666666666, \sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 - im\right)\right)\\ \end{array} \]

Alternative 2: 99.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-im} - e^{im}\\ \mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\ \;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 + \left({im}^{3} \cdot -0.16666666666666666 - im\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (- (exp (- im)) (exp im))))
   (if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
     (* t_0 (* 0.5 (sin re)))
     (*
      (sin re)
      (+
       (* (pow im 5.0) -0.008333333333333333)
       (- (* (pow im 3.0) -0.16666666666666666) im))))))
double code(double re, double im) {
	double t_0 = exp(-im) - exp(im);
	double tmp;
	if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * sin(re));
	} else {
		tmp = sin(re) * ((pow(im, 5.0) * -0.008333333333333333) + ((pow(im, 3.0) * -0.16666666666666666) - im));
	}
	return tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.exp(-im) - Math.exp(im);
	double tmp;
	if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * Math.sin(re));
	} else {
		tmp = Math.sin(re) * ((Math.pow(im, 5.0) * -0.008333333333333333) + ((Math.pow(im, 3.0) * -0.16666666666666666) - im));
	}
	return tmp;
}
def code(re, im):
	t_0 = math.exp(-im) - math.exp(im)
	tmp = 0
	if (t_0 <= -math.inf) or not (t_0 <= 0.001):
		tmp = t_0 * (0.5 * math.sin(re))
	else:
		tmp = math.sin(re) * ((math.pow(im, 5.0) * -0.008333333333333333) + ((math.pow(im, 3.0) * -0.16666666666666666) - im))
	return tmp
function code(re, im)
	t_0 = Float64(exp(Float64(-im)) - exp(im))
	tmp = 0.0
	if ((t_0 <= Float64(-Inf)) || !(t_0 <= 0.001))
		tmp = Float64(t_0 * Float64(0.5 * sin(re)));
	else
		tmp = Float64(sin(re) * Float64(Float64((im ^ 5.0) * -0.008333333333333333) + Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = exp(-im) - exp(im);
	tmp = 0.0;
	if ((t_0 <= -Inf) || ~((t_0 <= 0.001)))
		tmp = t_0 * (0.5 * sin(re));
	else
		tmp = sin(re) * (((im ^ 5.0) * -0.008333333333333333) + (((im ^ 3.0) * -0.16666666666666666) - im));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 5.0], $MachinePrecision] * -0.008333333333333333), $MachinePrecision] + N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\

\mathbf{else}:\\
\;\;\;\;\sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 + \left({im}^{3} \cdot -0.16666666666666666 - im\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1e-3 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

    1. Initial program 100.0%

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

    if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 1e-3

    1. Initial program 26.4%

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot \left(\sin re \cdot im\right) + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right)} + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      4. mul-1-neg99.9%

        \[\leadsto \left(\color{blue}{\left(-\sin re \cdot im\right)} + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      5. *-commutative99.9%

        \[\leadsto \left(\left(-\color{blue}{im \cdot \sin re}\right) + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      6. distribute-lft-neg-in99.9%

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

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

        \[\leadsto \left(\left(-im\right) \cdot \sin re + \color{blue}{\left(-0.16666666666666666 \cdot {im}^{3}\right) \cdot \sin re}\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      9. distribute-rgt-out99.8%

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

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(-0.008333333333333333 \cdot \sin re\right) \cdot {im}^{5}} \]
      11. *-commutative99.8%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(\sin re \cdot -0.008333333333333333\right)} \cdot {im}^{5} \]
      12. associate-*l*99.8%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\sin re \cdot \left(-0.008333333333333333 \cdot {im}^{5}\right)} \]
      13. distribute-lft-out99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left(\left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + -0.008333333333333333 \cdot {im}^{5}\right)} \]
    4. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{-im} - e^{im} \leq -\infty \lor \neg \left(e^{-im} - e^{im} \leq 0.001\right):\\ \;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left({im}^{5} \cdot -0.008333333333333333 + \left({im}^{3} \cdot -0.16666666666666666 - im\right)\right)\\ \end{array} \]

Alternative 3: 99.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-im} - e^{im}\\ \mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\ \;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot \sin re\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (- (exp (- im)) (exp im))))
   (if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
     (* t_0 (* 0.5 (sin re)))
     (- (* (sin re) (* (pow im 3.0) -0.16666666666666666)) (* im (sin re))))))
double code(double re, double im) {
	double t_0 = exp(-im) - exp(im);
	double tmp;
	if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * sin(re));
	} else {
		tmp = (sin(re) * (pow(im, 3.0) * -0.16666666666666666)) - (im * sin(re));
	}
	return tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.exp(-im) - Math.exp(im);
	double tmp;
	if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * Math.sin(re));
	} else {
		tmp = (Math.sin(re) * (Math.pow(im, 3.0) * -0.16666666666666666)) - (im * Math.sin(re));
	}
	return tmp;
}
def code(re, im):
	t_0 = math.exp(-im) - math.exp(im)
	tmp = 0
	if (t_0 <= -math.inf) or not (t_0 <= 0.001):
		tmp = t_0 * (0.5 * math.sin(re))
	else:
		tmp = (math.sin(re) * (math.pow(im, 3.0) * -0.16666666666666666)) - (im * math.sin(re))
	return tmp
function code(re, im)
	t_0 = Float64(exp(Float64(-im)) - exp(im))
	tmp = 0.0
	if ((t_0 <= Float64(-Inf)) || !(t_0 <= 0.001))
		tmp = Float64(t_0 * Float64(0.5 * sin(re)));
	else
		tmp = Float64(Float64(sin(re) * Float64((im ^ 3.0) * -0.16666666666666666)) - Float64(im * sin(re)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = exp(-im) - exp(im);
	tmp = 0.0;
	if ((t_0 <= -Inf) || ~((t_0 <= 0.001)))
		tmp = t_0 * (0.5 * sin(re));
	else
		tmp = (sin(re) * ((im ^ 3.0) * -0.16666666666666666)) - (im * sin(re));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Sin[re], $MachinePrecision] * N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(im * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1e-3 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

    1. Initial program 100.0%

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

    if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 1e-3

    1. Initial program 26.4%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

        \[\leadsto -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + \color{blue}{\left(-\sin re \cdot im\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Step-by-step derivation
      1. sub-neg99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right) + \sin re \cdot \left(-im\right)} \]
    6. Applied egg-rr99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{-im} - e^{im} \leq -\infty \lor \neg \left(e^{-im} - e^{im} \leq 0.001\right):\\ \;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot \sin re\\ \end{array} \]

Alternative 4: 99.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-im} - e^{im}\\ \mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\ \;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (- (exp (- im)) (exp im))))
   (if (or (<= t_0 (- INFINITY)) (not (<= t_0 0.001)))
     (* t_0 (* 0.5 (sin re)))
     (* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im)))))
double code(double re, double im) {
	double t_0 = exp(-im) - exp(im);
	double tmp;
	if ((t_0 <= -((double) INFINITY)) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * sin(re));
	} else {
		tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
	}
	return tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.exp(-im) - Math.exp(im);
	double tmp;
	if ((t_0 <= -Double.POSITIVE_INFINITY) || !(t_0 <= 0.001)) {
		tmp = t_0 * (0.5 * Math.sin(re));
	} else {
		tmp = Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
	}
	return tmp;
}
def code(re, im):
	t_0 = math.exp(-im) - math.exp(im)
	tmp = 0
	if (t_0 <= -math.inf) or not (t_0 <= 0.001):
		tmp = t_0 * (0.5 * math.sin(re))
	else:
		tmp = math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
	return tmp
function code(re, im)
	t_0 = Float64(exp(Float64(-im)) - exp(im))
	tmp = 0.0
	if ((t_0 <= Float64(-Inf)) || !(t_0 <= 0.001))
		tmp = Float64(t_0 * Float64(0.5 * sin(re)));
	else
		tmp = Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = exp(-im) - exp(im);
	tmp = 0.0;
	if ((t_0 <= -Inf) || ~((t_0 <= 0.001)))
		tmp = t_0 * (0.5 * sin(re));
	else
		tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im);
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, (-Infinity)], N[Not[LessEqual[t$95$0, 0.001]], $MachinePrecision]], N[(t$95$0 * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{-im} - e^{im}\\
\mathbf{if}\;t_0 \leq -\infty \lor \neg \left(t_0 \leq 0.001\right):\\
\;\;\;\;t_0 \cdot \left(0.5 \cdot \sin re\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < -inf.0 or 1e-3 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im))

    1. Initial program 100.0%

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

    if -inf.0 < (-.f64 (exp.f64 (neg.f64 im)) (exp.f64 im)) < 1e-3

    1. Initial program 26.4%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

        \[\leadsto -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + \color{blue}{\left(-\sin re \cdot im\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;e^{-im} - e^{im} \leq -\infty \lor \neg \left(e^{-im} - e^{im} \leq 0.001\right):\\ \;\;\;\;\left(e^{-im} - e^{im}\right) \cdot \left(0.5 \cdot \sin re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \end{array} \]

Alternative 5: 84.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\ \mathbf{if}\;im \leq -6.2 \cdot 10^{+97}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* -0.16666666666666666 (* (sin re) (pow im 3.0)))))
   (if (<= im -6.2e+97)
     t_0
     (if (<= im -420000000.0)
       (log1p (expm1 (* re -1.5)))
       (if (<= im 1.45e-29)
         (/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
         (if (<= im 8.5e+59)
           (* im (- (* (pow re 3.0) 0.16666666666666666) re))
           t_0))))))
double code(double re, double im) {
	double t_0 = -0.16666666666666666 * (sin(re) * pow(im, 3.0));
	double tmp;
	if (im <= -6.2e+97) {
		tmp = t_0;
	} else if (im <= -420000000.0) {
		tmp = log1p(expm1((re * -1.5)));
	} else if (im <= 1.45e-29) {
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 8.5e+59) {
		tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
public static double code(double re, double im) {
	double t_0 = -0.16666666666666666 * (Math.sin(re) * Math.pow(im, 3.0));
	double tmp;
	if (im <= -6.2e+97) {
		tmp = t_0;
	} else if (im <= -420000000.0) {
		tmp = Math.log1p(Math.expm1((re * -1.5)));
	} else if (im <= 1.45e-29) {
		tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 8.5e+59) {
		tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = -0.16666666666666666 * (math.sin(re) * math.pow(im, 3.0))
	tmp = 0
	if im <= -6.2e+97:
		tmp = t_0
	elif im <= -420000000.0:
		tmp = math.log1p(math.expm1((re * -1.5)))
	elif im <= 1.45e-29:
		tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im))
	elif im <= 8.5e+59:
		tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(-0.16666666666666666 * Float64(sin(re) * (im ^ 3.0)))
	tmp = 0.0
	if (im <= -6.2e+97)
		tmp = t_0;
	elseif (im <= -420000000.0)
		tmp = log1p(expm1(Float64(re * -1.5)));
	elseif (im <= 1.45e-29)
		tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im)));
	elseif (im <= 8.5e+59)
		tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re));
	else
		tmp = t_0;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(-0.16666666666666666 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -6.2e+97], t$95$0, If[LessEqual[im, -420000000.0], N[Log[1 + N[(Exp[N[(re * -1.5), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.5e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\
\mathbf{if}\;im \leq -6.2 \cdot 10^{+97}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\

\mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -6.19999999999999962e97 or 8.4999999999999999e59 < im

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--88.4%

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

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Taylor expanded in im around inf 88.4%

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

    if -6.19999999999999962e97 < im < -4.2e8

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)} \]
    3. Applied egg-rr2.5%

      \[\leadsto 0.5 \cdot \left(\color{blue}{-3} \cdot re\right) \]
    4. Step-by-step derivation
      1. log1p-expm1-u42.7%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(0.5 \cdot \left(-3 \cdot re\right)\right)\right)} \]
      2. associate-*r*42.7%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\left(0.5 \cdot -3\right) \cdot re}\right)\right) \]
      3. metadata-eval42.7%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{-1.5} \cdot re\right)\right) \]
    5. Applied egg-rr42.7%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(-1.5 \cdot re\right)\right)} \]

    if -4.2e8 < im < 1.45000000000000012e-29

    1. Initial program 27.6%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.0%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.0%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.0%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.0%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Step-by-step derivation
      1. flip--64.6%

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

        \[\leadsto \color{blue}{\frac{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666\right) \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im}} \]
      3. swap-sqr59.2%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{\left({im}^{3} \cdot {im}^{3}\right) \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right)} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      4. pow-prod-up59.2%

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

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

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot \color{blue}{0.027777777777777776} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      7. fma-def59.2%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\color{blue}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    6. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    7. Step-by-step derivation
      1. associate-/l*64.5%

        \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{{im}^{6} \cdot 0.027777777777777776 - im \cdot im}}} \]
      2. *-commutative64.5%

        \[\leadsto \frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{\color{blue}{0.027777777777777776 \cdot {im}^{6}} - im \cdot im}} \]
    8. Simplified64.5%

      \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{0.027777777777777776 \cdot {im}^{6} - im \cdot im}}} \]
    9. Taylor expanded in im around 0 98.7%

      \[\leadsto \frac{\sin re}{\color{blue}{0.16666666666666666 \cdot im - \frac{1}{im}}} \]
    10. Step-by-step derivation
      1. *-commutative98.7%

        \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666} - \frac{1}{im}} \]
    11. Simplified98.7%

      \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666 - \frac{1}{im}}} \]

    if 1.45000000000000012e-29 < im < 8.4999999999999999e59

    1. Initial program 74.4%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative29.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in29.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified29.6%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 55.7%

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

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

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

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

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative73.9%

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -6.2 \cdot 10^{+97}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\\ \end{array} \]

Alternative 6: 92.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \mathbf{if}\;im \leq -5 \cdot 10^{+61}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -0.07:\\ \;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
   (if (<= im -5e+61)
     t_0
     (if (<= im -0.07)
       (* 0.5 (* (- (exp (- im)) (exp im)) re))
       (if (<= im 1.45e-29)
         (/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
         (if (<= im 8.5e+59)
           (* im (- (* (pow re 3.0) 0.16666666666666666) re))
           t_0))))))
double code(double re, double im) {
	double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
	double tmp;
	if (im <= -5e+61) {
		tmp = t_0;
	} else if (im <= -0.07) {
		tmp = 0.5 * ((exp(-im) - exp(im)) * re);
	} else if (im <= 1.45e-29) {
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 8.5e+59) {
		tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-0.008333333333333333d0) * (sin(re) * (im ** 5.0d0))
    if (im <= (-5d+61)) then
        tmp = t_0
    else if (im <= (-0.07d0)) then
        tmp = 0.5d0 * ((exp(-im) - exp(im)) * re)
    else if (im <= 1.45d-29) then
        tmp = sin(re) / ((im * 0.16666666666666666d0) + ((-1.0d0) / im))
    else if (im <= 8.5d+59) then
        tmp = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = -0.008333333333333333 * (Math.sin(re) * Math.pow(im, 5.0));
	double tmp;
	if (im <= -5e+61) {
		tmp = t_0;
	} else if (im <= -0.07) {
		tmp = 0.5 * ((Math.exp(-im) - Math.exp(im)) * re);
	} else if (im <= 1.45e-29) {
		tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 8.5e+59) {
		tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = -0.008333333333333333 * (math.sin(re) * math.pow(im, 5.0))
	tmp = 0
	if im <= -5e+61:
		tmp = t_0
	elif im <= -0.07:
		tmp = 0.5 * ((math.exp(-im) - math.exp(im)) * re)
	elif im <= 1.45e-29:
		tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im))
	elif im <= 8.5e+59:
		tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(-0.008333333333333333 * Float64(sin(re) * (im ^ 5.0)))
	tmp = 0.0
	if (im <= -5e+61)
		tmp = t_0;
	elseif (im <= -0.07)
		tmp = Float64(0.5 * Float64(Float64(exp(Float64(-im)) - exp(im)) * re));
	elseif (im <= 1.45e-29)
		tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im)));
	elseif (im <= 8.5e+59)
		tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = -0.008333333333333333 * (sin(re) * (im ^ 5.0));
	tmp = 0.0;
	if (im <= -5e+61)
		tmp = t_0;
	elseif (im <= -0.07)
		tmp = 0.5 * ((exp(-im) - exp(im)) * re);
	elseif (im <= 1.45e-29)
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	elseif (im <= 8.5e+59)
		tmp = im * (((re ^ 3.0) * 0.16666666666666666) - re);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(-0.008333333333333333 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -5e+61], t$95$0, If[LessEqual[im, -0.07], N[(0.5 * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.5e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\
\mathbf{if}\;im \leq -5 \cdot 10^{+61}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -0.07:\\
\;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\

\mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -5.00000000000000018e61 or 8.4999999999999999e59 < im

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(-\sin re \cdot im\right)} + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      5. *-commutative98.5%

        \[\leadsto \left(\left(-\color{blue}{im \cdot \sin re}\right) + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      6. distribute-lft-neg-in98.5%

        \[\leadsto \left(\color{blue}{\left(-im\right) \cdot \sin re} + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      7. *-commutative98.5%

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

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

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

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(-0.008333333333333333 \cdot \sin re\right) \cdot {im}^{5}} \]
      11. *-commutative98.5%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(\sin re \cdot -0.008333333333333333\right)} \cdot {im}^{5} \]
      12. associate-*l*98.5%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\sin re \cdot \left(-0.008333333333333333 \cdot {im}^{5}\right)} \]
      13. distribute-lft-out98.5%

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

      \[\leadsto \color{blue}{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666 - im\right) + {im}^{5} \cdot -0.008333333333333333\right)} \]
    5. Taylor expanded in im around inf 98.5%

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

        \[\leadsto -0.008333333333333333 \cdot \color{blue}{\left({im}^{5} \cdot \sin re\right)} \]
    7. Simplified98.5%

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

    if -5.00000000000000018e61 < im < -0.070000000000000007

    1. Initial program 100.0%

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

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

    if -0.070000000000000007 < im < 1.45000000000000012e-29

    1. Initial program 27.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

        \[\leadsto -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + \color{blue}{\left(-\sin re \cdot im\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Step-by-step derivation
      1. flip--65.2%

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

        \[\leadsto \color{blue}{\frac{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666\right) \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im}} \]
      3. swap-sqr59.7%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{\left({im}^{3} \cdot {im}^{3}\right) \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right)} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      4. pow-prod-up59.7%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{{im}^{\left(3 + 3\right)}} \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      5. metadata-eval59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{\color{blue}{6}} \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      6. metadata-eval59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot \color{blue}{0.027777777777777776} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      7. fma-def59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\color{blue}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    6. Applied egg-rr59.7%

      \[\leadsto \color{blue}{\frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    7. Step-by-step derivation
      1. associate-/l*65.0%

        \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{{im}^{6} \cdot 0.027777777777777776 - im \cdot im}}} \]
      2. *-commutative65.0%

        \[\leadsto \frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{\color{blue}{0.027777777777777776 \cdot {im}^{6}} - im \cdot im}} \]
    8. Simplified65.0%

      \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{0.027777777777777776 \cdot {im}^{6} - im \cdot im}}} \]
    9. Taylor expanded in im around 0 99.6%

      \[\leadsto \frac{\sin re}{\color{blue}{0.16666666666666666 \cdot im - \frac{1}{im}}} \]
    10. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666} - \frac{1}{im}} \]
    11. Simplified99.6%

      \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666 - \frac{1}{im}}} \]

    if 1.45000000000000012e-29 < im < 8.4999999999999999e59

    1. Initial program 74.4%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative29.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in29.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified29.6%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 55.7%

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

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

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

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

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative73.9%

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -5 \cdot 10^{+61}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \mathbf{elif}\;im \leq -0.07:\\ \;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \end{array} \]

Alternative 7: 92.9% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \mathbf{if}\;im \leq -5 \cdot 10^{+61}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -0.135:\\ \;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
   (if (<= im -5e+61)
     t_0
     (if (<= im -0.135)
       (* 0.5 (* (- (exp (- im)) (exp im)) re))
       (if (<= im 1.45e-29)
         (* (sin re) (- (* (pow im 3.0) -0.16666666666666666) im))
         (if (<= im 8.5e+59)
           (* im (- (* (pow re 3.0) 0.16666666666666666) re))
           t_0))))))
double code(double re, double im) {
	double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
	double tmp;
	if (im <= -5e+61) {
		tmp = t_0;
	} else if (im <= -0.135) {
		tmp = 0.5 * ((exp(-im) - exp(im)) * re);
	} else if (im <= 1.45e-29) {
		tmp = sin(re) * ((pow(im, 3.0) * -0.16666666666666666) - im);
	} else if (im <= 8.5e+59) {
		tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-0.008333333333333333d0) * (sin(re) * (im ** 5.0d0))
    if (im <= (-5d+61)) then
        tmp = t_0
    else if (im <= (-0.135d0)) then
        tmp = 0.5d0 * ((exp(-im) - exp(im)) * re)
    else if (im <= 1.45d-29) then
        tmp = sin(re) * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
    else if (im <= 8.5d+59) then
        tmp = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = -0.008333333333333333 * (Math.sin(re) * Math.pow(im, 5.0));
	double tmp;
	if (im <= -5e+61) {
		tmp = t_0;
	} else if (im <= -0.135) {
		tmp = 0.5 * ((Math.exp(-im) - Math.exp(im)) * re);
	} else if (im <= 1.45e-29) {
		tmp = Math.sin(re) * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
	} else if (im <= 8.5e+59) {
		tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = -0.008333333333333333 * (math.sin(re) * math.pow(im, 5.0))
	tmp = 0
	if im <= -5e+61:
		tmp = t_0
	elif im <= -0.135:
		tmp = 0.5 * ((math.exp(-im) - math.exp(im)) * re)
	elif im <= 1.45e-29:
		tmp = math.sin(re) * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
	elif im <= 8.5e+59:
		tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(-0.008333333333333333 * Float64(sin(re) * (im ^ 5.0)))
	tmp = 0.0
	if (im <= -5e+61)
		tmp = t_0;
	elseif (im <= -0.135)
		tmp = Float64(0.5 * Float64(Float64(exp(Float64(-im)) - exp(im)) * re));
	elseif (im <= 1.45e-29)
		tmp = Float64(sin(re) * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im));
	elseif (im <= 8.5e+59)
		tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = -0.008333333333333333 * (sin(re) * (im ^ 5.0));
	tmp = 0.0;
	if (im <= -5e+61)
		tmp = t_0;
	elseif (im <= -0.135)
		tmp = 0.5 * ((exp(-im) - exp(im)) * re);
	elseif (im <= 1.45e-29)
		tmp = sin(re) * (((im ^ 3.0) * -0.16666666666666666) - im);
	elseif (im <= 8.5e+59)
		tmp = im * (((re ^ 3.0) * 0.16666666666666666) - re);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(-0.008333333333333333 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -5e+61], t$95$0, If[LessEqual[im, -0.135], N[(0.5 * N[(N[(N[Exp[(-im)], $MachinePrecision] - N[Exp[im], $MachinePrecision]), $MachinePrecision] * re), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8.5e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\
\mathbf{if}\;im \leq -5 \cdot 10^{+61}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -0.135:\\
\;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\

\mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\
\;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -5.00000000000000018e61 or 8.4999999999999999e59 < im

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(-\sin re \cdot im\right)} + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      5. *-commutative98.5%

        \[\leadsto \left(\left(-\color{blue}{im \cdot \sin re}\right) + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      6. distribute-lft-neg-in98.5%

        \[\leadsto \left(\color{blue}{\left(-im\right) \cdot \sin re} + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      7. *-commutative98.5%

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

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

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

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(-0.008333333333333333 \cdot \sin re\right) \cdot {im}^{5}} \]
      11. *-commutative98.5%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(\sin re \cdot -0.008333333333333333\right)} \cdot {im}^{5} \]
      12. associate-*l*98.5%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\sin re \cdot \left(-0.008333333333333333 \cdot {im}^{5}\right)} \]
      13. distribute-lft-out98.5%

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

      \[\leadsto \color{blue}{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666 - im\right) + {im}^{5} \cdot -0.008333333333333333\right)} \]
    5. Taylor expanded in im around inf 98.5%

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

        \[\leadsto -0.008333333333333333 \cdot \color{blue}{\left({im}^{5} \cdot \sin re\right)} \]
    7. Simplified98.5%

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

    if -5.00000000000000018e61 < im < -0.13500000000000001

    1. Initial program 100.0%

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

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

    if -0.13500000000000001 < im < 1.45000000000000012e-29

    1. Initial program 27.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

        \[\leadsto -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + \color{blue}{\left(-\sin re \cdot im\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.8%

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

    if 1.45000000000000012e-29 < im < 8.4999999999999999e59

    1. Initial program 74.4%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative29.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in29.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified29.6%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 55.7%

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

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

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

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

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative73.9%

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -5 \cdot 10^{+61}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \mathbf{elif}\;im \leq -0.135:\\ \;\;\;\;0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq 8.5 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \end{array} \]

Alternative 8: 89.7% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \mathbf{if}\;im \leq -2.35:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* -0.008333333333333333 (* (sin re) (pow im 5.0)))))
   (if (<= im -2.35)
     t_0
     (if (<= im 1.45e-29)
       (/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
       (if (<= im 7.2e+59)
         (* im (- (* (pow re 3.0) 0.16666666666666666) re))
         t_0)))))
double code(double re, double im) {
	double t_0 = -0.008333333333333333 * (sin(re) * pow(im, 5.0));
	double tmp;
	if (im <= -2.35) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 7.2e+59) {
		tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (-0.008333333333333333d0) * (sin(re) * (im ** 5.0d0))
    if (im <= (-2.35d0)) then
        tmp = t_0
    else if (im <= 1.45d-29) then
        tmp = sin(re) / ((im * 0.16666666666666666d0) + ((-1.0d0) / im))
    else if (im <= 7.2d+59) then
        tmp = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = -0.008333333333333333 * (Math.sin(re) * Math.pow(im, 5.0));
	double tmp;
	if (im <= -2.35) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 7.2e+59) {
		tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = -0.008333333333333333 * (math.sin(re) * math.pow(im, 5.0))
	tmp = 0
	if im <= -2.35:
		tmp = t_0
	elif im <= 1.45e-29:
		tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im))
	elif im <= 7.2e+59:
		tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(-0.008333333333333333 * Float64(sin(re) * (im ^ 5.0)))
	tmp = 0.0
	if (im <= -2.35)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im)));
	elseif (im <= 7.2e+59)
		tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = -0.008333333333333333 * (sin(re) * (im ^ 5.0));
	tmp = 0.0;
	if (im <= -2.35)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	elseif (im <= 7.2e+59)
		tmp = im * (((re ^ 3.0) * 0.16666666666666666) - re);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(-0.008333333333333333 * N[(N[Sin[re], $MachinePrecision] * N[Power[im, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.35], t$95$0, If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.2e+59], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\
\mathbf{if}\;im \leq -2.35:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -2.35000000000000009 or 7.1999999999999997e59 < im

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \left(\left(-\color{blue}{im \cdot \sin re}\right) + -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right)\right) + -0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right) \]
      6. distribute-lft-neg-in92.2%

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

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

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

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

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(-0.008333333333333333 \cdot \sin re\right) \cdot {im}^{5}} \]
      11. *-commutative92.2%

        \[\leadsto \sin re \cdot \left(\left(-im\right) + -0.16666666666666666 \cdot {im}^{3}\right) + \color{blue}{\left(\sin re \cdot -0.008333333333333333\right)} \cdot {im}^{5} \]
      12. associate-*l*92.2%

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

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

      \[\leadsto \color{blue}{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666 - im\right) + {im}^{5} \cdot -0.008333333333333333\right)} \]
    5. Taylor expanded in im around inf 92.2%

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

        \[\leadsto -0.008333333333333333 \cdot \color{blue}{\left({im}^{5} \cdot \sin re\right)} \]
    7. Simplified92.2%

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

    if -2.35000000000000009 < im < 1.45000000000000012e-29

    1. Initial program 27.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

        \[\leadsto -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + \color{blue}{\left(-\sin re \cdot im\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Step-by-step derivation
      1. flip--65.2%

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

        \[\leadsto \color{blue}{\frac{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666\right) \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im}} \]
      3. swap-sqr59.7%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{\left({im}^{3} \cdot {im}^{3}\right) \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right)} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      4. pow-prod-up59.7%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{{im}^{\left(3 + 3\right)}} \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      5. metadata-eval59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{\color{blue}{6}} \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      6. metadata-eval59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot \color{blue}{0.027777777777777776} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      7. fma-def59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\color{blue}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    6. Applied egg-rr59.7%

      \[\leadsto \color{blue}{\frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    7. Step-by-step derivation
      1. associate-/l*65.0%

        \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{{im}^{6} \cdot 0.027777777777777776 - im \cdot im}}} \]
      2. *-commutative65.0%

        \[\leadsto \frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{\color{blue}{0.027777777777777776 \cdot {im}^{6}} - im \cdot im}} \]
    8. Simplified65.0%

      \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{0.027777777777777776 \cdot {im}^{6} - im \cdot im}}} \]
    9. Taylor expanded in im around 0 99.6%

      \[\leadsto \frac{\sin re}{\color{blue}{0.16666666666666666 \cdot im - \frac{1}{im}}} \]
    10. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666} - \frac{1}{im}} \]
    11. Simplified99.6%

      \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666 - \frac{1}{im}}} \]

    if 1.45000000000000012e-29 < im < 7.1999999999999997e59

    1. Initial program 74.4%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative29.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in29.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified29.6%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 55.7%

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

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

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

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

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative73.9%

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified73.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -2.35:\\ \;\;\;\;-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+59}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;-0.008333333333333333 \cdot \left(\sin re \cdot {im}^{5}\right)\\ \end{array} \]

Alternative 9: 75.6% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\ t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{if}\;im \leq -4.9 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -4.7 \cdot 10^{+155}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -5 \cdot 10^{+96}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 8 \cdot 10^{+69}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (log1p (expm1 (* re -1.5))))
        (t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
   (if (<= im -4.9e+202)
     t_1
     (if (<= im -4.7e+155)
       t_0
       (if (<= im -5e+96)
         t_1
         (if (<= im -420000000.0)
           t_0
           (if (<= im 1.45e-29)
             (/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
             (if (<= im 8e+69)
               (* im (- (* (pow re 3.0) 0.16666666666666666) re))
               t_1))))))))
double code(double re, double im) {
	double t_0 = log1p(expm1((re * -1.5)));
	double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -4.9e+202) {
		tmp = t_1;
	} else if (im <= -4.7e+155) {
		tmp = t_0;
	} else if (im <= -5e+96) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 8e+69) {
		tmp = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_1;
	}
	return tmp;
}
public static double code(double re, double im) {
	double t_0 = Math.log1p(Math.expm1((re * -1.5)));
	double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -4.9e+202) {
		tmp = t_1;
	} else if (im <= -4.7e+155) {
		tmp = t_0;
	} else if (im <= -5e+96) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 8e+69) {
		tmp = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = math.log1p(math.expm1((re * -1.5)))
	t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
	tmp = 0
	if im <= -4.9e+202:
		tmp = t_1
	elif im <= -4.7e+155:
		tmp = t_0
	elif im <= -5e+96:
		tmp = t_1
	elif im <= -420000000.0:
		tmp = t_0
	elif im <= 1.45e-29:
		tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im))
	elif im <= 8e+69:
		tmp = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = log1p(expm1(Float64(re * -1.5)))
	t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im))
	tmp = 0.0
	if (im <= -4.9e+202)
		tmp = t_1;
	elseif (im <= -4.7e+155)
		tmp = t_0;
	elseif (im <= -5e+96)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im)));
	elseif (im <= 8e+69)
		tmp = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re));
	else
		tmp = t_1;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[Log[1 + N[(Exp[N[(re * -1.5), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.9e+202], t$95$1, If[LessEqual[im, -4.7e+155], t$95$0, If[LessEqual[im, -5e+96], t$95$1, If[LessEqual[im, -420000000.0], t$95$0, If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 8e+69], N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -4.9 \cdot 10^{+202}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -4.7 \cdot 10^{+155}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -5 \cdot 10^{+96}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -4.9e202 or -4.70000000000000019e155 < im < -5.0000000000000004e96 or 8.0000000000000006e69 < im

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg89.5%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative89.5%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--89.5%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified89.5%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Taylor expanded in re around 0 73.9%

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

    if -4.9e202 < im < -4.70000000000000019e155 or -5.0000000000000004e96 < im < -4.2e8

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)} \]
    3. Applied egg-rr3.4%

      \[\leadsto 0.5 \cdot \left(\color{blue}{-3} \cdot re\right) \]
    4. Step-by-step derivation
      1. log1p-expm1-u53.6%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(0.5 \cdot \left(-3 \cdot re\right)\right)\right)} \]
      2. associate-*r*53.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{\left(0.5 \cdot -3\right) \cdot re}\right)\right) \]
      3. metadata-eval53.6%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(\color{blue}{-1.5} \cdot re\right)\right) \]
    5. Applied egg-rr53.6%

      \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(-1.5 \cdot re\right)\right)} \]

    if -4.2e8 < im < 1.45000000000000012e-29

    1. Initial program 27.6%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.0%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.0%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.0%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.0%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Step-by-step derivation
      1. flip--64.6%

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

        \[\leadsto \color{blue}{\frac{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666\right) \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im}} \]
      3. swap-sqr59.2%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{\left({im}^{3} \cdot {im}^{3}\right) \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right)} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      4. pow-prod-up59.2%

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

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

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot \color{blue}{0.027777777777777776} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      7. fma-def59.2%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\color{blue}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    6. Applied egg-rr59.2%

      \[\leadsto \color{blue}{\frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    7. Step-by-step derivation
      1. associate-/l*64.5%

        \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{{im}^{6} \cdot 0.027777777777777776 - im \cdot im}}} \]
      2. *-commutative64.5%

        \[\leadsto \frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{\color{blue}{0.027777777777777776 \cdot {im}^{6}} - im \cdot im}} \]
    8. Simplified64.5%

      \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{0.027777777777777776 \cdot {im}^{6} - im \cdot im}}} \]
    9. Taylor expanded in im around 0 98.7%

      \[\leadsto \frac{\sin re}{\color{blue}{0.16666666666666666 \cdot im - \frac{1}{im}}} \]
    10. Step-by-step derivation
      1. *-commutative98.7%

        \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666} - \frac{1}{im}} \]
    11. Simplified98.7%

      \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666 - \frac{1}{im}}} \]

    if 1.45000000000000012e-29 < im < 8.0000000000000006e69

    1. Initial program 79.9%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative23.9%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in23.9%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified23.9%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 44.4%

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

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

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

        \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + 0.16666666666666666 \cdot {re}^{3}\right)} \]
      4. mul-1-neg58.7%

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative58.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -4.9 \cdot 10^{+202}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -4.7 \cdot 10^{+155}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\ \mathbf{elif}\;im \leq -5 \cdot 10^{+96}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(re \cdot -1.5\right)\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 8 \cdot 10^{+69}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \end{array} \]

Alternative 10: 76.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{if}\;im \leq -4.5 \cdot 10^{+202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -8 \cdot 10^{+93}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 700:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{+68}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* 0.16666666666666666 (* im (pow re 3.0))))
        (t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
   (if (<= im -4.5e+202)
     t_1
     (if (<= im -1e+157)
       t_0
       (if (<= im -8e+93)
         t_1
         (if (<= im -420000000.0)
           t_0
           (if (<= im 700.0)
             (* (- im) (sin re))
             (if (<= im 1.45e+68) t_0 t_1))))))))
double code(double re, double im) {
	double t_0 = 0.16666666666666666 * (im * pow(re, 3.0));
	double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -4.5e+202) {
		tmp = t_1;
	} else if (im <= -1e+157) {
		tmp = t_0;
	} else if (im <= -8e+93) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_0;
	} else if (im <= 700.0) {
		tmp = -im * sin(re);
	} else if (im <= 1.45e+68) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = 0.16666666666666666d0 * (im * (re ** 3.0d0))
    t_1 = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
    if (im <= (-4.5d+202)) then
        tmp = t_1
    else if (im <= (-1d+157)) then
        tmp = t_0
    else if (im <= (-8d+93)) then
        tmp = t_1
    else if (im <= (-420000000.0d0)) then
        tmp = t_0
    else if (im <= 700.0d0) then
        tmp = -im * sin(re)
    else if (im <= 1.45d+68) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = 0.16666666666666666 * (im * Math.pow(re, 3.0));
	double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -4.5e+202) {
		tmp = t_1;
	} else if (im <= -1e+157) {
		tmp = t_0;
	} else if (im <= -8e+93) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_0;
	} else if (im <= 700.0) {
		tmp = -im * Math.sin(re);
	} else if (im <= 1.45e+68) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.16666666666666666 * (im * math.pow(re, 3.0))
	t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
	tmp = 0
	if im <= -4.5e+202:
		tmp = t_1
	elif im <= -1e+157:
		tmp = t_0
	elif im <= -8e+93:
		tmp = t_1
	elif im <= -420000000.0:
		tmp = t_0
	elif im <= 700.0:
		tmp = -im * math.sin(re)
	elif im <= 1.45e+68:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(0.16666666666666666 * Float64(im * (re ^ 3.0)))
	t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im))
	tmp = 0.0
	if (im <= -4.5e+202)
		tmp = t_1;
	elseif (im <= -1e+157)
		tmp = t_0;
	elseif (im <= -8e+93)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_0;
	elseif (im <= 700.0)
		tmp = Float64(Float64(-im) * sin(re));
	elseif (im <= 1.45e+68)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.16666666666666666 * (im * (re ^ 3.0));
	t_1 = re * (((im ^ 3.0) * -0.16666666666666666) - im);
	tmp = 0.0;
	if (im <= -4.5e+202)
		tmp = t_1;
	elseif (im <= -1e+157)
		tmp = t_0;
	elseif (im <= -8e+93)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_0;
	elseif (im <= 700.0)
		tmp = -im * sin(re);
	elseif (im <= 1.45e+68)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(im * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.5e+202], t$95$1, If[LessEqual[im, -1e+157], t$95$0, If[LessEqual[im, -8e+93], t$95$1, If[LessEqual[im, -420000000.0], t$95$0, If[LessEqual[im, 700.0], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.45e+68], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -4.5 \cdot 10^{+202}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -8 \cdot 10^{+93}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 700:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{+68}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -4.49999999999999978e202 or -9.99999999999999983e156 < im < -8.00000000000000035e93 or 1.45000000000000006e68 < im

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg89.5%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative89.5%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--89.5%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified89.5%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Taylor expanded in re around 0 73.9%

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

    if -4.49999999999999978e202 < im < -9.99999999999999983e156 or -8.00000000000000035e93 < im < -4.2e8 or 700 < im < 1.45000000000000006e68

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative3.5%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in3.5%

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

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 25.2%

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

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

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

        \[\leadsto \color{blue}{im \cdot \left(-1 \cdot re + 0.16666666666666666 \cdot {re}^{3}\right)} \]
      4. mul-1-neg43.8%

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative43.8%

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified43.8%

      \[\leadsto \color{blue}{im \cdot \left(\left(-re\right) + {re}^{3} \cdot 0.16666666666666666\right)} \]
    8. Taylor expanded in re around inf 43.3%

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

    if -4.2e8 < im < 700

    1. Initial program 27.1%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative98.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in98.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -4.5 \cdot 10^{+202}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\ \;\;\;\;0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{elif}\;im \leq -8 \cdot 10^{+93}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{elif}\;im \leq 700:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{+68}:\\ \;\;\;\;0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \end{array} \]

Alternative 11: 75.1% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{if}\;im \leq -1.2 \cdot 10^{+207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -4 \cdot 10^{+97}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{elif}\;im \leq 1.85 \cdot 10^{+70}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* im (- (* (pow re 3.0) 0.16666666666666666) re)))
        (t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
   (if (<= im -1.2e+207)
     t_1
     (if (<= im -1e+157)
       t_0
       (if (<= im -4e+97)
         t_1
         (if (<= im -420000000.0)
           t_0
           (if (<= im 1.45e-29)
             (* (- im) (sin re))
             (if (<= im 1.85e+70) t_0 t_1))))))))
double code(double re, double im) {
	double t_0 = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -1.2e+207) {
		tmp = t_1;
	} else if (im <= -1e+157) {
		tmp = t_0;
	} else if (im <= -4e+97) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = -im * sin(re);
	} else if (im <= 1.85e+70) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
    t_1 = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
    if (im <= (-1.2d+207)) then
        tmp = t_1
    else if (im <= (-1d+157)) then
        tmp = t_0
    else if (im <= (-4d+97)) then
        tmp = t_1
    else if (im <= (-420000000.0d0)) then
        tmp = t_0
    else if (im <= 1.45d-29) then
        tmp = -im * sin(re)
    else if (im <= 1.85d+70) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -1.2e+207) {
		tmp = t_1;
	} else if (im <= -1e+157) {
		tmp = t_0;
	} else if (im <= -4e+97) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = -im * Math.sin(re);
	} else if (im <= 1.85e+70) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
	tmp = 0
	if im <= -1.2e+207:
		tmp = t_1
	elif im <= -1e+157:
		tmp = t_0
	elif im <= -4e+97:
		tmp = t_1
	elif im <= -420000000.0:
		tmp = t_0
	elif im <= 1.45e-29:
		tmp = -im * math.sin(re)
	elif im <= 1.85e+70:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re))
	t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im))
	tmp = 0.0
	if (im <= -1.2e+207)
		tmp = t_1;
	elseif (im <= -1e+157)
		tmp = t_0;
	elseif (im <= -4e+97)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = Float64(Float64(-im) * sin(re));
	elseif (im <= 1.85e+70)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = im * (((re ^ 3.0) * 0.16666666666666666) - re);
	t_1 = re * (((im ^ 3.0) * -0.16666666666666666) - im);
	tmp = 0.0;
	if (im <= -1.2e+207)
		tmp = t_1;
	elseif (im <= -1e+157)
		tmp = t_0;
	elseif (im <= -4e+97)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = -im * sin(re);
	elseif (im <= 1.85e+70)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.2e+207], t$95$1, If[LessEqual[im, -1e+157], t$95$0, If[LessEqual[im, -4e+97], t$95$1, If[LessEqual[im, -420000000.0], t$95$0, If[LessEqual[im, 1.45e-29], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.85e+70], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -1.2 \cdot 10^{+207}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -4 \cdot 10^{+97}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\

\mathbf{elif}\;im \leq 1.85 \cdot 10^{+70}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -1.2e207 or -9.99999999999999983e156 < im < -4.0000000000000003e97 or 1.84999999999999994e70 < im

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg89.5%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative89.5%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--89.5%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified89.5%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Taylor expanded in re around 0 73.9%

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

    if -1.2e207 < im < -9.99999999999999983e156 or -4.0000000000000003e97 < im < -4.2e8 or 1.45000000000000012e-29 < im < 1.84999999999999994e70

    1. Initial program 93.9%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative9.8%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in9.8%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified9.8%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 30.1%

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

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

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

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

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

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified47.5%

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

    if -4.2e8 < im < 1.45000000000000012e-29

    1. Initial program 27.6%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative98.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in98.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1.2 \cdot 10^{+207}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{elif}\;im \leq -4 \cdot 10^{+97}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{elif}\;im \leq 1.85 \cdot 10^{+70}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \end{array} \]

Alternative 12: 75.3% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{if}\;im \leq -3.1 \cdot 10^{+203}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -7.7 \cdot 10^{+93}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -2.4:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 7.6 \cdot 10^{+68}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* im (- (* (pow re 3.0) 0.16666666666666666) re)))
        (t_1 (* re (- (* (pow im 3.0) -0.16666666666666666) im))))
   (if (<= im -3.1e+203)
     t_1
     (if (<= im -1e+157)
       t_0
       (if (<= im -7.7e+93)
         t_1
         (if (<= im -2.4)
           t_0
           (if (<= im 1.45e-29)
             (/ (sin re) (+ (* im 0.16666666666666666) (/ -1.0 im)))
             (if (<= im 7.6e+68) t_0 t_1))))))))
double code(double re, double im) {
	double t_0 = im * ((pow(re, 3.0) * 0.16666666666666666) - re);
	double t_1 = re * ((pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -3.1e+203) {
		tmp = t_1;
	} else if (im <= -1e+157) {
		tmp = t_0;
	} else if (im <= -7.7e+93) {
		tmp = t_1;
	} else if (im <= -2.4) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 7.6e+68) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = im * (((re ** 3.0d0) * 0.16666666666666666d0) - re)
    t_1 = re * (((im ** 3.0d0) * (-0.16666666666666666d0)) - im)
    if (im <= (-3.1d+203)) then
        tmp = t_1
    else if (im <= (-1d+157)) then
        tmp = t_0
    else if (im <= (-7.7d+93)) then
        tmp = t_1
    else if (im <= (-2.4d0)) then
        tmp = t_0
    else if (im <= 1.45d-29) then
        tmp = sin(re) / ((im * 0.16666666666666666d0) + ((-1.0d0) / im))
    else if (im <= 7.6d+68) then
        tmp = t_0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = im * ((Math.pow(re, 3.0) * 0.16666666666666666) - re);
	double t_1 = re * ((Math.pow(im, 3.0) * -0.16666666666666666) - im);
	double tmp;
	if (im <= -3.1e+203) {
		tmp = t_1;
	} else if (im <= -1e+157) {
		tmp = t_0;
	} else if (im <= -7.7e+93) {
		tmp = t_1;
	} else if (im <= -2.4) {
		tmp = t_0;
	} else if (im <= 1.45e-29) {
		tmp = Math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	} else if (im <= 7.6e+68) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = im * ((math.pow(re, 3.0) * 0.16666666666666666) - re)
	t_1 = re * ((math.pow(im, 3.0) * -0.16666666666666666) - im)
	tmp = 0
	if im <= -3.1e+203:
		tmp = t_1
	elif im <= -1e+157:
		tmp = t_0
	elif im <= -7.7e+93:
		tmp = t_1
	elif im <= -2.4:
		tmp = t_0
	elif im <= 1.45e-29:
		tmp = math.sin(re) / ((im * 0.16666666666666666) + (-1.0 / im))
	elif im <= 7.6e+68:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(im * Float64(Float64((re ^ 3.0) * 0.16666666666666666) - re))
	t_1 = Float64(re * Float64(Float64((im ^ 3.0) * -0.16666666666666666) - im))
	tmp = 0.0
	if (im <= -3.1e+203)
		tmp = t_1;
	elseif (im <= -1e+157)
		tmp = t_0;
	elseif (im <= -7.7e+93)
		tmp = t_1;
	elseif (im <= -2.4)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = Float64(sin(re) / Float64(Float64(im * 0.16666666666666666) + Float64(-1.0 / im)));
	elseif (im <= 7.6e+68)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = im * (((re ^ 3.0) * 0.16666666666666666) - re);
	t_1 = re * (((im ^ 3.0) * -0.16666666666666666) - im);
	tmp = 0.0;
	if (im <= -3.1e+203)
		tmp = t_1;
	elseif (im <= -1e+157)
		tmp = t_0;
	elseif (im <= -7.7e+93)
		tmp = t_1;
	elseif (im <= -2.4)
		tmp = t_0;
	elseif (im <= 1.45e-29)
		tmp = sin(re) / ((im * 0.16666666666666666) + (-1.0 / im));
	elseif (im <= 7.6e+68)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(im * N[(N[(N[Power[re, 3.0], $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(N[(N[Power[im, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -3.1e+203], t$95$1, If[LessEqual[im, -1e+157], t$95$0, If[LessEqual[im, -7.7e+93], t$95$1, If[LessEqual[im, -2.4], t$95$0, If[LessEqual[im, 1.45e-29], N[(N[Sin[re], $MachinePrecision] / N[(N[(im * 0.16666666666666666), $MachinePrecision] + N[(-1.0 / im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 7.6e+68], t$95$0, t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\
t_1 := re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\
\mathbf{if}\;im \leq -3.1 \cdot 10^{+203}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -7.7 \cdot 10^{+93}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -2.4:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\
\;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\

\mathbf{elif}\;im \leq 7.6 \cdot 10^{+68}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -3.1e203 or -9.99999999999999983e156 < im < -7.70000000000000004e93 or 7.6000000000000002e68 < im

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg89.5%

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

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative89.5%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--89.5%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified89.5%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Taylor expanded in re around 0 73.9%

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

    if -3.1e203 < im < -9.99999999999999983e156 or -7.70000000000000004e93 < im < -2.39999999999999991 or 1.45000000000000012e-29 < im < 7.6000000000000002e68

    1. Initial program 94.0%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative9.7%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in9.7%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified9.7%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 29.5%

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

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

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

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

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

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified46.5%

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

    if -2.39999999999999991 < im < 1.45000000000000012e-29

    1. Initial program 27.0%

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

      \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + -1 \cdot \left(\sin re \cdot im\right)} \]
    3. Step-by-step derivation
      1. mul-1-neg99.8%

        \[\leadsto -0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) + \color{blue}{\left(-\sin re \cdot im\right)} \]
      2. unsub-neg99.8%

        \[\leadsto \color{blue}{-0.16666666666666666 \cdot \left(\sin re \cdot {im}^{3}\right) - \sin re \cdot im} \]
      3. *-commutative99.8%

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

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666\right)} - \sin re \cdot im \]
      5. distribute-lft-out--99.8%

        \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    4. Simplified99.8%

      \[\leadsto \color{blue}{\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)} \]
    5. Step-by-step derivation
      1. flip--65.2%

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

        \[\leadsto \color{blue}{\frac{\sin re \cdot \left(\left({im}^{3} \cdot -0.16666666666666666\right) \cdot \left({im}^{3} \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im}} \]
      3. swap-sqr59.7%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{\left({im}^{3} \cdot {im}^{3}\right) \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right)} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      4. pow-prod-up59.7%

        \[\leadsto \frac{\sin re \cdot \left(\color{blue}{{im}^{\left(3 + 3\right)}} \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      5. metadata-eval59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{\color{blue}{6}} \cdot \left(-0.16666666666666666 \cdot -0.16666666666666666\right) - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      6. metadata-eval59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot \color{blue}{0.027777777777777776} - im \cdot im\right)}{{im}^{3} \cdot -0.16666666666666666 + im} \]
      7. fma-def59.7%

        \[\leadsto \frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\color{blue}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    6. Applied egg-rr59.7%

      \[\leadsto \color{blue}{\frac{\sin re \cdot \left({im}^{6} \cdot 0.027777777777777776 - im \cdot im\right)}{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}} \]
    7. Step-by-step derivation
      1. associate-/l*65.0%

        \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{{im}^{6} \cdot 0.027777777777777776 - im \cdot im}}} \]
      2. *-commutative65.0%

        \[\leadsto \frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{\color{blue}{0.027777777777777776 \cdot {im}^{6}} - im \cdot im}} \]
    8. Simplified65.0%

      \[\leadsto \color{blue}{\frac{\sin re}{\frac{\mathsf{fma}\left({im}^{3}, -0.16666666666666666, im\right)}{0.027777777777777776 \cdot {im}^{6} - im \cdot im}}} \]
    9. Taylor expanded in im around 0 99.6%

      \[\leadsto \frac{\sin re}{\color{blue}{0.16666666666666666 \cdot im - \frac{1}{im}}} \]
    10. Step-by-step derivation
      1. *-commutative99.6%

        \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666} - \frac{1}{im}} \]
    11. Simplified99.6%

      \[\leadsto \frac{\sin re}{\color{blue}{im \cdot 0.16666666666666666 - \frac{1}{im}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification80.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -3.1 \cdot 10^{+203}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -1 \cdot 10^{+157}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{elif}\;im \leq -7.7 \cdot 10^{+93}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \mathbf{elif}\;im \leq -2.4:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{elif}\;im \leq 1.45 \cdot 10^{-29}:\\ \;\;\;\;\frac{\sin re}{im \cdot 0.16666666666666666 + \frac{-1}{im}}\\ \mathbf{elif}\;im \leq 7.6 \cdot 10^{+68}:\\ \;\;\;\;im \cdot \left({re}^{3} \cdot 0.16666666666666666 - re\right)\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\\ \end{array} \]

Alternative 13: 60.5% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := im \cdot {re}^{3}\\ t_1 := -0.16666666666666666 \cdot t_0\\ t_2 := 0.16666666666666666 \cdot t_0\\ \mathbf{if}\;im \leq -3.2 \cdot 10^{+215}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;im \leq 420:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{elif}\;im \leq 4.1 \cdot 10^{+125}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* im (pow re 3.0)))
        (t_1 (* -0.16666666666666666 t_0))
        (t_2 (* 0.16666666666666666 t_0)))
   (if (<= im -3.2e+215)
     t_1
     (if (<= im -420000000.0)
       t_2
       (if (<= im 420.0) (* (- im) (sin re)) (if (<= im 4.1e+125) t_2 t_1))))))
double code(double re, double im) {
	double t_0 = im * pow(re, 3.0);
	double t_1 = -0.16666666666666666 * t_0;
	double t_2 = 0.16666666666666666 * t_0;
	double tmp;
	if (im <= -3.2e+215) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_2;
	} else if (im <= 420.0) {
		tmp = -im * sin(re);
	} else if (im <= 4.1e+125) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = im * (re ** 3.0d0)
    t_1 = (-0.16666666666666666d0) * t_0
    t_2 = 0.16666666666666666d0 * t_0
    if (im <= (-3.2d+215)) then
        tmp = t_1
    else if (im <= (-420000000.0d0)) then
        tmp = t_2
    else if (im <= 420.0d0) then
        tmp = -im * sin(re)
    else if (im <= 4.1d+125) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = im * Math.pow(re, 3.0);
	double t_1 = -0.16666666666666666 * t_0;
	double t_2 = 0.16666666666666666 * t_0;
	double tmp;
	if (im <= -3.2e+215) {
		tmp = t_1;
	} else if (im <= -420000000.0) {
		tmp = t_2;
	} else if (im <= 420.0) {
		tmp = -im * Math.sin(re);
	} else if (im <= 4.1e+125) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = im * math.pow(re, 3.0)
	t_1 = -0.16666666666666666 * t_0
	t_2 = 0.16666666666666666 * t_0
	tmp = 0
	if im <= -3.2e+215:
		tmp = t_1
	elif im <= -420000000.0:
		tmp = t_2
	elif im <= 420.0:
		tmp = -im * math.sin(re)
	elif im <= 4.1e+125:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(im * (re ^ 3.0))
	t_1 = Float64(-0.16666666666666666 * t_0)
	t_2 = Float64(0.16666666666666666 * t_0)
	tmp = 0.0
	if (im <= -3.2e+215)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_2;
	elseif (im <= 420.0)
		tmp = Float64(Float64(-im) * sin(re));
	elseif (im <= 4.1e+125)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = im * (re ^ 3.0);
	t_1 = -0.16666666666666666 * t_0;
	t_2 = 0.16666666666666666 * t_0;
	tmp = 0.0;
	if (im <= -3.2e+215)
		tmp = t_1;
	elseif (im <= -420000000.0)
		tmp = t_2;
	elseif (im <= 420.0)
		tmp = -im * sin(re);
	elseif (im <= 4.1e+125)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(im * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-0.16666666666666666 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(0.16666666666666666 * t$95$0), $MachinePrecision]}, If[LessEqual[im, -3.2e+215], t$95$1, If[LessEqual[im, -420000000.0], t$95$2, If[LessEqual[im, 420.0], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.1e+125], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := im \cdot {re}^{3}\\
t_1 := -0.16666666666666666 \cdot t_0\\
t_2 := 0.16666666666666666 \cdot t_0\\
\mathbf{if}\;im \leq -3.2 \cdot 10^{+215}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -420000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;im \leq 420:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\

\mathbf{elif}\;im \leq 4.1 \cdot 10^{+125}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -3.1999999999999999e215 or 4.09999999999999992e125 < im

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative5.3%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in5.3%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified5.3%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 6.6%

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

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

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

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(\left(-re\right) + {re}^{3} \cdot 0.16666666666666666\right)} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt10.3%

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

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

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

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{\left(0.16666666666666666 \cdot {re}^{3}\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{3}\right)}}\right) \]
      5. swap-sqr24.1%

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

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{\color{blue}{0.027777777777777776} \cdot \left({re}^{3} \cdot {re}^{3}\right)}\right) \]
      7. pow-prod-up24.1%

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{0.027777777777777776 \cdot \color{blue}{{re}^{\left(3 + 3\right)}}}\right) \]
      8. metadata-eval24.1%

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{0.027777777777777776 \cdot {re}^{\color{blue}{6}}}\right) \]
    9. Applied egg-rr24.1%

      \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{\sqrt{0.027777777777777776 \cdot {re}^{6}}}\right) \]
    10. Taylor expanded in re around -inf 30.6%

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

    if -3.1999999999999999e215 < im < -4.2e8 or 420 < im < 4.09999999999999992e125

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative3.5%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in3.5%

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

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 17.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{im \cdot \left(\left(-re\right) + {re}^{3} \cdot 0.16666666666666666\right)} \]
    8. Taylor expanded in re around inf 31.5%

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

    if -4.2e8 < im < 420

    1. Initial program 27.1%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative98.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in98.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified98.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -3.2 \cdot 10^{+215}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{elif}\;im \leq -420000000:\\ \;\;\;\;0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{elif}\;im \leq 420:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{elif}\;im \leq 4.1 \cdot 10^{+125}:\\ \;\;\;\;0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;-0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \end{array} \]

Alternative 14: 59.6% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq -1.4 \cdot 10^{+30} \lor \neg \left(im \leq 8.2 \cdot 10^{+73}\right):\\ \;\;\;\;-0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (or (<= im -1.4e+30) (not (<= im 8.2e+73)))
   (* -0.16666666666666666 (* im (pow re 3.0)))
   (* (- im) (sin re))))
double code(double re, double im) {
	double tmp;
	if ((im <= -1.4e+30) || !(im <= 8.2e+73)) {
		tmp = -0.16666666666666666 * (im * pow(re, 3.0));
	} else {
		tmp = -im * sin(re);
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if ((im <= (-1.4d+30)) .or. (.not. (im <= 8.2d+73))) then
        tmp = (-0.16666666666666666d0) * (im * (re ** 3.0d0))
    else
        tmp = -im * sin(re)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if ((im <= -1.4e+30) || !(im <= 8.2e+73)) {
		tmp = -0.16666666666666666 * (im * Math.pow(re, 3.0));
	} else {
		tmp = -im * Math.sin(re);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if (im <= -1.4e+30) or not (im <= 8.2e+73):
		tmp = -0.16666666666666666 * (im * math.pow(re, 3.0))
	else:
		tmp = -im * math.sin(re)
	return tmp
function code(re, im)
	tmp = 0.0
	if ((im <= -1.4e+30) || !(im <= 8.2e+73))
		tmp = Float64(-0.16666666666666666 * Float64(im * (re ^ 3.0)));
	else
		tmp = Float64(Float64(-im) * sin(re));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if ((im <= -1.4e+30) || ~((im <= 8.2e+73)))
		tmp = -0.16666666666666666 * (im * (re ^ 3.0));
	else
		tmp = -im * sin(re);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[Or[LessEqual[im, -1.4e+30], N[Not[LessEqual[im, 8.2e+73]], $MachinePrecision]], N[(-0.16666666666666666 * N[(im * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-im) * N[Sin[re], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq -1.4 \cdot 10^{+30} \lor \neg \left(im \leq 8.2 \cdot 10^{+73}\right):\\
\;\;\;\;-0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < -1.39999999999999992e30 or 8.1999999999999996e73 < im

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative4.6%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in4.6%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified4.6%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 10.1%

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

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

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

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

        \[\leadsto im \cdot \left(\color{blue}{\left(-re\right)} + 0.16666666666666666 \cdot {re}^{3}\right) \]
      5. *-commutative23.9%

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{{re}^{3} \cdot 0.16666666666666666}\right) \]
    7. Simplified23.9%

      \[\leadsto \color{blue}{im \cdot \left(\left(-re\right) + {re}^{3} \cdot 0.16666666666666666\right)} \]
    8. Step-by-step derivation
      1. add-sqr-sqrt13.6%

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

        \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{\sqrt{\left({re}^{3} \cdot 0.16666666666666666\right) \cdot \left({re}^{3} \cdot 0.16666666666666666\right)}}\right) \]
      3. *-commutative24.6%

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{\color{blue}{\left(0.16666666666666666 \cdot {re}^{3}\right)} \cdot \left({re}^{3} \cdot 0.16666666666666666\right)}\right) \]
      4. *-commutative24.6%

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{\left(0.16666666666666666 \cdot {re}^{3}\right) \cdot \color{blue}{\left(0.16666666666666666 \cdot {re}^{3}\right)}}\right) \]
      5. swap-sqr24.6%

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

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{\color{blue}{0.027777777777777776} \cdot \left({re}^{3} \cdot {re}^{3}\right)}\right) \]
      7. pow-prod-up24.6%

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{0.027777777777777776 \cdot \color{blue}{{re}^{\left(3 + 3\right)}}}\right) \]
      8. metadata-eval24.6%

        \[\leadsto im \cdot \left(\left(-re\right) + \sqrt{0.027777777777777776 \cdot {re}^{\color{blue}{6}}}\right) \]
    9. Applied egg-rr24.6%

      \[\leadsto im \cdot \left(\left(-re\right) + \color{blue}{\sqrt{0.027777777777777776 \cdot {re}^{6}}}\right) \]
    10. Taylor expanded in re around -inf 23.9%

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

    if -1.39999999999999992e30 < im < 8.1999999999999996e73

    1. Initial program 36.9%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative85.7%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in85.7%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified85.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1.4 \cdot 10^{+30} \lor \neg \left(im \leq 8.2 \cdot 10^{+73}\right):\\ \;\;\;\;-0.16666666666666666 \cdot \left(im \cdot {re}^{3}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \end{array} \]

Alternative 15: 56.9% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;im \leq -1 \cdot 10^{+98}:\\
\;\;\;\;im \cdot \left(-re\right)\\

\mathbf{elif}\;im \leq 5 \cdot 10^{+127}:\\
\;\;\;\;\left(-im\right) \cdot \sin re\\

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


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

    1. Initial program 100.0%

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

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

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

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in5.1%

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

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    5. Taylor expanded in re around 0 19.4%

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

        \[\leadsto \color{blue}{-re \cdot im} \]
      2. *-commutative19.4%

        \[\leadsto -\color{blue}{im \cdot re} \]
      3. distribute-rgt-neg-in19.4%

        \[\leadsto \color{blue}{im \cdot \left(-re\right)} \]
    7. Simplified19.4%

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

    if -9.99999999999999998e97 < im < 5.0000000000000004e127

    1. Initial program 48.2%

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

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

        \[\leadsto \color{blue}{-\sin re \cdot im} \]
      2. *-commutative70.9%

        \[\leadsto -\color{blue}{im \cdot \sin re} \]
      3. distribute-rgt-neg-in70.9%

        \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
    4. Simplified70.9%

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

    if 5.0000000000000004e127 < im

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1 \cdot 10^{+98}:\\ \;\;\;\;im \cdot \left(-re\right)\\ \mathbf{elif}\;im \leq 5 \cdot 10^{+127}:\\ \;\;\;\;\left(-im\right) \cdot \sin re\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(re \cdot \left(im \cdot -2\right)\right)\\ \end{array} \]

Alternative 16: 33.5% accurate, 44.0× speedup?

\[\begin{array}{l} \\ 0.5 \cdot \left(re \cdot \left(im \cdot -2\right)\right) \end{array} \]
(FPCore (re im) :precision binary64 (* 0.5 (* re (* im -2.0))))
double code(double re, double im) {
	return 0.5 * (re * (im * -2.0));
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = 0.5d0 * (re * (im * (-2.0d0)))
end function
public static double code(double re, double im) {
	return 0.5 * (re * (im * -2.0));
}
def code(re, im):
	return 0.5 * (re * (im * -2.0))
function code(re, im)
	return Float64(0.5 * Float64(re * Float64(im * -2.0)))
end
function tmp = code(re, im)
	tmp = 0.5 * (re * (im * -2.0));
end
code[re_, im_] := N[(0.5 * N[(re * N[(im * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
0.5 \cdot \left(re \cdot \left(im \cdot -2\right)\right)
\end{array}
Derivation
  1. Initial program 67.2%

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

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

    \[\leadsto 0.5 \cdot \left(\color{blue}{\left(-2 \cdot im\right)} \cdot re\right) \]
  4. Final simplification30.8%

    \[\leadsto 0.5 \cdot \left(re \cdot \left(im \cdot -2\right)\right) \]

Alternative 17: 33.5% accurate, 77.0× speedup?

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

\\
im \cdot \left(-re\right)
\end{array}
Derivation
  1. Initial program 67.2%

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

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

      \[\leadsto \color{blue}{-\sin re \cdot im} \]
    2. *-commutative46.7%

      \[\leadsto -\color{blue}{im \cdot \sin re} \]
    3. distribute-rgt-neg-in46.7%

      \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
  4. Simplified46.7%

    \[\leadsto \color{blue}{im \cdot \left(-\sin re\right)} \]
  5. Taylor expanded in re around 0 30.5%

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

      \[\leadsto \color{blue}{-re \cdot im} \]
    2. *-commutative30.5%

      \[\leadsto -\color{blue}{im \cdot re} \]
    3. distribute-rgt-neg-in30.5%

      \[\leadsto \color{blue}{im \cdot \left(-re\right)} \]
  7. Simplified30.5%

    \[\leadsto \color{blue}{im \cdot \left(-re\right)} \]
  8. Final simplification30.5%

    \[\leadsto im \cdot \left(-re\right) \]

Alternative 18: 3.3% accurate, 102.7× speedup?

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

\\
re \cdot -1.5
\end{array}
Derivation
  1. Initial program 67.2%

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

    \[\leadsto \color{blue}{0.5 \cdot \left(\left(e^{-im} - e^{im}\right) \cdot re\right)} \]
  3. Applied egg-rr2.9%

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

    \[\leadsto \color{blue}{-1.5 \cdot re} \]
  5. Step-by-step derivation
    1. *-commutative2.9%

      \[\leadsto \color{blue}{re \cdot -1.5} \]
  6. Simplified2.9%

    \[\leadsto \color{blue}{re \cdot -1.5} \]
  7. Final simplification2.9%

    \[\leadsto re \cdot -1.5 \]

Developer target: 99.8% accurate, 0.8× 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 2023196 
(FPCore (re im)
  :name "math.cos on complex, imaginary part"
  :precision binary64

  :herbie-target
  (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))))