math.sin on complex, real part

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

\\
\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot \sin 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

Alternative 2: 84.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 0.0095:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;{im}^{2} \cdot \left(0.5 \cdot \sin re\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 0.0095)
   (* (sin re) (* 0.5 (fma im im 2.0)))
   (if (<= im 1.35e+154)
     (* (+ (exp (- im)) (exp im)) (* 0.5 re))
     (* (pow im 2.0) (* 0.5 (sin re))))))
double code(double re, double im) {
	double tmp;
	if (im <= 0.0095) {
		tmp = sin(re) * (0.5 * fma(im, im, 2.0));
	} else if (im <= 1.35e+154) {
		tmp = (exp(-im) + exp(im)) * (0.5 * re);
	} else {
		tmp = pow(im, 2.0) * (0.5 * sin(re));
	}
	return tmp;
}
function code(re, im)
	tmp = 0.0
	if (im <= 0.0095)
		tmp = Float64(sin(re) * Float64(0.5 * fma(im, im, 2.0)));
	elseif (im <= 1.35e+154)
		tmp = Float64(Float64(exp(Float64(-im)) + exp(im)) * Float64(0.5 * re));
	else
		tmp = Float64((im ^ 2.0) * Float64(0.5 * sin(re)));
	end
	return tmp
end
code[re_, im_] := If[LessEqual[im, 0.0095], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[(N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision], N[(N[Power[im, 2.0], $MachinePrecision] * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 0.0095:\\
\;\;\;\;\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\

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

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


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sin re \cdot 0.5\right) \cdot \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \]
      6. associate-*r*83.1%

        \[\leadsto \color{blue}{\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)} \]
    8. Simplified83.1%

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

    if 0.00949999999999999976 < im < 1.35000000000000003e154

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

    if 1.35000000000000003e154 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 0.0095:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\left(e^{-im} + e^{im}\right) \cdot \left(0.5 \cdot re\right)\\ \mathbf{else}:\\ \;\;\;\;{im}^{2} \cdot \left(0.5 \cdot \sin re\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 850:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{{re}^{-6}}\\ \mathbf{else}:\\ \;\;\;\;{im}^{2} \cdot \left(0.5 \cdot \sin re\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 850.0)
   (sin re)
   (if (<= im 1.35e+154)
     (cbrt (pow re -6.0))
     (* (pow im 2.0) (* 0.5 (sin re))))))
double code(double re, double im) {
	double tmp;
	if (im <= 850.0) {
		tmp = sin(re);
	} else if (im <= 1.35e+154) {
		tmp = cbrt(pow(re, -6.0));
	} else {
		tmp = pow(im, 2.0) * (0.5 * sin(re));
	}
	return tmp;
}
public static double code(double re, double im) {
	double tmp;
	if (im <= 850.0) {
		tmp = Math.sin(re);
	} else if (im <= 1.35e+154) {
		tmp = Math.cbrt(Math.pow(re, -6.0));
	} else {
		tmp = Math.pow(im, 2.0) * (0.5 * Math.sin(re));
	}
	return tmp;
}
function code(re, im)
	tmp = 0.0
	if (im <= 850.0)
		tmp = sin(re);
	elseif (im <= 1.35e+154)
		tmp = cbrt((re ^ -6.0));
	else
		tmp = Float64((im ^ 2.0) * Float64(0.5 * sin(re)));
	end
	return tmp
