_divideComplex, imaginary part

Percentage Accurate: 61.3% → 83.8%
Time: 7.7s
Alternatives: 12
Speedup: 1.5×

Specification

?
\[\begin{array}{l} \\ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 61.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    code = ((x_46im * y_46re) - (x_46re * y_46im)) / ((y_46re * y_46re) + (y_46im * y_46im))
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	return ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(Float64(Float64(x_46_im * y_46_re) - Float64(x_46_re * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = ((x_46_im * y_46_re) - (x_46_re * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(x$46$re * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}

Alternative 1: 83.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\ t_1 := \mathsf{fma}\left(\frac{y.re}{t\_0}, x.im, \frac{x.re}{t\_0} \cdot \left(-y.im\right)\right)\\ \mathbf{if}\;y.re \leq -5 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.re}{{y.re}^{4}} \cdot y.im - \frac{x.im}{{y.re}^{3}}, y.im, \frac{\frac{-x.re}{y.re}}{y.re}\right), y.im, \frac{x.im}{y.re}\right)\\ \mathbf{elif}\;y.re \leq -7.5 \cdot 10^{-44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (fma y.im y.im (* y.re y.re)))
        (t_1 (fma (/ y.re t_0) x.im (* (/ x.re t_0) (- y.im)))))
   (if (<= y.re -5e+154)
     (fma
      (fma
       (- (* (/ x.re (pow y.re 4.0)) y.im) (/ x.im (pow y.re 3.0)))
       y.im
       (/ (/ (- x.re) y.re) y.re))
      y.im
      (/ x.im y.re))
     (if (<= y.re -7.5e-44)
       t_1
       (if (<= y.re 2.8e-46)
         (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
         (if (<= y.re 7.5e+112)
           t_1
           (/ (- x.im (/ x.re (/ y.re y.im))) y.re)))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
	double t_1 = fma((y_46_re / t_0), x_46_im, ((x_46_re / t_0) * -y_46_im));
	double tmp;
	if (y_46_re <= -5e+154) {
		tmp = fma(fma((((x_46_re / pow(y_46_re, 4.0)) * y_46_im) - (x_46_im / pow(y_46_re, 3.0))), y_46_im, ((-x_46_re / y_46_re) / y_46_re)), y_46_im, (x_46_im / y_46_re));
	} else if (y_46_re <= -7.5e-44) {
		tmp = t_1;
	} else if (y_46_re <= 2.8e-46) {
		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
	} else if (y_46_re <= 7.5e+112) {
		tmp = t_1;
	} else {
		tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))
	t_1 = fma(Float64(y_46_re / t_0), x_46_im, Float64(Float64(x_46_re / t_0) * Float64(-y_46_im)))
	tmp = 0.0
	if (y_46_re <= -5e+154)
		tmp = fma(fma(Float64(Float64(Float64(x_46_re / (y_46_re ^ 4.0)) * y_46_im) - Float64(x_46_im / (y_46_re ^ 3.0))), y_46_im, Float64(Float64(Float64(-x_46_re) / y_46_re) / y_46_re)), y_46_im, Float64(x_46_im / y_46_re));
	elseif (y_46_re <= -7.5e-44)
		tmp = t_1;
	elseif (y_46_re <= 2.8e-46)
		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
	elseif (y_46_re <= 7.5e+112)
		tmp = t_1;
	else
		tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re);
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re / t$95$0), $MachinePrecision] * x$46$im + N[(N[(x$46$re / t$95$0), $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5e+154], N[(N[(N[(N[(N[(x$46$re / N[Power[y$46$re, 4.0], $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision] - N[(x$46$im / N[Power[y$46$re, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$46$im + N[(N[((-x$46$re) / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] * y$46$im + N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -7.5e-44], t$95$1, If[LessEqual[y$46$re, 2.8e-46], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 7.5e+112], t$95$1, N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
t_1 := \mathsf{fma}\left(\frac{y.re}{t\_0}, x.im, \frac{x.re}{t\_0} \cdot \left(-y.im\right)\right)\\
\mathbf{if}\;y.re \leq -5 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.re}{{y.re}^{4}} \cdot y.im - \frac{x.im}{{y.re}^{3}}, y.im, \frac{\frac{-x.re}{y.re}}{y.re}\right), y.im, \frac{x.im}{y.re}\right)\\

\mathbf{elif}\;y.re \leq -7.5 \cdot 10^{-44}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-46}:\\
\;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\

\mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -5.00000000000000004e154

    1. Initial program 34.1%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Add Preprocessing
    3. Taylor expanded in y.im around 0

      \[\leadsto \color{blue}{y.im \cdot \left(-1 \cdot \frac{x.re}{{y.re}^{2}} + y.im \cdot \left(\frac{x.re \cdot y.im}{{y.re}^{4}} - \frac{x.im}{{y.re}^{3}}\right)\right) + \frac{x.im}{y.re}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\left(-1 \cdot \frac{x.re}{{y.re}^{2}} + y.im \cdot \left(\frac{x.re \cdot y.im}{{y.re}^{4}} - \frac{x.im}{{y.re}^{3}}\right)\right) \cdot y.im} + \frac{x.im}{y.re} \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(-1 \cdot \frac{x.re}{{y.re}^{2}} + y.im \cdot \left(\frac{x.re \cdot y.im}{{y.re}^{4}} - \frac{x.im}{{y.re}^{3}}\right), y.im, \frac{x.im}{y.re}\right)} \]
    5. Applied rewrites87.9%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.re}{{y.re}^{4}} \cdot y.im - \frac{x.im}{{y.re}^{3}}, y.im, \frac{\frac{-x.re}{y.re}}{y.re}\right), y.im, \frac{x.im}{y.re}\right)} \]

    if -5.00000000000000004e154 < y.re < -7.50000000000000008e-44 or 2.7999999999999998e-46 < y.re < 7.5e112

    1. Initial program 77.2%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-/.f64N/A

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \]
      2. lift--.f64N/A

        \[\leadsto \frac{\color{blue}{x.im \cdot y.re - x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
      3. div-subN/A

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \]
      4. sub-negN/A

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right)} \]
      5. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      6. associate-/l*N/A

        \[\leadsto \color{blue}{x.im \cdot \frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      7. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im} \cdot x.im} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right)} \]
      9. lower-/.f64N/A

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      10. lift-+.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      11. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      12. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      13. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      14. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \mathsf{neg}\left(\frac{\color{blue}{x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      15. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \mathsf{neg}\left(\frac{\color{blue}{y.im \cdot x.re}}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
      16. associate-/l*N/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \mathsf{neg}\left(\color{blue}{y.im \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}}\right)\right) \]
      17. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
      18. lower-*.f64N/A

        \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
    4. Applied rewrites85.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \left(-y.im\right) \cdot \frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\right)} \]

    if -7.50000000000000008e-44 < y.re < 2.7999999999999998e-46

    1. Initial program 71.9%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Add Preprocessing
    3. Taylor expanded in y.re around 0

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im} + \frac{x.im \cdot y.re}{{y.im}^{2}}} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{x.im \cdot y.re}{{y.im}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re}{y.im}\right)\right)} \]
      3. unsub-negN/A

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
      4. unpow2N/A

        \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{y.im \cdot y.im}} - \frac{x.re}{y.im} \]
      5. associate-/r*N/A

        \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im}}{y.im}} - \frac{x.re}{y.im} \]
      6. div-subN/A

        \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
      7. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
      8. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im} - x.re}}{y.im} \]
      9. lower-/.f64N/A

        \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im}} - x.re}{y.im} \]
      10. lower-*.f6490.2

        \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re}}{y.im} - x.re}{y.im} \]
    5. Applied rewrites90.2%

      \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]

    if 7.5e112 < y.re

    1. Initial program 39.6%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Add Preprocessing
    3. Taylor expanded in y.re around inf

      \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
      2. mul-1-negN/A

        \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
      3. unsub-negN/A

        \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
      4. lower--.f64N/A

        \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
      5. lower-/.f64N/A

        \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
      6. lower-*.f6481.4

        \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
    5. Applied rewrites81.4%

      \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
    6. Step-by-step derivation
      1. Applied rewrites92.8%

        \[\leadsto \frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification88.8%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -5 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\frac{x.re}{{y.re}^{4}} \cdot y.im - \frac{x.im}{{y.re}^{3}}, y.im, \frac{\frac{-x.re}{y.re}}{y.re}\right), y.im, \frac{x.im}{y.re}\right)\\ \mathbf{elif}\;y.re \leq -7.5 \cdot 10^{-44}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-y.im\right)\right)\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-y.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 84.1% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\ t_1 := \mathsf{fma}\left(\frac{y.re}{t\_0}, x.im, \frac{x.re}{t\_0} \cdot \left(-y.im\right)\right)\\ \mathbf{if}\;y.re \leq -5 \cdot 10^{+154}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -7.5 \cdot 10^{-44}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+112}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (fma y.im y.im (* y.re y.re)))
            (t_1 (fma (/ y.re t_0) x.im (* (/ x.re t_0) (- y.im)))))
       (if (<= y.re -5e+154)
         (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
         (if (<= y.re -7.5e-44)
           t_1
           (if (<= y.re 2.8e-46)
             (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
             (if (<= y.re 7.5e+112)
               t_1
               (/ (- x.im (/ x.re (/ y.re y.im))) y.re)))))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double t_0 = fma(y_46_im, y_46_im, (y_46_re * y_46_re));
    	double t_1 = fma((y_46_re / t_0), x_46_im, ((x_46_re / t_0) * -y_46_im));
    	double tmp;
    	if (y_46_re <= -5e+154) {
    		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
    	} else if (y_46_re <= -7.5e-44) {
    		tmp = t_1;
    	} else if (y_46_re <= 2.8e-46) {
    		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
    	} else if (y_46_re <= 7.5e+112) {
    		tmp = t_1;
    	} else {
    		tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
    	}
    	return tmp;
    }
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	t_0 = fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))
    	t_1 = fma(Float64(y_46_re / t_0), x_46_im, Float64(Float64(x_46_re / t_0) * Float64(-y_46_im)))
    	tmp = 0.0
    	if (y_46_re <= -5e+154)
    		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
    	elseif (y_46_re <= -7.5e-44)
    		tmp = t_1;
    	elseif (y_46_re <= 2.8e-46)
    		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
    	elseif (y_46_re <= 7.5e+112)
    		tmp = t_1;
    	else
    		tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re);
    	end
    	return tmp
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$re / t$95$0), $MachinePrecision] * x$46$im + N[(N[(x$46$re / t$95$0), $MachinePrecision] * (-y$46$im)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5e+154], N[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -7.5e-44], t$95$1, If[LessEqual[y$46$re, 2.8e-46], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 7.5e+112], t$95$1, N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
    t_1 := \mathsf{fma}\left(\frac{y.re}{t\_0}, x.im, \frac{x.re}{t\_0} \cdot \left(-y.im\right)\right)\\
    \mathbf{if}\;y.re \leq -5 \cdot 10^{+154}:\\
    \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
    
    \mathbf{elif}\;y.re \leq -7.5 \cdot 10^{-44}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-46}:\\
    \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+112}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -5.00000000000000004e154

      1. Initial program 34.1%

        \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
      2. Add Preprocessing
      3. Taylor expanded in y.re around inf

        \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
        2. mul-1-negN/A

          \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
        3. unsub-negN/A

          \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
        4. lower--.f64N/A

          \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
        6. lower-*.f6478.5

          \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
      5. Applied rewrites78.5%

        \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
      6. Step-by-step derivation
        1. Applied rewrites87.9%

          \[\leadsto \frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re} \]

        if -5.00000000000000004e154 < y.re < -7.50000000000000008e-44 or 2.7999999999999998e-46 < y.re < 7.5e112

        1. Initial program 77.2%

          \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \]
          2. lift--.f64N/A

            \[\leadsto \frac{\color{blue}{x.im \cdot y.re - x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
          3. div-subN/A

            \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} - \frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}} \]
          4. sub-negN/A

            \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right)} \]
          5. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          6. associate-/l*N/A

            \[\leadsto \color{blue}{x.im \cdot \frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          7. *-commutativeN/A

            \[\leadsto \color{blue}{\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im} \cdot x.im} + \left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          8. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right)} \]
          9. lower-/.f64N/A

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{y.re}{y.re \cdot y.re + y.im \cdot y.im}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          10. lift-+.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          11. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          12. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          13. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\color{blue}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}}, x.im, \mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          14. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \mathsf{neg}\left(\frac{\color{blue}{x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          15. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \mathsf{neg}\left(\frac{\color{blue}{y.im \cdot x.re}}{y.re \cdot y.re + y.im \cdot y.im}\right)\right) \]
          16. associate-/l*N/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \mathsf{neg}\left(\color{blue}{y.im \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}}\right)\right) \]
          17. distribute-lft-neg-inN/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
          18. lower-*.f64N/A

            \[\leadsto \mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot \frac{x.re}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
        4. Applied rewrites85.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \left(-y.im\right) \cdot \frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\right)} \]

        if -7.50000000000000008e-44 < y.re < 2.7999999999999998e-46

        1. Initial program 71.9%

          \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
        2. Add Preprocessing
        3. Taylor expanded in y.re around 0

          \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im} + \frac{x.im \cdot y.re}{{y.im}^{2}}} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
          2. mul-1-negN/A

            \[\leadsto \frac{x.im \cdot y.re}{{y.im}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re}{y.im}\right)\right)} \]
          3. unsub-negN/A

            \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
          4. unpow2N/A

            \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{y.im \cdot y.im}} - \frac{x.re}{y.im} \]
          5. associate-/r*N/A

            \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im}}{y.im}} - \frac{x.re}{y.im} \]
          6. div-subN/A

            \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
          7. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
          8. lower--.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im} - x.re}}{y.im} \]
          9. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im}} - x.re}{y.im} \]
          10. lower-*.f6490.2

            \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re}}{y.im} - x.re}{y.im} \]
        5. Applied rewrites90.2%

          \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]

        if 7.5e112 < y.re

        1. Initial program 39.6%

          \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
        2. Add Preprocessing
        3. Taylor expanded in y.re around inf

          \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
        4. Step-by-step derivation
          1. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
          2. mul-1-negN/A

            \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
          3. unsub-negN/A

            \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
          4. lower--.f64N/A

            \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
          5. lower-/.f64N/A

            \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
          6. lower-*.f6481.4

            \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
        5. Applied rewrites81.4%

          \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
        6. Step-by-step derivation
          1. Applied rewrites92.8%

            \[\leadsto \frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re} \]
        7. Recombined 4 regimes into one program.
        8. Final simplification88.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -5 \cdot 10^{+154}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -7.5 \cdot 10^{-44}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-y.im\right)\right)\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-46}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 7.5 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}, x.im, \frac{x.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-y.im\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\ \end{array} \]
        9. Add Preprocessing

        Alternative 3: 82.0% accurate, 0.6× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ \mathbf{if}\;y.re \leq -5.6 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-45}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-155}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\ \end{array} \end{array} \]
        (FPCore (x.re x.im y.re y.im)
         :precision binary64
         (let* ((t_0
                 (/ (fma (- y.im) x.re (* x.im y.re)) (fma y.im y.im (* y.re y.re)))))
           (if (<= y.re -5.6e+109)
             (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
             (if (<= y.re -7.2e-45)
               t_0
               (if (<= y.re 7.4e-155)
                 (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
                 (if (<= y.re 1.75e+44)
                   t_0
                   (/ (- x.im (/ x.re (/ y.re y.im))) y.re)))))))
        double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
        	double t_0 = fma(-y_46_im, x_46_re, (x_46_im * y_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
        	double tmp;
        	if (y_46_re <= -5.6e+109) {
        		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
        	} else if (y_46_re <= -7.2e-45) {
        		tmp = t_0;
        	} else if (y_46_re <= 7.4e-155) {
        		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
        	} else if (y_46_re <= 1.75e+44) {
        		tmp = t_0;
        	} else {
        		tmp = (x_46_im - (x_46_re / (y_46_re / y_46_im))) / y_46_re;
        	}
        	return tmp;
        }
        
        function code(x_46_re, x_46_im, y_46_re, y_46_im)
        	t_0 = Float64(fma(Float64(-y_46_im), x_46_re, Float64(x_46_im * y_46_re)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))
        	tmp = 0.0
        	if (y_46_re <= -5.6e+109)
        		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
        	elseif (y_46_re <= -7.2e-45)
        		tmp = t_0;
        	elseif (y_46_re <= 7.4e-155)
        		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
        	elseif (y_46_re <= 1.75e+44)
        		tmp = t_0;
        	else
        		tmp = Float64(Float64(x_46_im - Float64(x_46_re / Float64(y_46_re / y_46_im))) / y_46_re);
        	end
        	return tmp
        end
        
        code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[((-y$46$im) * x$46$re + N[(x$46$im * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e+109], N[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -7.2e-45], t$95$0, If[LessEqual[y$46$re, 7.4e-155], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.75e+44], t$95$0, N[(N[(x$46$im - N[(x$46$re / N[(y$46$re / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
        \mathbf{if}\;y.re \leq -5.6 \cdot 10^{+109}:\\
        \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
        
        \mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-45}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-155}:\\
        \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
        
        \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if y.re < -5.6000000000000004e109

          1. Initial program 45.0%

            \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
          2. Add Preprocessing
          3. Taylor expanded in y.re around inf

            \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
            2. mul-1-negN/A

              \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
            3. unsub-negN/A

              \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
            4. lower--.f64N/A

              \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
            6. lower-*.f6477.3

              \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
          5. Applied rewrites77.3%

            \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
          6. Step-by-step derivation
            1. Applied rewrites83.6%

              \[\leadsto \frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re} \]

            if -5.6000000000000004e109 < y.re < -7.20000000000000001e-45 or 7.4000000000000001e-155 < y.re < 1.75e44

            1. Initial program 83.2%

              \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \frac{\color{blue}{x.im \cdot y.re - x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
              2. sub-negN/A

                \[\leadsto \frac{\color{blue}{x.im \cdot y.re + \left(\mathsf{neg}\left(x.re \cdot y.im\right)\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
              3. +-commutativeN/A

                \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x.re \cdot y.im\right)\right) + x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{x.re \cdot y.im}\right)\right) + x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \]
              5. *-commutativeN/A

                \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{y.im \cdot x.re}\right)\right) + x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \]
              6. distribute-lft-neg-inN/A

                \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot x.re} + x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \]
              7. lower-fma.f64N/A

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y.im\right), x.re, x.im \cdot y.re\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
              8. lower-neg.f6483.2

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{-y.im}, x.re, x.im \cdot y.re\right)}{y.re \cdot y.re + y.im \cdot y.im} \]
              9. lift-+.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} \]
              10. +-commutativeN/A

                \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}} \]
              11. lift-*.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
              12. lower-fma.f6483.2

                \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]
            4. Applied rewrites83.2%

              \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]

            if -7.20000000000000001e-45 < y.re < 7.4000000000000001e-155

            1. Initial program 67.3%

              \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
            2. Add Preprocessing
            3. Taylor expanded in y.re around 0

              \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im} + \frac{x.im \cdot y.re}{{y.im}^{2}}} \]
            4. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
              2. mul-1-negN/A

                \[\leadsto \frac{x.im \cdot y.re}{{y.im}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re}{y.im}\right)\right)} \]
              3. unsub-negN/A

                \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
              4. unpow2N/A

                \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{y.im \cdot y.im}} - \frac{x.re}{y.im} \]
              5. associate-/r*N/A

                \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im}}{y.im}} - \frac{x.re}{y.im} \]
              6. div-subN/A

                \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
              7. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
              8. lower--.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im} - x.re}}{y.im} \]
              9. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im}} - x.re}{y.im} \]
              10. lower-*.f6493.4

                \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re}}{y.im} - x.re}{y.im} \]
            5. Applied rewrites93.4%

              \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]

            if 1.75e44 < y.re

            1. Initial program 48.8%

              \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
            2. Add Preprocessing
            3. Taylor expanded in y.re around inf

              \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
            4. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
              2. mul-1-negN/A

                \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
              3. unsub-negN/A

                \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
              4. lower--.f64N/A

                \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
              6. lower-*.f6479.1

                \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
            5. Applied rewrites79.1%

              \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
            6. Step-by-step derivation
              1. Applied rewrites87.2%

                \[\leadsto \frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re} \]
            7. Recombined 4 regimes into one program.
            8. Final simplification87.1%

              \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -5.6 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-155}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{\frac{y.re}{y.im}}}{y.re}\\ \end{array} \]
            9. Add Preprocessing

            Alternative 4: 82.1% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ t_1 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{if}\;y.re \leq -5.6 \cdot 10^{+109}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-45}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-155}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
            (FPCore (x.re x.im y.re y.im)
             :precision binary64
             (let* ((t_0
                     (/ (fma (- y.im) x.re (* x.im y.re)) (fma y.im y.im (* y.re y.re))))
                    (t_1 (/ (- x.im (* (/ x.re y.re) y.im)) y.re)))
               (if (<= y.re -5.6e+109)
                 t_1
                 (if (<= y.re -7.2e-45)
                   t_0
                   (if (<= y.re 7.4e-155)
                     (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
                     (if (<= y.re 1.75e+44) t_0 t_1))))))
            double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
            	double t_0 = fma(-y_46_im, x_46_re, (x_46_im * y_46_re)) / fma(y_46_im, y_46_im, (y_46_re * y_46_re));
            	double t_1 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
            	double tmp;
            	if (y_46_re <= -5.6e+109) {
            		tmp = t_1;
            	} else if (y_46_re <= -7.2e-45) {
            		tmp = t_0;
            	} else if (y_46_re <= 7.4e-155) {
            		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
            	} else if (y_46_re <= 1.75e+44) {
            		tmp = t_0;
            	} else {
            		tmp = t_1;
            	}
            	return tmp;
            }
            
            function code(x_46_re, x_46_im, y_46_re, y_46_im)
            	t_0 = Float64(fma(Float64(-y_46_im), x_46_re, Float64(x_46_im * y_46_re)) / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re)))
            	t_1 = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re)
            	tmp = 0.0
            	if (y_46_re <= -5.6e+109)
            		tmp = t_1;
            	elseif (y_46_re <= -7.2e-45)
            		tmp = t_0;
            	elseif (y_46_re <= 7.4e-155)
            		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
            	elseif (y_46_re <= 1.75e+44)
            		tmp = t_0;
            	else
            		tmp = t_1;
            	end
            	return tmp
            end
            
            code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[((-y$46$im) * x$46$re + N[(x$46$im * y$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -5.6e+109], t$95$1, If[LessEqual[y$46$re, -7.2e-45], t$95$0, If[LessEqual[y$46$re, 7.4e-155], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.75e+44], t$95$0, t$95$1]]]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\
            t_1 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
            \mathbf{if}\;y.re \leq -5.6 \cdot 10^{+109}:\\
            \;\;\;\;t\_1\\
            
            \mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-45}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-155}:\\
            \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
            
            \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_1\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if y.re < -5.6000000000000004e109 or 1.75e44 < y.re

              1. Initial program 47.1%

                \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
              2. Add Preprocessing
              3. Taylor expanded in y.re around inf

                \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
              4. Step-by-step derivation
                1. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                2. mul-1-negN/A

                  \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
                3. unsub-negN/A

                  \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                4. lower--.f64N/A

                  \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                5. lower-/.f64N/A

                  \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                6. lower-*.f6478.3

                  \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
              5. Applied rewrites78.3%

                \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
              6. Step-by-step derivation
                1. Applied rewrites85.6%

                  \[\leadsto \frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re} \]

                if -5.6000000000000004e109 < y.re < -7.20000000000000001e-45 or 7.4000000000000001e-155 < y.re < 1.75e44

                1. Initial program 83.2%

                  \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                2. Add Preprocessing
                3. Step-by-step derivation
                  1. lift--.f64N/A

                    \[\leadsto \frac{\color{blue}{x.im \cdot y.re - x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
                  2. sub-negN/A

                    \[\leadsto \frac{\color{blue}{x.im \cdot y.re + \left(\mathsf{neg}\left(x.re \cdot y.im\right)\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
                  3. +-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x.re \cdot y.im\right)\right) + x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} \]
                  4. lift-*.f64N/A

                    \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{x.re \cdot y.im}\right)\right) + x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\left(\mathsf{neg}\left(\color{blue}{y.im \cdot x.re}\right)\right) + x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \]
                  6. distribute-lft-neg-inN/A

                    \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(y.im\right)\right) \cdot x.re} + x.im \cdot y.re}{y.re \cdot y.re + y.im \cdot y.im} \]
                  7. lower-fma.f64N/A

                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{neg}\left(y.im\right), x.re, x.im \cdot y.re\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
                  8. lower-neg.f6483.2

                    \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{-y.im}, x.re, x.im \cdot y.re\right)}{y.re \cdot y.re + y.im \cdot y.im} \]
                  9. lift-+.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} \]
                  10. +-commutativeN/A

                    \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{y.im \cdot y.im + y.re \cdot y.re}} \]
                  11. lift-*.f64N/A

                    \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
                  12. lower-fma.f6483.2

                    \[\leadsto \frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\color{blue}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]
                4. Applied rewrites83.2%

                  \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]

                if -7.20000000000000001e-45 < y.re < 7.4000000000000001e-155

                1. Initial program 67.3%

                  \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                2. Add Preprocessing
                3. Taylor expanded in y.re around 0

                  \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im} + \frac{x.im \cdot y.re}{{y.im}^{2}}} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
                  2. mul-1-negN/A

                    \[\leadsto \frac{x.im \cdot y.re}{{y.im}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re}{y.im}\right)\right)} \]
                  3. unsub-negN/A

                    \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
                  4. unpow2N/A

                    \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{y.im \cdot y.im}} - \frac{x.re}{y.im} \]
                  5. associate-/r*N/A

                    \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im}}{y.im}} - \frac{x.re}{y.im} \]
                  6. div-subN/A

                    \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
                  7. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
                  8. lower--.f64N/A

                    \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im} - x.re}}{y.im} \]
                  9. lower-/.f64N/A

                    \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im}} - x.re}{y.im} \]
                  10. lower-*.f6493.4

                    \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re}}{y.im} - x.re}{y.im} \]
                5. Applied rewrites93.4%

                  \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
              7. Recombined 3 regimes into one program.
              8. Final simplification87.1%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -5.6 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -7.2 \cdot 10^{-45}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ \mathbf{elif}\;y.re \leq 7.4 \cdot 10^{-155}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{+44}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-y.im, x.re, x.im \cdot y.re\right)}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \end{array} \]
              9. Add Preprocessing

              Alternative 5: 67.0% accurate, 0.7× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ t_1 := \frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-x.re\right)\\ \mathbf{if}\;y.im \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.im \leq 1.15 \cdot 10^{-49}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+114}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (x.re x.im y.re y.im)
               :precision binary64
               (let* ((t_0 (/ (- x.re) y.im))
                      (t_1 (* (/ y.im (fma y.im y.im (* y.re y.re))) (- x.re))))
                 (if (<= y.im -1.35e+154)
                   t_0
                   (if (<= y.im -3.8e-34)
                     t_1
                     (if (<= y.im 1.15e-49)
                       (/ x.im y.re)
                       (if (<= y.im 1.4e+114) t_1 t_0))))))
              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
              	double t_0 = -x_46_re / y_46_im;
              	double t_1 = (y_46_im / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * -x_46_re;
              	double tmp;
              	if (y_46_im <= -1.35e+154) {
              		tmp = t_0;
              	} else if (y_46_im <= -3.8e-34) {
              		tmp = t_1;
              	} else if (y_46_im <= 1.15e-49) {
              		tmp = x_46_im / y_46_re;
              	} else if (y_46_im <= 1.4e+114) {
              		tmp = t_1;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              function code(x_46_re, x_46_im, y_46_re, y_46_im)
              	t_0 = Float64(Float64(-x_46_re) / y_46_im)
              	t_1 = Float64(Float64(y_46_im / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * Float64(-x_46_re))
              	tmp = 0.0
              	if (y_46_im <= -1.35e+154)
              		tmp = t_0;
              	elseif (y_46_im <= -3.8e-34)
              		tmp = t_1;
              	elseif (y_46_im <= 1.15e-49)
              		tmp = Float64(x_46_im / y_46_re);
              	elseif (y_46_im <= 1.4e+114)
              		tmp = t_1;
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, Block[{t$95$1 = N[(N[(y$46$im / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $MachinePrecision]}, If[LessEqual[y$46$im, -1.35e+154], t$95$0, If[LessEqual[y$46$im, -3.8e-34], t$95$1, If[LessEqual[y$46$im, 1.15e-49], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 1.4e+114], t$95$1, t$95$0]]]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{-x.re}{y.im}\\
              t_1 := \frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-x.re\right)\\
              \mathbf{if}\;y.im \leq -1.35 \cdot 10^{+154}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-34}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;y.im \leq 1.15 \cdot 10^{-49}:\\
              \;\;\;\;\frac{x.im}{y.re}\\
              
              \mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+114}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if y.im < -1.35000000000000003e154 or 1.4e114 < y.im

                1. Initial program 38.3%

                  \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                2. Add Preprocessing
                3. Taylor expanded in y.re around 0

                  \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
                4. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x.re}{y.im}\right)} \]
                  2. distribute-neg-frac2N/A

                    \[\leadsto \color{blue}{\frac{x.re}{\mathsf{neg}\left(y.im\right)}} \]
                  3. mul-1-negN/A

                    \[\leadsto \frac{x.re}{\color{blue}{-1 \cdot y.im}} \]
                  4. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{x.re}{-1 \cdot y.im}} \]
                  5. mul-1-negN/A

                    \[\leadsto \frac{x.re}{\color{blue}{\mathsf{neg}\left(y.im\right)}} \]
                  6. lower-neg.f6478.9

                    \[\leadsto \frac{x.re}{\color{blue}{-y.im}} \]
                5. Applied rewrites78.9%

                  \[\leadsto \color{blue}{\frac{x.re}{-y.im}} \]

                if -1.35000000000000003e154 < y.im < -3.8000000000000001e-34 or 1.15e-49 < y.im < 1.4e114

                1. Initial program 73.2%

                  \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                2. Add Preprocessing
                3. Taylor expanded in x.re around inf

                  \[\leadsto \color{blue}{-1 \cdot \frac{x.re \cdot y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                4. Step-by-step derivation
                  1. associate-/l*N/A

                    \[\leadsto -1 \cdot \color{blue}{\left(x.re \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}}\right)} \]
                  2. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(-1 \cdot x.re\right) \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(-1 \cdot x.re\right) \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                  4. mul-1-negN/A

                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x.re\right)\right)} \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}} \]
                  5. lower-neg.f64N/A

                    \[\leadsto \color{blue}{\left(-x.re\right)} \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}} \]
                  6. lower-/.f64N/A

                    \[\leadsto \left(-x.re\right) \cdot \color{blue}{\frac{y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                  7. unpow2N/A

                    \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\color{blue}{y.im \cdot y.im} + {y.re}^{2}} \]
                  8. lower-fma.f64N/A

                    \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\color{blue}{\mathsf{fma}\left(y.im, y.im, {y.re}^{2}\right)}} \]
                  9. unpow2N/A

                    \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, \color{blue}{y.re \cdot y.re}\right)} \]
                  10. lower-*.f6463.5

                    \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, \color{blue}{y.re \cdot y.re}\right)} \]
                5. Applied rewrites63.5%

                  \[\leadsto \color{blue}{\left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]

                if -3.8000000000000001e-34 < y.im < 1.15e-49

                1. Initial program 73.9%

                  \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                2. Add Preprocessing
                3. Taylor expanded in y.re around inf

                  \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                4. Step-by-step derivation
                  1. lower-/.f6471.2

                    \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                5. Applied rewrites71.2%

                  \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
              3. Recombined 3 regimes into one program.
              4. Final simplification70.8%

                \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -1.35 \cdot 10^{+154}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq -3.8 \cdot 10^{-34}:\\ \;\;\;\;\frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-x.re\right)\\ \mathbf{elif}\;y.im \leq 1.15 \cdot 10^{-49}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 1.4 \cdot 10^{+114}:\\ \;\;\;\;\frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \left(-x.re\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 6: 78.4% accurate, 0.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{if}\;y.re \leq -3.9 \cdot 10^{+35}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 0.0014:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (x.re x.im y.re y.im)
               :precision binary64
               (let* ((t_0 (/ (- x.im (* (/ x.re y.re) y.im)) y.re)))
                 (if (<= y.re -3.9e+35)
                   t_0
                   (if (<= y.re 0.0014) (/ (- (/ (* x.im y.re) y.im) x.re) y.im) t_0))))
              double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
              	double t_0 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
              	double tmp;
              	if (y_46_re <= -3.9e+35) {
              		tmp = t_0;
              	} else if (y_46_re <= 0.0014) {
              		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(x_46re, x_46im, y_46re, y_46im)
                  real(8), intent (in) :: x_46re
                  real(8), intent (in) :: x_46im
                  real(8), intent (in) :: y_46re
                  real(8), intent (in) :: y_46im
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = (x_46im - ((x_46re / y_46re) * y_46im)) / y_46re
                  if (y_46re <= (-3.9d+35)) then
                      tmp = t_0
                  else if (y_46re <= 0.0014d0) then
                      tmp = (((x_46im * y_46re) / y_46im) - x_46re) / y_46im
                  else
                      tmp = t_0
                  end if
                  code = tmp
              end function
              
              public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
              	double t_0 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
              	double tmp;
              	if (y_46_re <= -3.9e+35) {
              		tmp = t_0;
              	} else if (y_46_re <= 0.0014) {
              		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(x_46_re, x_46_im, y_46_re, y_46_im):
              	t_0 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re
              	tmp = 0
              	if y_46_re <= -3.9e+35:
              		tmp = t_0
              	elif y_46_re <= 0.0014:
              		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im
              	else:
              		tmp = t_0
              	return tmp
              
              function code(x_46_re, x_46_im, y_46_re, y_46_im)
              	t_0 = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re)
              	tmp = 0.0
              	if (y_46_re <= -3.9e+35)
              		tmp = t_0;
              	elseif (y_46_re <= 0.0014)
              		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
              	else
              		tmp = t_0;
              	end
              	return tmp
              end
              
              function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
              	t_0 = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
              	tmp = 0.0;
              	if (y_46_re <= -3.9e+35)
              		tmp = t_0;
              	elseif (y_46_re <= 0.0014)
              		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
              	else
              		tmp = t_0;
              	end
              	tmp_2 = tmp;
              end
              
              code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -3.9e+35], t$95$0, If[LessEqual[y$46$re, 0.0014], N[(N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
              \mathbf{if}\;y.re \leq -3.9 \cdot 10^{+35}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;y.re \leq 0.0014:\\
              \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y.re < -3.8999999999999999e35 or 0.00139999999999999999 < y.re

                1. Initial program 55.5%

                  \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                2. Add Preprocessing
                3. Taylor expanded in y.re around inf

                  \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                4. Step-by-step derivation
                  1. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                  2. mul-1-negN/A

                    \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
                  3. unsub-negN/A

                    \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                  4. lower--.f64N/A

                    \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                  5. lower-/.f64N/A

                    \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                  6. lower-*.f6476.2

                    \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
                5. Applied rewrites76.2%

                  \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                6. Step-by-step derivation
                  1. Applied rewrites82.1%

                    \[\leadsto \frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re} \]

                  if -3.8999999999999999e35 < y.re < 0.00139999999999999999

                  1. Initial program 72.4%

                    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y.re around 0

                    \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im} + \frac{x.im \cdot y.re}{{y.im}^{2}}} \]
                  4. Step-by-step derivation
                    1. +-commutativeN/A

                      \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
                    2. mul-1-negN/A

                      \[\leadsto \frac{x.im \cdot y.re}{{y.im}^{2}} + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re}{y.im}\right)\right)} \]
                    3. unsub-negN/A

                      \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
                    4. unpow2N/A

                      \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{y.im \cdot y.im}} - \frac{x.re}{y.im} \]
                    5. associate-/r*N/A

                      \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im}}{y.im}} - \frac{x.re}{y.im} \]
                    6. div-subN/A

                      \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
                    7. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
                    8. lower--.f64N/A

                      \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im} - x.re}}{y.im} \]
                    9. lower-/.f64N/A

                      \[\leadsto \frac{\color{blue}{\frac{x.im \cdot y.re}{y.im}} - x.re}{y.im} \]
                    10. lower-*.f6483.2

                      \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re}}{y.im} - x.re}{y.im} \]
                  5. Applied rewrites83.2%

                    \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}} \]
                7. Recombined 2 regimes into one program.
                8. Final simplification82.6%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.9 \cdot 10^{+35}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq 0.0014:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \end{array} \]
                9. Add Preprocessing

                Alternative 7: 72.7% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -4.5 \cdot 10^{+69}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq 3200000000:\\ \;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (let* ((t_0 (/ (- x.re) y.im)))
                   (if (<= y.im -4.5e+69)
                     t_0
                     (if (<= y.im 3200000000.0)
                       (/ (- x.im (/ (* y.im x.re) y.re)) y.re)
                       t_0))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double t_0 = -x_46_re / y_46_im;
                	double tmp;
                	if (y_46_im <= -4.5e+69) {
                		tmp = t_0;
                	} else if (y_46_im <= 3200000000.0) {
                		tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                real(8) function code(x_46re, x_46im, y_46re, y_46im)
                    real(8), intent (in) :: x_46re
                    real(8), intent (in) :: x_46im
                    real(8), intent (in) :: y_46re
                    real(8), intent (in) :: y_46im
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = -x_46re / y_46im
                    if (y_46im <= (-4.5d+69)) then
                        tmp = t_0
                    else if (y_46im <= 3200000000.0d0) then
                        tmp = (x_46im - ((y_46im * x_46re) / y_46re)) / y_46re
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double t_0 = -x_46_re / y_46_im;
                	double tmp;
                	if (y_46_im <= -4.5e+69) {
                		tmp = t_0;
                	} else if (y_46_im <= 3200000000.0) {
                		tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x_46_re, x_46_im, y_46_re, y_46_im):
                	t_0 = -x_46_re / y_46_im
                	tmp = 0
                	if y_46_im <= -4.5e+69:
                		tmp = t_0
                	elif y_46_im <= 3200000000.0:
                		tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	t_0 = Float64(Float64(-x_46_re) / y_46_im)
                	tmp = 0.0
                	if (y_46_im <= -4.5e+69)
                		tmp = t_0;
                	elseif (y_46_im <= 3200000000.0)
                		tmp = Float64(Float64(x_46_im - Float64(Float64(y_46_im * x_46_re) / y_46_re)) / y_46_re);
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                	t_0 = -x_46_re / y_46_im;
                	tmp = 0.0;
                	if (y_46_im <= -4.5e+69)
                		tmp = t_0;
                	elseif (y_46_im <= 3200000000.0)
                		tmp = (x_46_im - ((y_46_im * x_46_re) / y_46_re)) / y_46_re;
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -4.5e+69], t$95$0, If[LessEqual[y$46$im, 3200000000.0], N[(N[(x$46$im - N[(N[(y$46$im * x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{-x.re}{y.im}\\
                \mathbf{if}\;y.im \leq -4.5 \cdot 10^{+69}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;y.im \leq 3200000000:\\
                \;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y.im < -4.4999999999999999e69 or 3.2e9 < y.im

                  1. Initial program 50.8%

                    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y.re around 0

                    \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
                  4. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x.re}{y.im}\right)} \]
                    2. distribute-neg-frac2N/A

                      \[\leadsto \color{blue}{\frac{x.re}{\mathsf{neg}\left(y.im\right)}} \]
                    3. mul-1-negN/A

                      \[\leadsto \frac{x.re}{\color{blue}{-1 \cdot y.im}} \]
                    4. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{x.re}{-1 \cdot y.im}} \]
                    5. mul-1-negN/A

                      \[\leadsto \frac{x.re}{\color{blue}{\mathsf{neg}\left(y.im\right)}} \]
                    6. lower-neg.f6471.0

                      \[\leadsto \frac{x.re}{\color{blue}{-y.im}} \]
                  5. Applied rewrites71.0%

                    \[\leadsto \color{blue}{\frac{x.re}{-y.im}} \]

                  if -4.4999999999999999e69 < y.im < 3.2e9

                  1. Initial program 74.7%

                    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y.re around inf

                    \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                    2. mul-1-negN/A

                      \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
                    3. unsub-negN/A

                      \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                    4. lower--.f64N/A

                      \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                    5. lower-/.f64N/A

                      \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                    6. lower-*.f6480.6

                      \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
                  5. Applied rewrites80.6%

                    \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                3. Recombined 2 regimes into one program.
                4. Final simplification76.2%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -4.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq 3200000000:\\ \;\;\;\;\frac{x.im - \frac{y.im \cdot x.re}{y.re}}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
                5. Add Preprocessing

                Alternative 8: 71.9% accurate, 0.9× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -6.4 \cdot 10^{+69}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq 3200000000:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (x.re x.im y.re y.im)
                 :precision binary64
                 (let* ((t_0 (/ (- x.re) y.im)))
                   (if (<= y.im -6.4e+69)
                     t_0
                     (if (<= y.im 3200000000.0)
                       (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
                       t_0))))
                double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double t_0 = -x_46_re / y_46_im;
                	double tmp;
                	if (y_46_im <= -6.4e+69) {
                		tmp = t_0;
                	} else if (y_46_im <= 3200000000.0) {
                		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                real(8) function code(x_46re, x_46im, y_46re, y_46im)
                    real(8), intent (in) :: x_46re
                    real(8), intent (in) :: x_46im
                    real(8), intent (in) :: y_46re
                    real(8), intent (in) :: y_46im
                    real(8) :: t_0
                    real(8) :: tmp
                    t_0 = -x_46re / y_46im
                    if (y_46im <= (-6.4d+69)) then
                        tmp = t_0
                    else if (y_46im <= 3200000000.0d0) then
                        tmp = (x_46im - ((x_46re / y_46re) * y_46im)) / y_46re
                    else
                        tmp = t_0
                    end if
                    code = tmp
                end function
                
                public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                	double t_0 = -x_46_re / y_46_im;
                	double tmp;
                	if (y_46_im <= -6.4e+69) {
                		tmp = t_0;
                	} else if (y_46_im <= 3200000000.0) {
                		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(x_46_re, x_46_im, y_46_re, y_46_im):
                	t_0 = -x_46_re / y_46_im
                	tmp = 0
                	if y_46_im <= -6.4e+69:
                		tmp = t_0
                	elif y_46_im <= 3200000000.0:
                		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re
                	else:
                		tmp = t_0
                	return tmp
                
                function code(x_46_re, x_46_im, y_46_re, y_46_im)
                	t_0 = Float64(Float64(-x_46_re) / y_46_im)
                	tmp = 0.0
                	if (y_46_im <= -6.4e+69)
                		tmp = t_0;
                	elseif (y_46_im <= 3200000000.0)
                		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                	t_0 = -x_46_re / y_46_im;
                	tmp = 0.0;
                	if (y_46_im <= -6.4e+69)
                		tmp = t_0;
                	elseif (y_46_im <= 3200000000.0)
                		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
                	else
                		tmp = t_0;
                	end
                	tmp_2 = tmp;
                end
                
                code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -6.4e+69], t$95$0, If[LessEqual[y$46$im, 3200000000.0], N[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := \frac{-x.re}{y.im}\\
                \mathbf{if}\;y.im \leq -6.4 \cdot 10^{+69}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;y.im \leq 3200000000:\\
                \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if y.im < -6.3999999999999997e69 or 3.2e9 < y.im

                  1. Initial program 50.8%

                    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y.re around 0

                    \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
                  4. Step-by-step derivation
                    1. mul-1-negN/A

                      \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x.re}{y.im}\right)} \]
                    2. distribute-neg-frac2N/A

                      \[\leadsto \color{blue}{\frac{x.re}{\mathsf{neg}\left(y.im\right)}} \]
                    3. mul-1-negN/A

                      \[\leadsto \frac{x.re}{\color{blue}{-1 \cdot y.im}} \]
                    4. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{x.re}{-1 \cdot y.im}} \]
                    5. mul-1-negN/A

                      \[\leadsto \frac{x.re}{\color{blue}{\mathsf{neg}\left(y.im\right)}} \]
                    6. lower-neg.f6471.0

                      \[\leadsto \frac{x.re}{\color{blue}{-y.im}} \]
                  5. Applied rewrites71.0%

                    \[\leadsto \color{blue}{\frac{x.re}{-y.im}} \]

                  if -6.3999999999999997e69 < y.im < 3.2e9

                  1. Initial program 74.7%

                    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                  2. Add Preprocessing
                  3. Taylor expanded in y.re around inf

                    \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                  4. Step-by-step derivation
                    1. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                    2. mul-1-negN/A

                      \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
                    3. unsub-negN/A

                      \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                    4. lower--.f64N/A

                      \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                    5. lower-/.f64N/A

                      \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                    6. lower-*.f6480.6

                      \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
                  5. Applied rewrites80.6%

                    \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                  6. Step-by-step derivation
                    1. Applied rewrites79.8%

                      \[\leadsto \frac{x.im - y.im \cdot \frac{x.re}{y.re}}{y.re} \]
                  7. Recombined 2 regimes into one program.
                  8. Final simplification75.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -6.4 \cdot 10^{+69}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq 3200000000:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
                  9. Add Preprocessing

                  Alternative 9: 61.8% accurate, 0.9× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -5.6 \cdot 10^{+61}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-40}:\\ \;\;\;\;\frac{-y.im}{y.re} \cdot \frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (x.re x.im y.re y.im)
                   :precision binary64
                   (let* ((t_0 (/ (- x.re) y.im)))
                     (if (<= y.im -5.6e+61)
                       t_0
                       (if (<= y.im -2.3e-40)
                         (* (/ (- y.im) y.re) (/ x.re y.re))
                         (if (<= y.im 3.3e-39) (/ x.im y.re) t_0)))))
                  double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	double t_0 = -x_46_re / y_46_im;
                  	double tmp;
                  	if (y_46_im <= -5.6e+61) {
                  		tmp = t_0;
                  	} else if (y_46_im <= -2.3e-40) {
                  		tmp = (-y_46_im / y_46_re) * (x_46_re / y_46_re);
                  	} else if (y_46_im <= 3.3e-39) {
                  		tmp = x_46_im / y_46_re;
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  real(8) function code(x_46re, x_46im, y_46re, y_46im)
                      real(8), intent (in) :: x_46re
                      real(8), intent (in) :: x_46im
                      real(8), intent (in) :: y_46re
                      real(8), intent (in) :: y_46im
                      real(8) :: t_0
                      real(8) :: tmp
                      t_0 = -x_46re / y_46im
                      if (y_46im <= (-5.6d+61)) then
                          tmp = t_0
                      else if (y_46im <= (-2.3d-40)) then
                          tmp = (-y_46im / y_46re) * (x_46re / y_46re)
                      else if (y_46im <= 3.3d-39) then
                          tmp = x_46im / y_46re
                      else
                          tmp = t_0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                  	double t_0 = -x_46_re / y_46_im;
                  	double tmp;
                  	if (y_46_im <= -5.6e+61) {
                  		tmp = t_0;
                  	} else if (y_46_im <= -2.3e-40) {
                  		tmp = (-y_46_im / y_46_re) * (x_46_re / y_46_re);
                  	} else if (y_46_im <= 3.3e-39) {
                  		tmp = x_46_im / y_46_re;
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  def code(x_46_re, x_46_im, y_46_re, y_46_im):
                  	t_0 = -x_46_re / y_46_im
                  	tmp = 0
                  	if y_46_im <= -5.6e+61:
                  		tmp = t_0
                  	elif y_46_im <= -2.3e-40:
                  		tmp = (-y_46_im / y_46_re) * (x_46_re / y_46_re)
                  	elif y_46_im <= 3.3e-39:
                  		tmp = x_46_im / y_46_re
                  	else:
                  		tmp = t_0
                  	return tmp
                  
                  function code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	t_0 = Float64(Float64(-x_46_re) / y_46_im)
                  	tmp = 0.0
                  	if (y_46_im <= -5.6e+61)
                  		tmp = t_0;
                  	elseif (y_46_im <= -2.3e-40)
                  		tmp = Float64(Float64(Float64(-y_46_im) / y_46_re) * Float64(x_46_re / y_46_re));
                  	elseif (y_46_im <= 3.3e-39)
                  		tmp = Float64(x_46_im / y_46_re);
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                  	t_0 = -x_46_re / y_46_im;
                  	tmp = 0.0;
                  	if (y_46_im <= -5.6e+61)
                  		tmp = t_0;
                  	elseif (y_46_im <= -2.3e-40)
                  		tmp = (-y_46_im / y_46_re) * (x_46_re / y_46_re);
                  	elseif (y_46_im <= 3.3e-39)
                  		tmp = x_46_im / y_46_re;
                  	else
                  		tmp = t_0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -5.6e+61], t$95$0, If[LessEqual[y$46$im, -2.3e-40], N[(N[((-y$46$im) / y$46$re), $MachinePrecision] * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 3.3e-39], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \frac{-x.re}{y.im}\\
                  \mathbf{if}\;y.im \leq -5.6 \cdot 10^{+61}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-40}:\\
                  \;\;\;\;\frac{-y.im}{y.re} \cdot \frac{x.re}{y.re}\\
                  
                  \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\
                  \;\;\;\;\frac{x.im}{y.re}\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if y.im < -5.6000000000000003e61 or 3.29999999999999985e-39 < y.im

                    1. Initial program 52.0%

                      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                    2. Add Preprocessing
                    3. Taylor expanded in y.re around 0

                      \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
                    4. Step-by-step derivation
                      1. mul-1-negN/A

                        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x.re}{y.im}\right)} \]
                      2. distribute-neg-frac2N/A

                        \[\leadsto \color{blue}{\frac{x.re}{\mathsf{neg}\left(y.im\right)}} \]
                      3. mul-1-negN/A

                        \[\leadsto \frac{x.re}{\color{blue}{-1 \cdot y.im}} \]
                      4. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{x.re}{-1 \cdot y.im}} \]
                      5. mul-1-negN/A

                        \[\leadsto \frac{x.re}{\color{blue}{\mathsf{neg}\left(y.im\right)}} \]
                      6. lower-neg.f6467.5

                        \[\leadsto \frac{x.re}{\color{blue}{-y.im}} \]
                    5. Applied rewrites67.5%

                      \[\leadsto \color{blue}{\frac{x.re}{-y.im}} \]

                    if -5.6000000000000003e61 < y.im < -2.3e-40

                    1. Initial program 80.3%

                      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                    2. Add Preprocessing
                    3. Taylor expanded in y.re around inf

                      \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                    4. Step-by-step derivation
                      1. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{x.im + -1 \cdot \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                      2. mul-1-negN/A

                        \[\leadsto \frac{x.im + \color{blue}{\left(\mathsf{neg}\left(\frac{x.re \cdot y.im}{y.re}\right)\right)}}{y.re} \]
                      3. unsub-negN/A

                        \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                      4. lower--.f64N/A

                        \[\leadsto \frac{\color{blue}{x.im - \frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                      5. lower-/.f64N/A

                        \[\leadsto \frac{x.im - \color{blue}{\frac{x.re \cdot y.im}{y.re}}}{y.re} \]
                      6. lower-*.f6462.7

                        \[\leadsto \frac{x.im - \frac{\color{blue}{x.re \cdot y.im}}{y.re}}{y.re} \]
                    5. Applied rewrites62.7%

                      \[\leadsto \color{blue}{\frac{x.im - \frac{x.re \cdot y.im}{y.re}}{y.re}} \]
                    6. Taylor expanded in x.re around inf

                      \[\leadsto -1 \cdot \color{blue}{\frac{x.re \cdot y.im}{{y.re}^{2}}} \]
                    7. Step-by-step derivation
                      1. Applied rewrites49.5%

                        \[\leadsto \frac{-x.re}{y.re} \cdot \color{blue}{\frac{y.im}{y.re}} \]

                      if -2.3e-40 < y.im < 3.29999999999999985e-39

                      1. Initial program 74.4%

                        \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y.re around inf

                        \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      4. Step-by-step derivation
                        1. lower-/.f6470.0

                          \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      5. Applied rewrites70.0%

                        \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                    8. Recombined 3 regimes into one program.
                    9. Final simplification66.8%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -5.6 \cdot 10^{+61}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq -2.3 \cdot 10^{-40}:\\ \;\;\;\;\frac{-y.im}{y.re} \cdot \frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 10: 62.9% accurate, 1.1× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -2.75 \cdot 10^{+14}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq -3 \cdot 10^{-31}:\\ \;\;\;\;\frac{y.im}{y.re \cdot y.re} \cdot \left(-x.re\right)\\ \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (x.re x.im y.re y.im)
                     :precision binary64
                     (let* ((t_0 (/ (- x.re) y.im)))
                       (if (<= y.im -2.75e+14)
                         t_0
                         (if (<= y.im -3e-31)
                           (* (/ y.im (* y.re y.re)) (- x.re))
                           (if (<= y.im 3.3e-39) (/ x.im y.re) t_0)))))
                    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                    	double t_0 = -x_46_re / y_46_im;
                    	double tmp;
                    	if (y_46_im <= -2.75e+14) {
                    		tmp = t_0;
                    	} else if (y_46_im <= -3e-31) {
                    		tmp = (y_46_im / (y_46_re * y_46_re)) * -x_46_re;
                    	} else if (y_46_im <= 3.3e-39) {
                    		tmp = x_46_im / y_46_re;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    real(8) function code(x_46re, x_46im, y_46re, y_46im)
                        real(8), intent (in) :: x_46re
                        real(8), intent (in) :: x_46im
                        real(8), intent (in) :: y_46re
                        real(8), intent (in) :: y_46im
                        real(8) :: t_0
                        real(8) :: tmp
                        t_0 = -x_46re / y_46im
                        if (y_46im <= (-2.75d+14)) then
                            tmp = t_0
                        else if (y_46im <= (-3d-31)) then
                            tmp = (y_46im / (y_46re * y_46re)) * -x_46re
                        else if (y_46im <= 3.3d-39) then
                            tmp = x_46im / y_46re
                        else
                            tmp = t_0
                        end if
                        code = tmp
                    end function
                    
                    public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                    	double t_0 = -x_46_re / y_46_im;
                    	double tmp;
                    	if (y_46_im <= -2.75e+14) {
                    		tmp = t_0;
                    	} else if (y_46_im <= -3e-31) {
                    		tmp = (y_46_im / (y_46_re * y_46_re)) * -x_46_re;
                    	} else if (y_46_im <= 3.3e-39) {
                    		tmp = x_46_im / y_46_re;
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(x_46_re, x_46_im, y_46_re, y_46_im):
                    	t_0 = -x_46_re / y_46_im
                    	tmp = 0
                    	if y_46_im <= -2.75e+14:
                    		tmp = t_0
                    	elif y_46_im <= -3e-31:
                    		tmp = (y_46_im / (y_46_re * y_46_re)) * -x_46_re
                    	elif y_46_im <= 3.3e-39:
                    		tmp = x_46_im / y_46_re
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(x_46_re, x_46_im, y_46_re, y_46_im)
                    	t_0 = Float64(Float64(-x_46_re) / y_46_im)
                    	tmp = 0.0
                    	if (y_46_im <= -2.75e+14)
                    		tmp = t_0;
                    	elseif (y_46_im <= -3e-31)
                    		tmp = Float64(Float64(y_46_im / Float64(y_46_re * y_46_re)) * Float64(-x_46_re));
                    	elseif (y_46_im <= 3.3e-39)
                    		tmp = Float64(x_46_im / y_46_re);
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                    	t_0 = -x_46_re / y_46_im;
                    	tmp = 0.0;
                    	if (y_46_im <= -2.75e+14)
                    		tmp = t_0;
                    	elseif (y_46_im <= -3e-31)
                    		tmp = (y_46_im / (y_46_re * y_46_re)) * -x_46_re;
                    	elseif (y_46_im <= 3.3e-39)
                    		tmp = x_46_im / y_46_re;
                    	else
                    		tmp = t_0;
                    	end
                    	tmp_2 = tmp;
                    end
                    
                    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.75e+14], t$95$0, If[LessEqual[y$46$im, -3e-31], N[(N[(y$46$im / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision] * (-x$46$re)), $MachinePrecision], If[LessEqual[y$46$im, 3.3e-39], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{-x.re}{y.im}\\
                    \mathbf{if}\;y.im \leq -2.75 \cdot 10^{+14}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;y.im \leq -3 \cdot 10^{-31}:\\
                    \;\;\;\;\frac{y.im}{y.re \cdot y.re} \cdot \left(-x.re\right)\\
                    
                    \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\
                    \;\;\;\;\frac{x.im}{y.re}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if y.im < -2.75e14 or 3.29999999999999985e-39 < y.im

                      1. Initial program 54.0%

                        \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y.re around 0

                        \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
                      4. Step-by-step derivation
                        1. mul-1-negN/A

                          \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x.re}{y.im}\right)} \]
                        2. distribute-neg-frac2N/A

                          \[\leadsto \color{blue}{\frac{x.re}{\mathsf{neg}\left(y.im\right)}} \]
                        3. mul-1-negN/A

                          \[\leadsto \frac{x.re}{\color{blue}{-1 \cdot y.im}} \]
                        4. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{x.re}{-1 \cdot y.im}} \]
                        5. mul-1-negN/A

                          \[\leadsto \frac{x.re}{\color{blue}{\mathsf{neg}\left(y.im\right)}} \]
                        6. lower-neg.f6463.1

                          \[\leadsto \frac{x.re}{\color{blue}{-y.im}} \]
                      5. Applied rewrites63.1%

                        \[\leadsto \color{blue}{\frac{x.re}{-y.im}} \]

                      if -2.75e14 < y.im < -2.99999999999999981e-31

                      1. Initial program 99.3%

                        \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                      2. Add Preprocessing
                      3. Taylor expanded in x.re around inf

                        \[\leadsto \color{blue}{-1 \cdot \frac{x.re \cdot y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                      4. Step-by-step derivation
                        1. associate-/l*N/A

                          \[\leadsto -1 \cdot \color{blue}{\left(x.re \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}}\right)} \]
                        2. associate-*r*N/A

                          \[\leadsto \color{blue}{\left(-1 \cdot x.re\right) \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                        3. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(-1 \cdot x.re\right) \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                        4. mul-1-negN/A

                          \[\leadsto \color{blue}{\left(\mathsf{neg}\left(x.re\right)\right)} \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}} \]
                        5. lower-neg.f64N/A

                          \[\leadsto \color{blue}{\left(-x.re\right)} \cdot \frac{y.im}{{y.im}^{2} + {y.re}^{2}} \]
                        6. lower-/.f64N/A

                          \[\leadsto \left(-x.re\right) \cdot \color{blue}{\frac{y.im}{{y.im}^{2} + {y.re}^{2}}} \]
                        7. unpow2N/A

                          \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\color{blue}{y.im \cdot y.im} + {y.re}^{2}} \]
                        8. lower-fma.f64N/A

                          \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\color{blue}{\mathsf{fma}\left(y.im, y.im, {y.re}^{2}\right)}} \]
                        9. unpow2N/A

                          \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, \color{blue}{y.re \cdot y.re}\right)} \]
                        10. lower-*.f6489.3

                          \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, \color{blue}{y.re \cdot y.re}\right)} \]
                      5. Applied rewrites89.3%

                        \[\leadsto \color{blue}{\left(-x.re\right) \cdot \frac{y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]
                      6. Taylor expanded in y.re around inf

                        \[\leadsto \left(-x.re\right) \cdot \frac{y.im}{\color{blue}{{y.re}^{2}}} \]
                      7. Step-by-step derivation
                        1. Applied rewrites78.2%

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

                        if -2.99999999999999981e-31 < y.im < 3.29999999999999985e-39

                        1. Initial program 74.4%

                          \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                        2. Add Preprocessing
                        3. Taylor expanded in y.re around inf

                          \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                        4. Step-by-step derivation
                          1. lower-/.f6470.0

                            \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                        5. Applied rewrites70.0%

                          \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      8. Recombined 3 regimes into one program.
                      9. Final simplification66.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -2.75 \cdot 10^{+14}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq -3 \cdot 10^{-31}:\\ \;\;\;\;\frac{y.im}{y.re \cdot y.re} \cdot \left(-x.re\right)\\ \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 11: 63.0% accurate, 1.5× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+65}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                      (FPCore (x.re x.im y.re y.im)
                       :precision binary64
                       (let* ((t_0 (/ (- x.re) y.im)))
                         (if (<= y.im -8.5e+65) t_0 (if (<= y.im 3.3e-39) (/ x.im y.re) t_0))))
                      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                      	double t_0 = -x_46_re / y_46_im;
                      	double tmp;
                      	if (y_46_im <= -8.5e+65) {
                      		tmp = t_0;
                      	} else if (y_46_im <= 3.3e-39) {
                      		tmp = x_46_im / y_46_re;
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(x_46re, x_46im, y_46re, y_46im)
                          real(8), intent (in) :: x_46re
                          real(8), intent (in) :: x_46im
                          real(8), intent (in) :: y_46re
                          real(8), intent (in) :: y_46im
                          real(8) :: t_0
                          real(8) :: tmp
                          t_0 = -x_46re / y_46im
                          if (y_46im <= (-8.5d+65)) then
                              tmp = t_0
                          else if (y_46im <= 3.3d-39) then
                              tmp = x_46im / y_46re
                          else
                              tmp = t_0
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                      	double t_0 = -x_46_re / y_46_im;
                      	double tmp;
                      	if (y_46_im <= -8.5e+65) {
                      		tmp = t_0;
                      	} else if (y_46_im <= 3.3e-39) {
                      		tmp = x_46_im / y_46_re;
                      	} else {
                      		tmp = t_0;
                      	}
                      	return tmp;
                      }
                      
                      def code(x_46_re, x_46_im, y_46_re, y_46_im):
                      	t_0 = -x_46_re / y_46_im
                      	tmp = 0
                      	if y_46_im <= -8.5e+65:
                      		tmp = t_0
                      	elif y_46_im <= 3.3e-39:
                      		tmp = x_46_im / y_46_re
                      	else:
                      		tmp = t_0
                      	return tmp
                      
                      function code(x_46_re, x_46_im, y_46_re, y_46_im)
                      	t_0 = Float64(Float64(-x_46_re) / y_46_im)
                      	tmp = 0.0
                      	if (y_46_im <= -8.5e+65)
                      		tmp = t_0;
                      	elseif (y_46_im <= 3.3e-39)
                      		tmp = Float64(x_46_im / y_46_re);
                      	else
                      		tmp = t_0;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
                      	t_0 = -x_46_re / y_46_im;
                      	tmp = 0.0;
                      	if (y_46_im <= -8.5e+65)
                      		tmp = t_0;
                      	elseif (y_46_im <= 3.3e-39)
                      		tmp = x_46_im / y_46_re;
                      	else
                      		tmp = t_0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e+65], t$95$0, If[LessEqual[y$46$im, 3.3e-39], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      t_0 := \frac{-x.re}{y.im}\\
                      \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+65}:\\
                      \;\;\;\;t\_0\\
                      
                      \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\
                      \;\;\;\;\frac{x.im}{y.re}\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if y.im < -8.50000000000000075e65 or 3.29999999999999985e-39 < y.im

                        1. Initial program 52.4%

                          \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                        2. Add Preprocessing
                        3. Taylor expanded in y.re around 0

                          \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
                        4. Step-by-step derivation
                          1. mul-1-negN/A

                            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{x.re}{y.im}\right)} \]
                          2. distribute-neg-frac2N/A

                            \[\leadsto \color{blue}{\frac{x.re}{\mathsf{neg}\left(y.im\right)}} \]
                          3. mul-1-negN/A

                            \[\leadsto \frac{x.re}{\color{blue}{-1 \cdot y.im}} \]
                          4. lower-/.f64N/A

                            \[\leadsto \color{blue}{\frac{x.re}{-1 \cdot y.im}} \]
                          5. mul-1-negN/A

                            \[\leadsto \frac{x.re}{\color{blue}{\mathsf{neg}\left(y.im\right)}} \]
                          6. lower-neg.f6468.0

                            \[\leadsto \frac{x.re}{\color{blue}{-y.im}} \]
                        5. Applied rewrites68.0%

                          \[\leadsto \color{blue}{\frac{x.re}{-y.im}} \]

                        if -8.50000000000000075e65 < y.im < 3.29999999999999985e-39

                        1. Initial program 75.0%

                          \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                        2. Add Preprocessing
                        3. Taylor expanded in y.re around inf

                          \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                        4. Step-by-step derivation
                          1. lower-/.f6461.4

                            \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                        5. Applied rewrites61.4%

                          \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification64.7%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+65}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq 3.3 \cdot 10^{-39}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 12: 42.1% accurate, 3.2× speedup?

                      \[\begin{array}{l} \\ \frac{x.im}{y.re} \end{array} \]
                      (FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.im y.re))
                      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                      	return x_46_im / y_46_re;
                      }
                      
                      real(8) function code(x_46re, x_46im, y_46re, y_46im)
                          real(8), intent (in) :: x_46re
                          real(8), intent (in) :: x_46im
                          real(8), intent (in) :: y_46re
                          real(8), intent (in) :: y_46im
                          code = x_46im / y_46re
                      end function
                      
                      public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
                      	return x_46_im / y_46_re;
                      }
                      
                      def code(x_46_re, x_46_im, y_46_re, y_46_im):
                      	return x_46_im / y_46_re
                      
                      function code(x_46_re, x_46_im, y_46_re, y_46_im)
                      	return Float64(x_46_im / y_46_re)
                      end
                      
                      function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
                      	tmp = x_46_im / y_46_re;
                      end
                      
                      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$re), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \frac{x.im}{y.re}
                      \end{array}
                      
                      Derivation
                      1. Initial program 63.8%

                        \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
                      2. Add Preprocessing
                      3. Taylor expanded in y.re around inf

                        \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      4. Step-by-step derivation
                        1. lower-/.f6440.4

                          \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      5. Applied rewrites40.4%

                        \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
                      6. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2024294 
                      (FPCore (x.re x.im y.re y.im)
                        :name "_divideComplex, imaginary part"
                        :precision binary64
                        (/ (- (* x.im y.re) (* x.re y.im)) (+ (* y.re y.re) (* y.im y.im))))