math.sin on complex, real part

Percentage Accurate: 100.0% → 100.0%
Time: 11.6s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
    13. neg-mul-1100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
    14. 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. Final simplification100.0%

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

Alternative 2: 84.1% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(im \cdot im\right)\\ t_1 := \sin re \cdot \left(t_0 + 1\right)\\ \mathbf{if}\;im \leq 1000:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* 0.5 (* im im))) (t_1 (* (sin re) (+ t_0 1.0))))
   (if (<= im 1000.0)
     t_1
     (if (<= im 9.5e+112)
       (* (* 0.5 re) (+ (exp (- im)) (exp im)))
       (if (<= im 5.4e+133)
         (*
          (fma im (* 0.5 im) 1.0)
          (+ re (* -0.16666666666666666 (pow re 3.0))))
         (if (<= im 1.4e+154)
           (/ re (/ (- 1.0 t_0) (+ 1.0 (* -0.25 (pow im 4.0)))))
           t_1))))))
double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = sin(re) * (t_0 + 1.0);
	double tmp;
	if (im <= 1000.0) {
		tmp = t_1;
	} else if (im <= 9.5e+112) {
		tmp = (0.5 * re) * (exp(-im) + exp(im));
	} else if (im <= 5.4e+133) {
		tmp = fma(im, (0.5 * im), 1.0) * (re + (-0.16666666666666666 * pow(re, 3.0)));
	} else if (im <= 1.4e+154) {
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * pow(im, 4.0))));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(0.5 * Float64(im * im))
	t_1 = Float64(sin(re) * Float64(t_0 + 1.0))
	tmp = 0.0
	if (im <= 1000.0)
		tmp = t_1;
	elseif (im <= 9.5e+112)
		tmp = Float64(Float64(0.5 * re) * Float64(exp(Float64(-im)) + exp(im)));
	elseif (im <= 5.4e+133)
		tmp = Float64(fma(im, Float64(0.5 * im), 1.0) * Float64(re + Float64(-0.16666666666666666 * (re ^ 3.0))));
	elseif (im <= 1.4e+154)
		tmp = Float64(re / Float64(Float64(1.0 - t_0) / Float64(1.0 + Float64(-0.25 * (im ^ 4.0)))));
	else
		tmp = t_1;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[re], $MachinePrecision] * N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 1000.0], t$95$1, If[LessEqual[im, 9.5e+112], N[(N[(0.5 * re), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.4e+133], N[(N[(im * N[(0.5 * im), $MachinePrecision] + 1.0), $MachinePrecision] * N[(re + N[(-0.16666666666666666 * N[Power[re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+154], N[(re / N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[(-0.25 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right)\\
t_1 := \sin re \cdot \left(t_0 + 1\right)\\
\mathbf{if}\;im \leq 1000:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)\\

\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < 1e3 or 1.4e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 1e3 < im < 9.5000000000000008e112

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in re around 0 82.9%

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

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

    if 9.5000000000000008e112 < im < 5.4000000000000004e133

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 6.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot \left(0.5 \cdot im\right)} + 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
      8. fma-udef75.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right)} \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
    8. Simplified75.9%

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

    if 5.4000000000000004e133 < im < 1.4e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.7%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified3.5%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. flip-+80.0%

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

        \[\leadsto \color{blue}{\frac{re \cdot \left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      3. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      4. swap-sqr80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow-prod-up80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. *-commutative80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      11. associate-*r*80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - im \cdot \left(im \cdot 0.5\right)}} \]
    11. Step-by-step derivation
      1. associate-/l*80.0%

        \[\leadsto \color{blue}{\frac{re}{\frac{1 - im \cdot \left(im \cdot 0.5\right)}{1 - 0.25 \cdot {im}^{4}}}} \]
      2. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(im \cdot 0.5\right) \cdot im}}{1 - 0.25 \cdot {im}^{4}}} \]
      3. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(0.5 \cdot im\right)} \cdot im}{1 - 0.25 \cdot {im}^{4}}} \]
      4. associate-*r*80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{0.5 \cdot \left(im \cdot im\right)}}{1 - 0.25 \cdot {im}^{4}}} \]
      5. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{\color{blue}{1 + \left(-0.25\right) \cdot {im}^{4}}}} \]
      6. metadata-eval80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + \color{blue}{-0.25} \cdot {im}^{4}}} \]
    12. Simplified80.0%

      \[\leadsto \color{blue}{\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1000:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 3: 84.0% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(im \cdot im\right)\\ t_1 := t_0 + 1\\ t_2 := \sin re \cdot t_1\\ \mathbf{if}\;im \leq 1000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot t_1\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* 0.5 (* im im))) (t_1 (+ t_0 1.0)) (t_2 (* (sin re) t_1)))
   (if (<= im 1000.0)
     t_2
     (if (<= im 9.5e+112)
       (* (* 0.5 re) (+ (exp (- im)) (exp im)))
       (if (<= im 5.4e+133)
         (* -0.16666666666666666 (* (pow re 3.0) t_1))
         (if (<= im 1.4e+154)
           (/ re (/ (- 1.0 t_0) (+ 1.0 (* -0.25 (pow im 4.0)))))
           t_2))))))
double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = t_0 + 1.0;
	double t_2 = sin(re) * t_1;
	double tmp;
	if (im <= 1000.0) {
		tmp = t_2;
	} else if (im <= 9.5e+112) {
		tmp = (0.5 * re) * (exp(-im) + exp(im));
	} else if (im <= 5.4e+133) {
		tmp = -0.16666666666666666 * (pow(re, 3.0) * t_1);
	} else if (im <= 1.4e+154) {
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * pow(im, 4.0))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = 0.5d0 * (im * im)
    t_1 = t_0 + 1.0d0
    t_2 = sin(re) * t_1
    if (im <= 1000.0d0) then
        tmp = t_2
    else if (im <= 9.5d+112) then
        tmp = (0.5d0 * re) * (exp(-im) + exp(im))
    else if (im <= 5.4d+133) then
        tmp = (-0.16666666666666666d0) * ((re ** 3.0d0) * t_1)
    else if (im <= 1.4d+154) then
        tmp = re / ((1.0d0 - t_0) / (1.0d0 + ((-0.25d0) * (im ** 4.0d0))))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = t_0 + 1.0;
	double t_2 = Math.sin(re) * t_1;
	double tmp;
	if (im <= 1000.0) {
		tmp = t_2;
	} else if (im <= 9.5e+112) {
		tmp = (0.5 * re) * (Math.exp(-im) + Math.exp(im));
	} else if (im <= 5.4e+133) {
		tmp = -0.16666666666666666 * (Math.pow(re, 3.0) * t_1);
	} else if (im <= 1.4e+154) {
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * Math.pow(im, 4.0))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.5 * (im * im)
	t_1 = t_0 + 1.0
	t_2 = math.sin(re) * t_1
	tmp = 0
	if im <= 1000.0:
		tmp = t_2
	elif im <= 9.5e+112:
		tmp = (0.5 * re) * (math.exp(-im) + math.exp(im))
	elif im <= 5.4e+133:
		tmp = -0.16666666666666666 * (math.pow(re, 3.0) * t_1)
	elif im <= 1.4e+154:
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * math.pow(im, 4.0))))
	else:
		tmp = t_2
	return tmp
function code(re, im)
	t_0 = Float64(0.5 * Float64(im * im))
	t_1 = Float64(t_0 + 1.0)
	t_2 = Float64(sin(re) * t_1)
	tmp = 0.0
	if (im <= 1000.0)
		tmp = t_2;
	elseif (im <= 9.5e+112)
		tmp = Float64(Float64(0.5 * re) * Float64(exp(Float64(-im)) + exp(im)));
	elseif (im <= 5.4e+133)
		tmp = Float64(-0.16666666666666666 * Float64((re ^ 3.0) * t_1));
	elseif (im <= 1.4e+154)
		tmp = Float64(re / Float64(Float64(1.0 - t_0) / Float64(1.0 + Float64(-0.25 * (im ^ 4.0)))));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.5 * (im * im);
	t_1 = t_0 + 1.0;
	t_2 = sin(re) * t_1;
	tmp = 0.0;
	if (im <= 1000.0)
		tmp = t_2;
	elseif (im <= 9.5e+112)
		tmp = (0.5 * re) * (exp(-im) + exp(im));
	elseif (im <= 5.4e+133)
		tmp = -0.16666666666666666 * ((re ^ 3.0) * t_1);
	elseif (im <= 1.4e+154)
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * (im ^ 4.0))));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[im, 1000.0], t$95$2, If[LessEqual[im, 9.5e+112], N[(N[(0.5 * re), $MachinePrecision] * N[(N[Exp[(-im)], $MachinePrecision] + N[Exp[im], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.4e+133], N[(-0.16666666666666666 * N[(N[Power[re, 3.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+154], N[(re / N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[(-0.25 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right)\\
t_1 := t_0 + 1\\
t_2 := \sin re \cdot t_1\\
\mathbf{if}\;im \leq 1000:\\
\;\;\;\;t_2\\

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

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

\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < 1e3 or 1.4e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 1e3 < im < 9.5000000000000008e112

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in re around 0 82.9%

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

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

    if 9.5000000000000008e112 < im < 5.4000000000000004e133

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 6.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot \left(0.5 \cdot im\right)} + 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
      8. fma-udef75.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right)} \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
    8. Simplified75.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)} \]
    9. Taylor expanded in re around inf 75.4%

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

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

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

    if 5.4000000000000004e133 < im < 1.4e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.7%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified3.5%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. flip-+80.0%

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

        \[\leadsto \color{blue}{\frac{re \cdot \left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      3. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      4. swap-sqr80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow-prod-up80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. *-commutative80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      11. associate-*r*80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - im \cdot \left(im \cdot 0.5\right)}} \]
    11. Step-by-step derivation
      1. associate-/l*80.0%

        \[\leadsto \color{blue}{\frac{re}{\frac{1 - im \cdot \left(im \cdot 0.5\right)}{1 - 0.25 \cdot {im}^{4}}}} \]
      2. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(im \cdot 0.5\right) \cdot im}}{1 - 0.25 \cdot {im}^{4}}} \]
      3. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(0.5 \cdot im\right)} \cdot im}{1 - 0.25 \cdot {im}^{4}}} \]
      4. associate-*r*80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{0.5 \cdot \left(im \cdot im\right)}}{1 - 0.25 \cdot {im}^{4}}} \]
      5. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{\color{blue}{1 + \left(-0.25\right) \cdot {im}^{4}}}} \]
      6. metadata-eval80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + \color{blue}{-0.25} \cdot {im}^{4}}} \]
    12. Simplified80.0%

      \[\leadsto \color{blue}{\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification85.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 1000:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\left(0.5 \cdot re\right) \cdot \left(e^{-im} + e^{im}\right)\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 4: 81.5% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(im \cdot im\right)\\ t_1 := t_0 + 1\\ t_2 := \sin re \cdot t_1\\ \mathbf{if}\;im \leq 180000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;im \leq 7.1 \cdot 10^{+75}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{re \cdot \left(1 - {im}^{4} \cdot 0.25\right)}{1 - im \cdot \left(0.5 \cdot im\right)}\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot t_1\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* 0.5 (* im im))) (t_1 (+ t_0 1.0)) (t_2 (* (sin re) t_1)))
   (if (<= im 180000.0)
     t_2
     (if (<= im 7.1e+75)
       (log1p (expm1 (* im (* im (* 0.5 re)))))
       (if (<= im 9.5e+112)
         (/ (* re (- 1.0 (* (pow im 4.0) 0.25))) (- 1.0 (* im (* 0.5 im))))
         (if (<= im 5.4e+133)
           (* -0.16666666666666666 (* (pow re 3.0) t_1))
           (if (<= im 1.4e+154)
             (/ re (/ (- 1.0 t_0) (+ 1.0 (* -0.25 (pow im 4.0)))))
             t_2)))))))
double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = t_0 + 1.0;
	double t_2 = sin(re) * t_1;
	double tmp;
	if (im <= 180000.0) {
		tmp = t_2;
	} else if (im <= 7.1e+75) {
		tmp = log1p(expm1((im * (im * (0.5 * re)))));
	} else if (im <= 9.5e+112) {
		tmp = (re * (1.0 - (pow(im, 4.0) * 0.25))) / (1.0 - (im * (0.5 * im)));
	} else if (im <= 5.4e+133) {
		tmp = -0.16666666666666666 * (pow(re, 3.0) * t_1);
	} else if (im <= 1.4e+154) {
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * pow(im, 4.0))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
public static double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = t_0 + 1.0;
	double t_2 = Math.sin(re) * t_1;
	double tmp;
	if (im <= 180000.0) {
		tmp = t_2;
	} else if (im <= 7.1e+75) {
		tmp = Math.log1p(Math.expm1((im * (im * (0.5 * re)))));
	} else if (im <= 9.5e+112) {
		tmp = (re * (1.0 - (Math.pow(im, 4.0) * 0.25))) / (1.0 - (im * (0.5 * im)));
	} else if (im <= 5.4e+133) {
		tmp = -0.16666666666666666 * (Math.pow(re, 3.0) * t_1);
	} else if (im <= 1.4e+154) {
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * Math.pow(im, 4.0))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.5 * (im * im)
	t_1 = t_0 + 1.0
	t_2 = math.sin(re) * t_1
	tmp = 0
	if im <= 180000.0:
		tmp = t_2
	elif im <= 7.1e+75:
		tmp = math.log1p(math.expm1((im * (im * (0.5 * re)))))
	elif im <= 9.5e+112:
		tmp = (re * (1.0 - (math.pow(im, 4.0) * 0.25))) / (1.0 - (im * (0.5 * im)))
	elif im <= 5.4e+133:
		tmp = -0.16666666666666666 * (math.pow(re, 3.0) * t_1)
	elif im <= 1.4e+154:
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * math.pow(im, 4.0))))
	else:
		tmp = t_2
	return tmp
