math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 8.2s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.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}
Derivation
  1. Initial program 100.0%

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
  2. Step-by-step derivation
    1. sub0-neg100.0%

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

    \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + e^{im}\right)} \]
  4. Final simplification100.0%

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

Alternative 2: 92.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ t_1 := re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -108000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 1.6 \cdot 10^{-5}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3.15 \cdot 10^{+153}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (+ (exp (- im)) (exp im)) (* 0.5 re)))
        (t_1 (+ re (* (* 0.5 (sin re)) (* im im)))))
   (if (<= im -1.32e+154)
     t_1
     (if (<= im -108000.0)
       t_0
       (if (<= im 1.6e-5) (sin re) (if (<= im 3.15e+153) t_0 t_1))))))
double code(double re, double im) {
	double t_0 = (exp(-im) + exp(im)) * (0.5 * re);
	double t_1 = re + ((0.5 * sin(re)) * (im * im));
	double tmp;
	if (im <= -1.32e+154) {
		tmp = t_1;
	} else if (im <= -108000.0) {
		tmp = t_0;
	} else if (im <= 1.6e-5) {
		tmp = sin(re);
	} else if (im <= 3.15e+153) {
		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 = (exp(-im) + exp(im)) * (0.5d0 * re)
    t_1 = re + ((0.5d0 * sin(re)) * (im * im))
    if (im <= (-1.32d+154)) then
        tmp = t_1
    else if (im <= (-108000.0d0)) then
        tmp = t_0
    else if (im <= 1.6d-5) then
        tmp = sin(re)
    else if (im <= 3.15d+153) 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 = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
	double t_1 = re + ((0.5 * Math.sin(re)) * (im * im));
	double tmp;
	if (im <= -1.32e+154) {
		tmp = t_1;
	} else if (im <= -108000.0) {
		tmp = t_0;
	} else if (im <= 1.6e-5) {
		tmp = Math.sin(re);
	} else if (im <= 3.15e+153) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = (math.exp(-im) + math.exp(im)) * (0.5 * re)
	t_1 = re + ((0.5 * math.sin(re)) * (im * im))
	tmp = 0
	if im <= -1.32e+154:
		tmp = t_1
	elif im <= -108000.0:
		tmp = t_0
	elif im <= 1.6e-5:
		tmp = math.sin(re)
	elif im <= 3.15e+153:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re))
	t_1 = Float64(re + Float64(Float64(0.5 * sin(re)) * Float64(im * im)))
	tmp = 0.0
	if (im <= -1.32e+154)
		tmp = t_1;
	elseif (im <= -108000.0)
		tmp = t_0;
	elseif (im <= 1.6e-5)
		tmp = sin(re);
	elseif (im <= 3.15e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = (exp(-im) + exp(im)) * (0.5 * re);
	t_1 = re + ((0.5 * sin(re)) * (im * im));
	tmp = 0.0;
	if (im <= -1.32e+154)
		tmp = t_1;
	elseif (im <= -108000.0)
		tmp = t_0;
	elseif (im <= 1.6e-5)
		tmp = sin(re);
	elseif (im <= 3.15e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re + N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.32e+154], t$95$1, If[LessEqual[im, -108000.0], t$95$0, If[LessEqual[im, 1.6e-5], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3.15e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
t_1 := re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;im \leq 1.6 \cdot 10^{-5}:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 3.15 \cdot 10^{+153}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -1.31999999999999998e154 or 3.1500000000000001e153 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

    if -1.31999999999999998e154 < im < -108000 or 1.59999999999999993e-5 < im < 3.1500000000000001e153

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

    if -108000 < im < 1.59999999999999993e-5

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

      \[\leadsto \color{blue}{\sin re} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification93.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq -108000:\\ \;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;im \leq 1.6 \cdot 10^{-5}:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3.15 \cdot 10^{+153}:\\ \;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \end{array} \]

Alternative 3: 92.8% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ t_1 := re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -108000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 0.0305:\\ \;\;\;\;\sin re + 0.5 \cdot \left(im \cdot \left(\sin re \cdot im\right)\right)\\ \mathbf{elif}\;im \leq 3.15 \cdot 10^{+153}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* (+ (exp (- im)) (exp im)) (* 0.5 re)))
        (t_1 (+ re (* (* 0.5 (sin re)) (* im im)))))
   (if (<= im -1.32e+154)
     t_1
     (if (<= im -108000.0)
       t_0
       (if (<= im 0.0305)
         (+ (sin re) (* 0.5 (* im (* (sin re) im))))
         (if (<= im 3.15e+153) t_0 t_1))))))