end
code[re_, im_] := If[LessEqual[im, 850.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 1.35e+154], N[Power[N[Power[re, -6.0], $MachinePrecision], 1/3], $MachinePrecision], N[(N[Power[im, 2.0], $MachinePrecision] * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 850:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{{re}^{-6}}\\

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


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

    if 850 < im < 1.35000000000000003e154

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr13.9%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 13.8%

      \[\leadsto {\color{blue}{re}}^{-2} \]
    8. Step-by-step derivation
      1. metadata-eval13.8%

        \[\leadsto {re}^{\color{blue}{\left(-2\right)}} \]
      2. pow-flip13.8%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}}} \]
      3. add-cbrt-cube25.2%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{1}{{re}^{2}} \cdot \frac{1}{{re}^{2}}\right) \cdot \frac{1}{{re}^{2}}}} \]
      4. pow325.2%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1}{{re}^{2}}\right)}^{3}}} \]
      5. pow-flip25.2%

        \[\leadsto \sqrt[3]{{\color{blue}{\left({re}^{\left(-2\right)}\right)}}^{3}} \]
      6. metadata-eval25.2%

        \[\leadsto \sqrt[3]{{\left({re}^{\color{blue}{-2}}\right)}^{3}} \]
      7. pow-pow25.2%

        \[\leadsto \sqrt[3]{\color{blue}{{re}^{\left(-2 \cdot 3\right)}}} \]
      8. metadata-eval25.2%

        \[\leadsto \sqrt[3]{{re}^{\color{blue}{-6}}} \]
    9. Applied egg-rr25.2%

      \[\leadsto \color{blue}{\sqrt[3]{{re}^{-6}}} \]

    if 1.35000000000000003e154 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 850:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{{re}^{-6}}\\ \mathbf{else}:\\ \;\;\;\;{im}^{2} \cdot \left(0.5 \cdot \sin re\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 980:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{{re}^{-6}}\\ \mathbf{else}:\\ \;\;\;\;{im}^{2} \cdot \left(0.5 \cdot \sin re\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 980.0)
   (* (sin re) (* 0.5 (fma im im 2.0)))
   (if (<= im 1.35e+154)
     (cbrt (pow re -6.0))
     (* (pow im 2.0) (* 0.5 (sin re))))))
double code(double re, double im) {
	double tmp;
	if (im <= 980.0) {
		tmp = sin(re) * (0.5 * fma(im, im, 2.0));
	} else if (im <= 1.35e+154) {
		tmp = cbrt(pow(re, -6.0));
	} else {
		tmp = pow(im, 2.0) * (0.5 * sin(re));
	}
	return tmp;
}
function code(re, im)
	tmp = 0.0
	if (im <= 980.0)
		tmp = Float64(sin(re) * Float64(0.5 * fma(im, im, 2.0)));
	elseif (im <= 1.35e+154)
		tmp = cbrt((re ^ -6.0));
	else
		tmp = Float64((im ^ 2.0) * Float64(0.5 * sin(re)));
	end
	return tmp
end
code[re_, im_] := If[LessEqual[im, 980.0], N[(N[Sin[re], $MachinePrecision] * N[(0.5 * N[(im * im + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.35e+154], N[Power[N[Power[re, -6.0], $MachinePrecision], 1/3], $MachinePrecision], N[(N[Power[im, 2.0], $MachinePrecision] * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 980:\\
\;\;\;\;\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\

\mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\sqrt[3]{{re}^{-6}}\\

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


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\sin re \cdot 0.5\right) \cdot \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \]
      6. associate-*r*83.0%

        \[\leadsto \color{blue}{\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)} \]
    8. Simplified83.0%

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

    if 980 < im < 1.35000000000000003e154

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr13.9%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 13.8%

      \[\leadsto {\color{blue}{re}}^{-2} \]
    8. Step-by-step derivation
      1. metadata-eval13.8%

        \[\leadsto {re}^{\color{blue}{\left(-2\right)}} \]
      2. pow-flip13.8%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}}} \]
      3. add-cbrt-cube25.2%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{1}{{re}^{2}} \cdot \frac{1}{{re}^{2}}\right) \cdot \frac{1}{{re}^{2}}}} \]
      4. pow325.2%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1}{{re}^{2}}\right)}^{3}}} \]
      5. pow-flip25.2%

        \[\leadsto \sqrt[3]{{\color{blue}{\left({re}^{\left(-2\right)}\right)}}^{3}} \]
      6. metadata-eval25.2%

        \[\leadsto \sqrt[3]{{\left({re}^{\color{blue}{-2}}\right)}^{3}} \]
      7. pow-pow25.2%

        \[\leadsto \sqrt[3]{\color{blue}{{re}^{\left(-2 \cdot 3\right)}}} \]
      8. metadata-eval25.2%

        \[\leadsto \sqrt[3]{{re}^{\color{blue}{-6}}} \]
    9. Applied egg-rr25.2%

      \[\leadsto \color{blue}{\sqrt[3]{{re}^{-6}}} \]

    if 1.35000000000000003e154 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 980:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \mathsf{fma}\left(im, im, 2\right)\right)\\ \mathbf{elif}\;im \leq 1.35 \cdot 10^{+154}:\\ \;\;\;\;\sqrt[3]{{re}^{-6}}\\ \mathbf{else}:\\ \;\;\;\;{im}^{2} \cdot \left(0.5 \cdot \sin re\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.9% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 780:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.5 \cdot 10^{+162}:\\ \;\;\;\;\sqrt[3]{{re}^{-6}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 780.0)
   (sin re)
   (if (<= im 2.5e+162) (cbrt (pow re -6.0)) (* (fma im im 2.0) (* 0.5 re)))))