function code(re, im)
	t_0 = Float64(0.5 * Float64(im * im))
	t_1 = Float64(t_0 + 1.0)
	t_2 = Float64(sin(re) * t_1)
	tmp = 0.0
	if (im <= 180000.0)
		tmp = t_2;
	elseif (im <= 7.1e+75)
		tmp = log1p(expm1(Float64(im * Float64(im * Float64(0.5 * re)))));
	elseif (im <= 9.5e+112)
		tmp = Float64(Float64(re * Float64(1.0 - Float64((im ^ 4.0) * 0.25))) / Float64(1.0 - Float64(im * Float64(0.5 * im))));
	elseif (im <= 5.4e+133)
		tmp = Float64(-0.16666666666666666 * Float64((re ^ 3.0) * t_1));
	elseif (im <= 1.4e+154)
		tmp = Float64(re / Float64(Float64(1.0 - t_0) / Float64(1.0 + Float64(-0.25 * (im ^ 4.0)))));
	else
		tmp = t_2;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[im, 180000.0], t$95$2, If[LessEqual[im, 7.1e+75], N[Log[1 + N[(Exp[N[(im * N[(im * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision], If[LessEqual[im, 9.5e+112], N[(N[(re * N[(1.0 - N[(N[Power[im, 4.0], $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.4e+133], N[(-0.16666666666666666 * N[(N[Power[re, 3.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+154], N[(re / N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[(-0.25 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right)\\
t_1 := t_0 + 1\\
t_2 := \sin re \cdot t_1\\
\mathbf{if}\;im \leq 180000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;im \leq 7.1 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\right)\right)\\

\mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\
\;\;\;\;\frac{re \cdot \left(1 - {im}^{4} \cdot 0.25\right)}{1 - im \cdot \left(0.5 \cdot im\right)}\\

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

\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if im < 1.8e5 or 1.4e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 1.8e5 < im < 7.09999999999999982e75

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 3.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]
    11. Simplified3.7%

      \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]
    12. Step-by-step derivation
      1. log1p-expm1-u55.1%

        \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(im \cdot \left(im \cdot \left(re \cdot 0.5\right)\right)\right)\right)} \]
      2. *-commutative55.1%

        \[\leadsto \mathsf{log1p}\left(\mathsf{expm1}\left(im \cdot \left(im \cdot \color{blue}{\left(0.5 \cdot re\right)}\right)\right)\right) \]
    13. Applied egg-rr55.1%

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

    if 7.09999999999999982e75 < im < 9.5000000000000008e112

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 4.4%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified33.4%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative33.4%

        \[\leadsto \color{blue}{\left(1 + 0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. flip-+85.0%

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \cdot re \]
      3. associate-*l/92.3%

        \[\leadsto \color{blue}{\frac{\left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      4. metadata-eval92.3%

        \[\leadsto \frac{\left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. swap-sqr92.3%

        \[\leadsto \frac{\left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. metadata-eval92.3%

        \[\leadsto \frac{\left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow292.3%

        \[\leadsto \frac{\left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow292.3%

        \[\leadsto \frac{\left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. pow-prod-up92.3%

        \[\leadsto \frac{\left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. metadata-eval92.3%

        \[\leadsto \frac{\left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      11. *-commutative92.3%

        \[\leadsto \frac{\left(1 - 0.25 \cdot {im}^{4}\right) \cdot re}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      12. associate-*r*92.3%

        \[\leadsto \frac{\left(1 - 0.25 \cdot {im}^{4}\right) \cdot re}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr92.3%

      \[\leadsto \color{blue}{\frac{\left(1 - 0.25 \cdot {im}^{4}\right) \cdot re}{1 - im \cdot \left(im \cdot 0.5\right)}} \]

    if 9.5000000000000008e112 < im < 5.4000000000000004e133

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 6.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot \left(0.5 \cdot im\right)} + 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
      8. fma-udef75.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right)} \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
    8. Simplified75.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)} \]
    9. Taylor expanded in re around inf 75.4%

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

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

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

    if 5.4000000000000004e133 < im < 1.4e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.7%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified3.5%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. flip-+80.0%

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

        \[\leadsto \color{blue}{\frac{re \cdot \left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      3. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      4. swap-sqr80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow-prod-up80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. *-commutative80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      11. associate-*r*80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - im \cdot \left(im \cdot 0.5\right)}} \]
    11. Step-by-step derivation
      1. associate-/l*80.0%

        \[\leadsto \color{blue}{\frac{re}{\frac{1 - im \cdot \left(im \cdot 0.5\right)}{1 - 0.25 \cdot {im}^{4}}}} \]
      2. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(im \cdot 0.5\right) \cdot im}}{1 - 0.25 \cdot {im}^{4}}} \]
      3. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(0.5 \cdot im\right)} \cdot im}{1 - 0.25 \cdot {im}^{4}}} \]
      4. associate-*r*80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{0.5 \cdot \left(im \cdot im\right)}}{1 - 0.25 \cdot {im}^{4}}} \]
      5. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{\color{blue}{1 + \left(-0.25\right) \cdot {im}^{4}}}} \]
      6. metadata-eval80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + \color{blue}{-0.25} \cdot {im}^{4}}} \]
    12. Simplified80.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 180000:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 7.1 \cdot 10^{+75}:\\ \;\;\;\;\mathsf{log1p}\left(\mathsf{expm1}\left(im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\right)\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{re \cdot \left(1 - {im}^{4} \cdot 0.25\right)}{1 - im \cdot \left(0.5 \cdot im\right)}\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 5: 81.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(im \cdot im\right)\\ t_1 := t_0 + 1\\ t_2 := \sin re \cdot t_1\\ t_3 := \frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{if}\;im \leq 680:\\ \;\;\;\;t_2\\ \mathbf{elif}\;im \leq 1.5 \cdot 10^{+68}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot t_1\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* 0.5 (* im im)))
        (t_1 (+ t_0 1.0))
        (t_2 (* (sin re) t_1))
        (t_3 (/ re (/ (- 1.0 t_0) (+ 1.0 (* -0.25 (pow im 4.0)))))))
   (if (<= im 680.0)
     t_2
     (if (<= im 1.5e+68)
       (+
        0.08333333333333333
        (fma (* re re) 0.016666666666666666 (/ 0.25 (* re re))))
       (if (<= im 9.5e+112)
         t_3
         (if (<= im 5.4e+133)
           (* -0.16666666666666666 (* (pow re 3.0) t_1))
           (if (<= im 1.4e+154) t_3 t_2)))))))
double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = t_0 + 1.0;
	double t_2 = sin(re) * t_1;
	double t_3 = re / ((1.0 - t_0) / (1.0 + (-0.25 * pow(im, 4.0))));
	double tmp;
	if (im <= 680.0) {
		tmp = t_2;
	} else if (im <= 1.5e+68) {
		tmp = 0.08333333333333333 + fma((re * re), 0.016666666666666666, (0.25 / (re * re)));
	} else if (im <= 9.5e+112) {
		tmp = t_3;
	} else if (im <= 5.4e+133) {
		tmp = -0.16666666666666666 * (pow(re, 3.0) * t_1);
	} else if (im <= 1.4e+154) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(0.5 * Float64(im * im))
	t_1 = Float64(t_0 + 1.0)
	t_2 = Float64(sin(re) * t_1)
	t_3 = Float64(re / Float64(Float64(1.0 - t_0) / Float64(1.0 + Float64(-0.25 * (im ^ 4.0)))))
	tmp = 0.0
	if (im <= 680.0)
		tmp = t_2;
	elseif (im <= 1.5e+68)
		tmp = Float64(0.08333333333333333 + fma(Float64(re * re), 0.016666666666666666, Float64(0.25 / Float64(re * re))));
	elseif (im <= 9.5e+112)
		tmp = t_3;
	elseif (im <= 5.4e+133)
		tmp = Float64(-0.16666666666666666 * Float64((re ^ 3.0) * t_1));
	elseif (im <= 1.4e+154)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(re / N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[(-0.25 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 680.0], t$95$2, If[LessEqual[im, 1.5e+68], N[(0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.5e+112], t$95$3, If[LessEqual[im, 5.4e+133], N[(-0.16666666666666666 * N[(N[Power[re, 3.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+154], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right)\\
t_1 := t_0 + 1\\
t_2 := \sin re \cdot t_1\\
t_3 := \frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\
\mathbf{if}\;im \leq 680:\\
\;\;\;\;t_2\\

\mathbf{elif}\;im \leq 1.5 \cdot 10^{+68}:\\
\;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\

\mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < 680 or 1.4e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 680 < im < 1.5000000000000001e68

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr16.0%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative30.1%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def30.1%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow230.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/30.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval30.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow230.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified30.1%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]

    if 1.5000000000000001e68 < im < 9.5000000000000008e112 or 5.4000000000000004e133 < im < 1.4e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 4.7%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified24.0%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. flip-+79.4%

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

        \[\leadsto \color{blue}{\frac{re \cdot \left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      3. metadata-eval84.4%

        \[\leadsto \frac{re \cdot \left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      4. swap-sqr84.4%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. metadata-eval84.4%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. pow284.4%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow284.4%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow-prod-up84.4%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. metadata-eval84.4%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. *-commutative84.4%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      11. associate-*r*84.4%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr84.4%

      \[\leadsto \color{blue}{\frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - im \cdot \left(im \cdot 0.5\right)}} \]
    11. Step-by-step derivation
      1. associate-/l*79.4%

        \[\leadsto \color{blue}{\frac{re}{\frac{1 - im \cdot \left(im \cdot 0.5\right)}{1 - 0.25 \cdot {im}^{4}}}} \]
      2. *-commutative79.4%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(im \cdot 0.5\right) \cdot im}}{1 - 0.25 \cdot {im}^{4}}} \]
      3. *-commutative79.4%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(0.5 \cdot im\right)} \cdot im}{1 - 0.25 \cdot {im}^{4}}} \]
      4. associate-*r*79.4%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{0.5 \cdot \left(im \cdot im\right)}}{1 - 0.25 \cdot {im}^{4}}} \]
      5. cancel-sign-sub-inv79.4%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{\color{blue}{1 + \left(-0.25\right) \cdot {im}^{4}}}} \]
      6. metadata-eval79.4%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + \color{blue}{-0.25} \cdot {im}^{4}}} \]
    12. Simplified79.4%

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

    if 9.5000000000000008e112 < im < 5.4000000000000004e133

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 6.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot \left(0.5 \cdot im\right)} + 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
      8. fma-udef75.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right)} \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
    8. Simplified75.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)} \]
    9. Taylor expanded in re around inf 75.4%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 680:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 1.5 \cdot 10^{+68}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 6: 81.0% accurate, 2.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(im \cdot im\right)\\ t_1 := t_0 + 1\\ t_2 := \sin re \cdot t_1\\ \mathbf{if}\;im \leq 580:\\ \;\;\;\;t_2\\ \mathbf{elif}\;im \leq 7 \cdot 10^{+65}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{re \cdot \left(1 - {im}^{4} \cdot 0.25\right)}{1 - im \cdot \left(0.5 \cdot im\right)}\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot t_1\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* 0.5 (* im im))) (t_1 (+ t_0 1.0)) (t_2 (* (sin re) t_1)))
   (if (<= im 580.0)
     t_2
     (if (<= im 7e+65)
       (+
        0.08333333333333333
        (fma (* re re) 0.016666666666666666 (/ 0.25 (* re re))))
       (if (<= im 9.5e+112)
         (/ (* re (- 1.0 (* (pow im 4.0) 0.25))) (- 1.0 (* im (* 0.5 im))))
         (if (<= im 5.4e+133)
           (* -0.16666666666666666 (* (pow re 3.0) t_1))
           (if (<= im 1.4e+154)
             (/ re (/ (- 1.0 t_0) (+ 1.0 (* -0.25 (pow im 4.0)))))
             t_2)))))))
