_divideComplex, real part

Percentage Accurate: 61.8% → 83.2%
Time: 8.4s
Alternatives: 8
Speedup: 1.6×

Specification

?
\[\begin{array}{l} \\ \frac{x.re \cdot y.re + x.im \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.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \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 8 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.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{x.re \cdot y.re + x.im \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.re y.re) (* x.im 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_re * y_46_re) + (x_46_im * 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_46re * y_46re) + (x_46im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + (x_46_im * 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_re * y_46_re) + Float64(x_46_im * 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_re * y_46_re) + (x_46_im * 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$re * y$46$re), $MachinePrecision] + N[(x$46$im * 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.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\end{array}

Alternative 1: 83.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(y.re, x.re, y.im \cdot x.im\right)}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{if}\;y.re \leq -9.5 \cdot 10^{+113}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\ \mathbf{elif}\;y.re \leq -1.7 \cdot 10^{-130}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.re \leq 9 \cdot 10^{-140}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\ \mathbf{elif}\;y.re \leq 2.25 \cdot 10^{+70}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{y.re} \cdot \left(-x.im\right), y.im, x.re\right)}{y.re}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (/ (fma y.re x.re (* y.im x.im)) (+ (* y.im y.im) (* y.re y.re)))))
   (if (<= y.re -9.5e+113)
     (/ (fma (/ x.im y.re) y.im x.re) y.re)
     (if (<= y.re -1.7e-130)
       t_0
       (if (<= y.re 9e-140)
         (/ (fma (/ y.re y.im) x.re x.im) y.im)
         (if (<= y.re 2.25e+70)
           t_0
           (/ (fma (* (/ -1.0 y.re) (- x.im)) y.im x.re) 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_re, x_46_re, (y_46_im * x_46_im)) / ((y_46_im * y_46_im) + (y_46_re * y_46_re));
	double tmp;
	if (y_46_re <= -9.5e+113) {
		tmp = fma((x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re;
	} else if (y_46_re <= -1.7e-130) {
		tmp = t_0;
	} else if (y_46_re <= 9e-140) {
		tmp = fma((y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im;
	} else if (y_46_re <= 2.25e+70) {
		tmp = t_0;
	} else {
		tmp = fma(((-1.0 / y_46_re) * -x_46_im), y_46_im, x_46_re) / y_46_re;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(fma(y_46_re, x_46_re, Float64(y_46_im * x_46_im)) / Float64(Float64(y_46_im * y_46_im) + Float64(y_46_re * y_46_re)))
	tmp = 0.0
	if (y_46_re <= -9.5e+113)
		tmp = Float64(fma(Float64(x_46_im / y_46_re), y_46_im, x_46_re) / y_46_re);
	elseif (y_46_re <= -1.7e-130)
		tmp = t_0;
	elseif (y_46_re <= 9e-140)
		tmp = Float64(fma(Float64(y_46_re / y_46_im), x_46_re, x_46_im) / y_46_im);
	elseif (y_46_re <= 2.25e+70)
		tmp = t_0;
	else
		tmp = Float64(fma(Float64(Float64(-1.0 / y_46_re) * Float64(-x_46_im)), y_46_im, x_46_re) / y_46_re);
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$re + N[(y$46$im * x$46$im), $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, -9.5e+113], N[(N[(N[(x$46$im / y$46$re), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -1.7e-130], t$95$0, If[LessEqual[y$46$re, 9e-140], N[(N[(N[(y$46$re / y$46$im), $MachinePrecision] * x$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.25e+70], t$95$0, N[(N[(N[(N[(-1.0 / y$46$re), $MachinePrecision] * (-x$46$im)), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(y.re, x.re, y.im \cdot x.im\right)}{y.im \cdot y.im + y.re \cdot y.re}\\
\mathbf{if}\;y.re \leq -9.5 \cdot 10^{+113}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\

\mathbf{elif}\;y.re \leq -1.7 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;y.re \leq 2.25 \cdot 10^{+70}:\\
\;\;\;\;t\_0\\

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


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

    1. Initial program 33.7%

      \[\frac{x.re \cdot y.re + x.im \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.re + \frac{x.im \cdot y.im}{y.re}}{y.re}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

    if -9.5000000000000001e113 < y.re < -1.70000000000000003e-130 or 9.00000000000000008e-140 < y.re < 2.25e70

    1. Initial program 78.5%

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

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

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

        \[\leadsto \frac{\color{blue}{y.re \cdot x.re} + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
      4. lower-fma.f6478.6

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

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

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

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

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

    if -1.70000000000000003e-130 < y.re < 9.00000000000000008e-140

    1. Initial program 67.2%

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

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

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

        \[\leadsto \frac{\color{blue}{y.re \cdot x.re} + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
      4. lower-fma.f6467.2

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.25e70 < y.re

    1. Initial program 30.6%

      \[\frac{x.re \cdot y.re + x.im \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.re + \frac{x.im \cdot y.im}{y.re}}{y.re}} \]
    4. Step-by-step derivation
      1. lower-/.f64N/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{\mathsf{fma}\left(\left(-x.im\right) \cdot \frac{-1}{y.re}, y.im, x.re\right)}{y.re} \]
    7. Recombined 4 regimes into one program.
    8. Final simplification86.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{+113}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\ \mathbf{elif}\;y.re \leq -1.7 \cdot 10^{-130}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y.re, x.re, y.im \cdot x.im\right)}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{elif}\;y.re \leq 9 \cdot 10^{-140}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{y.re}{y.im}, x.re, x.im\right)}{y.im}\\ \mathbf{elif}\;y.re \leq 2.25 \cdot 10^{+70}:\\ \;\;\;\;\frac{\mathsf{fma}\left(y.re, x.re, y.im \cdot x.im\right)}{y.im \cdot y.im + y.re \cdot y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{-1}{y.re} \cdot \left(-x.im\right), y.im, x.re\right)}{y.re}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 2: 65.1% 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{y.re}{t\_0} \cdot x.re\\ \mathbf{if}\;y.re \leq -1.75 \cdot 10^{+88}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -3 \cdot 10^{+29}:\\ \;\;\;\;\frac{x.im}{t\_0} \cdot y.im\\ \mathbf{elif}\;y.re \leq -9 \cdot 10^{-96}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-101}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.re \leq 1.32 \cdot 10^{+135}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (fma y.im y.im (* y.re y.re))) (t_1 (* (/ y.re t_0) x.re)))
       (if (<= y.re -1.75e+88)
         (/ x.re y.re)
         (if (<= y.re -3e+29)
           (* (/ x.im t_0) y.im)
           (if (<= y.re -9e-96)
             t_1
             (if (<= y.re 2.5e-101)
               (/ x.im y.im)
               (if (<= y.re 1.32e+135) t_1 (/ x.re 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 = (y_46_re / t_0) * x_46_re;
    	double tmp;
    	if (y_46_re <= -1.75e+88) {
    		tmp = x_46_re / y_46_re;
    	} else if (y_46_re <= -3e+29) {
    		tmp = (x_46_im / t_0) * y_46_im;
    	} else if (y_46_re <= -9e-96) {
    		tmp = t_1;
    	} else if (y_46_re <= 2.5e-101) {
    		tmp = x_46_im / y_46_im;
    	} else if (y_46_re <= 1.32e+135) {
    		tmp = t_1;
    	} else {
    		tmp = x_46_re / 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 = Float64(Float64(y_46_re / t_0) * x_46_re)
    	tmp = 0.0
    	if (y_46_re <= -1.75e+88)
    		tmp = Float64(x_46_re / y_46_re);
    	elseif (y_46_re <= -3e+29)
    		tmp = Float64(Float64(x_46_im / t_0) * y_46_im);
    	elseif (y_46_re <= -9e-96)
    		tmp = t_1;
    	elseif (y_46_re <= 2.5e-101)
    		tmp = Float64(x_46_im / y_46_im);
    	elseif (y_46_re <= 1.32e+135)
    		tmp = t_1;
    	else
    		tmp = Float64(x_46_re / 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$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.75e+88], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -3e+29], N[(N[(x$46$im / t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -9e-96], t$95$1, If[LessEqual[y$46$re, 2.5e-101], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 1.32e+135], t$95$1, N[(x$46$re / y$46$re), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
    t_1 := \frac{y.re}{t\_0} \cdot x.re\\
    \mathbf{if}\;y.re \leq -1.75 \cdot 10^{+88}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    \mathbf{elif}\;y.re \leq -3 \cdot 10^{+29}:\\
    \;\;\;\;\frac{x.im}{t\_0} \cdot y.im\\
    
    \mathbf{elif}\;y.re \leq -9 \cdot 10^{-96}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-101}:\\
    \;\;\;\;\frac{x.im}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 1.32 \cdot 10^{+135}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -1.7499999999999999e88 or 1.32e135 < y.re

      1. Initial program 28.7%

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

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

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

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

      if -1.7499999999999999e88 < y.re < -2.9999999999999999e29

      1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.9999999999999999e29 < y.re < -9e-96 or 2.5e-101 < y.re < 1.32e135

      1. Initial program 77.8%

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

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

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

          \[\leadsto \frac{\color{blue}{y.re \cdot x.re} + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
        4. lower-fma.f6477.8

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x.re \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.re}}{{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.re} \]
        3. lower-*.f64N/A

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

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

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

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

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

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

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

      if -9e-96 < y.re < 2.5e-101

      1. Initial program 68.5%

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

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

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

        \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
    3. Recombined 4 regimes into one program.
    4. Add Preprocessing

    Alternative 3: 64.3% 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}{t\_0} \cdot y.re\\ \mathbf{if}\;y.re \leq -1.75 \cdot 10^{+88}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -3 \cdot 10^{+29}:\\ \;\;\;\;\frac{x.im}{t\_0} \cdot y.im\\ \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-95}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y.re \leq 3.4 \cdot 10^{-58}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+133}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (fma y.im y.im (* y.re y.re))) (t_1 (* (/ x.re t_0) y.re)))
       (if (<= y.re -1.75e+88)
         (/ x.re y.re)
         (if (<= y.re -3e+29)
           (* (/ x.im t_0) y.im)
           (if (<= y.re -8.8e-95)
             t_1
             (if (<= y.re 3.4e-58)
               (/ x.im y.im)
               (if (<= y.re 2.4e+133) t_1 (/ x.re 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 = (x_46_re / t_0) * y_46_re;
    	double tmp;
    	if (y_46_re <= -1.75e+88) {
    		tmp = x_46_re / y_46_re;
    	} else if (y_46_re <= -3e+29) {
    		tmp = (x_46_im / t_0) * y_46_im;
    	} else if (y_46_re <= -8.8e-95) {
    		tmp = t_1;
    	} else if (y_46_re <= 3.4e-58) {
    		tmp = x_46_im / y_46_im;
    	} else if (y_46_re <= 2.4e+133) {
    		tmp = t_1;
    	} else {
    		tmp = x_46_re / 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 = Float64(Float64(x_46_re / t_0) * y_46_re)
    	tmp = 0.0
    	if (y_46_re <= -1.75e+88)
    		tmp = Float64(x_46_re / y_46_re);
    	elseif (y_46_re <= -3e+29)
    		tmp = Float64(Float64(x_46_im / t_0) * y_46_im);
    	elseif (y_46_re <= -8.8e-95)
    		tmp = t_1;
    	elseif (y_46_re <= 3.4e-58)
    		tmp = Float64(x_46_im / y_46_im);
    	elseif (y_46_re <= 2.4e+133)
    		tmp = t_1;
    	else
    		tmp = Float64(x_46_re / 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[(x$46$re / t$95$0), $MachinePrecision] * y$46$re), $MachinePrecision]}, If[LessEqual[y$46$re, -1.75e+88], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -3e+29], N[(N[(x$46$im / t$95$0), $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$re, -8.8e-95], t$95$1, If[LessEqual[y$46$re, 3.4e-58], N[(x$46$im / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.4e+133], t$95$1, N[(x$46$re / y$46$re), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)\\
    t_1 := \frac{x.re}{t\_0} \cdot y.re\\
    \mathbf{if}\;y.re \leq -1.75 \cdot 10^{+88}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    \mathbf{elif}\;y.re \leq -3 \cdot 10^{+29}:\\
    \;\;\;\;\frac{x.im}{t\_0} \cdot y.im\\
    
    \mathbf{elif}\;y.re \leq -8.8 \cdot 10^{-95}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y.re \leq 3.4 \cdot 10^{-58}:\\
    \;\;\;\;\frac{x.im}{y.im}\\
    
    \mathbf{elif}\;y.re \leq 2.4 \cdot 10^{+133}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if y.re < -1.7499999999999999e88 or 2.3999999999999999e133 < y.re

      1. Initial program 28.7%

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

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

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

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

      if -1.7499999999999999e88 < y.re < -2.9999999999999999e29

      1. Initial program 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.9999999999999999e29 < y.re < -8.7999999999999995e-95 or 3.39999999999999973e-58 < y.re < 2.3999999999999999e133

      1. Initial program 78.4%

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

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

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

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

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

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

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

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

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

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

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

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

      if -8.7999999999999995e-95 < y.re < 3.39999999999999973e-58

      1. Initial program 68.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
    3. Recombined 4 regimes into one program.
    4. Add Preprocessing

    Alternative 4: 76.7% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)}{y.im}\\ \mathbf{if}\;y.im \leq -5.4 \cdot 10^{+39}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+90}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (let* ((t_0 (/ (fma (/ x.re y.im) y.re x.im) y.im)))
       (if (<= y.im -5.4e+39)
         t_0
         (if (<= y.im 1.8e+90) (/ (fma (/ x.im y.re) y.im x.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 = fma((x_46_re / y_46_im), y_46_re, x_46_im) / y_46_im;
    	double tmp;
    	if (y_46_im <= -5.4e+39) {
    		tmp = t_0;
    	} else if (y_46_im <= 1.8e+90) {
    		tmp = fma((x_46_im / y_46_re), y_46_im, x_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(fma(Float64(x_46_re / y_46_im), y_46_re, x_46_im) / y_46_im)
    	tmp = 0.0
    	if (y_46_im <= -5.4e+39)
    		tmp = t_0;
    	elseif (y_46_im <= 1.8e+90)
    		tmp = Float64(fma(Float64(x_46_im / y_46_re), y_46_im, x_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[(N[(x$46$re / y$46$im), $MachinePrecision] * y$46$re + x$46$im), $MachinePrecision] / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -5.4e+39], t$95$0, If[LessEqual[y$46$im, 1.8e+90], N[(N[(N[(x$46$im / y$46$re), $MachinePrecision] * y$46$im + x$46$re), $MachinePrecision] / y$46$re), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)}{y.im}\\
    \mathbf{if}\;y.im \leq -5.4 \cdot 10^{+39}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;y.im \leq 1.8 \cdot 10^{+90}:\\
    \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.im < -5.40000000000000007e39 or 1.8e90 < y.im

      1. Initial program 42.8%

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

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

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

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

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

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

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

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

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

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

      if -5.40000000000000007e39 < y.im < 1.8e90

      1. Initial program 71.7%

        \[\frac{x.re \cdot y.re + x.im \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.re + \frac{x.im \cdot y.im}{y.re}}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 5: 71.4% accurate, 0.9× speedup?

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

      1. Initial program 43.9%

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

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

          \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
      5. Applied rewrites76.3%

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

      if -6.99999999999999996e34 < y.im < 6.2e133

      1. Initial program 70.4%

        \[\frac{x.re \cdot y.re + x.im \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.re + \frac{x.im \cdot y.im}{y.re}}{y.re}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\frac{x.im}{y.re}, y.im, x.re\right)}{y.re}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 6: 63.1% accurate, 0.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.75 \cdot 10^{+88}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq -2.4 \cdot 10^{+19}:\\ \;\;\;\;\frac{x.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot y.im\\ \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-45}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (<= y.re -1.75e+88)
       (/ x.re y.re)
       (if (<= y.re -2.4e+19)
         (* (/ x.im (fma y.im y.im (* y.re y.re))) y.im)
         (if (<= y.re 2.7e-45) (/ x.im y.im) (/ x.re 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.75e+88) {
    		tmp = x_46_re / y_46_re;
    	} else if (y_46_re <= -2.4e+19) {
    		tmp = (x_46_im / fma(y_46_im, y_46_im, (y_46_re * y_46_re))) * y_46_im;
    	} else if (y_46_re <= 2.7e-45) {
    		tmp = x_46_im / y_46_im;
    	} else {
    		tmp = x_46_re / 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.75e+88)
    		tmp = Float64(x_46_re / y_46_re);
    	elseif (y_46_re <= -2.4e+19)
    		tmp = Float64(Float64(x_46_im / fma(y_46_im, y_46_im, Float64(y_46_re * y_46_re))) * y_46_im);
    	elseif (y_46_re <= 2.7e-45)
    		tmp = Float64(x_46_im / y_46_im);
    	else
    		tmp = Float64(x_46_re / 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.75e+88], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, -2.4e+19], N[(N[(x$46$im / N[(y$46$im * y$46$im + N[(y$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 2.7e-45], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.re \leq -1.75 \cdot 10^{+88}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    \mathbf{elif}\;y.re \leq -2.4 \cdot 10^{+19}:\\
    \;\;\;\;\frac{x.im}{\mathsf{fma}\left(y.im, y.im, y.re \cdot y.re\right)} \cdot y.im\\
    
    \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-45}:\\
    \;\;\;\;\frac{x.im}{y.im}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y.re < -1.7499999999999999e88 or 2.69999999999999985e-45 < y.re

      1. Initial program 44.5%

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

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

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

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

      if -1.7499999999999999e88 < y.re < -2.4e19

      1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.4e19 < y.re < 2.69999999999999985e-45

      1. Initial program 70.7%

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

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

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

        \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
    3. Recombined 3 regimes into one program.
    4. Add Preprocessing

    Alternative 7: 63.7% accurate, 1.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -185000000000:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-45}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \end{array} \]
    (FPCore (x.re x.im y.re y.im)
     :precision binary64
     (if (<= y.re -185000000000.0)
       (/ x.re y.re)
       (if (<= y.re 2.7e-45) (/ x.im y.im) (/ x.re 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 <= -185000000000.0) {
    		tmp = x_46_re / y_46_re;
    	} else if (y_46_re <= 2.7e-45) {
    		tmp = x_46_im / y_46_im;
    	} else {
    		tmp = x_46_re / 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 <= (-185000000000.0d0)) then
            tmp = x_46re / y_46re
        else if (y_46re <= 2.7d-45) then
            tmp = x_46im / y_46im
        else
            tmp = x_46re / 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 <= -185000000000.0) {
    		tmp = x_46_re / y_46_re;
    	} else if (y_46_re <= 2.7e-45) {
    		tmp = x_46_im / y_46_im;
    	} else {
    		tmp = x_46_re / 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 <= -185000000000.0:
    		tmp = x_46_re / y_46_re
    	elif y_46_re <= 2.7e-45:
    		tmp = x_46_im / y_46_im
    	else:
    		tmp = x_46_re / 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 <= -185000000000.0)
    		tmp = Float64(x_46_re / y_46_re);
    	elseif (y_46_re <= 2.7e-45)
    		tmp = Float64(x_46_im / y_46_im);
    	else
    		tmp = Float64(x_46_re / 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 <= -185000000000.0)
    		tmp = x_46_re / y_46_re;
    	elseif (y_46_re <= 2.7e-45)
    		tmp = x_46_im / y_46_im;
    	else
    		tmp = x_46_re / 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, -185000000000.0], N[(x$46$re / y$46$re), $MachinePrecision], If[LessEqual[y$46$re, 2.7e-45], N[(x$46$im / y$46$im), $MachinePrecision], N[(x$46$re / y$46$re), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;y.re \leq -185000000000:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    \mathbf{elif}\;y.re \leq 2.7 \cdot 10^{-45}:\\
    \;\;\;\;\frac{x.im}{y.im}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{x.re}{y.re}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if y.re < -1.85e11 or 2.69999999999999985e-45 < y.re

      1. Initial program 49.4%

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

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

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

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

      if -1.85e11 < y.re < 2.69999999999999985e-45

      1. Initial program 71.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x.im}{y.im}} \]
    3. Recombined 2 regimes into one program.
    4. Add Preprocessing

    Alternative 8: 43.3% accurate, 3.2× speedup?

    \[\begin{array}{l} \\ \frac{x.im}{y.im} \end{array} \]
    (FPCore (x.re x.im y.re y.im) :precision binary64 (/ x.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_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_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_im;
    }
    
    def code(x_46_re, x_46_im, y_46_re, y_46_im):
    	return x_46_im / y_46_im
    
    function code(x_46_re, x_46_im, y_46_re, y_46_im)
    	return Float64(x_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_im;
    end
    
    code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(x$46$im / y$46$im), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{x.im}{y.im}
    \end{array}
    
    Derivation
    1. Initial program 59.6%

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

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

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

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

    Reproduce

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