double code(double re, double im) {
	double tmp;
	if (im <= 780.0) {
		tmp = sin(re);
	} else if (im <= 2.5e+162) {
		tmp = cbrt(pow(re, -6.0));
	} else {
		tmp = fma(im, im, 2.0) * (0.5 * re);
	}
	return tmp;
}
function code(re, im)
	tmp = 0.0
	if (im <= 780.0)
		tmp = sin(re);
	elseif (im <= 2.5e+162)
		tmp = cbrt((re ^ -6.0));
	else
		tmp = Float64(fma(im, im, 2.0) * Float64(0.5 * re));
	end
	return tmp
end
code[re_, im_] := If[LessEqual[im, 780.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.5e+162], N[Power[N[Power[re, -6.0], $MachinePrecision], 1/3], $MachinePrecision], N[(N[(im * im + 2.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 780:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 2.5 \cdot 10^{+162}:\\
\;\;\;\;\sqrt[3]{{re}^{-6}}\\

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


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

    if 780 < im < 2.4999999999999998e162

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr13.5%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 13.5%

      \[\leadsto {\color{blue}{re}}^{-2} \]
    8. Step-by-step derivation
      1. metadata-eval13.5%

        \[\leadsto {re}^{\color{blue}{\left(-2\right)}} \]
      2. pow-flip13.5%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}}} \]
      3. add-cbrt-cube24.5%

        \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{1}{{re}^{2}} \cdot \frac{1}{{re}^{2}}\right) \cdot \frac{1}{{re}^{2}}}} \]
      4. pow324.5%

        \[\leadsto \sqrt[3]{\color{blue}{{\left(\frac{1}{{re}^{2}}\right)}^{3}}} \]
      5. pow-flip24.5%

        \[\leadsto \sqrt[3]{{\color{blue}{\left({re}^{\left(-2\right)}\right)}}^{3}} \]
      6. metadata-eval24.5%

        \[\leadsto \sqrt[3]{{\left({re}^{\color{blue}{-2}}\right)}^{3}} \]
      7. pow-pow24.5%

        \[\leadsto \sqrt[3]{\color{blue}{{re}^{\left(-2 \cdot 3\right)}}} \]
      8. metadata-eval24.5%

        \[\leadsto \sqrt[3]{{re}^{\color{blue}{-6}}} \]
    9. Applied egg-rr24.5%

      \[\leadsto \color{blue}{\sqrt[3]{{re}^{-6}}} \]

    if 2.4999999999999998e162 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(re \cdot 0.5\right) \]
      6. fma-udef75.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(re \cdot 0.5\right) \]
    8. Simplified75.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 780:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.5 \cdot 10^{+162}:\\ \;\;\;\;\sqrt[3]{{re}^{-6}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 59.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 650:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.5 \cdot 10^{+162}:\\ \;\;\;\;0.3333333333333333 + {re}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 650.0)
   (sin re)
   (if (<= im 2.5e+162)
     (+ 0.3333333333333333 (pow re -2.0))
     (* (fma im im 2.0) (* 0.5 re)))))
double code(double re, double im) {
	double tmp;
	if (im <= 650.0) {
		tmp = sin(re);
	} else if (im <= 2.5e+162) {
		tmp = 0.3333333333333333 + pow(re, -2.0);
	} else {
		tmp = fma(im, im, 2.0) * (0.5 * re);
	}
	return tmp;
}
function code(re, im)
	tmp = 0.0
	if (im <= 650.0)
		tmp = sin(re);
	elseif (im <= 2.5e+162)
		tmp = Float64(0.3333333333333333 + (re ^ -2.0));
	else
		tmp = Float64(fma(im, im, 2.0) * Float64(0.5 * re));
	end
	return tmp