double code(double re, double im) {
	double t_0 = 0.5 * (im * im);
	double t_1 = t_0 + 1.0;
	double t_2 = sin(re) * t_1;
	double tmp;
	if (im <= 580.0) {
		tmp = t_2;
	} else if (im <= 7e+65) {
		tmp = 0.08333333333333333 + fma((re * re), 0.016666666666666666, (0.25 / (re * re)));
	} else if (im <= 9.5e+112) {
		tmp = (re * (1.0 - (pow(im, 4.0) * 0.25))) / (1.0 - (im * (0.5 * im)));
	} else if (im <= 5.4e+133) {
		tmp = -0.16666666666666666 * (pow(re, 3.0) * t_1);
	} else if (im <= 1.4e+154) {
		tmp = re / ((1.0 - t_0) / (1.0 + (-0.25 * pow(im, 4.0))));
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(0.5 * Float64(im * im))
	t_1 = Float64(t_0 + 1.0)
	t_2 = Float64(sin(re) * t_1)
	tmp = 0.0
	if (im <= 580.0)
		tmp = t_2;
	elseif (im <= 7e+65)
		tmp = Float64(0.08333333333333333 + fma(Float64(re * re), 0.016666666666666666, Float64(0.25 / Float64(re * re))));
	elseif (im <= 9.5e+112)
		tmp = Float64(Float64(re * Float64(1.0 - Float64((im ^ 4.0) * 0.25))) / Float64(1.0 - Float64(im * Float64(0.5 * im))));
	elseif (im <= 5.4e+133)
		tmp = Float64(-0.16666666666666666 * Float64((re ^ 3.0) * t_1));
	elseif (im <= 1.4e+154)
		tmp = Float64(re / Float64(Float64(1.0 - t_0) / Float64(1.0 + Float64(-0.25 * (im ^ 4.0)))));
	else
		tmp = t_2;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, If[LessEqual[im, 580.0], t$95$2, If[LessEqual[im, 7e+65], N[(0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.5e+112], N[(N[(re * N[(1.0 - N[(N[Power[im, 4.0], $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - N[(im * N[(0.5 * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.4e+133], N[(-0.16666666666666666 * N[(N[Power[re, 3.0], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.4e+154], N[(re / N[(N[(1.0 - t$95$0), $MachinePrecision] / N[(1.0 + N[(-0.25 * N[Power[im, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right)\\
t_1 := t_0 + 1\\
t_2 := \sin re \cdot t_1\\
\mathbf{if}\;im \leq 580:\\
\;\;\;\;t_2\\

\mathbf{elif}\;im \leq 7 \cdot 10^{+65}:\\
\;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\

\mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\
\;\;\;\;\frac{re \cdot \left(1 - {im}^{4} \cdot 0.25\right)}{1 - im \cdot \left(0.5 \cdot im\right)}\\

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

\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\frac{re}{\frac{1 - t_0}{1 + -0.25 \cdot {im}^{4}}}\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if im < 580 or 1.4e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 580 < im < 7.0000000000000002e65

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr16.0%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative30.1%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def30.1%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow230.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/30.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval30.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow230.1%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified30.1%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]

    if 7.0000000000000002e65 < im < 9.5000000000000008e112

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 4.4%

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

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

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

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

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative31.3%

        \[\leadsto \color{blue}{\left(1 + 0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. flip-+79.2%

        \[\leadsto \color{blue}{\frac{1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \cdot re \]
      3. associate-*l/86.0%

        \[\leadsto \color{blue}{\frac{\left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      4. metadata-eval86.0%

        \[\leadsto \frac{\left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. swap-sqr86.0%

        \[\leadsto \frac{\left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. metadata-eval86.0%

        \[\leadsto \frac{\left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow286.0%

        \[\leadsto \frac{\left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow286.0%

        \[\leadsto \frac{\left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. pow-prod-up86.0%

        \[\leadsto \frac{\left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. metadata-eval86.0%

        \[\leadsto \frac{\left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right) \cdot re}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      11. *-commutative86.0%

        \[\leadsto \frac{\left(1 - 0.25 \cdot {im}^{4}\right) \cdot re}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      12. associate-*r*86.0%

        \[\leadsto \frac{\left(1 - 0.25 \cdot {im}^{4}\right) \cdot re}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr86.0%

      \[\leadsto \color{blue}{\frac{\left(1 - 0.25 \cdot {im}^{4}\right) \cdot re}{1 - im \cdot \left(im \cdot 0.5\right)}} \]

    if 9.5000000000000008e112 < im < 5.4000000000000004e133

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 6.4%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\color{blue}{im \cdot \left(0.5 \cdot im\right)} + 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
      8. fma-udef75.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right)} \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right) \]
    8. Simplified75.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(im, 0.5 \cdot im, 1\right) \cdot \left(re + -0.16666666666666666 \cdot {re}^{3}\right)} \]
    9. Taylor expanded in re around inf 75.4%

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

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

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

    if 5.4000000000000004e133 < im < 1.4e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.7%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified3.5%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. flip-+80.0%

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

        \[\leadsto \color{blue}{\frac{re \cdot \left(1 \cdot 1 - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)}} \]
      3. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(\color{blue}{1} - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      4. swap-sqr80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      5. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - \color{blue}{0.25} \cdot \left(\left(im \cdot im\right) \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      6. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left(\color{blue}{{im}^{2}} \cdot \left(im \cdot im\right)\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      7. pow280.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \left({im}^{2} \cdot \color{blue}{{im}^{2}}\right)\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      8. pow-prod-up80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot \color{blue}{{im}^{\left(2 + 2\right)}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      9. metadata-eval80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{\color{blue}{4}}\right)}{1 - 0.5 \cdot \left(im \cdot im\right)} \]
      10. *-commutative80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{\left(im \cdot im\right) \cdot 0.5}} \]
      11. associate-*r*80.0%

        \[\leadsto \frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - \color{blue}{im \cdot \left(im \cdot 0.5\right)}} \]
    10. Applied egg-rr80.0%

      \[\leadsto \color{blue}{\frac{re \cdot \left(1 - 0.25 \cdot {im}^{4}\right)}{1 - im \cdot \left(im \cdot 0.5\right)}} \]
    11. Step-by-step derivation
      1. associate-/l*80.0%

        \[\leadsto \color{blue}{\frac{re}{\frac{1 - im \cdot \left(im \cdot 0.5\right)}{1 - 0.25 \cdot {im}^{4}}}} \]
      2. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(im \cdot 0.5\right) \cdot im}}{1 - 0.25 \cdot {im}^{4}}} \]
      3. *-commutative80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{\left(0.5 \cdot im\right)} \cdot im}{1 - 0.25 \cdot {im}^{4}}} \]
      4. associate-*r*80.0%

        \[\leadsto \frac{re}{\frac{1 - \color{blue}{0.5 \cdot \left(im \cdot im\right)}}{1 - 0.25 \cdot {im}^{4}}} \]
      5. cancel-sign-sub-inv80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{\color{blue}{1 + \left(-0.25\right) \cdot {im}^{4}}}} \]
      6. metadata-eval80.0%

        \[\leadsto \frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + \color{blue}{-0.25} \cdot {im}^{4}}} \]
    12. Simplified80.0%

      \[\leadsto \color{blue}{\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification80.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 580:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 7 \cdot 10^{+65}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;\frac{re \cdot \left(1 - {im}^{4} \cdot 0.25\right)}{1 - im \cdot \left(0.5 \cdot im\right)}\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+133}:\\ \;\;\;\;-0.16666666666666666 \cdot \left({re}^{3} \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\frac{re}{\frac{1 - 0.5 \cdot \left(im \cdot im\right)}{1 + -0.25 \cdot {im}^{4}}}\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 7: 78.5% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ t_1 := 0.5 \cdot \left(im \cdot im\right) + 1\\ t_2 := \sin re \cdot t_1\\ t_3 := re \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq 680:\\ \;\;\;\;t_2\\ \mathbf{elif}\;im \leq 1.2 \cdot 10^{+68}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 6.6 \cdot 10^{+92}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_3 \cdot t_3\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 1.06 \cdot 10^{+100}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 3.8 \cdot 10^{+122}:\\ \;\;\;\;re \cdot t_1\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0
         (+
          0.08333333333333333
          (fma (* re re) 0.016666666666666666 (/ 0.25 (* re re)))))
        (t_1 (+ (* 0.5 (* im im)) 1.0))
        (t_2 (* (sin re) t_1))
        (t_3 (* re (* im im))))
   (if (<= im 680.0)
     t_2
     (if (<= im 1.2e+68)
       t_0
       (if (<= im 6.6e+92)
         (/
          (- (* re re) (* 0.25 (* t_3 t_3)))
          (+ re (* (* re im) (* im -0.5))))
         (if (<= im 1.06e+100)
           t_0
           (if (<= im 3.8e+122) (* re t_1) (if (<= im 1.4e+154) t_0 t_2))))))))
double code(double re, double im) {
	double t_0 = 0.08333333333333333 + fma((re * re), 0.016666666666666666, (0.25 / (re * re)));
	double t_1 = (0.5 * (im * im)) + 1.0;
	double t_2 = sin(re) * t_1;
	double t_3 = re * (im * im);
	double tmp;
	if (im <= 680.0) {
		tmp = t_2;
	} else if (im <= 1.2e+68) {
		tmp = t_0;
	} else if (im <= 6.6e+92) {
		tmp = ((re * re) - (0.25 * (t_3 * t_3))) / (re + ((re * im) * (im * -0.5)));
	} else if (im <= 1.06e+100) {
		tmp = t_0;
	} else if (im <= 3.8e+122) {
		tmp = re * t_1;
	} else if (im <= 1.4e+154) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
function code(re, im)
	t_0 = Float64(0.08333333333333333 + fma(Float64(re * re), 0.016666666666666666, Float64(0.25 / Float64(re * re))))
	t_1 = Float64(Float64(0.5 * Float64(im * im)) + 1.0)
	t_2 = Float64(sin(re) * t_1)
	t_3 = Float64(re * Float64(im * im))
	tmp = 0.0
	if (im <= 680.0)
		tmp = t_2;
	elseif (im <= 1.2e+68)
		tmp = t_0;
	elseif (im <= 6.6e+92)
		tmp = Float64(Float64(Float64(re * re) - Float64(0.25 * Float64(t_3 * t_3))) / Float64(re + Float64(Float64(re * im) * Float64(im * -0.5))));
	elseif (im <= 1.06e+100)
		tmp = t_0;
	elseif (im <= 3.8e+122)
		tmp = Float64(re * t_1);
	elseif (im <= 1.4e+154)
		tmp = t_0;
	else
		tmp = t_2;
	end
	return tmp
end
code[re_, im_] := Block[{t$95$0 = N[(0.08333333333333333 + N[(N[(re * re), $MachinePrecision] * 0.016666666666666666 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[re], $MachinePrecision] * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 680.0], t$95$2, If[LessEqual[im, 1.2e+68], t$95$0, If[LessEqual[im, 6.6e+92], N[(N[(N[(re * re), $MachinePrecision] - N[(0.25 * N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(re + N[(N[(re * im), $MachinePrecision] * N[(im * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.06e+100], t$95$0, If[LessEqual[im, 3.8e+122], N[(re * t$95$1), $MachinePrecision], If[LessEqual[im, 1.4e+154], t$95$0, t$95$2]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\
t_1 := 0.5 \cdot \left(im \cdot im\right) + 1\\
t_2 := \sin re \cdot t_1\\
t_3 := re \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq 680:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;im \leq 6.6 \cdot 10^{+92}:\\
\;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_3 \cdot t_3\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\

\mathbf{elif}\;im \leq 1.06 \cdot 10^{+100}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 3.8 \cdot 10^{+122}:\\
\;\;\;\;re \cdot t_1\\

\mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < 680 or 1.4e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 680 < im < 1.20000000000000004e68 or 6.59999999999999948e92 < im < 1.06000000000000007e100 or 3.7999999999999998e122 < im < 1.4e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr25.0%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative42.3%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def42.3%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow242.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/42.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval42.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow242.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified42.3%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]

    if 1.20000000000000004e68 < im < 6.59999999999999948e92

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 4.3%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified5.5%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in5.5%

        \[\leadsto \color{blue}{1 \cdot re + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. *-un-lft-identity5.5%

        \[\leadsto \color{blue}{re} + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re \]
      3. flip-+61.4%

        \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re}} \]
      4. associate-*r*61.4%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      5. associate-*l*61.4%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)} \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      6. *-commutative61.4%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      7. associate-*r*61.4%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      8. associate-*l*61.4%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)}}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      9. *-commutative61.4%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      10. associate-*r*61.4%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re} \]
      11. associate-*l*61.4%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)}} \]
      12. *-commutative61.4%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)} \]
    10. Applied egg-rr61.4%

      \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)}} \]
    11. Step-by-step derivation
      1. *-commutative61.4%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(0.5 \cdot im\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      2. associate-*l*61.4%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)\right)} \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      3. associate-*l*61.4%

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot re\right)}\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      4. unpow261.4%

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      5. *-commutative61.4%

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

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

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      9. swap-sqr61.4%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      10. metadata-eval61.4%

        \[\leadsto \frac{re \cdot re - \color{blue}{0.25} \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      11. *-commutative61.4%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\color{blue}{\left(re \cdot {im}^{2}\right)} \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      12. unpow261.4%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      13. *-commutative61.4%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(re \cdot {im}^{2}\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      14. unpow261.4%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
    12. Simplified61.4%

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

    if 1.06000000000000007e100 < im < 3.7999999999999998e122

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.3%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 680:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 1.2 \cdot 10^{+68}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{elif}\;im \leq 6.6 \cdot 10^{+92}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \left(im \cdot im\right)\right)\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 1.06 \cdot 10^{+100}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{elif}\;im \leq 3.8 \cdot 10^{+122}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 8: 63.1% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ t_1 := re \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq 390:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 4 \cdot 10^{+57}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;im \leq 2.1 \cdot 10^{+100}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_1 \cdot t_1\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 3.8 \cdot 10^{+152}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{elif}\;im \leq 4.8 \cdot 10^{+231}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot \sin re\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* re (+ (* 0.5 (* im im)) 1.0))) (t_1 (* re (* im im))))
   (if (<= im 390.0)
     (sin re)
     (if (<= im 4e+57)
       (+ 0.08333333333333333 (* re (* re 0.016666666666666666)))
       (if (<= im 2.1e+100)
         (/
          (- (* re re) (* 0.25 (* t_1 t_1)))
          (+ re (* (* re im) (* im -0.5))))
         (if (<= im 9.2e+112)
           t_0
           (if (<= im 3.8e+152)
             (+ 0.08333333333333333 (/ 0.25 (* re re)))
             (if (<= im 4.8e+231) t_0 (* im (* im (* 0.5 (sin re))))))))))))
double code(double re, double im) {
	double t_0 = re * ((0.5 * (im * im)) + 1.0);
	double t_1 = re * (im * im);
	double tmp;
	if (im <= 390.0) {
		tmp = sin(re);
	} else if (im <= 4e+57) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (im <= 2.1e+100) {
		tmp = ((re * re) - (0.25 * (t_1 * t_1))) / (re + ((re * im) * (im * -0.5)));
	} else if (im <= 9.2e+112) {
		tmp = t_0;
	} else if (im <= 3.8e+152) {
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	} else if (im <= 4.8e+231) {
		tmp = t_0;
	} else {
		tmp = im * (im * (0.5 * sin(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) :: t_1
    real(8) :: tmp
    t_0 = re * ((0.5d0 * (im * im)) + 1.0d0)
    t_1 = re * (im * im)
    if (im <= 390.0d0) then
        tmp = sin(re)
    else if (im <= 4d+57) then
        tmp = 0.08333333333333333d0 + (re * (re * 0.016666666666666666d0))
    else if (im <= 2.1d+100) then
        tmp = ((re * re) - (0.25d0 * (t_1 * t_1))) / (re + ((re * im) * (im * (-0.5d0))))
    else if (im <= 9.2d+112) then
        tmp = t_0
    else if (im <= 3.8d+152) then
        tmp = 0.08333333333333333d0 + (0.25d0 / (re * re))
    else if (im <= 4.8d+231) then
        tmp = t_0
    else
        tmp = im * (im * (0.5d0 * sin(re)))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = re * ((0.5 * (im * im)) + 1.0);
	double t_1 = re * (im * im);
	double tmp;
	if (im <= 390.0) {
		tmp = Math.sin(re);
	} else if (im <= 4e+57) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (im <= 2.1e+100) {
		tmp = ((re * re) - (0.25 * (t_1 * t_1))) / (re + ((re * im) * (im * -0.5)));
	} else if (im <= 9.2e+112) {
		tmp = t_0;
	} else if (im <= 3.8e+152) {
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	} else if (im <= 4.8e+231) {
		tmp = t_0;
	} else {
		tmp = im * (im * (0.5 * Math.sin(re)));
	}
	return tmp;
}
def code(re, im):
	t_0 = re * ((0.5 * (im * im)) + 1.0)
	t_1 = re * (im * im)
	tmp = 0
	if im <= 390.0:
		tmp = math.sin(re)
	elif im <= 4e+57:
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666))
	elif im <= 2.1e+100:
		tmp = ((re * re) - (0.25 * (t_1 * t_1))) / (re + ((re * im) * (im * -0.5)))
	elif im <= 9.2e+112:
		tmp = t_0
	elif im <= 3.8e+152:
		tmp = 0.08333333333333333 + (0.25 / (re * re))
	elif im <= 4.8e+231:
		tmp = t_0
	else:
		tmp = im * (im * (0.5 * math.sin(re)))
	return tmp
function code(re, im)
	t_0 = Float64(re * Float64(Float64(0.5 * Float64(im * im)) + 1.0))
	t_1 = Float64(re * Float64(im * im))
	tmp = 0.0
	if (im <= 390.0)
		tmp = sin(re);
	elseif (im <= 4e+57)
		tmp = Float64(0.08333333333333333 + Float64(re * Float64(re * 0.016666666666666666)));
	elseif (im <= 2.1e+100)
		tmp = Float64(Float64(Float64(re * re) - Float64(0.25 * Float64(t_1 * t_1))) / Float64(re + Float64(Float64(re * im) * Float64(im * -0.5))));
	elseif (im <= 9.2e+112)
		tmp = t_0;
	elseif (im <= 3.8e+152)
		tmp = Float64(0.08333333333333333 + Float64(0.25 / Float64(re * re)));
	elseif (im <= 4.8e+231)
		tmp = t_0;
	else
		tmp = Float64(im * Float64(im * Float64(0.5 * sin(re))));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re * ((0.5 * (im * im)) + 1.0);
	t_1 = re * (im * im);
	tmp = 0.0;
	if (im <= 390.0)
		tmp = sin(re);
	elseif (im <= 4e+57)
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	elseif (im <= 2.1e+100)
		tmp = ((re * re) - (0.25 * (t_1 * t_1))) / (re + ((re * im) * (im * -0.5)));
	elseif (im <= 9.2e+112)
		tmp = t_0;
	elseif (im <= 3.8e+152)
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	elseif (im <= 4.8e+231)
		tmp = t_0;
	else
		tmp = im * (im * (0.5 * sin(re)));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 390.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 4e+57], N[(0.08333333333333333 + N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.1e+100], N[(N[(N[(re * re), $MachinePrecision] - N[(0.25 * N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(re + N[(N[(re * im), $MachinePrecision] * N[(im * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.2e+112], t$95$0, If[LessEqual[im, 3.8e+152], N[(0.08333333333333333 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 4.8e+231], t$95$0, N[(im * N[(im * N[(0.5 * N[Sin[re], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\
t_1 := re \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq 390:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 4 \cdot 10^{+57}:\\
\;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\

\mathbf{elif}\;im \leq 2.1 \cdot 10^{+100}:\\
\;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_1 \cdot t_1\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\

\mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 3.8 \cdot 10^{+152}:\\
\;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\

\mathbf{elif}\;im \leq 4.8 \cdot 10^{+231}:\\
\;\;\;\;t_0\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 67.4%

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

    if 390 < im < 4.00000000000000019e57

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr12.8%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative29.0%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def29.0%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow229.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/29.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval29.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow229.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified29.0%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]
    8. Taylor expanded in re around inf 18.3%

      \[\leadsto \color{blue}{0.08333333333333333 + 0.016666666666666666 \cdot {re}^{2}} \]
    9. Step-by-step derivation
      1. +-commutative18.3%

        \[\leadsto \color{blue}{0.016666666666666666 \cdot {re}^{2} + 0.08333333333333333} \]
      2. *-commutative18.3%

        \[\leadsto \color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.08333333333333333 \]
      3. unpow218.3%

        \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot 0.016666666666666666 + 0.08333333333333333 \]
      4. associate-*l*18.3%

        \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right)} + 0.08333333333333333 \]
    10. Simplified18.3%

      \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right) + 0.08333333333333333} \]

    if 4.00000000000000019e57 < im < 2.0999999999999999e100

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 3.9%

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

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

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

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

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in4.1%

        \[\leadsto \color{blue}{1 \cdot re + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. *-un-lft-identity4.1%

        \[\leadsto \color{blue}{re} + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re \]
      3. flip-+35.2%

        \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re}} \]
      4. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      5. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)} \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      6. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      7. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      8. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)}}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      9. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      10. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re} \]
      11. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)}} \]
      12. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)} \]
    10. Applied egg-rr35.2%

      \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)}} \]
    11. Step-by-step derivation
      1. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(0.5 \cdot im\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      2. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)\right)} \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      3. associate-*l*35.2%

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      5. *-commutative35.2%

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

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot re\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      8. unpow235.2%

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      9. swap-sqr35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      10. metadata-eval35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{0.25} \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      11. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\color{blue}{\left(re \cdot {im}^{2}\right)} \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      12. unpow235.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      13. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(re \cdot {im}^{2}\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      14. unpow235.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
    12. Simplified35.2%

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

    if 2.0999999999999999e100 < im < 9.1999999999999999e112 or 3.8e152 < im < 4.80000000000000013e231

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 70.4%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified87.7%

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

    if 9.1999999999999999e112 < im < 3.8e152

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr34.5%

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

      \[\leadsto \color{blue}{0.08333333333333333 + 0.25 \cdot \frac{1}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. associate-*r/34.5%

        \[\leadsto 0.08333333333333333 + \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}} \]
      2. metadata-eval34.5%

        \[\leadsto 0.08333333333333333 + \frac{\color{blue}{0.25}}{{re}^{2}} \]
      3. unpow234.5%

        \[\leadsto 0.08333333333333333 + \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified34.5%

      \[\leadsto \color{blue}{0.08333333333333333 + \frac{0.25}{re \cdot re}} \]

    if 4.80000000000000013e231 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 100.0%

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

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    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. unpow2100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 390:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 4 \cdot 10^{+57}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;im \leq 2.1 \cdot 10^{+100}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \left(im \cdot im\right)\right)\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 3.8 \cdot 10^{+152}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{elif}\;im \leq 4.8 \cdot 10^{+231}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot \sin re\right)\right)\\ \end{array} \]

Alternative 9: 77.4% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(im \cdot im\right) + 1\\ t_1 := \sin re \cdot t_0\\ t_2 := re \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq 650:\\ \;\;\;\;t_1\\ \mathbf{elif}\;im \leq 1.32 \cdot 10^{+57}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;im \leq 1.9 \cdot 10^{+100}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_2 \cdot t_2\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\ \;\;\;\;re \cdot t_0\\ \mathbf{elif}\;im \leq 1.26 \cdot 10^{+154}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ (* 0.5 (* im im)) 1.0))
        (t_1 (* (sin re) t_0))
        (t_2 (* re (* im im))))
   (if (<= im 650.0)
     t_1
     (if (<= im 1.32e+57)
       (+ 0.08333333333333333 (* re (* re 0.016666666666666666)))
       (if (<= im 1.9e+100)
         (/
          (- (* re re) (* 0.25 (* t_2 t_2)))
          (+ re (* (* re im) (* im -0.5))))
         (if (<= im 9.2e+112)
           (* re t_0)
           (if (<= im 1.26e+154)
             (+ 0.08333333333333333 (/ 0.25 (* re re)))
             t_1)))))))
double code(double re, double im) {
	double t_0 = (0.5 * (im * im)) + 1.0;
	double t_1 = sin(re) * t_0;
	double t_2 = re * (im * im);
	double tmp;
	if (im <= 650.0) {
		tmp = t_1;
	} else if (im <= 1.32e+57) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (im <= 1.9e+100) {
		tmp = ((re * re) - (0.25 * (t_2 * t_2))) / (re + ((re * im) * (im * -0.5)));
	} else if (im <= 9.2e+112) {
		tmp = re * t_0;
	} else if (im <= 1.26e+154) {
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_0 = (0.5d0 * (im * im)) + 1.0d0
    t_1 = sin(re) * t_0
    t_2 = re * (im * im)
    if (im <= 650.0d0) then
        tmp = t_1
    else if (im <= 1.32d+57) then
        tmp = 0.08333333333333333d0 + (re * (re * 0.016666666666666666d0))
    else if (im <= 1.9d+100) then
        tmp = ((re * re) - (0.25d0 * (t_2 * t_2))) / (re + ((re * im) * (im * (-0.5d0))))
    else if (im <= 9.2d+112) then
        tmp = re * t_0
    else if (im <= 1.26d+154) then
        tmp = 0.08333333333333333d0 + (0.25d0 / (re * re))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = (0.5 * (im * im)) + 1.0;
	double t_1 = Math.sin(re) * t_0;
	double t_2 = re * (im * im);
	double tmp;
	if (im <= 650.0) {
		tmp = t_1;
	} else if (im <= 1.32e+57) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (im <= 1.9e+100) {
		tmp = ((re * re) - (0.25 * (t_2 * t_2))) / (re + ((re * im) * (im * -0.5)));
	} else if (im <= 9.2e+112) {
		tmp = re * t_0;
	} else if (im <= 1.26e+154) {
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(re, im):
	t_0 = (0.5 * (im * im)) + 1.0
	t_1 = math.sin(re) * t_0
	t_2 = re * (im * im)
	tmp = 0
	if im <= 650.0:
		tmp = t_1
	elif im <= 1.32e+57:
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666))
	elif im <= 1.9e+100:
		tmp = ((re * re) - (0.25 * (t_2 * t_2))) / (re + ((re * im) * (im * -0.5)))
	elif im <= 9.2e+112:
		tmp = re * t_0
	elif im <= 1.26e+154:
		tmp = 0.08333333333333333 + (0.25 / (re * re))
	else:
		tmp = t_1
	return tmp
function code(re, im)
	t_0 = Float64(Float64(0.5 * Float64(im * im)) + 1.0)
	t_1 = Float64(sin(re) * t_0)
	t_2 = Float64(re * Float64(im * im))
	tmp = 0.0
	if (im <= 650.0)
		tmp = t_1;
	elseif (im <= 1.32e+57)
		tmp = Float64(0.08333333333333333 + Float64(re * Float64(re * 0.016666666666666666)));
	elseif (im <= 1.9e+100)
		tmp = Float64(Float64(Float64(re * re) - Float64(0.25 * Float64(t_2 * t_2))) / Float64(re + Float64(Float64(re * im) * Float64(im * -0.5))));
	elseif (im <= 9.2e+112)
		tmp = Float64(re * t_0);
	elseif (im <= 1.26e+154)
		tmp = Float64(0.08333333333333333 + Float64(0.25 / Float64(re * re)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = (0.5 * (im * im)) + 1.0;
	t_1 = sin(re) * t_0;
	t_2 = re * (im * im);
	tmp = 0.0;
	if (im <= 650.0)
		tmp = t_1;
	elseif (im <= 1.32e+57)
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	elseif (im <= 1.9e+100)
		tmp = ((re * re) - (0.25 * (t_2 * t_2))) / (re + ((re * im) * (im * -0.5)));
	elseif (im <= 9.2e+112)
		tmp = re * t_0;
	elseif (im <= 1.26e+154)
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[re], $MachinePrecision] * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 650.0], t$95$1, If[LessEqual[im, 1.32e+57], N[(0.08333333333333333 + N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 1.9e+100], N[(N[(N[(re * re), $MachinePrecision] - N[(0.25 * N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(re + N[(N[(re * im), $MachinePrecision] * N[(im * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 9.2e+112], N[(re * t$95$0), $MachinePrecision], If[LessEqual[im, 1.26e+154], N[(0.08333333333333333 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(im \cdot im\right) + 1\\
t_1 := \sin re \cdot t_0\\
t_2 := re \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq 650:\\
\;\;\;\;t_1\\

\mathbf{elif}\;im \leq 1.32 \cdot 10^{+57}:\\
\;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\

\mathbf{elif}\;im \leq 1.9 \cdot 10^{+100}:\\
\;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_2 \cdot t_2\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\

\mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\
\;\;\;\;re \cdot t_0\\

\mathbf{elif}\;im \leq 1.26 \cdot 10^{+154}:\\
\;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if im < 650 or 1.26e154 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 85.7%

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

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

    if 650 < im < 1.32000000000000001e57

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr12.8%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative29.0%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def29.0%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow229.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/29.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval29.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow229.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified29.0%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]
    8. Taylor expanded in re around inf 18.3%

      \[\leadsto \color{blue}{0.08333333333333333 + 0.016666666666666666 \cdot {re}^{2}} \]
    9. Step-by-step derivation
      1. +-commutative18.3%

        \[\leadsto \color{blue}{0.016666666666666666 \cdot {re}^{2} + 0.08333333333333333} \]
      2. *-commutative18.3%

        \[\leadsto \color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.08333333333333333 \]
      3. unpow218.3%

        \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot 0.016666666666666666 + 0.08333333333333333 \]
      4. associate-*l*18.3%

        \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right)} + 0.08333333333333333 \]
    10. Simplified18.3%

      \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right) + 0.08333333333333333} \]

    if 1.32000000000000001e57 < im < 1.89999999999999982e100

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 3.9%

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

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

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

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

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in4.1%

        \[\leadsto \color{blue}{1 \cdot re + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. *-un-lft-identity4.1%

        \[\leadsto \color{blue}{re} + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re \]
      3. flip-+35.2%

        \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re}} \]
      4. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      5. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)} \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      6. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      7. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      8. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)}}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      9. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      10. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re} \]
      11. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)}} \]
      12. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)} \]
    10. Applied egg-rr35.2%

      \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)}} \]
    11. Step-by-step derivation
      1. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(0.5 \cdot im\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      2. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)\right)} \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      3. associate-*l*35.2%

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      5. *-commutative35.2%

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

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot re\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      8. unpow235.2%

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      9. swap-sqr35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      10. metadata-eval35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{0.25} \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      11. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\color{blue}{\left(re \cdot {im}^{2}\right)} \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      12. unpow235.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      13. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(re \cdot {im}^{2}\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      14. unpow235.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
    12. Simplified35.2%

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

    if 1.89999999999999982e100 < im < 9.1999999999999999e112

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.3%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified80.6%

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

    if 9.1999999999999999e112 < im < 1.26e154

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr34.5%

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

      \[\leadsto \color{blue}{0.08333333333333333 + 0.25 \cdot \frac{1}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. associate-*r/34.5%

        \[\leadsto 0.08333333333333333 + \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}} \]
      2. metadata-eval34.5%

        \[\leadsto 0.08333333333333333 + \frac{\color{blue}{0.25}}{{re}^{2}} \]
      3. unpow234.5%

        \[\leadsto 0.08333333333333333 + \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified34.5%

      \[\leadsto \color{blue}{0.08333333333333333 + \frac{0.25}{re \cdot re}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification76.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 650:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 1.32 \cdot 10^{+57}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;im \leq 1.9 \cdot 10^{+100}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \left(im \cdot im\right)\right)\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{elif}\;im \leq 1.26 \cdot 10^{+154}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{else}:\\ \;\;\;\;\sin re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \end{array} \]

Alternative 10: 62.3% accurate, 3.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot \left(im \cdot im\right)\\ \mathbf{if}\;im \leq 520:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 4.3 \cdot 10^{+57}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;im \leq 2.1 \cdot 10^{+100}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_0 \cdot t_0\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112} \lor \neg \left(im \leq 1.4 \cdot 10^{+153}\right):\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* re (* im im))))
   (if (<= im 520.0)
     (sin re)
     (if (<= im 4.3e+57)
       (+ 0.08333333333333333 (* re (* re 0.016666666666666666)))
       (if (<= im 2.1e+100)
         (/
          (- (* re re) (* 0.25 (* t_0 t_0)))
          (+ re (* (* re im) (* im -0.5))))
         (if (or (<= im 9.5e+112) (not (<= im 1.4e+153)))
           (* re (+ (* 0.5 (* im im)) 1.0))
           (+ 0.08333333333333333 (/ 0.25 (* re re)))))))))