double code(double re, double im) {
	double t_0 = (exp(-im) + exp(im)) * (0.5 * re);
	double t_1 = re + ((0.5 * sin(re)) * (im * im));
	double tmp;
	if (im <= -1.32e+154) {
		tmp = t_1;
	} else if (im <= -108000.0) {
		tmp = t_0;
	} else if (im <= 0.0305) {
		tmp = sin(re) + (0.5 * (im * (sin(re) * im)));
	} else if (im <= 3.15e+153) {
		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 = (exp(-im) + exp(im)) * (0.5d0 * re)
    t_1 = re + ((0.5d0 * sin(re)) * (im * im))
    if (im <= (-1.32d+154)) then
        tmp = t_1
    else if (im <= (-108000.0d0)) then
        tmp = t_0
    else if (im <= 0.0305d0) then
        tmp = sin(re) + (0.5d0 * (im * (sin(re) * im)))
    else if (im <= 3.15d+153) 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 = (Math.exp(-im) + Math.exp(im)) * (0.5 * re);
	double t_1 = re + ((0.5 * Math.sin(re)) * (im * im));
	double tmp;
	if (im <= -1.32e+154) {
		tmp = t_1;
	} else if (im <= -108000.0) {
		tmp = t_0;
	} else if (im <= 0.0305) {
		tmp = Math.sin(re) + (0.5 * (im * (Math.sin(re) * im)));
	} else if (im <= 3.15e+153) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = (math.exp(-im) + math.exp(im)) * (0.5 * re)
	t_1 = re + ((0.5 * math.sin(re)) * (im * im))
	tmp = 0
	if im <= -1.32e+154:
		tmp = t_1
	elif im <= -108000.0:
		tmp = t_0
	elif im <= 0.0305:
		tmp = math.sin(re) + (0.5 * (im * (math.sin(re) * im)))
	elif im <= 3.15e+153:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re))
	t_1 = Float64(re + Float64(Float64(0.5 * sin(re)) * Float64(im * im)))
	tmp = 0.0
	if (im <= -1.32e+154)
		tmp = t_1;
	elseif (im <= -108000.0)
		tmp = t_0;
	elseif (im <= 0.0305)
		tmp = Float64(sin(re) + Float64(0.5 * Float64(im * Float64(sin(re) * im))));
	elseif (im <= 3.15e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = (exp(-im) + exp(im)) * (0.5 * re);
	t_1 = re + ((0.5 * sin(re)) * (im * im));
	tmp = 0.0;
	if (im <= -1.32e+154)
		tmp = t_1;
	elseif (im <= -108000.0)
		tmp = t_0;
	elseif (im <= 0.0305)
		tmp = sin(re) + (0.5 * (im * (sin(re) * im)));
	elseif (im <= 3.15e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re + N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -1.32e+154], t$95$1, If[LessEqual[im, -108000.0], t$95$0, If[LessEqual[im, 0.0305], N[(N[Sin[re], $MachinePrecision] + N[(0.5 * N[(im * N[(N[Sin[re], $MachinePrecision] * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.15e+153], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\
t_1 := re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;im \leq 0.0305:\\
\;\;\;\;\sin re + 0.5 \cdot \left(im \cdot \left(\sin re \cdot im\right)\right)\\

\mathbf{elif}\;im \leq 3.15 \cdot 10^{+153}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -1.31999999999999998e154 or 3.1500000000000001e153 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

    if -1.31999999999999998e154 < im < -108000 or 0.030499999999999999 < im < 3.1500000000000001e153

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

    if -108000 < im < 0.030499999999999999

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -1.32 \cdot 10^{+154}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq -108000:\\ \;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;im \leq 0.0305:\\ \;\;\;\;\sin re + 0.5 \cdot \left(im \cdot \left(\sin re \cdot im\right)\right)\\ \mathbf{elif}\;im \leq 3.15 \cdot 10^{+153}:\\ \;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \end{array} \]

Alternative 4: 75.4% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq -4.7 \cdot 10^{+85}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq -1.6 \cdot 10^{+33}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -480 \lor \neg \left(im \leq 4 \cdot 10^{-5}\right):\\ \;\;\;\;\sin re + \left(im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im -4.7e+85)
   (+ re (* (* 0.5 (sin re)) (* im im)))
   (if (<= im -1.6e+33)
     (pow re -512.0)
     (if (or (<= im -480.0) (not (<= im 4e-5)))
       (+
        (sin re)
        (* (* im im) (* re (+ 0.5 (* -0.08333333333333333 (* re re))))))
       (sin re)))))
double code(double re, double im) {
	double tmp;
	if (im <= -4.7e+85) {
		tmp = re + ((0.5 * sin(re)) * (im * im));
	} else if (im <= -1.6e+33) {
		tmp = pow(re, -512.0);
	} else if ((im <= -480.0) || !(im <= 4e-5)) {
		tmp = sin(re) + ((im * im) * (re * (0.5 + (-0.08333333333333333 * (re * re)))));
	} else {
		tmp = 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 <= (-4.7d+85)) then
        tmp = re + ((0.5d0 * sin(re)) * (im * im))
    else if (im <= (-1.6d+33)) then
        tmp = re ** (-512.0d0)
    else if ((im <= (-480.0d0)) .or. (.not. (im <= 4d-5))) then
        tmp = sin(re) + ((im * im) * (re * (0.5d0 + ((-0.08333333333333333d0) * (re * re)))))
    else
        tmp = sin(re)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= -4.7e+85) {
		tmp = re + ((0.5 * Math.sin(re)) * (im * im));
	} else if (im <= -1.6e+33) {
		tmp = Math.pow(re, -512.0);
	} else if ((im <= -480.0) || !(im <= 4e-5)) {
		tmp = Math.sin(re) + ((im * im) * (re * (0.5 + (-0.08333333333333333 * (re * re)))));
	} else {
		tmp = Math.sin(re);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= -4.7e+85:
		tmp = re + ((0.5 * math.sin(re)) * (im * im))
	elif im <= -1.6e+33:
		tmp = math.pow(re, -512.0)
	elif (im <= -480.0) or not (im <= 4e-5):
		tmp = math.sin(re) + ((im * im) * (re * (0.5 + (-0.08333333333333333 * (re * re)))))
	else:
		tmp = math.sin(re)
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= -4.7e+85)
		tmp = Float64(re + Float64(Float64(0.5 * sin(re)) * Float64(im * im)));
	elseif (im <= -1.6e+33)
		tmp = re ^ -512.0;
	elseif ((im <= -480.0) || !(im <= 4e-5))
		tmp = Float64(sin(re) + Float64(Float64(im * im) * Float64(re * Float64(0.5 + Float64(-0.08333333333333333 * Float64(re * re))))));
	else
		tmp = sin(re);
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= -4.7e+85)
		tmp = re + ((0.5 * sin(re)) * (im * im));
	elseif (im <= -1.6e+33)
		tmp = re ^ -512.0;
	elseif ((im <= -480.0) || ~((im <= 4e-5)))
		tmp = sin(re) + ((im * im) * (re * (0.5 + (-0.08333333333333333 * (re * re)))));
	else
		tmp = sin(re);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, -4.7e+85], N[(re + N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -1.6e+33], N[Power[re, -512.0], $MachinePrecision], If[Or[LessEqual[im, -480.0], N[Not[LessEqual[im, 4e-5]], $MachinePrecision]], N[(N[Sin[re], $MachinePrecision] + N[(N[(im * im), $MachinePrecision] * N[(re * N[(0.5 + N[(-0.08333333333333333 * N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[re], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq -4.7 \cdot 10^{+85}:\\
\;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\

\mathbf{elif}\;im \leq -1.6 \cdot 10^{+33}:\\
\;\;\;\;{re}^{-512}\\

\mathbf{elif}\;im \leq -480 \lor \neg \left(im \leq 4 \cdot 10^{-5}\right):\\
\;\;\;\;\sin re + \left(im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\sin re\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -4.7000000000000002e85

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

    if -4.7000000000000002e85 < im < -1.60000000000000009e33

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{{re}^{-512}} \]

    if -1.60000000000000009e33 < im < -480 or 4.00000000000000033e-5 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \sin re + \left(\left(-0.08333333333333333 \cdot {re}^{3}\right) \cdot {im}^{2} + \color{blue}{\left(0.5 \cdot re\right) \cdot {im}^{2}}\right) \]
      3. distribute-rgt-out62.5%

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

        \[\leadsto \sin re + \color{blue}{\left(im \cdot im\right)} \cdot \left(-0.08333333333333333 \cdot {re}^{3} + 0.5 \cdot re\right) \]
      5. unpow362.5%

        \[\leadsto \sin re + \left(im \cdot im\right) \cdot \left(-0.08333333333333333 \cdot \color{blue}{\left(\left(re \cdot re\right) \cdot re\right)} + 0.5 \cdot re\right) \]
      6. associate-*r*62.5%

        \[\leadsto \sin re + \left(im \cdot im\right) \cdot \left(\color{blue}{\left(-0.08333333333333333 \cdot \left(re \cdot re\right)\right) \cdot re} + 0.5 \cdot re\right) \]
      7. distribute-rgt-out62.5%

        \[\leadsto \sin re + \left(im \cdot im\right) \cdot \color{blue}{\left(re \cdot \left(-0.08333333333333333 \cdot \left(re \cdot re\right) + 0.5\right)\right)} \]
    10. Simplified62.5%

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

    if -480 < im < 4.00000000000000033e-5

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

      \[\leadsto \color{blue}{\sin re} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -4.7 \cdot 10^{+85}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq -1.6 \cdot 10^{+33}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -480 \lor \neg \left(im \leq 4 \cdot 10^{-5}\right):\\ \;\;\;\;\sin re + \left(im \cdot im\right) \cdot \left(re \cdot \left(0.5 + -0.08333333333333333 \cdot \left(re \cdot re\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re\\ \end{array} \]

Alternative 5: 68.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ t_1 := re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{if}\;im \leq -2.65 \cdot 10^{+213}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -2.6 \cdot 10^{+182}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -3.7 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -4.9 \cdot 10^{+33}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -500:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq 0.225:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+217}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ re (* (* im im) (* 0.5 re))))
        (t_1 (+ re (* (pow re 3.0) -0.16666666666666666))))
   (if (<= im -2.65e+213)
     t_0
     (if (<= im -2.6e+182)
       t_1
       (if (<= im -3.7e+85)
         t_0
         (if (<= im -4.9e+33)
           (pow re -512.0)
           (if (<= im -500.0)
             t_1
             (if (<= im 0.225) (sin re) (if (<= im 3e+217) t_1 t_0)))))))))
double code(double re, double im) {
	double t_0 = re + ((im * im) * (0.5 * re));
	double t_1 = re + (pow(re, 3.0) * -0.16666666666666666);
	double tmp;
	if (im <= -2.65e+213) {
		tmp = t_0;
	} else if (im <= -2.6e+182) {
		tmp = t_1;
	} else if (im <= -3.7e+85) {
		tmp = t_0;
	} else if (im <= -4.9e+33) {
		tmp = pow(re, -512.0);
	} else if (im <= -500.0) {
		tmp = t_1;
	} else if (im <= 0.225) {
		tmp = sin(re);
	} else if (im <= 3e+217) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_0 = re + ((im * im) * (0.5d0 * re))
    t_1 = re + ((re ** 3.0d0) * (-0.16666666666666666d0))
    if (im <= (-2.65d+213)) then
        tmp = t_0
    else if (im <= (-2.6d+182)) then
        tmp = t_1
    else if (im <= (-3.7d+85)) then
        tmp = t_0
    else if (im <= (-4.9d+33)) then
        tmp = re ** (-512.0d0)
    else if (im <= (-500.0d0)) then
        tmp = t_1
    else if (im <= 0.225d0) then
        tmp = sin(re)
    else if (im <= 3d+217) then
        tmp = t_1
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = re + ((im * im) * (0.5 * re));
	double t_1 = re + (Math.pow(re, 3.0) * -0.16666666666666666);
	double tmp;
	if (im <= -2.65e+213) {
		tmp = t_0;
	} else if (im <= -2.6e+182) {
		tmp = t_1;
	} else if (im <= -3.7e+85) {
		tmp = t_0;
	} else if (im <= -4.9e+33) {
		tmp = Math.pow(re, -512.0);
	} else if (im <= -500.0) {
		tmp = t_1;
	} else if (im <= 0.225) {
		tmp = Math.sin(re);
	} else if (im <= 3e+217) {
		tmp = t_1;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = re + ((im * im) * (0.5 * re))
	t_1 = re + (math.pow(re, 3.0) * -0.16666666666666666)
	tmp = 0
	if im <= -2.65e+213:
		tmp = t_0
	elif im <= -2.6e+182:
		tmp = t_1
	elif im <= -3.7e+85:
		tmp = t_0
	elif im <= -4.9e+33:
		tmp = math.pow(re, -512.0)
	elif im <= -500.0:
		tmp = t_1
	elif im <= 0.225:
		tmp = math.sin(re)
	elif im <= 3e+217:
		tmp = t_1
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(re + Float64(Float64(im * im) * Float64(0.5 * re)))
	t_1 = Float64(re + Float64((re ^ 3.0) * -0.16666666666666666))
	tmp = 0.0
	if (im <= -2.65e+213)
		tmp = t_0;
	elseif (im <= -2.6e+182)
		tmp = t_1;
	elseif (im <= -3.7e+85)
		tmp = t_0;
	elseif (im <= -4.9e+33)
		tmp = re ^ -512.0;
	elseif (im <= -500.0)
		tmp = t_1;
	elseif (im <= 0.225)
		tmp = sin(re);
	elseif (im <= 3e+217)
		tmp = t_1;
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re + ((im * im) * (0.5 * re));
	t_1 = re + ((re ^ 3.0) * -0.16666666666666666);
	tmp = 0.0;
	if (im <= -2.65e+213)
		tmp = t_0;
	elseif (im <= -2.6e+182)
		tmp = t_1;
	elseif (im <= -3.7e+85)
		tmp = t_0;
	elseif (im <= -4.9e+33)
		tmp = re ^ -512.0;
	elseif (im <= -500.0)
		tmp = t_1;
	elseif (im <= 0.225)
		tmp = sin(re);
	elseif (im <= 3e+217)
		tmp = t_1;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re + N[(N[(im * im), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re + N[(N[Power[re, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -2.65e+213], t$95$0, If[LessEqual[im, -2.6e+182], t$95$1, If[LessEqual[im, -3.7e+85], t$95$0, If[LessEqual[im, -4.9e+33], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, -500.0], t$95$1, If[LessEqual[im, 0.225], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3e+217], t$95$1, t$95$0]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;im \leq -2.6 \cdot 10^{+182}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq -3.7 \cdot 10^{+85}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq -4.9 \cdot 10^{+33}:\\
\;\;\;\;{re}^{-512}\\

\mathbf{elif}\;im \leq -500:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq 0.225:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 3 \cdot 10^{+217}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -2.6499999999999999e213 or -2.6e182 < im < -3.7000000000000002e85 or 2.99999999999999976e217 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

    if -2.6499999999999999e213 < im < -2.6e182 or -4.90000000000000014e33 < im < -500 or 0.225000000000000006 < im < 2.99999999999999976e217

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{re + -0.16666666666666666 \cdot {re}^{3}} \]
    6. Simplified48.7%

      \[\leadsto \color{blue}{re + {re}^{3} \cdot -0.16666666666666666} \]

    if -3.7000000000000002e85 < im < -4.90000000000000014e33

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{{re}^{-512}} \]

    if -500 < im < 0.225000000000000006

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

      \[\leadsto \color{blue}{\sin re} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification77.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -2.65 \cdot 10^{+213}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;im \leq -2.6 \cdot 10^{+182}:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;im \leq -3.7 \cdot 10^{+85}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;im \leq -4.9 \cdot 10^{+33}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -500:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;im \leq 0.225:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+217}:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{else}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \]

Alternative 6: 78.2% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re + {re}^{3} \cdot -0.16666666666666666\\ t_1 := re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq -4.7 \cdot 10^{+85}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq -1.48 \cdot 10^{+32}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -540:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 0.225:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+153}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ re (* (pow re 3.0) -0.16666666666666666)))
        (t_1 (+ re (* (* 0.5 (sin re)) (* im im)))))
   (if (<= im -4.7e+85)
     t_1
     (if (<= im -1.48e+32)
       (pow re -512.0)
       (if (<= im -540.0)
         t_0
         (if (<= im 0.225) (sin re) (if (<= im 7.2e+153) t_0 t_1)))))))
double code(double re, double im) {
	double t_0 = re + (pow(re, 3.0) * -0.16666666666666666);
	double t_1 = re + ((0.5 * sin(re)) * (im * im));
	double tmp;
	if (im <= -4.7e+85) {
		tmp = t_1;
	} else if (im <= -1.48e+32) {
		tmp = pow(re, -512.0);
	} else if (im <= -540.0) {
		tmp = t_0;
	} else if (im <= 0.225) {
		tmp = sin(re);
	} else if (im <= 7.2e+153) {
		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 = re + ((re ** 3.0d0) * (-0.16666666666666666d0))
    t_1 = re + ((0.5d0 * sin(re)) * (im * im))
    if (im <= (-4.7d+85)) then
        tmp = t_1
    else if (im <= (-1.48d+32)) then
        tmp = re ** (-512.0d0)
    else if (im <= (-540.0d0)) then
        tmp = t_0
    else if (im <= 0.225d0) then
        tmp = sin(re)
    else if (im <= 7.2d+153) 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 = re + (Math.pow(re, 3.0) * -0.16666666666666666);
	double t_1 = re + ((0.5 * Math.sin(re)) * (im * im));
	double tmp;
	if (im <= -4.7e+85) {
		tmp = t_1;
	} else if (im <= -1.48e+32) {
		tmp = Math.pow(re, -512.0);
	} else if (im <= -540.0) {
		tmp = t_0;
	} else if (im <= 0.225) {
		tmp = Math.sin(re);
	} else if (im <= 7.2e+153) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = re + (math.pow(re, 3.0) * -0.16666666666666666)
	t_1 = re + ((0.5 * math.sin(re)) * (im * im))
	tmp = 0
	if im <= -4.7e+85:
		tmp = t_1
	elif im <= -1.48e+32:
		tmp = math.pow(re, -512.0)
	elif im <= -540.0:
		tmp = t_0
	elif im <= 0.225:
		tmp = math.sin(re)
	elif im <= 7.2e+153:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(re + Float64((re ^ 3.0) * -0.16666666666666666))
	t_1 = Float64(re + Float64(Float64(0.5 * sin(re)) * Float64(im * im)))
	tmp = 0.0
	if (im <= -4.7e+85)
		tmp = t_1;
	elseif (im <= -1.48e+32)
		tmp = re ^ -512.0;
	elseif (im <= -540.0)
		tmp = t_0;
	elseif (im <= 0.225)
		tmp = sin(re);
	elseif (im <= 7.2e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re + ((re ^ 3.0) * -0.16666666666666666);
	t_1 = re + ((0.5 * sin(re)) * (im * im));
	tmp = 0.0;
	if (im <= -4.7e+85)
		tmp = t_1;
	elseif (im <= -1.48e+32)
		tmp = re ^ -512.0;
	elseif (im <= -540.0)
		tmp = t_0;
	elseif (im <= 0.225)
		tmp = sin(re);
	elseif (im <= 7.2e+153)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re + N[(N[Power[re, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re + N[(N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision] * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.7e+85], t$95$1, If[LessEqual[im, -1.48e+32], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, -540.0], t$95$0, If[LessEqual[im, 0.225], N[Sin[re], $MachinePrecision], If[LessEqual[im, 7.2e+153], t$95$0, t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;im \leq -1.48 \cdot 10^{+32}:\\
\;\;\;\;{re}^{-512}\\

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

\mathbf{elif}\;im \leq 0.225:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 7.2 \cdot 10^{+153}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < -4.7000000000000002e85 or 7.2000000000000001e153 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

    if -4.7000000000000002e85 < im < -1.4799999999999999e32

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{{re}^{-512}} \]

    if -1.4799999999999999e32 < im < -540 or 0.225000000000000006 < im < 7.2000000000000001e153

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{re + -0.16666666666666666 \cdot {re}^{3}} \]
    6. Simplified39.8%

      \[\leadsto \color{blue}{re + {re}^{3} \cdot -0.16666666666666666} \]

    if -540 < im < 0.225000000000000006

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

      \[\leadsto \color{blue}{\sin re} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification82.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -4.7 \cdot 10^{+85}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \mathbf{elif}\;im \leq -1.48 \cdot 10^{+32}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -540:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;im \leq 0.225:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 7.2 \cdot 10^{+153}:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{else}:\\ \;\;\;\;re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)\\ \end{array} \]

Alternative 7: 70.0% accurate, 2.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{if}\;im \leq -6 \cdot 10^{+181}:\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(0.5 \cdot im\right)\right)\\ \mathbf{elif}\;im \leq -5.6 \cdot 10^{+32}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -405:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 0.225:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+217}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ re (* (pow re 3.0) -0.16666666666666666))))
   (if (<= im -6e+181)
     (* im (* (sin re) (* 0.5 im)))
     (if (<= im -5.6e+32)
       (pow re -512.0)
       (if (<= im -405.0)
         t_0
         (if (<= im 0.225)
           (sin re)
           (if (<= im 3e+217) t_0 (+ re (* (* im im) (* 0.5 re))))))))))
double code(double re, double im) {
	double t_0 = re + (pow(re, 3.0) * -0.16666666666666666);
	double tmp;
	if (im <= -6e+181) {
		tmp = im * (sin(re) * (0.5 * im));
	} else if (im <= -5.6e+32) {
		tmp = pow(re, -512.0);
	} else if (im <= -405.0) {
		tmp = t_0;
	} else if (im <= 0.225) {
		tmp = sin(re);
	} else if (im <= 3e+217) {
		tmp = t_0;
	} else {
		tmp = re + ((im * im) * (0.5 * re));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = re + ((re ** 3.0d0) * (-0.16666666666666666d0))
    if (im <= (-6d+181)) then
        tmp = im * (sin(re) * (0.5d0 * im))
    else if (im <= (-5.6d+32)) then
        tmp = re ** (-512.0d0)
    else if (im <= (-405.0d0)) then
        tmp = t_0
    else if (im <= 0.225d0) then
        tmp = sin(re)
    else if (im <= 3d+217) then
        tmp = t_0
    else
        tmp = re + ((im * im) * (0.5d0 * re))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = re + (Math.pow(re, 3.0) * -0.16666666666666666);
	double tmp;
	if (im <= -6e+181) {
		tmp = im * (Math.sin(re) * (0.5 * im));
	} else if (im <= -5.6e+32) {
		tmp = Math.pow(re, -512.0);
	} else if (im <= -405.0) {
		tmp = t_0;
	} else if (im <= 0.225) {
		tmp = Math.sin(re);
	} else if (im <= 3e+217) {
		tmp = t_0;
	} else {
		tmp = re + ((im * im) * (0.5 * re));
	}
	return tmp;
}
def code(re, im):
	t_0 = re + (math.pow(re, 3.0) * -0.16666666666666666)
	tmp = 0
	if im <= -6e+181:
		tmp = im * (math.sin(re) * (0.5 * im))
	elif im <= -5.6e+32:
		tmp = math.pow(re, -512.0)
	elif im <= -405.0:
		tmp = t_0
	elif im <= 0.225:
		tmp = math.sin(re)
	elif im <= 3e+217:
		tmp = t_0
	else:
		tmp = re + ((im * im) * (0.5 * re))
	return tmp
function code(re, im)
	t_0 = Float64(re + Float64((re ^ 3.0) * -0.16666666666666666))
	tmp = 0.0
	if (im <= -6e+181)
		tmp = Float64(im * Float64(sin(re) * Float64(0.5 * im)));
	elseif (im <= -5.6e+32)
		tmp = re ^ -512.0;
	elseif (im <= -405.0)
		tmp = t_0;
	elseif (im <= 0.225)
		tmp = sin(re);
	elseif (im <= 3e+217)
		tmp = t_0;
	else
		tmp = Float64(re + Float64(Float64(im * im) * Float64(0.5 * re)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re + ((re ^ 3.0) * -0.16666666666666666);
	tmp = 0.0;
	if (im <= -6e+181)
		tmp = im * (sin(re) * (0.5 * im));
	elseif (im <= -5.6e+32)
		tmp = re ^ -512.0;
	elseif (im <= -405.0)
		tmp = t_0;
	elseif (im <= 0.225)
		tmp = sin(re);
	elseif (im <= 3e+217)
		tmp = t_0;
	else
		tmp = re + ((im * im) * (0.5 * re));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re + N[(N[Power[re, 3.0], $MachinePrecision] * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -6e+181], N[(im * N[(N[Sin[re], $MachinePrecision] * N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, -5.6e+32], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, -405.0], t$95$0, If[LessEqual[im, 0.225], N[Sin[re], $MachinePrecision], If[LessEqual[im, 3e+217], t$95$0, N[(re + N[(N[(im * im), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;im \leq -5.6 \cdot 10^{+32}:\\
\;\;\;\;{re}^{-512}\\

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

\mathbf{elif}\;im \leq 0.225:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 3 \cdot 10^{+217}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if im < -6.00000000000000024e181

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

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

        \[\leadsto \left(\sin re \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot 0.5 \]
      3. associate-*r*92.8%

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

        \[\leadsto \color{blue}{\left(im \cdot \left(\sin re \cdot im\right)\right)} \cdot 0.5 \]
      5. associate-*r*92.8%

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

        \[\leadsto im \cdot \color{blue}{\left(\sin re \cdot \left(im \cdot 0.5\right)\right)} \]
    9. Simplified92.8%

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

    if -6.00000000000000024e181 < im < -5.6e32

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{{re}^{-512}} \]

    if -5.6e32 < im < -405 or 0.225000000000000006 < im < 2.99999999999999976e217

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{re + -0.16666666666666666 \cdot {re}^{3}} \]
    6. Simplified44.8%

      \[\leadsto \color{blue}{re + {re}^{3} \cdot -0.16666666666666666} \]

    if -405 < im < 0.225000000000000006

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

    if 2.99999999999999976e217 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -6 \cdot 10^{+181}:\\ \;\;\;\;im \cdot \left(\sin re \cdot \left(0.5 \cdot im\right)\right)\\ \mathbf{elif}\;im \leq -5.6 \cdot 10^{+32}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq -405:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{elif}\;im \leq 0.225:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 3 \cdot 10^{+217}:\\ \;\;\;\;re + {re}^{3} \cdot -0.16666666666666666\\ \mathbf{else}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \]

Alternative 8: 72.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{if}\;im \leq -4.5 \cdot 10^{+85}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq -1.7 \cdot 10^{+31}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq 0.0152:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ re (* (* im im) (* 0.5 re)))))
   (if (<= im -4.5e+85)
     t_0
     (if (<= im -1.7e+31) (pow re -512.0) (if (<= im 0.0152) (sin re) t_0)))))
double code(double re, double im) {
	double t_0 = re + ((im * im) * (0.5 * re));
	double tmp;
	if (im <= -4.5e+85) {
		tmp = t_0;
	} else if (im <= -1.7e+31) {
		tmp = pow(re, -512.0);
	} else if (im <= 0.0152) {
		tmp = sin(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 = re + ((im * im) * (0.5d0 * re))
    if (im <= (-4.5d+85)) then
        tmp = t_0
    else if (im <= (-1.7d+31)) then
        tmp = re ** (-512.0d0)
    else if (im <= 0.0152d0) then
        tmp = sin(re)
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = re + ((im * im) * (0.5 * re));
	double tmp;
	if (im <= -4.5e+85) {
		tmp = t_0;
	} else if (im <= -1.7e+31) {
		tmp = Math.pow(re, -512.0);
	} else if (im <= 0.0152) {
		tmp = Math.sin(re);
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(re, im):
	t_0 = re + ((im * im) * (0.5 * re))
	tmp = 0
	if im <= -4.5e+85:
		tmp = t_0
	elif im <= -1.7e+31:
		tmp = math.pow(re, -512.0)
	elif im <= 0.0152:
		tmp = math.sin(re)
	else:
		tmp = t_0
	return tmp
function code(re, im)
	t_0 = Float64(re + Float64(Float64(im * im) * Float64(0.5 * re)))
	tmp = 0.0
	if (im <= -4.5e+85)
		tmp = t_0;
	elseif (im <= -1.7e+31)
		tmp = re ^ -512.0;
	elseif (im <= 0.0152)
		tmp = sin(re);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re + ((im * im) * (0.5 * re));
	tmp = 0.0;
	if (im <= -4.5e+85)
		tmp = t_0;
	elseif (im <= -1.7e+31)
		tmp = re ^ -512.0;
	elseif (im <= 0.0152)
		tmp = sin(re);
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re + N[(N[(im * im), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, -4.5e+85], t$95$0, If[LessEqual[im, -1.7e+31], N[Power[re, -512.0], $MachinePrecision], If[LessEqual[im, 0.0152], N[Sin[re], $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

\mathbf{elif}\;im \leq -1.7 \cdot 10^{+31}:\\
\;\;\;\;{re}^{-512}\\

\mathbf{elif}\;im \leq 0.0152:\\
\;\;\;\;\sin re\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if im < -4.50000000000000007e85 or 0.0152 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

    if -4.50000000000000007e85 < im < -1.6999999999999999e31

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

      \[\leadsto \color{blue}{{re}^{-512}} \]

    if -1.6999999999999999e31 < im < 0.0152

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

      \[\leadsto \color{blue}{\sin re} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification71.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -4.5 \cdot 10^{+85}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{elif}\;im \leq -1.7 \cdot 10^{+31}:\\ \;\;\;\;{re}^{-512}\\ \mathbf{elif}\;im \leq 0.0152:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \]

Alternative 9: 72.0% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq -2.4 \cdot 10^{+29} \lor \neg \left(im \leq 7 \cdot 10^{-5}\right):\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (or (<= im -2.4e+29) (not (<= im 7e-5)))
   (+ re (* (* im im) (* 0.5 re)))
   (sin re)))
double code(double re, double im) {
	double tmp;
	if ((im <= -2.4e+29) || !(im <= 7e-5)) {
		tmp = re + ((im * im) * (0.5 * re));
	} else {
		tmp = 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 <= (-2.4d+29)) .or. (.not. (im <= 7d-5))) then
        tmp = re + ((im * im) * (0.5d0 * re))
    else
        tmp = sin(re)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if ((im <= -2.4e+29) || !(im <= 7e-5)) {
		tmp = re + ((im * im) * (0.5 * re));
	} else {
		tmp = Math.sin(re);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if (im <= -2.4e+29) or not (im <= 7e-5):
		tmp = re + ((im * im) * (0.5 * re))
	else:
		tmp = math.sin(re)
	return tmp
function code(re, im)
	tmp = 0.0
	if ((im <= -2.4e+29) || !(im <= 7e-5))
		tmp = Float64(re + Float64(Float64(im * im) * Float64(0.5 * re)));
	else
		tmp = sin(re);
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if ((im <= -2.4e+29) || ~((im <= 7e-5)))
		tmp = re + ((im * im) * (0.5 * re));
	else
		tmp = sin(re);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[Or[LessEqual[im, -2.4e+29], N[Not[LessEqual[im, 7e-5]], $MachinePrecision]], N[(re + N[(N[(im * im), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sin[re], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq -2.4 \cdot 10^{+29} \lor \neg \left(im \leq 7 \cdot 10^{-5}\right):\\
\;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\

\mathbf{else}:\\
\;\;\;\;\sin re\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < -2.4000000000000001e29 or 6.9999999999999994e-5 < im

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

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

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

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

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

    if -2.4000000000000001e29 < im < 6.9999999999999994e-5

    1. Initial program 100.0%

      \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
    2. Step-by-step derivation
      1. sub0-neg100.0%

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

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

      \[\leadsto \color{blue}{\sin re} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq -2.4 \cdot 10^{+29} \lor \neg \left(im \leq 7 \cdot 10^{-5}\right):\\ \;\;\;\;re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re\\ \end{array} \]

Alternative 10: 48.6% accurate, 34.3× speedup?

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

\\
re + \left(im \cdot im\right) \cdot \left(0.5 \cdot re\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
  2. Step-by-step derivation
    1. sub0-neg100.0%

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

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

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

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

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

    \[\leadsto re + \left(0.5 \cdot \color{blue}{re}\right) \cdot \left(im \cdot im\right) \]
  8. Final simplification44.3%

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

Alternative 11: 3.8% accurate, 309.0× speedup?

\[\begin{array}{l} \\ 64 \end{array} \]
(FPCore (re im) :precision binary64 64.0)
double code(double re, double im) {
	return 64.0;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = 64.0d0
end function
public static double code(double re, double im) {
	return 64.0;
}
def code(re, im):
	return 64.0
function code(re, im)
	return 64.0
end
function tmp = code(re, im)
	tmp = 64.0;
end
code[re_, im_] := 64.0
\begin{array}{l}

\\
64
\end{array}
Derivation
  1. Initial program 100.0%

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
  2. Step-by-step derivation
    1. sub0-neg100.0%

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

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

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

    \[\leadsto \color{blue}{\sin re + \left(0.5 \cdot \sin re\right) \cdot \left(im \cdot im\right)} \]
  6. Applied egg-rr4.1%

    \[\leadsto \sin re + \color{blue}{64} \]
  7. Taylor expanded in re around 0 4.1%

    \[\leadsto \color{blue}{64} \]
  8. Final simplification4.1%

    \[\leadsto 64 \]

Alternative 12: 26.8% accurate, 309.0× speedup?

\[\begin{array}{l} \\ re \end{array} \]
(FPCore (re im) :precision binary64 re)
double code(double re, double im) {
	return re;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = re
end function
public static double code(double re, double im) {
	return re;
}
def code(re, im):
	return re
function code(re, im)
	return re
end
function tmp = code(re, im)
	tmp = re;
end
code[re_, im_] := re
\begin{array}{l}

\\
re
\end{array}
Derivation
  1. Initial program 100.0%

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} + e^{im}\right) \]
  2. Step-by-step derivation
    1. sub0-neg100.0%

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

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

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

    \[\leadsto \color{blue}{re} \]
  6. Final simplification29.7%

    \[\leadsto re \]

Reproduce

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