end
code[re_, im_] := If[LessEqual[im, 650.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 2.5e+162], N[(0.3333333333333333 + N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision], N[(N[(im * im + 2.0), $MachinePrecision] * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 650:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 2.5 \cdot 10^{+162}:\\
\;\;\;\;0.3333333333333333 + {re}^{-2}\\

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


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

    if 650 < im < 2.4999999999999998e162

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr13.5%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 13.5%

      \[\leadsto \color{blue}{0.3333333333333333 + \frac{1}{{re}^{2}}} \]
    8. Step-by-step derivation
      1. +-commutative13.5%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
    9. Simplified13.5%

      \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
    10. Taylor expanded in re around 0 13.5%

      \[\leadsto \color{blue}{0.3333333333333333 + \frac{1}{{re}^{2}}} \]
    11. Step-by-step derivation
      1. unpow213.5%

        \[\leadsto 0.3333333333333333 + \frac{1}{\color{blue}{re \cdot re}} \]
      2. associate-/l/13.5%

        \[\leadsto 0.3333333333333333 + \color{blue}{\frac{\frac{1}{re}}{re}} \]
      3. *-rgt-identity13.5%

        \[\leadsto 0.3333333333333333 + \frac{\color{blue}{\frac{1}{re} \cdot 1}}{re} \]
      4. associate-*r/13.5%

        \[\leadsto 0.3333333333333333 + \color{blue}{\frac{1}{re} \cdot \frac{1}{re}} \]
      5. unpow-113.5%

        \[\leadsto 0.3333333333333333 + \color{blue}{{re}^{-1}} \cdot \frac{1}{re} \]
      6. unpow-113.5%

        \[\leadsto 0.3333333333333333 + {re}^{-1} \cdot \color{blue}{{re}^{-1}} \]
      7. pow-sqr13.5%

        \[\leadsto 0.3333333333333333 + \color{blue}{{re}^{\left(2 \cdot -1\right)}} \]
      8. metadata-eval13.5%

        \[\leadsto 0.3333333333333333 + {re}^{\color{blue}{-2}} \]
    12. Simplified13.5%

      \[\leadsto \color{blue}{0.3333333333333333 + {re}^{-2}} \]

    if 2.4999999999999998e162 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot im} + 2\right) \cdot \left(re \cdot 0.5\right) \]
      6. fma-udef75.7%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right)} \cdot \left(re \cdot 0.5\right) \]
    8. Simplified75.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(im, im, 2\right) \cdot \left(re \cdot 0.5\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 650:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 2.5 \cdot 10^{+162}:\\ \;\;\;\;0.3333333333333333 + {re}^{-2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(im, im, 2\right) \cdot \left(0.5 \cdot re\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 53.0% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 720:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 + {re}^{-2}\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 720.0) (sin re) (+ 0.3333333333333333 (pow re -2.0))))