double code(double re, double im) {
	double t_0 = re * (im * im);
	double tmp;
	if (im <= 520.0) {
		tmp = sin(re);
	} else if (im <= 4.3e+57) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (im <= 2.1e+100) {
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)));
	} else if ((im <= 9.5e+112) || !(im <= 1.4e+153)) {
		tmp = re * ((0.5 * (im * im)) + 1.0);
	} else {
		tmp = 0.08333333333333333 + (0.25 / (re * 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 * (im * im)
    if (im <= 520.0d0) then
        tmp = sin(re)
    else if (im <= 4.3d+57) then
        tmp = 0.08333333333333333d0 + (re * (re * 0.016666666666666666d0))
    else if (im <= 2.1d+100) then
        tmp = ((re * re) - (0.25d0 * (t_0 * t_0))) / (re + ((re * im) * (im * (-0.5d0))))
    else if ((im <= 9.5d+112) .or. (.not. (im <= 1.4d+153))) then
        tmp = re * ((0.5d0 * (im * im)) + 1.0d0)
    else
        tmp = 0.08333333333333333d0 + (0.25d0 / (re * re))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = re * (im * im);
	double tmp;
	if (im <= 520.0) {
		tmp = Math.sin(re);
	} else if (im <= 4.3e+57) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (im <= 2.1e+100) {
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)));
	} else if ((im <= 9.5e+112) || !(im <= 1.4e+153)) {
		tmp = re * ((0.5 * (im * im)) + 1.0);
	} else {
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	}
	return tmp;
}
def code(re, im):
	t_0 = re * (im * im)
	tmp = 0
	if im <= 520.0:
		tmp = math.sin(re)
	elif im <= 4.3e+57:
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666))
	elif im <= 2.1e+100:
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)))
	elif (im <= 9.5e+112) or not (im <= 1.4e+153):
		tmp = re * ((0.5 * (im * im)) + 1.0)
	else:
		tmp = 0.08333333333333333 + (0.25 / (re * re))
	return tmp
