_divideComplex, imaginary part

Percentage Accurate: 61.4% → 83.2%
Time: 8.3s
Alternatives: 16
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 16 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.4% 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.2% accurate, 0.4× 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 -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.im, \frac{x.re}{y.im} \cdot \frac{y.re \cdot y.re}{y.im}\right) - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\ \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 -3.1e+125)
     (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
     (if (<= y.re -1.1e+108)
       (/
        (-
         (fma (/ y.re y.im) x.im (* (/ x.re y.im) (/ (* y.re y.re) y.im)))
         x.re)
        y.im)
       (if (<= y.re -1.05e-104)
         t_1
         (if (<= y.re 1.85e-148)
           (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
           (if (<= y.re 4.4e+91)
             t_1
             (fma (/ (- x.re) y.re) (/ y.im y.re) (/ x.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 <= -3.1e+125) {
		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
	} else if (y_46_re <= -1.1e+108) {
		tmp = (fma((y_46_re / y_46_im), x_46_im, ((x_46_re / y_46_im) * ((y_46_re * y_46_re) / y_46_im))) - x_46_re) / y_46_im;
	} else if (y_46_re <= -1.05e-104) {
		tmp = t_1;
	} else if (y_46_re <= 1.85e-148) {
		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
	} else if (y_46_re <= 4.4e+91) {
		tmp = t_1;
	} else {
		tmp = fma((-x_46_re / y_46_re), (y_46_im / y_46_re), (x_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 <= -3.1e+125)
		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
	elseif (y_46_re <= -1.1e+108)
		tmp = Float64(Float64(fma(Float64(y_46_re / y_46_im), x_46_im, Float64(Float64(x_46_re / y_46_im) * Float64(Float64(y_46_re * y_46_re) / y_46_im))) - x_46_re) / y_46_im);
	elseif (y_46_re <= -1.05e-104)
		tmp = t_1;
	elseif (y_46_re <= 1.85e-148)
		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
	elseif (y_46_re <= 4.4e+91)
		tmp = t_1;
	else
		tmp = fma(Float64(Float64(-x_46_re) / y_46_re), Float64(y_46_im / y_46_re), Float64(x_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, -3.1e+125], 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, -1.1e+108], N[(N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$im + N[(N[(x$46$re / y$46$im), $MachinePrecision] * N[(N[(y$46$re * y$46$re), $MachinePrecision] / y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x$46$re), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -1.05e-104], t$95$1, If[LessEqual[y$46$re, 1.85e-148], 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, 4.4e+91], t$95$1, N[(N[((-x$46$re) / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision] + N[(x$46$im / y$46$re), $MachinePrecision]), $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 -3.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\

\mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.im, \frac{x.re}{y.im} \cdot \frac{y.re \cdot y.re}{y.im}\right) - x.re}{y.im}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y.re < -3.1e125

    1. Initial program 47.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6447.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6447.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6495.1

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < y.re < -1.1000000000000001e108

    1. Initial program 12.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. 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. frac-subN/A

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

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

        \[\leadsto \color{blue}{\frac{\frac{\left(x.im \cdot y.re\right) \cdot \left(y.re \cdot y.re + y.im \cdot y.im\right) - \left(y.re \cdot y.re + y.im \cdot y.im\right) \cdot \left(x.re \cdot y.im\right)}{y.re \cdot y.re + y.im \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im}} \]
    4. Applied rewrites0.3%

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

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

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

    if -1.1000000000000001e108 < y.re < -1.04999999999999999e-104 or 1.85000000000000017e-148 < y.re < 4.39999999999999999e91

    1. Initial program 77.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. 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) \]
    4. Applied rewrites83.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 -1.04999999999999999e-104 < y.re < 1.85000000000000017e-148

    1. Initial program 66.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} + \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-*.f6494.3

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

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

    if 4.39999999999999999e91 < y.re

    1. Initial program 37.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6491.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.im, \frac{x.re}{y.im} \cdot \frac{y.re \cdot y.re}{y.im}\right) - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;\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 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;\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}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 83.2% accurate, 0.4× 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 -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\ \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 -3.1e+125)
     (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
     (if (<= y.re -1.1e+108)
       (/ (fma (/ x.im y.im) y.re (- x.re)) y.im)
       (if (<= y.re -1.05e-104)
         t_1
         (if (<= y.re 1.85e-148)
           (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
           (if (<= y.re 4.4e+91)
             t_1
             (fma (/ (- x.re) y.re) (/ y.im y.re) (/ x.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 <= -3.1e+125) {
		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
	} else if (y_46_re <= -1.1e+108) {
		tmp = fma((x_46_im / y_46_im), y_46_re, -x_46_re) / y_46_im;
	} else if (y_46_re <= -1.05e-104) {
		tmp = t_1;
	} else if (y_46_re <= 1.85e-148) {
		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
	} else if (y_46_re <= 4.4e+91) {
		tmp = t_1;
	} else {
		tmp = fma((-x_46_re / y_46_re), (y_46_im / y_46_re), (x_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 <= -3.1e+125)
		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
	elseif (y_46_re <= -1.1e+108)
		tmp = Float64(fma(Float64(x_46_im / y_46_im), y_46_re, Float64(-x_46_re)) / y_46_im);
	elseif (y_46_re <= -1.05e-104)
		tmp = t_1;
	elseif (y_46_re <= 1.85e-148)
		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
	elseif (y_46_re <= 4.4e+91)
		tmp = t_1;
	else
		tmp = fma(Float64(Float64(-x_46_re) / y_46_re), Float64(y_46_im / y_46_re), Float64(x_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, -3.1e+125], 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, -1.1e+108], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -1.05e-104], t$95$1, If[LessEqual[y$46$re, 1.85e-148], 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, 4.4e+91], t$95$1, N[(N[((-x$46$re) / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision] + N[(x$46$im / y$46$re), $MachinePrecision]), $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 -3.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\

\mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\

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

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

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y.re < -3.1e125

    1. Initial program 47.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6447.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6447.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6495.1

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < y.re < -1.1000000000000001e108

    1. Initial program 12.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6413.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6413.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6417.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}}} \]
    9. 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. sub-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, \color{blue}{\mathsf{neg}\left(x.re\right)}\right)}{y.im} \]
      14. lower-neg.f6487.4

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

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

    if -1.1000000000000001e108 < y.re < -1.04999999999999999e-104 or 1.85000000000000017e-148 < y.re < 4.39999999999999999e91

    1. Initial program 77.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. 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) \]
    4. Applied rewrites83.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 -1.04999999999999999e-104 < y.re < 1.85000000000000017e-148

    1. Initial program 66.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} + \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-*.f6494.3

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

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

    if 4.39999999999999999e91 < y.re

    1. Initial program 37.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6491.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification89.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -1.05 \cdot 10^{-104}:\\ \;\;\;\;\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 1.85 \cdot 10^{-148}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4.4 \cdot 10^{+91}:\\ \;\;\;\;\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}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 82.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (<= y.re -3.1e+125)
   (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
   (if (<= y.re -1.1e+108)
     (/ (fma (/ x.im y.im) y.re (- x.re)) y.im)
     (if (<= y.re -6.5e-80)
       (*
        (/ -1.0 (fma y.im y.im (* y.re y.re)))
        (fma (- x.im) y.re (* y.im x.re)))
       (if (<= y.re 1.35e-71)
         (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
         (if (<= y.re 2.5e+85)
           (/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.im y.im) (* y.re y.re)))
           (fma (/ (- x.re) y.re) (/ y.im y.re) (/ x.im y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double tmp;
	if (y_46_re <= -3.1e+125) {
		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
	} else if (y_46_re <= -1.1e+108) {
		tmp = fma((x_46_im / y_46_im), y_46_re, -x_46_re) / y_46_im;
	} else if (y_46_re <= -6.5e-80) {
		tmp = (-1.0 / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * fma(-x_46_im, y_46_re, (y_46_im * x_46_re));
	} else if (y_46_re <= 1.35e-71) {
		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
	} else if (y_46_re <= 2.5e+85) {
		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_im * y_46_im) + (y_46_re * y_46_re));
	} else {
		tmp = fma((-x_46_re / y_46_re), (y_46_im / y_46_re), (x_46_im / y_46_re));
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = 0.0
	if (y_46_re <= -3.1e+125)
		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
	elseif (y_46_re <= -1.1e+108)
		tmp = Float64(fma(Float64(x_46_im / y_46_im), y_46_re, Float64(-x_46_re)) / y_46_im);
	elseif (y_46_re <= -6.5e-80)
		tmp = Float64(Float64(-1.0 / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * fma(Float64(-x_46_im), y_46_re, Float64(y_46_im * x_46_re)));
	elseif (y_46_re <= 1.35e-71)
		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
	elseif (y_46_re <= 2.5e+85)
		tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_im * y_46_im) + Float64(y_46_re * y_46_re)));
	else
		tmp = fma(Float64(Float64(-x_46_re) / y_46_re), Float64(y_46_im / y_46_re), Float64(x_46_im / y_46_re));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.1e+125], 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, -1.1e+108], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -6.5e-80], N[(N[(-1.0 / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-x$46$im) * y$46$re + N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.35e-71], 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, 2.5e+85], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$im * y$46$im), $MachinePrecision] + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x$46$re) / y$46$re), $MachinePrecision] * N[(y$46$im / y$46$re), $MachinePrecision] + N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\

\mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\

\mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\

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

\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\
\;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y.re < -3.1e125

    1. Initial program 47.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6447.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6447.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6495.1

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < y.re < -1.1000000000000001e108

    1. Initial program 12.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6413.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6413.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6417.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}}} \]
    9. 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. sub-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, \color{blue}{\mathsf{neg}\left(x.re\right)}\right)}{y.im} \]
      14. lower-neg.f6487.4

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

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

    if -1.1000000000000001e108 < y.re < -6.49999999999999984e-80

    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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6475.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6475.0

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

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

    if -6.49999999999999984e-80 < y.re < 1.3500000000000001e-71

    1. Initial program 66.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} + \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.8

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

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

    if 1.3500000000000001e-71 < y.re < 2.5e85

    1. Initial program 84.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

    if 2.5e85 < y.re

    1. Initial program 36.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6436.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6436.4

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification87.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 81.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x.re, \frac{\frac{y.im}{y.re}}{y.re}, \frac{x.im}{y.re}\right)\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (<= y.re -3.1e+125)
   (/ (- x.im (* (/ x.re y.re) y.im)) y.re)
   (if (<= y.re -1.1e+108)
     (/ (fma (/ x.im y.im) y.re (- x.re)) y.im)
     (if (<= y.re -6.5e-80)
       (*
        (/ -1.0 (fma y.im y.im (* y.re y.re)))
        (fma (- x.im) y.re (* y.im x.re)))
       (if (<= y.re 1.35e-71)
         (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
         (if (<= y.re 2.5e+85)
           (/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.im y.im) (* y.re y.re)))
           (fma (- x.re) (/ (/ y.im y.re) y.re) (/ x.im y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double tmp;
	if (y_46_re <= -3.1e+125) {
		tmp = (x_46_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
	} else if (y_46_re <= -1.1e+108) {
		tmp = fma((x_46_im / y_46_im), y_46_re, -x_46_re) / y_46_im;
	} else if (y_46_re <= -6.5e-80) {
		tmp = (-1.0 / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * fma(-x_46_im, y_46_re, (y_46_im * x_46_re));
	} else if (y_46_re <= 1.35e-71) {
		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
	} else if (y_46_re <= 2.5e+85) {
		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_im * y_46_im) + (y_46_re * y_46_re));
	} else {
		tmp = fma(-x_46_re, ((y_46_im / y_46_re) / y_46_re), (x_46_im / y_46_re));
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = 0.0
	if (y_46_re <= -3.1e+125)
		tmp = Float64(Float64(x_46_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re);
	elseif (y_46_re <= -1.1e+108)
		tmp = Float64(fma(Float64(x_46_im / y_46_im), y_46_re, Float64(-x_46_re)) / y_46_im);
	elseif (y_46_re <= -6.5e-80)
		tmp = Float64(Float64(-1.0 / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * fma(Float64(-x_46_im), y_46_re, Float64(y_46_im * x_46_re)));
	elseif (y_46_re <= 1.35e-71)
		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
	elseif (y_46_re <= 2.5e+85)
		tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_im * y_46_im) + Float64(y_46_re * y_46_re)));
	else
		tmp = fma(Float64(-x_46_re), Float64(Float64(y_46_im / y_46_re) / y_46_re), Float64(x_46_im / y_46_re));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -3.1e+125], 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, -1.1e+108], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -6.5e-80], N[(N[(-1.0 / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-x$46$im) * y$46$re + N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.35e-71], 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, 2.5e+85], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$im * y$46$im), $MachinePrecision] + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x$46$re) * N[(N[(y$46$im / y$46$re), $MachinePrecision] / y$46$re), $MachinePrecision] + N[(x$46$im / y$46$re), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\
\;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\

\mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\

\mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\

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

\mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\
\;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x.re, \frac{\frac{y.im}{y.re}}{y.re}, \frac{x.im}{y.re}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y.re < -3.1e125

    1. Initial program 47.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6447.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6447.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6495.1

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}} \]
    9. 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. *-commutativeN/A

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

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

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

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

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

    if -3.1e125 < y.re < -1.1000000000000001e108

    1. Initial program 12.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6413.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6413.0

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
      10. lower-/.f6417.0

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. 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}}} \]
    9. 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. sub-negN/A

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, \color{blue}{\mathsf{neg}\left(x.re\right)}\right)}{y.im} \]
      14. lower-neg.f6487.4

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

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

    if -1.1000000000000001e108 < y.re < -6.49999999999999984e-80

    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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6475.0

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6475.0

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

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

    if -6.49999999999999984e-80 < y.re < 1.3500000000000001e-71

    1. Initial program 66.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} + \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.8

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

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

    if 1.3500000000000001e-71 < y.re < 2.5e85

    1. Initial program 84.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

    if 2.5e85 < y.re

    1. Initial program 36.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
      16. lower-/.f6436.4

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

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

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

        \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
      20. lower-fma.f6436.4

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites89.0%

        \[\leadsto \mathsf{fma}\left(-x.re, \color{blue}{\frac{\frac{y.im}{y.re}}{y.re}}, \frac{x.im}{y.re}\right) \]
    9. Recombined 6 regimes into one program.
    10. Final simplification87.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-x.re, \frac{\frac{y.im}{y.re}}{y.re}, \frac{x.im}{y.re}\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 5: 82.2% accurate, 0.6× 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.1 \cdot 10^{+125}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot 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.im (* (/ x.re y.re) y.im)) y.re)))
       (if (<= y.re -3.1e+125)
         t_0
         (if (<= y.re -1.1e+108)
           (/ (fma (/ x.im y.im) y.re (- x.re)) y.im)
           (if (<= y.re -6.5e-80)
             (*
              (/ -1.0 (fma y.im y.im (* y.re y.re)))
              (fma (- x.im) y.re (* y.im x.re)))
             (if (<= y.re 1.35e-71)
               (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
               (if (<= y.re 2.5e+85)
                 (/
                  (- (* x.im y.re) (* y.im x.re))
                  (+ (* y.im y.im) (* 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_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
    	double tmp;
    	if (y_46_re <= -3.1e+125) {
    		tmp = t_0;
    	} else if (y_46_re <= -1.1e+108) {
    		tmp = fma((x_46_im / y_46_im), y_46_re, -x_46_re) / y_46_im;
    	} else if (y_46_re <= -6.5e-80) {
    		tmp = (-1.0 / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * fma(-x_46_im, y_46_re, (y_46_im * x_46_re));
    	} else if (y_46_re <= 1.35e-71) {
    		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
    	} else if (y_46_re <= 2.5e+85) {
    		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_im * y_46_im) + (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_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re)
    	tmp = 0.0
    	if (y_46_re <= -3.1e+125)
    		tmp = t_0;
    	elseif (y_46_re <= -1.1e+108)
    		tmp = Float64(fma(Float64(x_46_im / y_46_im), y_46_re, Float64(-x_46_re)) / y_46_im);
    	elseif (y_46_re <= -6.5e-80)
    		tmp = Float64(Float64(-1.0 / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * fma(Float64(-x_46_im), y_46_re, Float64(y_46_im * x_46_re)));
    	elseif (y_46_re <= 1.35e-71)
    		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
    	elseif (y_46_re <= 2.5e+85)
    		tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_im * y_46_im) + Float64(y_46_re * y_46_re)));
    	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[(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.1e+125], t$95$0, If[LessEqual[y$46$re, -1.1e+108], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -6.5e-80], N[(N[(-1.0 / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[((-x$46$im) * y$46$re + N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.35e-71], 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, 2.5e+85], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$im * y$46$im), $MachinePrecision] + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $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.1 \cdot 10^{+125}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\
    
    \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\
    \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\
    
    \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\
    \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\
    \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if y.re < -3.1e125 or 2.5e85 < y.re

      1. Initial program 41.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6441.5

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6441.5

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6491.9

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}} \]
      9. 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. *-commutativeN/A

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

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

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

          \[\leadsto \frac{x.im - y.im \cdot \color{blue}{\frac{x.re}{y.re}}}{y.re} \]
      10. Applied rewrites91.9%

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

      if -3.1e125 < y.re < -1.1000000000000001e108

      1. Initial program 12.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6413.0

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6413.0

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6417.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}}} \]
      9. 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. sub-negN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, \color{blue}{\mathsf{neg}\left(x.re\right)}\right)}{y.im} \]
        14. lower-neg.f6487.4

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

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

      if -1.1000000000000001e108 < y.re < -6.49999999999999984e-80

      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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6475.0

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6475.0

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

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

      if -6.49999999999999984e-80 < y.re < 1.3500000000000001e-71

      1. Initial program 66.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} + \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.8

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

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

      if 1.3500000000000001e-71 < y.re < 2.5e85

      1. Initial program 84.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. Recombined 5 regimes into one program.
    4. Final simplification87.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{-1}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot \mathsf{fma}\left(-x.im, y.re, y.im \cdot x.re\right)\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 6: 82.2% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ t_1 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;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.im (* (/ x.re y.re) y.im)) y.re))
            (t_1
             (/ (- (* x.im y.re) (* y.im x.re)) (+ (* y.im y.im) (* y.re y.re)))))
       (if (<= y.re -3.1e+125)
         t_0
         (if (<= y.re -1.1e+108)
           (/ (fma (/ x.im y.im) y.re (- x.re)) y.im)
           (if (<= y.re -6.5e-80)
             t_1
             (if (<= y.re 1.35e-71)
               (/ (- (/ (* x.im y.re) y.im) x.re) y.im)
               (if (<= y.re 2.5e+85) 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_im - ((x_46_re / y_46_re) * y_46_im)) / y_46_re;
    	double t_1 = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / ((y_46_im * y_46_im) + (y_46_re * y_46_re));
    	double tmp;
    	if (y_46_re <= -3.1e+125) {
    		tmp = t_0;
    	} else if (y_46_re <= -1.1e+108) {
    		tmp = fma((x_46_im / y_46_im), y_46_re, -x_46_re) / y_46_im;
    	} else if (y_46_re <= -6.5e-80) {
    		tmp = t_1;
    	} else if (y_46_re <= 1.35e-71) {
    		tmp = (((x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im;
    	} else if (y_46_re <= 2.5e+85) {
    		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_im - Float64(Float64(x_46_re / y_46_re) * y_46_im)) / y_46_re)
    	t_1 = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_im * y_46_im) + Float64(y_46_re * y_46_re)))
    	tmp = 0.0
    	if (y_46_re <= -3.1e+125)
    		tmp = t_0;
    	elseif (y_46_re <= -1.1e+108)
    		tmp = Float64(fma(Float64(x_46_im / y_46_im), y_46_re, Float64(-x_46_re)) / y_46_im);
    	elseif (y_46_re <= -6.5e-80)
    		tmp = t_1;
    	elseif (y_46_re <= 1.35e-71)
    		tmp = Float64(Float64(Float64(Float64(x_46_im * y_46_re) / y_46_im) - x_46_re) / y_46_im);
    	elseif (y_46_re <= 2.5e+85)
    		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[(N[(x$46$im - N[(N[(x$46$re / y$46$re), $MachinePrecision] * y$46$im), $MachinePrecision]), $MachinePrecision] / y$46$re), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$im * y$46$im), $MachinePrecision] + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.1e+125], t$95$0, If[LessEqual[y$46$re, -1.1e+108], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re + (-x$46$re)), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -6.5e-80], t$95$1, If[LessEqual[y$46$re, 1.35e-71], 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, 2.5e+85], t$95$1, t$95$0]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\
    t_1 := \frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\
    \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\
    
    \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\
    \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -3.1e125 or 2.5e85 < y.re

      1. Initial program 41.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6441.5

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6441.5

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6491.9

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}} \]
      9. 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. *-commutativeN/A

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

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

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

          \[\leadsto \frac{x.im - y.im \cdot \color{blue}{\frac{x.re}{y.re}}}{y.re} \]
      10. Applied rewrites91.9%

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

      if -3.1e125 < y.re < -1.1000000000000001e108

      1. Initial program 12.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6413.0

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6413.0

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6417.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}}} \]
      9. 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. sub-negN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, \color{blue}{\mathsf{neg}\left(x.re\right)}\right)}{y.im} \]
        14. lower-neg.f6487.4

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

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

      if -1.1000000000000001e108 < y.re < -6.49999999999999984e-80 or 1.3500000000000001e-71 < y.re < 2.5e85

      1. Initial program 79.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

      if -6.49999999999999984e-80 < y.re < 1.3500000000000001e-71

      1. Initial program 66.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} + \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.8

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.1 \cdot 10^{+125}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq -1.1 \cdot 10^{+108}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{elif}\;y.re \leq -6.5 \cdot 10^{-80}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{elif}\;y.re \leq 1.35 \cdot 10^{-71}:\\ \;\;\;\;\frac{\frac{x.im \cdot y.re}{y.im} - x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{+85}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 66.4% accurate, 0.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\ t_1 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;\frac{y.im}{t\_0} \cdot \left(-x.re\right)\\ \mathbf{elif}\;y.im \leq 1.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{+73}:\\ \;\;\;\;\frac{\left(-x.re\right) \cdot y.im}{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 y.im (* y.re y.re))) (t_1 (/ (- x.re) y.im)))
       (if (<= y.im -8.5e+170)
         t_1
         (if (<= y.im -1.2e-80)
           (* (/ y.im t_0) (- x.re))
           (if (<= y.im 1.52e-64)
             (/ x.im y.re)
             (if (<= y.im 3.6e+73) (/ (* (- x.re) y.im) 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, y_46_im, (y_46_re * y_46_re));
    	double t_1 = -x_46_re / y_46_im;
    	double tmp;
    	if (y_46_im <= -8.5e+170) {
    		tmp = t_1;
    	} else if (y_46_im <= -1.2e-80) {
    		tmp = (y_46_im / t_0) * -x_46_re;
    	} else if (y_46_im <= 1.52e-64) {
    		tmp = x_46_im / y_46_re;
    	} else if (y_46_im <= 3.6e+73) {
    		tmp = (-x_46_re * y_46_im) / t_0;
    	} else {
    		tmp = t_1;
    	}
    	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 = Float64(Float64(-x_46_re) / y_46_im)
    	tmp = 0.0
    	if (y_46_im <= -8.5e+170)
    		tmp = t_1;
    	elseif (y_46_im <= -1.2e-80)
    		tmp = Float64(Float64(y_46_im / t_0) * Float64(-x_46_re));
    	elseif (y_46_im <= 1.52e-64)
    		tmp = Float64(x_46_im / y_46_re);
    	elseif (y_46_im <= 3.6e+73)
    		tmp = Float64(Float64(Float64(-x_46_re) * y_46_im) / 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[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -8.5e+170], t$95$1, If[LessEqual[y$46$im, -1.2e-80], N[(N[(y$46$im / t$95$0), $MachinePrecision] * (-x$46$re)), $MachinePrecision], If[LessEqual[y$46$im, 1.52e-64], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.6e+73], N[(N[((-x$46$re) * y$46$im), $MachinePrecision] / t$95$0), $MachinePrecision], t$95$1]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
    t_1 := \frac{-x.re}{y.im}\\
    \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+170}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-80}:\\
    \;\;\;\;\frac{y.im}{t\_0} \cdot \left(-x.re\right)\\
    
    \mathbf{elif}\;y.im \leq 1.52 \cdot 10^{-64}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{+73}:\\
    \;\;\;\;\frac{\left(-x.re\right) \cdot y.im}{t\_0}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.im < -8.5000000000000004e170 or 3.5999999999999999e73 < y.im

      1. Initial program 33.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}} \]
      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.8

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

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

      if -8.5000000000000004e170 < y.im < -1.2e-80

      1. Initial program 65.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 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-*.f6459.9

          \[\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 rewrites59.9%

        \[\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 -1.2e-80 < y.im < 1.5200000000000001e-64

      1. Initial program 75.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}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f6478.6

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

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

      if 1.5200000000000001e-64 < y.im < 3.5999999999999999e73

      1. Initial program 85.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 x.re around inf

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

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

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

          \[\leadsto \frac{\color{blue}{\left(\mathsf{neg}\left(x.re\right)\right)} \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
        4. lower-neg.f6463.9

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

        \[\leadsto \frac{\color{blue}{\left(-x.re\right) \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
      6. Step-by-step derivation
        1. lift-+.f64N/A

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

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

          \[\leadsto \frac{\left(-x.re\right) \cdot y.im}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        4. lift-fma.f6463.9

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

        \[\leadsto \color{blue}{\frac{\left(-x.re\right) \cdot y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}} \]
    3. Recombined 4 regimes into one program.
    4. Final simplification70.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;\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.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{+73}:\\ \;\;\;\;\frac{\left(-x.re\right) \cdot y.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 66.6% 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 -8.5 \cdot 10^{+170}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.im \leq 1.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 3.8 \cdot 10^{+77}:\\ \;\;\;\;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 -8.5e+170)
         t_0
         (if (<= y.im -1.2e-80)
           t_1
           (if (<= y.im 1.52e-64) (/ x.im y.re) (if (<= y.im 3.8e+77) 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 <= -8.5e+170) {
    		tmp = t_0;
    	} else if (y_46_im <= -1.2e-80) {
    		tmp = t_1;
    	} else if (y_46_im <= 1.52e-64) {
    		tmp = x_46_im / y_46_re;
    	} else if (y_46_im <= 3.8e+77) {
    		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 <= -8.5e+170)
    		tmp = t_0;
    	elseif (y_46_im <= -1.2e-80)
    		tmp = t_1;
    	elseif (y_46_im <= 1.52e-64)
    		tmp = Float64(x_46_im / y_46_re);
    	elseif (y_46_im <= 3.8e+77)
    		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, -8.5e+170], t$95$0, If[LessEqual[y$46$im, -1.2e-80], t$95$1, If[LessEqual[y$46$im, 1.52e-64], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, 3.8e+77], 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 -8.5 \cdot 10^{+170}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-80}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.im \leq 1.52 \cdot 10^{-64}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    \mathbf{elif}\;y.im \leq 3.8 \cdot 10^{+77}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.im < -8.5000000000000004e170 or 3.8000000000000001e77 < y.im

      1. Initial program 34.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 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.f6469.2

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

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

      if -8.5000000000000004e170 < y.im < -1.2e-80 or 1.5200000000000001e-64 < y.im < 3.8000000000000001e77

      1. Initial program 71.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 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-*.f6461.0

          \[\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 rewrites61.0%

        \[\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 -1.2e-80 < y.im < 1.5200000000000001e-64

      1. Initial program 75.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}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f6478.6

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -8.5 \cdot 10^{+170}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq -1.2 \cdot 10^{-80}:\\ \;\;\;\;\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.52 \cdot 10^{-64}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq 3.8 \cdot 10^{+77}:\\ \;\;\;\;\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 9: 64.3% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{-70}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4 \cdot 10^{+83}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (<= y.re -1.1e+46)
       (/ x.im y.re)
       (if (<= y.re 1.75e-70)
         (/ (- x.re) y.im)
         (if (<= y.re 4e+83)
           (/ (- (* x.im y.re) (* y.im x.re)) (* y.re y.re))
           (/ x.im y.re)))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double tmp;
    	if (y_46_re <= -1.1e+46) {
    		tmp = x_46_im / y_46_re;
    	} else if (y_46_re <= 1.75e-70) {
    		tmp = -x_46_re / y_46_im;
    	} else if (y_46_re <= 4e+83) {
    		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / (y_46_re * y_46_re);
    	} else {
    		tmp = x_46_im / y_46_re;
    	}
    	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) :: tmp
        if (y_46re <= (-1.1d+46)) then
            tmp = x_46im / y_46re
        else if (y_46re <= 1.75d-70) then
            tmp = -x_46re / y_46im
        else if (y_46re <= 4d+83) then
            tmp = ((x_46im * y_46re) - (y_46im * x_46re)) / (y_46re * y_46re)
        else
            tmp = x_46im / y_46re
        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 tmp;
    	if (y_46_re <= -1.1e+46) {
    		tmp = x_46_im / y_46_re;
    	} else if (y_46_re <= 1.75e-70) {
    		tmp = -x_46_re / y_46_im;
    	} else if (y_46_re <= 4e+83) {
    		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / (y_46_re * y_46_re);
    	} else {
    		tmp = x_46_im / y_46_re;
    	}
    	return tmp;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	tmp = 0
    	if y_46_re <= -1.1e+46:
    		tmp = x_46_im / y_46_re
    	elif y_46_re <= 1.75e-70:
    		tmp = -x_46_re / y_46_im
    	elif y_46_re <= 4e+83:
    		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / (y_46_re * y_46_re)
    	else:
    		tmp = x_46_im / y_46_re
    	return tmp
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	tmp = 0.0
    	if (y_46_re <= -1.1e+46)
    		tmp = Float64(x_46_im / y_46_re);
    	elseif (y_46_re <= 1.75e-70)
    		tmp = Float64(Float64(-x_46_re) / y_46_im);
    	elseif (y_46_re <= 4e+83)
    		tmp = Float64(Float64(Float64(x_46_im * y_46_re) - Float64(y_46_im * x_46_re)) / Float64(y_46_re * y_46_re));
    	else
    		tmp = Float64(x_46_im / y_46_re);
    	end
    	return tmp
    end
    
    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
    	tmp = 0.0;
    	if (y_46_re <= -1.1e+46)
    		tmp = x_46_im / y_46_re;
    	elseif (y_46_re <= 1.75e-70)
    		tmp = -x_46_re / y_46_im;
    	elseif (y_46_re <= 4e+83)
    		tmp = ((x_46_im * y_46_re) - (y_46_im * x_46_re)) / (y_46_re * y_46_re);
    	else
    		tmp = x_46_im / y_46_re;
    	end
    	tmp_2 = tmp;
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.1e+46], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.75e-70], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 4e+83], N[(N[(N[(x$46$im * y$46$re), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{-70}:\\
    \;\;\;\;\frac{-x.re}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 4 \cdot 10^{+83}:\\
    \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -1.1e46 or 4.00000000000000012e83 < y.re

      1. Initial program 45.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}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f6475.1

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

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

      if -1.1e46 < y.re < 1.74999999999999987e-70

      1. Initial program 69.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.f6466.9

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

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

      if 1.74999999999999987e-70 < y.re < 4.00000000000000012e83

      1. Initial program 83.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 \frac{x.im \cdot y.re - x.re \cdot y.im}{\color{blue}{{y.re}^{2}}} \]
      4. Step-by-step derivation
        1. unpow2N/A

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.re \leq 1.75 \cdot 10^{-70}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4 \cdot 10^{+83}:\\ \;\;\;\;\frac{x.im \cdot y.re - y.im \cdot x.re}{y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 65.0% accurate, 0.8× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot x.im\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (<= y.re -1.1e+46)
       (/ x.im y.re)
       (if (<= y.re 1.12e-68)
         (/ (- x.re) y.im)
         (if (<= y.re 1.5e+86)
           (* (/ y.re (fma y.im y.im (* y.re y.re))) x.im)
           (/ x.im y.re)))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double tmp;
    	if (y_46_re <= -1.1e+46) {
    		tmp = x_46_im / y_46_re;
    	} else if (y_46_re <= 1.12e-68) {
    		tmp = -x_46_re / y_46_im;
    	} else if (y_46_re <= 1.5e+86) {
    		tmp = (y_46_re / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * x_46_im;
    	} else {
    		tmp = x_46_im / y_46_re;
    	}
    	return tmp;
    }
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	tmp = 0.0
    	if (y_46_re <= -1.1e+46)
    		tmp = Float64(x_46_im / y_46_re);
    	elseif (y_46_re <= 1.12e-68)
    		tmp = Float64(Float64(-x_46_re) / y_46_im);
    	elseif (y_46_re <= 1.5e+86)
    		tmp = Float64(Float64(y_46_re / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * x_46_im);
    	else
    		tmp = Float64(x_46_im / y_46_re);
    	end
    	return tmp
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.1e+46], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.12e-68], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.5e+86], N[(N[(y$46$re / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    \mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-68}:\\
    \;\;\;\;\frac{-x.re}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+86}:\\
    \;\;\;\;\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot x.im\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -1.1e46 or 1.49999999999999988e86 < y.re

      1. Initial program 43.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}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f6475.2

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

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

      if -1.1e46 < y.re < 1.11999999999999992e-68

      1. Initial program 69.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.f6467.2

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

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

      if 1.11999999999999992e-68 < y.re < 1.49999999999999988e86

      1. Initial program 84.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. 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) \]
      4. Applied rewrites86.9%

        \[\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)} \]
      5. Taylor expanded in x.re around 0

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot x.im} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification68.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.re \leq 1.12 \cdot 10^{-68}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.5 \cdot 10^{+86}:\\ \;\;\;\;\frac{y.re}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot x.im\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 77.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 -2.2 \cdot 10^{+40}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-53}:\\ \;\;\;\;\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 -2.2e+40)
         t_0
         (if (<= y.re 7.8e-53) (/ (- (/ (* 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 <= -2.2e+40) {
    		tmp = t_0;
    	} else if (y_46_re <= 7.8e-53) {
    		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 <= (-2.2d+40)) then
            tmp = t_0
        else if (y_46re <= 7.8d-53) 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 <= -2.2e+40) {
    		tmp = t_0;
    	} else if (y_46_re <= 7.8e-53) {
    		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 <= -2.2e+40:
    		tmp = t_0
    	elif y_46_re <= 7.8e-53:
    		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 <= -2.2e+40)
    		tmp = t_0;
    	elseif (y_46_re <= 7.8e-53)
    		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 <= -2.2e+40)
    		tmp = t_0;
    	elseif (y_46_re <= 7.8e-53)
    		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, -2.2e+40], t$95$0, If[LessEqual[y$46$re, 7.8e-53], 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 -2.2 \cdot 10^{+40}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-53}:\\
    \;\;\;\;\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 < -2.1999999999999999e40 or 7.8000000000000004e-53 < y.re

      1. Initial program 53.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6453.5

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6453.5

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6481.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      if -2.1999999999999999e40 < y.re < 7.8000000000000004e-53

      1. Initial program 70.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 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-*.f6484.3

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-53}:\\ \;\;\;\;\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} \]
    5. Add Preprocessing

    Alternative 12: 76.5% 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 -2.2 \cdot 10^{+40}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-53}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{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 -2.2e+40)
         t_0
         (if (<= y.re 7.8e-53) (/ (fma (/ x.im y.im) y.re (- 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 <= -2.2e+40) {
    		tmp = t_0;
    	} else if (y_46_re <= 7.8e-53) {
    		tmp = fma((x_46_im / y_46_im), y_46_re, -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 <= -2.2e+40)
    		tmp = t_0;
    	elseif (y_46_re <= 7.8e-53)
    		tmp = Float64(fma(Float64(x_46_im / y_46_im), y_46_re, Float64(-x_46_re)) / y_46_im);
    	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[(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, -2.2e+40], t$95$0, If[LessEqual[y$46$re, 7.8e-53], N[(N[(N[(x$46$im / y$46$im), $MachinePrecision] * y$46$re + (-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 -2.2 \cdot 10^{+40}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-53}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.re < -2.1999999999999999e40 or 7.8000000000000004e-53 < y.re

      1. Initial program 53.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6453.5

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6453.5

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6481.0

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

      if -2.1999999999999999e40 < y.re < 7.8000000000000004e-53

      1. Initial program 70.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{\color{blue}{-1}}{y.re \cdot y.re + y.im \cdot y.im} \]
        16. lower-/.f6470.0

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6470.0

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}}} \]
      9. 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. sub-negN/A

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

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

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

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

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

          \[\leadsto \frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, \color{blue}{\mathsf{neg}\left(x.re\right)}\right)}{y.im} \]
        14. lower-neg.f6482.1

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification81.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \mathbf{elif}\;y.re \leq 7.8 \cdot 10^{-53}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.im}, y.re, -x.re\right)}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im - \frac{x.re}{y.re} \cdot y.im}{y.re}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 13: 72.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -4.3 \cdot 10^{+52}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq 1.85 \cdot 10^{+84}:\\ \;\;\;\;\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 -4.3e+52)
         t_0
         (if (<= y.im 1.85e+84) (/ (- 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 <= -4.3e+52) {
    		tmp = t_0;
    	} else if (y_46_im <= 1.85e+84) {
    		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 <= (-4.3d+52)) then
            tmp = t_0
        else if (y_46im <= 1.85d+84) 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 <= -4.3e+52) {
    		tmp = t_0;
    	} else if (y_46_im <= 1.85e+84) {
    		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 <= -4.3e+52:
    		tmp = t_0
    	elif y_46_im <= 1.85e+84:
    		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 <= -4.3e+52)
    		tmp = t_0;
    	elseif (y_46_im <= 1.85e+84)
    		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 <= -4.3e+52)
    		tmp = t_0;
    	elseif (y_46_im <= 1.85e+84)
    		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, -4.3e+52], t$95$0, If[LessEqual[y$46$im, 1.85e+84], 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 -4.3 \cdot 10^{+52}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.im \leq 1.85 \cdot 10^{+84}:\\
    \;\;\;\;\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 < -4.3e52 or 1.85e84 < y.im

      1. Initial program 38.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 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.f6470.1

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

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

      if -4.3e52 < y.im < 1.85e84

      1. Initial program 74.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. 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. frac-2negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(-x.im, y.re, x.re \cdot y.im\right) \cdot \frac{-1}{\color{blue}{y.im \cdot y.im} + y.re \cdot y.re} \]
        20. lower-fma.f6474.9

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{-x.re}{y.re}, \color{blue}{\frac{y.im}{y.re}}, \frac{x.im}{y.re}\right) \]
        10. lower-/.f6475.8

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-x.re}{y.re}, \frac{y.im}{y.re}, \frac{x.im}{y.re}\right)} \]
      8. 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}} \]
      9. 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. *-commutativeN/A

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

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

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

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

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

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

    Alternative 14: 63.1% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -1.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (<= y.im -1.6e+51)
       (/ (- x.re) y.im)
       (if (<= y.im 3.6e-63) (/ x.im y.re) (/ -1.0 (/ y.im x.re)))))
    double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
    	double tmp;
    	if (y_46_im <= -1.6e+51) {
    		tmp = -x_46_re / y_46_im;
    	} else if (y_46_im <= 3.6e-63) {
    		tmp = x_46_im / y_46_re;
    	} else {
    		tmp = -1.0 / (y_46_im / x_46_re);
    	}
    	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) :: tmp
        if (y_46im <= (-1.6d+51)) then
            tmp = -x_46re / y_46im
        else if (y_46im <= 3.6d-63) then
            tmp = x_46im / y_46re
        else
            tmp = (-1.0d0) / (y_46im / x_46re)
        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 tmp;
    	if (y_46_im <= -1.6e+51) {
    		tmp = -x_46_re / y_46_im;
    	} else if (y_46_im <= 3.6e-63) {
    		tmp = x_46_im / y_46_re;
    	} else {
    		tmp = -1.0 / (y_46_im / x_46_re);
    	}
    	return tmp;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	tmp = 0
    	if y_46_im <= -1.6e+51:
    		tmp = -x_46_re / y_46_im
    	elif y_46_im <= 3.6e-63:
    		tmp = x_46_im / y_46_re
    	else:
    		tmp = -1.0 / (y_46_im / x_46_re)
    	return tmp
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	tmp = 0.0
    	if (y_46_im <= -1.6e+51)
    		tmp = Float64(Float64(-x_46_re) / y_46_im);
    	elseif (y_46_im <= 3.6e-63)
    		tmp = Float64(x_46_im / y_46_re);
    	else
    		tmp = Float64(-1.0 / Float64(y_46_im / x_46_re));
    	end
    	return tmp
    end
    
    function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
    	tmp = 0.0;
    	if (y_46_im <= -1.6e+51)
    		tmp = -x_46_re / y_46_im;
    	elseif (y_46_im <= 3.6e-63)
    		tmp = x_46_im / y_46_re;
    	else
    		tmp = -1.0 / (y_46_im / x_46_re);
    	end
    	tmp_2 = tmp;
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$im, -1.6e+51], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$im, 3.6e-63], N[(x$46$im / y$46$re), $MachinePrecision], N[(-1.0 / N[(y$46$im / x$46$re), $MachinePrecision]), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.im \leq -1.6 \cdot 10^{+51}:\\
    \;\;\;\;\frac{-x.re}{y.im}\\
    
    \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-63}:\\
    \;\;\;\;\frac{x.im}{y.re}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.im < -1.6000000000000001e51

      1. Initial program 31.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 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.f6470.7

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

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

      if -1.6000000000000001e51 < y.im < 3.60000000000000008e-63

      1. Initial program 74.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}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f6470.5

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

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

      if 3.60000000000000008e-63 < y.im

      1. Initial program 57.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 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.f6458.8

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -1.6 \cdot 10^{+51}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq 3.6 \cdot 10^{-63}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-1}{\frac{y.im}{x.re}}\\ \end{array} \]
      9. Add Preprocessing

      Alternative 15: 63.2% accurate, 1.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-53}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \end{array} \]
      (FPCore (x.re x.im y.re y.im)
       :precision binary64
       (if (<= y.re -1.1e+46)
         (/ x.im y.re)
         (if (<= y.re 1.95e-53) (/ (- x.re) y.im) (/ x.im y.re))))
      double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
      	double tmp;
      	if (y_46_re <= -1.1e+46) {
      		tmp = x_46_im / y_46_re;
      	} else if (y_46_re <= 1.95e-53) {
      		tmp = -x_46_re / y_46_im;
      	} else {
      		tmp = x_46_im / y_46_re;
      	}
      	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) :: tmp
          if (y_46re <= (-1.1d+46)) then
              tmp = x_46im / y_46re
          else if (y_46re <= 1.95d-53) then
              tmp = -x_46re / y_46im
          else
              tmp = x_46im / y_46re
          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 tmp;
      	if (y_46_re <= -1.1e+46) {
      		tmp = x_46_im / y_46_re;
      	} else if (y_46_re <= 1.95e-53) {
      		tmp = -x_46_re / y_46_im;
      	} else {
      		tmp = x_46_im / y_46_re;
      	}
      	return tmp;
      }
      
      def code(x_46_re, x_46_im, y_46_re, y_46_im):
      	tmp = 0
      	if y_46_re <= -1.1e+46:
      		tmp = x_46_im / y_46_re
      	elif y_46_re <= 1.95e-53:
      		tmp = -x_46_re / y_46_im
      	else:
      		tmp = x_46_im / y_46_re
      	return tmp
      
      function code(x_46_re, x_46_im, y_46_re, y_46_im)
      	tmp = 0.0
      	if (y_46_re <= -1.1e+46)
      		tmp = Float64(x_46_im / y_46_re);
      	elseif (y_46_re <= 1.95e-53)
      		tmp = Float64(Float64(-x_46_re) / y_46_im);
      	else
      		tmp = Float64(x_46_im / y_46_re);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
      	tmp = 0.0;
      	if (y_46_re <= -1.1e+46)
      		tmp = x_46_im / y_46_re;
      	elseif (y_46_re <= 1.95e-53)
      		tmp = -x_46_re / y_46_im;
      	else
      		tmp = x_46_im / y_46_re;
      	end
      	tmp_2 = tmp;
      end
      
      code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[LessEqual[y$46$re, -1.1e+46], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 1.95e-53], N[((-x$46$re) / y$46$im), $MachinePrecision], N[(x$46$im / y$46$re), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;y.re \leq -1.1 \cdot 10^{+46}:\\
      \;\;\;\;\frac{x.im}{y.re}\\
      
      \mathbf{elif}\;y.re \leq 1.95 \cdot 10^{-53}:\\
      \;\;\;\;\frac{-x.re}{y.im}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{x.im}{y.re}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if y.re < -1.1e46 or 1.9500000000000001e-53 < y.re

        1. Initial program 53.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}{y.re}} \]
        4. Step-by-step derivation
          1. lower-/.f6467.1

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

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

        if -1.1e46 < y.re < 1.9500000000000001e-53

        1. Initial program 70.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 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.f6466.4

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

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

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

      Alternative 16: 43.3% 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 61.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}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f6445.7

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

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

      Reproduce

      ?
      herbie shell --seed 2024304 
      (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))))