double code(double re, double im) {
	double tmp;
	if (im <= 720.0) {
		tmp = sin(re);
	} else {
		tmp = 0.3333333333333333 + pow(re, -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 <= 720.0d0) then
        tmp = sin(re)
    else
        tmp = 0.3333333333333333d0 + (re ** (-2.0d0))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 720.0) {
		tmp = Math.sin(re);
	} else {
		tmp = 0.3333333333333333 + Math.pow(re, -2.0);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 720.0:
		tmp = math.sin(re)
	else:
		tmp = 0.3333333333333333 + math.pow(re, -2.0)
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 720.0)
		tmp = sin(re);
	else
		tmp = Float64(0.3333333333333333 + (re ^ -2.0));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 720.0)
		tmp = sin(re);
	else
		tmp = 0.3333333333333333 + (re ^ -2.0);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 720.0], N[Sin[re], $MachinePrecision], N[(0.3333333333333333 + N[Power[re, -2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 720:\\
\;\;\;\;\sin re\\

\mathbf{else}:\\
\;\;\;\;0.3333333333333333 + {re}^{-2}\\


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

    if 720 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr14.3%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 14.3%

      \[\leadsto \color{blue}{0.3333333333333333 + \frac{1}{{re}^{2}}} \]
    8. Step-by-step derivation
      1. +-commutative14.3%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
    9. Simplified14.3%

      \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
    10. Taylor expanded in re around 0 14.3%

      \[\leadsto \color{blue}{0.3333333333333333 + \frac{1}{{re}^{2}}} \]
    11. Step-by-step derivation
      1. unpow214.3%

        \[\leadsto 0.3333333333333333 + \frac{1}{\color{blue}{re \cdot re}} \]
      2. associate-/l/14.3%

        \[\leadsto 0.3333333333333333 + \color{blue}{\frac{\frac{1}{re}}{re}} \]
      3. *-rgt-identity14.3%

        \[\leadsto 0.3333333333333333 + \frac{\color{blue}{\frac{1}{re} \cdot 1}}{re} \]
      4. associate-*r/14.3%

        \[\leadsto 0.3333333333333333 + \color{blue}{\frac{1}{re} \cdot \frac{1}{re}} \]
      5. unpow-114.3%

        \[\leadsto 0.3333333333333333 + \color{blue}{{re}^{-1}} \cdot \frac{1}{re} \]
      6. unpow-114.3%

        \[\leadsto 0.3333333333333333 + {re}^{-1} \cdot \color{blue}{{re}^{-1}} \]
      7. pow-sqr14.3%

        \[\leadsto 0.3333333333333333 + \color{blue}{{re}^{\left(2 \cdot -1\right)}} \]
      8. metadata-eval14.3%

        \[\leadsto 0.3333333333333333 + {re}^{\color{blue}{-2}} \]
    12. Simplified14.3%

      \[\leadsto \color{blue}{0.3333333333333333 + {re}^{-2}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification52.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 720:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333 + {re}^{-2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 53.0% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 720:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{re}}{re}\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 720.0) (sin re) (/ (/ 1.0 re) re)))
double code(double re, double im) {
	double tmp;
	if (im <= 720.0) {
		tmp = sin(re);
	} else {
		tmp = (1.0 / re) / re;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (im <= 720.0d0) then
        tmp = sin(re)
    else
        tmp = (1.0d0 / re) / re
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 720.0) {
		tmp = Math.sin(re);
	} else {
		tmp = (1.0 / re) / re;
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 720.0:
		tmp = math.sin(re)
	else:
		tmp = (1.0 / re) / re
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 720.0)
		tmp = sin(re);
	else
		tmp = Float64(Float64(1.0 / re) / re);
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 720.0)
		tmp = sin(re);
	else
		tmp = (1.0 / re) / re;
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 720.0], N[Sin[re], $MachinePrecision], N[(N[(1.0 / re), $MachinePrecision] / re), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 720:\\
\;\;\;\;\sin re\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{re}}{re}\\


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

    if 720 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr14.3%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 14.3%

      \[\leadsto {\color{blue}{re}}^{-2} \]
    8. Step-by-step derivation
      1. metadata-eval14.3%

        \[\leadsto {re}^{\color{blue}{\left(-2\right)}} \]
      2. pow-flip14.3%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}}} \]
      3. unpow214.3%

        \[\leadsto \frac{1}{\color{blue}{re \cdot re}} \]
      4. associate-/r*14.3%

        \[\leadsto \color{blue}{\frac{\frac{1}{re}}{re}} \]
    9. Applied egg-rr14.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 720:\\ \;\;\;\;\sin re\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{re}}{re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 29.4% accurate, 43.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 1080:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{re}}{re}\\ \end{array} \end{array} \]