function code(re, im)
	t_0 = Float64(re * Float64(im * im))
	tmp = 0.0
	if (im <= 520.0)
		tmp = sin(re);
	elseif (im <= 4.3e+57)
		tmp = Float64(0.08333333333333333 + Float64(re * Float64(re * 0.016666666666666666)));
	elseif (im <= 2.1e+100)
		tmp = Float64(Float64(Float64(re * re) - Float64(0.25 * Float64(t_0 * t_0))) / Float64(re + Float64(Float64(re * im) * Float64(im * -0.5))));
	elseif ((im <= 9.5e+112) || !(im <= 1.4e+153))
		tmp = Float64(re * Float64(Float64(0.5 * Float64(im * im)) + 1.0));
	else
		tmp = Float64(0.08333333333333333 + Float64(0.25 / Float64(re * re)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re * (im * im);
	tmp = 0.0;
	if (im <= 520.0)
		tmp = sin(re);
	elseif (im <= 4.3e+57)
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	elseif (im <= 2.1e+100)
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)));
	elseif ((im <= 9.5e+112) || ~((im <= 1.4e+153)))
		tmp = re * ((0.5 * (im * im)) + 1.0);
	else
		tmp = 0.08333333333333333 + (0.25 / (re * re));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 520.0], N[Sin[re], $MachinePrecision], If[LessEqual[im, 4.3e+57], N[(0.08333333333333333 + N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 2.1e+100], N[(N[(N[(re * re), $MachinePrecision] - N[(0.25 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(re + N[(N[(re * im), $MachinePrecision] * N[(im * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[im, 9.5e+112], N[Not[LessEqual[im, 1.4e+153]], $MachinePrecision]], N[(re * N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(0.08333333333333333 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := re \cdot \left(im \cdot im\right)\\
\mathbf{if}\;im \leq 520:\\
\;\;\;\;\sin re\\

\mathbf{elif}\;im \leq 4.3 \cdot 10^{+57}:\\
\;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\

\mathbf{elif}\;im \leq 2.1 \cdot 10^{+100}:\\
\;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_0 \cdot t_0\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\

\mathbf{elif}\;im \leq 9.5 \cdot 10^{+112} \lor \neg \left(im \leq 1.4 \cdot 10^{+153}\right):\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\

\mathbf{else}:\\
\;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\


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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 67.4%

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

    if 520 < im < 4.30000000000000033e57

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr12.8%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative29.0%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def29.0%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow229.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/29.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval29.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow229.0%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified29.0%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]
    8. Taylor expanded in re around inf 18.3%

      \[\leadsto \color{blue}{0.08333333333333333 + 0.016666666666666666 \cdot {re}^{2}} \]
    9. Step-by-step derivation
      1. +-commutative18.3%

        \[\leadsto \color{blue}{0.016666666666666666 \cdot {re}^{2} + 0.08333333333333333} \]
      2. *-commutative18.3%

        \[\leadsto \color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.08333333333333333 \]
      3. unpow218.3%

        \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot 0.016666666666666666 + 0.08333333333333333 \]
      4. associate-*l*18.3%

        \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right)} + 0.08333333333333333 \]
    10. Simplified18.3%

      \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right) + 0.08333333333333333} \]

    if 4.30000000000000033e57 < im < 2.0999999999999999e100

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 3.9%

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

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

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

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

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in4.1%

        \[\leadsto \color{blue}{1 \cdot re + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. *-un-lft-identity4.1%

        \[\leadsto \color{blue}{re} + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re \]
      3. flip-+35.2%

        \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re}} \]
      4. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      5. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)} \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      6. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      7. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      8. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)}}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      9. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      10. associate-*r*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re} \]
      11. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)}} \]
      12. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)} \]
    10. Applied egg-rr35.2%

      \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)}} \]
    11. Step-by-step derivation
      1. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(0.5 \cdot im\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      2. associate-*l*35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)\right)} \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      3. associate-*l*35.2%

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      5. *-commutative35.2%

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

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot re\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      8. unpow235.2%

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      9. swap-sqr35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      10. metadata-eval35.2%

        \[\leadsto \frac{re \cdot re - \color{blue}{0.25} \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      11. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\color{blue}{\left(re \cdot {im}^{2}\right)} \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      12. unpow235.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      13. *-commutative35.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(re \cdot {im}^{2}\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      14. unpow235.2%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
    12. Simplified35.2%

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

    if 2.0999999999999999e100 < im < 9.5000000000000008e112 or 1.39999999999999993e153 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 83.7%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified76.0%

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

    if 9.5000000000000008e112 < im < 1.39999999999999993e153

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr34.5%

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

      \[\leadsto \color{blue}{0.08333333333333333 + 0.25 \cdot \frac{1}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. associate-*r/34.5%

        \[\leadsto 0.08333333333333333 + \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}} \]
      2. metadata-eval34.5%

        \[\leadsto 0.08333333333333333 + \frac{\color{blue}{0.25}}{{re}^{2}} \]
      3. unpow234.5%

        \[\leadsto 0.08333333333333333 + \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified34.5%

      \[\leadsto \color{blue}{0.08333333333333333 + \frac{0.25}{re \cdot re}} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification62.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 520:\\ \;\;\;\;\sin re\\ \mathbf{elif}\;im \leq 4.3 \cdot 10^{+57}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;im \leq 2.1 \cdot 10^{+100}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \left(im \cdot im\right)\right)\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112} \lor \neg \left(im \leq 1.4 \cdot 10^{+153}\right):\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \end{array} \]

Alternative 11: 45.3% accurate, 9.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := re \cdot \left(im \cdot im\right)\\ \mathbf{if}\;re \leq -1.16 \cdot 10^{+156}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;re \leq -1 \cdot 10^{-132}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_0 \cdot t_0\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{-242} \lor \neg \left(re \leq 3 \cdot 10^{-191}\right):\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (* re (* im im))))
   (if (<= re -1.16e+156)
     (+ 0.08333333333333333 (* re (* re 0.016666666666666666)))
     (if (<= re -1e-132)
       (/ (- (* re re) (* 0.25 (* t_0 t_0))) (+ re (* (* re im) (* im -0.5))))
       (if (or (<= re 1.9e-242) (not (<= re 3e-191)))
         (* re (+ (* 0.5 (* im im)) 1.0))
         (/ 0.25 (* re re)))))))