(FPCore (re im) :precision binary64 (if (<= im 1080.0) re (/ (/ 1.0 re) re)))
double code(double re, double im) {
	double tmp;
	if (im <= 1080.0) {
		tmp = re;
	} else {
		tmp = (1.0 / re) / re;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (im <= 1080.0d0) then
        tmp = re
    else
        tmp = (1.0d0 / re) / re
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 1080.0) {
		tmp = re;
	} else {
		tmp = (1.0 / re) / re;
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 1080.0:
		tmp = re
	else:
		tmp = (1.0 / re) / re
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 1080.0)
		tmp = re;
	else
		tmp = Float64(Float64(1.0 / re) / re);
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 1080.0)
		tmp = re;
	else
		tmp = (1.0 / re) / re;
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 1080.0], re, N[(N[(1.0 / re), $MachinePrecision] / re), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 1080:\\
\;\;\;\;re\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{re}}{re}\\


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

    if 1080 < 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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr14.3%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 14.3%

      \[\leadsto {\color{blue}{re}}^{-2} \]
    8. Step-by-step derivation
      1. metadata-eval14.3%

        \[\leadsto {re}^{\color{blue}{\left(-2\right)}} \]
      2. pow-flip14.3%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}}} \]
      3. unpow214.3%

        \[\leadsto \frac{1}{\color{blue}{re \cdot re}} \]
      4. associate-/r*14.3%

        \[\leadsto \color{blue}{\frac{\frac{1}{re}}{re}} \]
    9. Applied egg-rr14.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1080:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{1}{re}}{re}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 27.2% accurate, 100.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 3.55 \cdot 10^{-10}:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= re 3.55e-10) re 0.3333333333333333))
double code(double re, double im) {
	double tmp;
	if (re <= 3.55e-10) {
		tmp = re;
	} else {
		tmp = 0.3333333333333333;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if (re <= 3.55d-10) then
        tmp = re
    else
        tmp = 0.3333333333333333d0
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (re <= 3.55e-10) {
		tmp = re;
	} else {
		tmp = 0.3333333333333333;
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if re <= 3.55e-10:
		tmp = re
	else:
		tmp = 0.3333333333333333
	return tmp
function code(re, im)
	tmp = 0.0
	if (re <= 3.55e-10)
		tmp = re;
	else
		tmp = 0.3333333333333333;
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (re <= 3.55e-10)
		tmp = re;
	else
		tmp = 0.3333333333333333;
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[re, 3.55e-10], re, 0.3333333333333333]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;re \leq 3.55 \cdot 10^{-10}:\\
\;\;\;\;re\\

\mathbf{else}:\\
\;\;\;\;0.3333333333333333\\


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

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

    if 3.5500000000000001e-10 < re

    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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\sin re} \]
    6. Applied egg-rr7.0%

      \[\leadsto \color{blue}{{\sin re}^{-2}} \]
    7. Taylor expanded in re around 0 6.4%

      \[\leadsto \color{blue}{0.3333333333333333 + \frac{1}{{re}^{2}}} \]
    8. Step-by-step derivation
      1. +-commutative6.4%

        \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
    9. Simplified6.4%

      \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
    10. Taylor expanded in re around inf 6.4%

      \[\leadsto \color{blue}{0.3333333333333333} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification23.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 3.55 \cdot 10^{-10}:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;0.3333333333333333\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 4.3% accurate, 309.0× speedup?

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

\\
-0.16666666666666666
\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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{re + {re}^{3} \cdot -0.16666666666666666} \]
  8. Applied egg-rr3.1%

    \[\leadsto re + \color{blue}{-0.16666666666666666} \]
  9. Taylor expanded in re around 0 4.3%

    \[\leadsto \color{blue}{-0.16666666666666666} \]
  10. Final simplification4.3%

    \[\leadsto -0.16666666666666666 \]
  11. Add Preprocessing

Alternative 12: 4.4% accurate, 309.0× speedup?

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

\\
0.3333333333333333
\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. distribute-rgt-in100.0%

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{\sin re} \]
  6. Applied egg-rr11.3%

    \[\leadsto \color{blue}{{\sin re}^{-2}} \]
  7. Taylor expanded in re around 0 11.0%

    \[\leadsto \color{blue}{0.3333333333333333 + \frac{1}{{re}^{2}}} \]
  8. Step-by-step derivation
    1. +-commutative11.0%

      \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
  9. Simplified11.0%

    \[\leadsto \color{blue}{\frac{1}{{re}^{2}} + 0.3333333333333333} \]
  10. Taylor expanded in re around inf 4.8%

    \[\leadsto \color{blue}{0.3333333333333333} \]
  11. Final simplification4.8%

    \[\leadsto 0.3333333333333333 \]
  12. Add Preprocessing

Reproduce

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