double code(double re, double im) {
	double t_0 = re * (im * im);
	double tmp;
	if (re <= -1.16e+156) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (re <= -1e-132) {
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)));
	} else if ((re <= 1.9e-242) || !(re <= 3e-191)) {
		tmp = re * ((0.5 * (im * im)) + 1.0);
	} else {
		tmp = 0.25 / (re * 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 * (im * im)
    if (re <= (-1.16d+156)) then
        tmp = 0.08333333333333333d0 + (re * (re * 0.016666666666666666d0))
    else if (re <= (-1d-132)) then
        tmp = ((re * re) - (0.25d0 * (t_0 * t_0))) / (re + ((re * im) * (im * (-0.5d0))))
    else if ((re <= 1.9d-242) .or. (.not. (re <= 3d-191))) then
        tmp = re * ((0.5d0 * (im * im)) + 1.0d0)
    else
        tmp = 0.25d0 / (re * re)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = re * (im * im);
	double tmp;
	if (re <= -1.16e+156) {
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	} else if (re <= -1e-132) {
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)));
	} else if ((re <= 1.9e-242) || !(re <= 3e-191)) {
		tmp = re * ((0.5 * (im * im)) + 1.0);
	} else {
		tmp = 0.25 / (re * re);
	}
	return tmp;
}
def code(re, im):
	t_0 = re * (im * im)
	tmp = 0
	if re <= -1.16e+156:
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666))
	elif re <= -1e-132:
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)))
	elif (re <= 1.9e-242) or not (re <= 3e-191):
		tmp = re * ((0.5 * (im * im)) + 1.0)
	else:
		tmp = 0.25 / (re * re)
	return tmp
function code(re, im)
	t_0 = Float64(re * Float64(im * im))
	tmp = 0.0
	if (re <= -1.16e+156)
		tmp = Float64(0.08333333333333333 + Float64(re * Float64(re * 0.016666666666666666)));
	elseif (re <= -1e-132)
		tmp = Float64(Float64(Float64(re * re) - Float64(0.25 * Float64(t_0 * t_0))) / Float64(re + Float64(Float64(re * im) * Float64(im * -0.5))));
	elseif ((re <= 1.9e-242) || !(re <= 3e-191))
		tmp = Float64(re * Float64(Float64(0.5 * Float64(im * im)) + 1.0));
	else
		tmp = Float64(0.25 / Float64(re * re));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = re * (im * im);
	tmp = 0.0;
	if (re <= -1.16e+156)
		tmp = 0.08333333333333333 + (re * (re * 0.016666666666666666));
	elseif (re <= -1e-132)
		tmp = ((re * re) - (0.25 * (t_0 * t_0))) / (re + ((re * im) * (im * -0.5)));
	elseif ((re <= 1.9e-242) || ~((re <= 3e-191)))
		tmp = re * ((0.5 * (im * im)) + 1.0);
	else
		tmp = 0.25 / (re * re);
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(re * N[(im * im), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[re, -1.16e+156], N[(0.08333333333333333 + N[(re * N[(re * 0.016666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[re, -1e-132], N[(N[(N[(re * re), $MachinePrecision] - N[(0.25 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(re + N[(N[(re * im), $MachinePrecision] * N[(im * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[re, 1.9e-242], N[Not[LessEqual[re, 3e-191]], $MachinePrecision]], N[(re * N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := re \cdot \left(im \cdot im\right)\\
\mathbf{if}\;re \leq -1.16 \cdot 10^{+156}:\\
\;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\

\mathbf{elif}\;re \leq -1 \cdot 10^{-132}:\\
\;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(t_0 \cdot t_0\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\

\mathbf{elif}\;re \leq 1.9 \cdot 10^{-242} \lor \neg \left(re \leq 3 \cdot 10^{-191}\right):\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\


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

    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-lft-in99.9%

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

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

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out99.9%

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

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out99.9%

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

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*99.9%

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr6.6%

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

      \[\leadsto \color{blue}{0.08333333333333333 + \left(0.016666666666666666 \cdot {re}^{2} + 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
    6. Step-by-step derivation
      1. *-commutative34.3%

        \[\leadsto 0.08333333333333333 + \left(\color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      2. fma-def34.3%

        \[\leadsto 0.08333333333333333 + \color{blue}{\mathsf{fma}\left({re}^{2}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right)} \]
      3. unpow234.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(\color{blue}{re \cdot re}, 0.016666666666666666, 0.25 \cdot \frac{1}{{re}^{2}}\right) \]
      4. associate-*r/34.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}}\right) \]
      5. metadata-eval34.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{\color{blue}{0.25}}{{re}^{2}}\right) \]
      6. unpow234.3%

        \[\leadsto 0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{\color{blue}{re \cdot re}}\right) \]
    7. Simplified34.3%

      \[\leadsto \color{blue}{0.08333333333333333 + \mathsf{fma}\left(re \cdot re, 0.016666666666666666, \frac{0.25}{re \cdot re}\right)} \]
    8. Taylor expanded in re around inf 34.3%

      \[\leadsto \color{blue}{0.08333333333333333 + 0.016666666666666666 \cdot {re}^{2}} \]
    9. Step-by-step derivation
      1. +-commutative34.3%

        \[\leadsto \color{blue}{0.016666666666666666 \cdot {re}^{2} + 0.08333333333333333} \]
      2. *-commutative34.3%

        \[\leadsto \color{blue}{{re}^{2} \cdot 0.016666666666666666} + 0.08333333333333333 \]
      3. unpow234.3%

        \[\leadsto \color{blue}{\left(re \cdot re\right)} \cdot 0.016666666666666666 + 0.08333333333333333 \]
      4. associate-*l*34.3%

        \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right)} + 0.08333333333333333 \]
    10. Simplified34.3%

      \[\leadsto \color{blue}{re \cdot \left(re \cdot 0.016666666666666666\right) + 0.08333333333333333} \]

    if -1.16e156 < re < -9.9999999999999999e-133

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 73.6%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified42.0%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Step-by-step derivation
      1. distribute-rgt-in42.0%

        \[\leadsto \color{blue}{1 \cdot re + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      2. *-un-lft-identity42.0%

        \[\leadsto \color{blue}{re} + \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re \]
      3. flip-+47.3%

        \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re}} \]
      4. associate-*r*47.3%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      5. associate-*l*47.3%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)\right)} \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      6. *-commutative47.3%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      7. associate-*r*47.3%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      8. associate-*l*47.3%

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

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)\right)}{re - \left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
      10. associate-*r*47.3%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(\left(0.5 \cdot im\right) \cdot im\right)} \cdot re} \]
      11. associate-*l*48.8%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(0.5 \cdot im\right) \cdot \left(im \cdot re\right)}} \]
      12. *-commutative48.8%

        \[\leadsto \frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \color{blue}{\left(im \cdot 0.5\right)} \cdot \left(im \cdot re\right)} \]
    10. Applied egg-rr48.8%

      \[\leadsto \color{blue}{\frac{re \cdot re - \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

        \[\leadsto \frac{re \cdot re - \left(\color{blue}{\left(0.5 \cdot im\right)} \cdot \left(im \cdot re\right)\right) \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      2. associate-*l*48.8%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot \left(im \cdot \left(im \cdot re\right)\right)\right)} \cdot \left(\left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      3. associate-*l*48.8%

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

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

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

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

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \color{blue}{\left(\left(im \cdot im\right) \cdot re\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      8. unpow248.8%

        \[\leadsto \frac{re \cdot re - \left(0.5 \cdot \left({im}^{2} \cdot re\right)\right) \cdot \left(0.5 \cdot \left(\color{blue}{{im}^{2}} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      9. swap-sqr48.8%

        \[\leadsto \frac{re \cdot re - \color{blue}{\left(0.5 \cdot 0.5\right) \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      10. metadata-eval48.8%

        \[\leadsto \frac{re \cdot re - \color{blue}{0.25} \cdot \left(\left({im}^{2} \cdot re\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      11. *-commutative48.8%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\color{blue}{\left(re \cdot {im}^{2}\right)} \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      12. unpow248.8%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot \left({im}^{2} \cdot re\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      13. *-commutative48.8%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \color{blue}{\left(re \cdot {im}^{2}\right)}\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
      14. unpow248.8%

        \[\leadsto \frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \color{blue}{\left(im \cdot im\right)}\right)\right)}{re - \left(im \cdot 0.5\right) \cdot \left(im \cdot re\right)} \]
    12. Simplified48.8%

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

    if -9.9999999999999999e-133 < re < 1.9000000000000001e-242 or 3.0000000000000001e-191 < 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-lft-in100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 74.8%

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

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

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

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified54.0%

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

    if 1.9000000000000001e-242 < re < 3.0000000000000001e-191

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr86.0%

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

      \[\leadsto \color{blue}{\frac{0.25}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. unpow286.0%

        \[\leadsto \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified86.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq -1.16 \cdot 10^{+156}:\\ \;\;\;\;0.08333333333333333 + re \cdot \left(re \cdot 0.016666666666666666\right)\\ \mathbf{elif}\;re \leq -1 \cdot 10^{-132}:\\ \;\;\;\;\frac{re \cdot re - 0.25 \cdot \left(\left(re \cdot \left(im \cdot im\right)\right) \cdot \left(re \cdot \left(im \cdot im\right)\right)\right)}{re + \left(re \cdot im\right) \cdot \left(im \cdot -0.5\right)}\\ \mathbf{elif}\;re \leq 1.9 \cdot 10^{-242} \lor \neg \left(re \leq 3 \cdot 10^{-191}\right):\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \end{array} \]

Alternative 12: 34.6% accurate, 20.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{elif}\;im \leq 1.25 \cdot 10^{+100} \lor \neg \left(im \leq 9.2 \cdot 10^{+112}\right) \land im \leq 2.8 \cdot 10^{+170}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (<= im 9.2e-7)
   re
   (if (or (<= im 1.25e+100) (and (not (<= im 9.2e+112)) (<= im 2.8e+170)))
     (/ 0.25 (* re re))
     (* im (* im (* 0.5 re))))))
double code(double re, double im) {
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else if ((im <= 1.25e+100) || (!(im <= 9.2e+112) && (im <= 2.8e+170))) {
		tmp = 0.25 / (re * re);
	} else {
		tmp = 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) :: tmp
    if (im <= 9.2d-7) then
        tmp = re
    else if ((im <= 1.25d+100) .or. (.not. (im <= 9.2d+112)) .and. (im <= 2.8d+170)) then
        tmp = 0.25d0 / (re * re)
    else
        tmp = im * (im * (0.5d0 * re))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else if ((im <= 1.25e+100) || (!(im <= 9.2e+112) && (im <= 2.8e+170))) {
		tmp = 0.25 / (re * re);
	} else {
		tmp = im * (im * (0.5 * re));
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 9.2e-7:
		tmp = re
	elif (im <= 1.25e+100) or (not (im <= 9.2e+112) and (im <= 2.8e+170)):
		tmp = 0.25 / (re * re)
	else:
		tmp = im * (im * (0.5 * re))
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 9.2e-7)
		tmp = re;
	elseif ((im <= 1.25e+100) || (!(im <= 9.2e+112) && (im <= 2.8e+170)))
		tmp = Float64(0.25 / Float64(re * re));
	else
		tmp = Float64(im * Float64(im * Float64(0.5 * re)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 9.2e-7)
		tmp = re;
	elseif ((im <= 1.25e+100) || (~((im <= 9.2e+112)) && (im <= 2.8e+170)))
		tmp = 0.25 / (re * re);
	else
		tmp = im * (im * (0.5 * re));
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 9.2e-7], re, If[Or[LessEqual[im, 1.25e+100], And[N[Not[LessEqual[im, 9.2e+112]], $MachinePrecision], LessEqual[im, 2.8e+170]]], N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision], N[(im * N[(im * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

\mathbf{elif}\;im \leq 1.25 \cdot 10^{+100} \lor \neg \left(im \leq 9.2 \cdot 10^{+112}\right) \land im \leq 2.8 \cdot 10^{+170}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 84.1%

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

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

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

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

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

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

    if 9.1999999999999998e-7 < im < 1.25e100 or 9.1999999999999999e112 < im < 2.80000000000000015e170

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr25.7%

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

      \[\leadsto \color{blue}{\frac{0.25}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. unpow225.0%

        \[\leadsto \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified25.0%

      \[\leadsto \color{blue}{\frac{0.25}{re \cdot re}} \]

    if 1.25e100 < im < 9.1999999999999999e112 or 2.80000000000000015e170 < 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-lft-in100.0%

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

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

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 82.5%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified82.5%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in im around inf 82.5%

      \[\leadsto \color{blue}{0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    7. Step-by-step derivation
      1. unpow282.5%

        \[\leadsto 0.5 \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \sin re\right) \]
      2. associate-*r*61.4%

        \[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot \left(im \cdot \sin re\right)\right)} \]
      3. *-commutative61.4%

        \[\leadsto \color{blue}{\left(im \cdot \left(im \cdot \sin re\right)\right) \cdot 0.5} \]
      4. associate-*l*61.4%

        \[\leadsto \color{blue}{im \cdot \left(\left(im \cdot \sin re\right) \cdot 0.5\right)} \]
      5. associate-*r*61.4%

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(\sin re \cdot 0.5\right)\right)} \]
    8. Simplified61.4%

      \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\sin re \cdot 0.5\right)\right)} \]
    9. Taylor expanded in re around 0 53.1%

      \[\leadsto im \cdot \color{blue}{\left(0.5 \cdot \left(im \cdot re\right)\right)} \]
    10. Step-by-step derivation
      1. *-commutative53.1%

        \[\leadsto im \cdot \color{blue}{\left(\left(im \cdot re\right) \cdot 0.5\right)} \]
      2. associate-*l*53.1%

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]
    11. Simplified53.1%

      \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification37.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{elif}\;im \leq 1.25 \cdot 10^{+100} \lor \neg \left(im \leq 9.2 \cdot 10^{+112}\right) \land im \leq 2.8 \cdot 10^{+170}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \mathbf{else}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\ \end{array} \]

Alternative 13: 37.8% accurate, 20.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{0.25}{re \cdot re}\\ \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{elif}\;im \leq 10^{+100}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+153}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (/ 0.25 (* re re))))
   (if (<= im 9.2e-7)
     re
     (if (<= im 1e+100)
       t_0
       (if (<= im 9.5e+112)
         (* im (* im (* 0.5 re)))
         (if (<= im 5.4e+153) t_0 (* re (* 0.5 (* im im)))))))))
double code(double re, double im) {
	double t_0 = 0.25 / (re * re);
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else if (im <= 1e+100) {
		tmp = t_0;
	} else if (im <= 9.5e+112) {
		tmp = im * (im * (0.5 * re));
	} else if (im <= 5.4e+153) {
		tmp = t_0;
	} else {
		tmp = re * (0.5 * (im * im));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.25d0 / (re * re)
    if (im <= 9.2d-7) then
        tmp = re
    else if (im <= 1d+100) then
        tmp = t_0
    else if (im <= 9.5d+112) then
        tmp = im * (im * (0.5d0 * re))
    else if (im <= 5.4d+153) then
        tmp = t_0
    else
        tmp = re * (0.5d0 * (im * im))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = 0.25 / (re * re);
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else if (im <= 1e+100) {
		tmp = t_0;
	} else if (im <= 9.5e+112) {
		tmp = im * (im * (0.5 * re));
	} else if (im <= 5.4e+153) {
		tmp = t_0;
	} else {
		tmp = re * (0.5 * (im * im));
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.25 / (re * re)
	tmp = 0
	if im <= 9.2e-7:
		tmp = re
	elif im <= 1e+100:
		tmp = t_0
	elif im <= 9.5e+112:
		tmp = im * (im * (0.5 * re))
	elif im <= 5.4e+153:
		tmp = t_0
	else:
		tmp = re * (0.5 * (im * im))
	return tmp
function code(re, im)
	t_0 = Float64(0.25 / Float64(re * re))
	tmp = 0.0
	if (im <= 9.2e-7)
		tmp = re;
	elseif (im <= 1e+100)
		tmp = t_0;
	elseif (im <= 9.5e+112)
		tmp = Float64(im * Float64(im * Float64(0.5 * re)));
	elseif (im <= 5.4e+153)
		tmp = t_0;
	else
		tmp = Float64(re * Float64(0.5 * Float64(im * im)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.25 / (re * re);
	tmp = 0.0;
	if (im <= 9.2e-7)
		tmp = re;
	elseif (im <= 1e+100)
		tmp = t_0;
	elseif (im <= 9.5e+112)
		tmp = im * (im * (0.5 * re));
	elseif (im <= 5.4e+153)
		tmp = t_0;
	else
		tmp = re * (0.5 * (im * im));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 9.2e-7], re, If[LessEqual[im, 1e+100], t$95$0, If[LessEqual[im, 9.5e+112], N[(im * N[(im * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 5.4e+153], t$95$0, N[(re * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{0.25}{re \cdot re}\\
\mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;re\\

\mathbf{elif}\;im \leq 10^{+100}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\
\;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\

\mathbf{elif}\;im \leq 5.4 \cdot 10^{+153}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < 9.1999999999999998e-7

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 84.1%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified84.1%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in re around 0 51.8%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
    7. Step-by-step derivation
      1. unpow251.8%

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified51.8%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Taylor expanded in im around 0 37.6%

      \[\leadsto \color{blue}{re} \]

    if 9.1999999999999998e-7 < im < 1.00000000000000002e100 or 9.5000000000000008e112 < im < 5.4000000000000001e153

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr24.4%

      \[\leadsto \color{blue}{{\left(\sin re \cdot -2\right)}^{-2}} \]
    5. Taylor expanded in re around 0 23.7%

      \[\leadsto \color{blue}{\frac{0.25}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. unpow223.7%

        \[\leadsto \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified23.7%

      \[\leadsto \color{blue}{\frac{0.25}{re \cdot re}} \]

    if 1.00000000000000002e100 < im < 9.5000000000000008e112

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.3%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified5.3%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in im around inf 5.3%

      \[\leadsto \color{blue}{0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    7. Step-by-step derivation
      1. unpow25.3%

        \[\leadsto 0.5 \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \sin re\right) \]
      2. associate-*r*5.3%

        \[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot \left(im \cdot \sin re\right)\right)} \]
      3. *-commutative5.3%

        \[\leadsto \color{blue}{\left(im \cdot \left(im \cdot \sin re\right)\right) \cdot 0.5} \]
      4. associate-*l*5.3%

        \[\leadsto \color{blue}{im \cdot \left(\left(im \cdot \sin re\right) \cdot 0.5\right)} \]
      5. associate-*r*5.3%

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(\sin re \cdot 0.5\right)\right)} \]
    8. Simplified5.3%

      \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\sin re \cdot 0.5\right)\right)} \]
    9. Taylor expanded in re around 0 80.6%

      \[\leadsto im \cdot \color{blue}{\left(0.5 \cdot \left(im \cdot re\right)\right)} \]
    10. Step-by-step derivation
      1. *-commutative80.6%

        \[\leadsto im \cdot \color{blue}{\left(\left(im \cdot re\right) \cdot 0.5\right)} \]
      2. associate-*l*80.6%

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]
    11. Simplified80.6%

      \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]

    if 5.4000000000000001e153 < 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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 100.0%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in re around 0 75.0%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
    7. Step-by-step derivation
      1. unpow275.0%

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified75.0%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Taylor expanded in im around inf 75.0%

      \[\leadsto \color{blue}{0.5 \cdot \left({im}^{2} \cdot re\right)} \]
    10. Step-by-step derivation
      1. associate-*r*75.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot {im}^{2}\right) \cdot re} \]
      2. unpow275.0%

        \[\leadsto \left(0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot re \]
    11. Simplified75.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification39.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{elif}\;im \leq 10^{+100}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \mathbf{elif}\;im \leq 9.5 \cdot 10^{+112}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\ \mathbf{elif}\;im \leq 5.4 \cdot 10^{+153}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]

Alternative 14: 37.8% accurate, 20.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{elif}\;im \leq 8.8 \cdot 10^{+99}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\ \mathbf{elif}\;im \leq 3.7 \cdot 10^{+152}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (let* ((t_0 (+ 0.08333333333333333 (/ 0.25 (* re re)))))
   (if (<= im 9.2e-7)
     re
     (if (<= im 8.8e+99)
       t_0
       (if (<= im 9.2e+112)
         (* im (* im (* 0.5 re)))
         (if (<= im 3.7e+152) t_0 (* re (* 0.5 (* im im)))))))))
double code(double re, double im) {
	double t_0 = 0.08333333333333333 + (0.25 / (re * re));
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else if (im <= 8.8e+99) {
		tmp = t_0;
	} else if (im <= 9.2e+112) {
		tmp = im * (im * (0.5 * re));
	} else if (im <= 3.7e+152) {
		tmp = t_0;
	} else {
		tmp = re * (0.5 * (im * im));
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = 0.08333333333333333d0 + (0.25d0 / (re * re))
    if (im <= 9.2d-7) then
        tmp = re
    else if (im <= 8.8d+99) then
        tmp = t_0
    else if (im <= 9.2d+112) then
        tmp = im * (im * (0.5d0 * re))
    else if (im <= 3.7d+152) then
        tmp = t_0
    else
        tmp = re * (0.5d0 * (im * im))
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double t_0 = 0.08333333333333333 + (0.25 / (re * re));
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else if (im <= 8.8e+99) {
		tmp = t_0;
	} else if (im <= 9.2e+112) {
		tmp = im * (im * (0.5 * re));
	} else if (im <= 3.7e+152) {
		tmp = t_0;
	} else {
		tmp = re * (0.5 * (im * im));
	}
	return tmp;
}
def code(re, im):
	t_0 = 0.08333333333333333 + (0.25 / (re * re))
	tmp = 0
	if im <= 9.2e-7:
		tmp = re
	elif im <= 8.8e+99:
		tmp = t_0
	elif im <= 9.2e+112:
		tmp = im * (im * (0.5 * re))
	elif im <= 3.7e+152:
		tmp = t_0
	else:
		tmp = re * (0.5 * (im * im))
	return tmp
function code(re, im)
	t_0 = Float64(0.08333333333333333 + Float64(0.25 / Float64(re * re)))
	tmp = 0.0
	if (im <= 9.2e-7)
		tmp = re;
	elseif (im <= 8.8e+99)
		tmp = t_0;
	elseif (im <= 9.2e+112)
		tmp = Float64(im * Float64(im * Float64(0.5 * re)));
	elseif (im <= 3.7e+152)
		tmp = t_0;
	else
		tmp = Float64(re * Float64(0.5 * Float64(im * im)));
	end
	return tmp
end
function tmp_2 = code(re, im)
	t_0 = 0.08333333333333333 + (0.25 / (re * re));
	tmp = 0.0;
	if (im <= 9.2e-7)
		tmp = re;
	elseif (im <= 8.8e+99)
		tmp = t_0;
	elseif (im <= 9.2e+112)
		tmp = im * (im * (0.5 * re));
	elseif (im <= 3.7e+152)
		tmp = t_0;
	else
		tmp = re * (0.5 * (im * im));
	end
	tmp_2 = tmp;
end
code[re_, im_] := Block[{t$95$0 = N[(0.08333333333333333 + N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[im, 9.2e-7], re, If[LessEqual[im, 8.8e+99], t$95$0, If[LessEqual[im, 9.2e+112], N[(im * N[(im * N[(0.5 * re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[im, 3.7e+152], t$95$0, N[(re * N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.08333333333333333 + \frac{0.25}{re \cdot re}\\
\mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;re\\

\mathbf{elif}\;im \leq 8.8 \cdot 10^{+99}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\
\;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\

\mathbf{elif}\;im \leq 3.7 \cdot 10^{+152}:\\
\;\;\;\;t_0\\

\mathbf{else}:\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if im < 9.1999999999999998e-7

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 84.1%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified84.1%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in re around 0 51.8%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
    7. Step-by-step derivation
      1. unpow251.8%

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified51.8%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Taylor expanded in im around 0 37.6%

      \[\leadsto \color{blue}{re} \]

    if 9.1999999999999998e-7 < im < 8.79999999999999913e99 or 9.1999999999999999e112 < im < 3.69999999999999996e152

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr24.4%

      \[\leadsto \color{blue}{{\left(\sin re \cdot -2\right)}^{-2}} \]
    5. Taylor expanded in re around 0 24.3%

      \[\leadsto \color{blue}{0.08333333333333333 + 0.25 \cdot \frac{1}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. associate-*r/24.3%

        \[\leadsto 0.08333333333333333 + \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}} \]
      2. metadata-eval24.3%

        \[\leadsto 0.08333333333333333 + \frac{\color{blue}{0.25}}{{re}^{2}} \]
      3. unpow224.3%

        \[\leadsto 0.08333333333333333 + \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified24.3%

      \[\leadsto \color{blue}{0.08333333333333333 + \frac{0.25}{re \cdot re}} \]

    if 8.79999999999999913e99 < im < 9.1999999999999999e112

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 5.3%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified5.3%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in im around inf 5.3%

      \[\leadsto \color{blue}{0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    7. Step-by-step derivation
      1. unpow25.3%

        \[\leadsto 0.5 \cdot \left(\color{blue}{\left(im \cdot im\right)} \cdot \sin re\right) \]
      2. associate-*r*5.3%

        \[\leadsto 0.5 \cdot \color{blue}{\left(im \cdot \left(im \cdot \sin re\right)\right)} \]
      3. *-commutative5.3%

        \[\leadsto \color{blue}{\left(im \cdot \left(im \cdot \sin re\right)\right) \cdot 0.5} \]
      4. associate-*l*5.3%

        \[\leadsto \color{blue}{im \cdot \left(\left(im \cdot \sin re\right) \cdot 0.5\right)} \]
      5. associate-*r*5.3%

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(\sin re \cdot 0.5\right)\right)} \]
    8. Simplified5.3%

      \[\leadsto \color{blue}{im \cdot \left(im \cdot \left(\sin re \cdot 0.5\right)\right)} \]
    9. Taylor expanded in re around 0 80.6%

      \[\leadsto im \cdot \color{blue}{\left(0.5 \cdot \left(im \cdot re\right)\right)} \]
    10. Step-by-step derivation
      1. *-commutative80.6%

        \[\leadsto im \cdot \color{blue}{\left(\left(im \cdot re\right) \cdot 0.5\right)} \]
      2. associate-*l*80.6%

        \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]
    11. Simplified80.6%

      \[\leadsto im \cdot \color{blue}{\left(im \cdot \left(re \cdot 0.5\right)\right)} \]

    if 3.69999999999999996e152 < 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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 100.0%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified100.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in re around 0 75.0%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
    7. Step-by-step derivation
      1. unpow275.0%

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified75.0%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Taylor expanded in im around inf 75.0%

      \[\leadsto \color{blue}{0.5 \cdot \left({im}^{2} \cdot re\right)} \]
    10. Step-by-step derivation
      1. associate-*r*75.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot {im}^{2}\right) \cdot re} \]
      2. unpow275.0%

        \[\leadsto \left(0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \cdot re \]
    11. Simplified75.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right)\right) \cdot re} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification39.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{elif}\;im \leq 8.8 \cdot 10^{+99}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{elif}\;im \leq 9.2 \cdot 10^{+112}:\\ \;\;\;\;im \cdot \left(im \cdot \left(0.5 \cdot re\right)\right)\\ \mathbf{elif}\;im \leq 3.7 \cdot 10^{+152}:\\ \;\;\;\;0.08333333333333333 + \frac{0.25}{re \cdot re}\\ \mathbf{else}:\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right)\right)\\ \end{array} \]

Alternative 15: 46.8% accurate, 23.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;re \leq 2 \cdot 10^{-242} \lor \neg \left(re \leq 3 \cdot 10^{-191}\right):\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \end{array} \end{array} \]
(FPCore (re im)
 :precision binary64
 (if (or (<= re 2e-242) (not (<= re 3e-191)))
   (* re (+ (* 0.5 (* im im)) 1.0))
   (/ 0.25 (* re re))))
double code(double re, double im) {
	double tmp;
	if ((re <= 2e-242) || !(re <= 3e-191)) {
		tmp = re * ((0.5 * (im * im)) + 1.0);
	} else {
		tmp = 0.25 / (re * re);
	}
	return tmp;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    real(8) :: tmp
    if ((re <= 2d-242) .or. (.not. (re <= 3d-191))) then
        tmp = re * ((0.5d0 * (im * im)) + 1.0d0)
    else
        tmp = 0.25d0 / (re * re)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if ((re <= 2e-242) || !(re <= 3e-191)) {
		tmp = re * ((0.5 * (im * im)) + 1.0);
	} else {
		tmp = 0.25 / (re * re);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if (re <= 2e-242) or not (re <= 3e-191):
		tmp = re * ((0.5 * (im * im)) + 1.0)
	else:
		tmp = 0.25 / (re * re)
	return tmp
function code(re, im)
	tmp = 0.0
	if ((re <= 2e-242) || !(re <= 3e-191))
		tmp = Float64(re * Float64(Float64(0.5 * Float64(im * im)) + 1.0));
	else
		tmp = Float64(0.25 / Float64(re * re));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if ((re <= 2e-242) || ~((re <= 3e-191)))
		tmp = re * ((0.5 * (im * im)) + 1.0);
	else
		tmp = 0.25 / (re * re);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[Or[LessEqual[re, 2e-242], N[Not[LessEqual[re, 3e-191]], $MachinePrecision]], N[(re * N[(N[(0.5 * N[(im * im), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;re \leq 2 \cdot 10^{-242} \lor \neg \left(re \leq 3 \cdot 10^{-191}\right):\\
\;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if re < 2e-242 or 3.0000000000000001e-191 < 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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 73.3%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified73.3%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in re around 0 47.1%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
    7. Step-by-step derivation
      1. unpow247.1%

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified47.1%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]

    if 2e-242 < re < 3.0000000000000001e-191

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr86.0%

      \[\leadsto \color{blue}{{\left(\sin re \cdot -2\right)}^{-2}} \]
    5. Taylor expanded in re around 0 86.0%

      \[\leadsto \color{blue}{\frac{0.25}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. unpow286.0%

        \[\leadsto \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified86.0%

      \[\leadsto \color{blue}{\frac{0.25}{re \cdot re}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification49.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \leq 2 \cdot 10^{-242} \lor \neg \left(re \leq 3 \cdot 10^{-191}\right):\\ \;\;\;\;re \cdot \left(0.5 \cdot \left(im \cdot im\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \end{array} \]

Alternative 16: 29.7% accurate, 43.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \end{array} \end{array} \]
(FPCore (re im) :precision binary64 (if (<= im 9.2e-7) re (/ 0.25 (* re re))))
double code(double re, double im) {
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else {
		tmp = 0.25 / (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 <= 9.2d-7) then
        tmp = re
    else
        tmp = 0.25d0 / (re * re)
    end if
    code = tmp
end function
public static double code(double re, double im) {
	double tmp;
	if (im <= 9.2e-7) {
		tmp = re;
	} else {
		tmp = 0.25 / (re * re);
	}
	return tmp;
}
def code(re, im):
	tmp = 0
	if im <= 9.2e-7:
		tmp = re
	else:
		tmp = 0.25 / (re * re)
	return tmp
function code(re, im)
	tmp = 0.0
	if (im <= 9.2e-7)
		tmp = re;
	else
		tmp = Float64(0.25 / Float64(re * re));
	end
	return tmp
end
function tmp_2 = code(re, im)
	tmp = 0.0;
	if (im <= 9.2e-7)
		tmp = re;
	else
		tmp = 0.25 / (re * re);
	end
	tmp_2 = tmp;
end
code[re_, im_] := If[LessEqual[im, 9.2e-7], re, N[(0.25 / N[(re * re), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\
\;\;\;\;re\\

\mathbf{else}:\\
\;\;\;\;\frac{0.25}{re \cdot re}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if im < 9.1999999999999998e-7

    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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Taylor expanded in im around 0 84.1%

      \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
    5. Simplified84.1%

      \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
    6. Taylor expanded in re around 0 51.8%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
    7. Step-by-step derivation
      1. unpow251.8%

        \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
    8. Simplified51.8%

      \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
    9. Taylor expanded in im around 0 37.6%

      \[\leadsto \color{blue}{re} \]

    if 9.1999999999999998e-7 < 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-lft-in100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
      2. *-commutative100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
      3. cancel-sign-sub100.0%

        \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
      4. distribute-lft-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
      5. *-commutative100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
      6. distribute-rgt-neg-out100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
      7. neg-mul-1100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
      8. associate-*r*100.0%

        \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
      9. distribute-rgt-out--100.0%

        \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
      10. sub-neg100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
      11. neg-sub0100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
      12. *-commutative100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
      13. neg-mul-1100.0%

        \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
      14. 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. Applied egg-rr22.0%

      \[\leadsto \color{blue}{{\left(\sin re \cdot -2\right)}^{-2}} \]
    5. Taylor expanded in re around 0 21.5%

      \[\leadsto \color{blue}{\frac{0.25}{{re}^{2}}} \]
    6. Step-by-step derivation
      1. unpow221.5%

        \[\leadsto \frac{0.25}{\color{blue}{re \cdot re}} \]
    7. Simplified21.5%

      \[\leadsto \color{blue}{\frac{0.25}{re \cdot re}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification33.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;im \leq 9.2 \cdot 10^{-7}:\\ \;\;\;\;re\\ \mathbf{else}:\\ \;\;\;\;\frac{0.25}{re \cdot re}\\ \end{array} \]

Alternative 17: 4.3% accurate, 309.0× speedup?

\[\begin{array}{l} \\ 0.08333333333333333 \end{array} \]
(FPCore (re im) :precision binary64 0.08333333333333333)
double code(double re, double im) {
	return 0.08333333333333333;
}
real(8) function code(re, im)
    real(8), intent (in) :: re
    real(8), intent (in) :: im
    code = 0.08333333333333333d0
end function
public static double code(double re, double im) {
	return 0.08333333333333333;
}
def code(re, im):
	return 0.08333333333333333
function code(re, im)
	return 0.08333333333333333
end
function tmp = code(re, im)
	tmp = 0.08333333333333333;
end
code[re_, im_] := 0.08333333333333333
\begin{array}{l}

\\
0.08333333333333333
\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-lft-in100.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
    2. *-commutative100.0%

      \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
    3. cancel-sign-sub100.0%

      \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
    4. distribute-lft-neg-out100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
    5. *-commutative100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
    6. distribute-rgt-neg-out100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
    7. neg-mul-1100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
    8. associate-*r*100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
    9. distribute-rgt-out--100.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
    10. sub-neg100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
    11. neg-sub0100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
    12. *-commutative100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
    13. neg-mul-1100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
    14. 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. Applied egg-rr14.1%

    \[\leadsto \color{blue}{{\left(\sin re \cdot -2\right)}^{-2}} \]
  5. Taylor expanded in re around 0 13.9%

    \[\leadsto \color{blue}{0.08333333333333333 + 0.25 \cdot \frac{1}{{re}^{2}}} \]
  6. Step-by-step derivation
    1. associate-*r/13.9%

      \[\leadsto 0.08333333333333333 + \color{blue}{\frac{0.25 \cdot 1}{{re}^{2}}} \]
    2. metadata-eval13.9%

      \[\leadsto 0.08333333333333333 + \frac{\color{blue}{0.25}}{{re}^{2}} \]
    3. unpow213.9%

      \[\leadsto 0.08333333333333333 + \frac{0.25}{\color{blue}{re \cdot re}} \]
  7. Simplified13.9%

    \[\leadsto \color{blue}{0.08333333333333333 + \frac{0.25}{re \cdot re}} \]
  8. Taylor expanded in re around inf 4.4%

    \[\leadsto \color{blue}{0.08333333333333333} \]
  9. Final simplification4.4%

    \[\leadsto 0.08333333333333333 \]

Alternative 18: 26.7% 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. distribute-lft-in100.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot e^{0 - im} + \left(0.5 \cdot \sin re\right) \cdot e^{im}} \]
    2. *-commutative100.0%

      \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right)} + \left(0.5 \cdot \sin re\right) \cdot e^{im} \]
    3. cancel-sign-sub100.0%

      \[\leadsto \color{blue}{e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-0.5 \cdot \sin re\right) \cdot e^{im}} \]
    4. distribute-lft-neg-out100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(-\left(0.5 \cdot \sin re\right) \cdot e^{im}\right)} \]
    5. *-commutative100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \left(-\color{blue}{e^{im} \cdot \left(0.5 \cdot \sin re\right)}\right) \]
    6. distribute-rgt-neg-out100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{e^{im} \cdot \left(-0.5 \cdot \sin re\right)} \]
    7. neg-mul-1100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - e^{im} \cdot \color{blue}{\left(-1 \cdot \left(0.5 \cdot \sin re\right)\right)} \]
    8. associate-*r*100.0%

      \[\leadsto e^{0 - im} \cdot \left(0.5 \cdot \sin re\right) - \color{blue}{\left(e^{im} \cdot -1\right) \cdot \left(0.5 \cdot \sin re\right)} \]
    9. distribute-rgt-out--100.0%

      \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left(e^{0 - im} - e^{im} \cdot -1\right)} \]
    10. sub-neg100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(e^{0 - im} + \left(-e^{im} \cdot -1\right)\right)} \]
    11. neg-sub0100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{\color{blue}{-im}} + \left(-e^{im} \cdot -1\right)\right) \]
    12. *-commutative100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{-1 \cdot e^{im}}\right)\right) \]
    13. neg-mul-1100.0%

      \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} + \left(-\color{blue}{\left(-e^{im}\right)}\right)\right) \]
    14. 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. Taylor expanded in im around 0 71.7%

    \[\leadsto \color{blue}{\sin re + 0.5 \cdot \left({im}^{2} \cdot \sin re\right)} \]
  5. Simplified71.7%

    \[\leadsto \color{blue}{\left(0.5 \cdot \left(im \cdot im\right) + 1\right) \cdot \sin re} \]
  6. Taylor expanded in re around 0 47.0%

    \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot {im}^{2}\right)} \]
  7. Step-by-step derivation
    1. unpow247.0%

      \[\leadsto re \cdot \left(1 + 0.5 \cdot \color{blue}{\left(im \cdot im\right)}\right) \]
  8. Simplified47.0%

    \[\leadsto \color{blue}{re \cdot \left(1 + 0.5 \cdot \left(im \cdot im\right)\right)} \]
  9. Taylor expanded in im around 0 28.2%

    \[\leadsto \color{blue}{re} \]
  10. Final simplification28.2%

    \[\leadsto re \]

Reproduce

?
herbie shell --seed 2023271 
(FPCore (re im)
  :name "math.sin on complex, real part"
  :precision binary64
  (* (* 0.5 (sin re)) (+ (exp (- 0.0 im)) (exp im))))