_divideComplex, imaginary part

Percentage Accurate: 61.8% → 97.6%
Time: 14.6s
Alternatives: 14
Speedup: 1.8×

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 14 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.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: 97.6% accurate, 0.0× speedup?

\[\begin{array}{l} \\ \frac{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}{\mathsf{hypot}\left(y.re, y.im\right)} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (/
  (- (/ y.re (/ (hypot y.re y.im) x.im)) (/ y.im (/ (hypot y.re y.im) x.re)))
  (hypot y.re y.im)))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((y_46_re / (hypot(y_46_re, y_46_im) / x_46_im)) - (y_46_im / (hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_46_re, y_46_im);
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((y_46_re / (Math.hypot(y_46_re, y_46_im) / x_46_im)) - (y_46_im / (Math.hypot(y_46_re, y_46_im) / x_46_re))) / Math.hypot(y_46_re, y_46_im);
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	return ((y_46_re / (math.hypot(y_46_re, y_46_im) / x_46_im)) - (y_46_im / (math.hypot(y_46_re, y_46_im) / x_46_re))) / math.hypot(y_46_re, y_46_im)
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(Float64(Float64(y_46_re / Float64(hypot(y_46_re, y_46_im) / x_46_im)) - Float64(y_46_im / Float64(hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_46_re, y_46_im))
end
function tmp = code(x_46_re, x_46_im, y_46_re, y_46_im)
	tmp = ((y_46_re / (hypot(y_46_re, y_46_im) / x_46_im)) - (y_46_im / (hypot(y_46_re, y_46_im) / x_46_re))) / hypot(y_46_re, y_46_im);
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(y$46$re / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / x$46$im), $MachinePrecision]), $MachinePrecision] - N[(y$46$im / N[(N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}
\end{array}
Derivation
  1. Initial program 64.9%

    \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
  2. Step-by-step derivation
    1. fma-def64.9%

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

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

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

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

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

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

      \[\leadsto \frac{x.im}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
    8. hypot-def61.4%

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

      \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
    10. add-sqr-sqrt61.4%

      \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\right) \]
    11. pow261.4%

      \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}\right) \]
    12. hypot-def61.4%

      \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}\right) \]
  3. Applied egg-rr61.4%

    \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)} \]
  4. Step-by-step derivation
    1. sub-neg61.4%

      \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
    2. associate-/r/58.0%

      \[\leadsto \color{blue}{\frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot y.re} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
    3. *-commutative58.0%

      \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
    4. *-commutative58.0%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
    5. associate-/l*59.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
  5. Simplified59.6%

    \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
  6. Step-by-step derivation
    1. unpow259.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \mathsf{hypot}\left(y.re, y.im\right)}}{x.re}} \]
    2. hypot-udef59.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)}{x.re}} \]
    3. hypot-udef59.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{x.re}} \]
    4. add-sqr-sqrt59.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{x.re}} \]
    5. add-sqr-sqrt33.4%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
    6. sqrt-prod36.5%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im \cdot y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
    7. sqr-neg36.5%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
    8. sqrt-unprod14.4%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
    9. add-sqr-sqrt36.3%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{-y.im}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
    10. associate-/l*34.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{\left(-y.im\right) \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}} \]
    11. add-sqr-sqrt34.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
    12. hypot-udef34.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
    13. hypot-udef34.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    14. times-frac36.8%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    15. add-sqr-sqrt15.1%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    16. sqrt-unprod41.3%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    17. sqr-neg41.3%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{y.im \cdot y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    18. sqrt-prod44.1%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    19. add-sqr-sqrt77.9%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
  7. Applied egg-rr77.9%

    \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
  8. Step-by-step derivation
    1. unpow277.9%

      \[\leadsto y.re \cdot \frac{x.im}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    2. hypot-udef77.9%

      \[\leadsto y.re \cdot \frac{x.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    3. hypot-udef77.9%

      \[\leadsto y.re \cdot \frac{x.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    4. add-sqr-sqrt77.9%

      \[\leadsto y.re \cdot \frac{x.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    5. associate-*r/77.8%

      \[\leadsto \color{blue}{\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    6. *-commutative77.8%

      \[\leadsto \frac{\color{blue}{x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    7. add-sqr-sqrt77.8%

      \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    8. hypot-udef77.8%

      \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    9. hypot-udef77.8%

      \[\leadsto \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    10. associate-/r*86.3%

      \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    11. *-commutative86.3%

      \[\leadsto \frac{\frac{\color{blue}{y.re \cdot x.im}}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
  9. Applied egg-rr86.3%

    \[\leadsto \color{blue}{\frac{\frac{y.re \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
  10. Step-by-step derivation
    1. associate-*l/86.6%

      \[\leadsto \frac{\frac{y.re \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \color{blue}{\frac{y.im \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    2. sub-div87.0%

      \[\leadsto \color{blue}{\frac{\frac{y.re \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)} - y.im \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    3. associate-/l*97.1%

      \[\leadsto \frac{\color{blue}{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}}} - y.im \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    4. clear-num96.8%

      \[\leadsto \frac{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - y.im \cdot \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    5. un-div-inv97.0%

      \[\leadsto \frac{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \color{blue}{\frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
  11. Applied egg-rr97.0%

    \[\leadsto \color{blue}{\frac{\frac{y.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.im}} - \frac{y.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
  12. Final simplification97.0%

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

Alternative 2: 80.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x.im}{y.re} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{if}\;y.re \leq -2.55 \cdot 10^{-90}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 1.06 \cdot 10^{-200}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.36 \cdot 10^{+20}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot 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 y.re)
          (* (/ y.im (hypot y.re y.im)) (/ x.re (hypot y.re y.im))))))
   (if (<= y.re -2.55e-90)
     t_0
     (if (<= y.re 1.06e-200)
       (- (/ x.im (/ (pow y.im 2.0) y.re)) (/ x.re y.im))
       (if (<= y.re 1.36e+20)
         (/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im 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 / y_46_re) - ((y_46_im / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_46_re, y_46_im)));
	double tmp;
	if (y_46_re <= -2.55e-90) {
		tmp = t_0;
	} else if (y_46_re <= 1.06e-200) {
		tmp = (x_46_im / (pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 1.36e+20) {
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	} else {
		tmp = t_0;
	}
	return tmp;
}
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 / y_46_re) - ((y_46_im / Math.hypot(y_46_re, y_46_im)) * (x_46_re / Math.hypot(y_46_re, y_46_im)));
	double tmp;
	if (y_46_re <= -2.55e-90) {
		tmp = t_0;
	} else if (y_46_re <= 1.06e-200) {
		tmp = (x_46_im / (Math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 1.36e+20) {
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * 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 / y_46_re) - ((y_46_im / math.hypot(y_46_re, y_46_im)) * (x_46_re / math.hypot(y_46_re, y_46_im)))
	tmp = 0
	if y_46_re <= -2.55e-90:
		tmp = t_0
	elif y_46_re <= 1.06e-200:
		tmp = (x_46_im / (math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im)
	elif y_46_re <= 1.36e+20:
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * 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 / y_46_re) - Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * Float64(x_46_re / hypot(y_46_re, y_46_im))))
	tmp = 0.0
	if (y_46_re <= -2.55e-90)
		tmp = t_0;
	elseif (y_46_re <= 1.06e-200)
		tmp = Float64(Float64(x_46_im / Float64((y_46_im ^ 2.0) / y_46_re)) - Float64(x_46_re / y_46_im));
	elseif (y_46_re <= 1.36e+20)
		tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * 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 / y_46_re) - ((y_46_im / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_46_re, y_46_im)));
	tmp = 0.0;
	if (y_46_re <= -2.55e-90)
		tmp = t_0;
	elseif (y_46_re <= 1.06e-200)
		tmp = (x_46_im / ((y_46_im ^ 2.0) / y_46_re)) - (x_46_re / y_46_im);
	elseif (y_46_re <= 1.36e+20)
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * 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 / y$46$re), $MachinePrecision] - N[(N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.55e-90], t$95$0, If[LessEqual[y$46$re, 1.06e-200], N[(N[(x$46$im / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 1.36e+20], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

\mathbf{elif}\;y.re \leq 1.06 \cdot 10^{-200}:\\
\;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -2.5499999999999998e-90 or 1.36e20 < y.re

    1. Initial program 51.2%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def51.2%

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

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

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

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

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

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      8. hypot-def54.1%

        \[\leadsto \frac{x.im}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      9. fma-def54.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
      10. add-sqr-sqrt54.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\right) \]
      11. pow254.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}\right) \]
      12. hypot-def54.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}\right) \]
    3. Applied egg-rr54.0%

      \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)} \]
    4. Step-by-step derivation
      1. sub-neg54.0%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
      2. associate-/r/50.6%

        \[\leadsto \color{blue}{\frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot y.re} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      3. *-commutative50.6%

        \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      4. *-commutative50.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      5. associate-/l*54.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    5. Simplified54.0%

      \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    6. Step-by-step derivation
      1. unpow254.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \mathsf{hypot}\left(y.re, y.im\right)}}{x.re}} \]
      2. hypot-udef54.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)}{x.re}} \]
      3. hypot-udef54.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{x.re}} \]
      4. add-sqr-sqrt54.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{x.re}} \]
      5. add-sqr-sqrt29.8%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      6. sqrt-prod41.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im \cdot y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      7. sqr-neg41.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      8. sqrt-unprod16.3%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      9. add-sqr-sqrt38.1%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{-y.im}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      10. associate-/l*37.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{\left(-y.im\right) \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}} \]
      11. add-sqr-sqrt37.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      12. hypot-udef37.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      13. hypot-udef37.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      14. times-frac37.8%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      15. add-sqr-sqrt16.1%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      16. sqrt-unprod42.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      17. sqr-neg42.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{y.im \cdot y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      18. sqrt-prod39.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      19. add-sqr-sqrt71.3%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    7. Applied egg-rr71.3%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    8. Taylor expanded in y.re around inf 89.1%

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

    if -2.5499999999999998e-90 < y.re < 1.05999999999999998e-200

    1. Initial program 75.2%

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

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
      2. mul-1-neg75.5%

        \[\leadsto \frac{x.im \cdot y.re}{{y.im}^{2}} + \color{blue}{\left(-\frac{x.re}{y.im}\right)} \]
      3. unsub-neg75.5%

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
      4. associate-/l*83.1%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{y.im}^{2}}{y.re}}} - \frac{x.re}{y.im} \]
    4. Simplified83.1%

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

    if 1.05999999999999998e-200 < y.re < 1.36e20

    1. Initial program 86.5%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification87.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.55 \cdot 10^{-90}:\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 1.06 \cdot 10^{-200}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 1.36 \cdot 10^{+20}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \]

Alternative 3: 85.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{x.im}{y.re} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{if}\;y.re \leq -3.2 \cdot 10^{-38}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{y.re \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 8 \cdot 10^{+20}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot 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 y.re)
          (* (/ y.im (hypot y.re y.im)) (/ x.re (hypot y.re y.im))))))
   (if (<= y.re -3.2e-38)
     t_0
     (if (<= y.re 6.5e-88)
       (-
        (/ (/ (* y.re x.im) (hypot y.re y.im)) (hypot y.re y.im))
        (/ x.re y.im))
       (if (<= y.re 8e+20)
         (/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im 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 / y_46_re) - ((y_46_im / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_46_re, y_46_im)));
	double tmp;
	if (y_46_re <= -3.2e-38) {
		tmp = t_0;
	} else if (y_46_re <= 6.5e-88) {
		tmp = (((y_46_re * x_46_im) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 8e+20) {
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	} else {
		tmp = t_0;
	}
	return tmp;
}
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 / y_46_re) - ((y_46_im / Math.hypot(y_46_re, y_46_im)) * (x_46_re / Math.hypot(y_46_re, y_46_im)));
	double tmp;
	if (y_46_re <= -3.2e-38) {
		tmp = t_0;
	} else if (y_46_re <= 6.5e-88) {
		tmp = (((y_46_re * x_46_im) / Math.hypot(y_46_re, y_46_im)) / Math.hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 8e+20) {
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * 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 / y_46_re) - ((y_46_im / math.hypot(y_46_re, y_46_im)) * (x_46_re / math.hypot(y_46_re, y_46_im)))
	tmp = 0
	if y_46_re <= -3.2e-38:
		tmp = t_0
	elif y_46_re <= 6.5e-88:
		tmp = (((y_46_re * x_46_im) / math.hypot(y_46_re, y_46_im)) / math.hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im)
	elif y_46_re <= 8e+20:
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * 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 / y_46_re) - Float64(Float64(y_46_im / hypot(y_46_re, y_46_im)) * Float64(x_46_re / hypot(y_46_re, y_46_im))))
	tmp = 0.0
	if (y_46_re <= -3.2e-38)
		tmp = t_0;
	elseif (y_46_re <= 6.5e-88)
		tmp = Float64(Float64(Float64(Float64(y_46_re * x_46_im) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)) - Float64(x_46_re / y_46_im));
	elseif (y_46_re <= 8e+20)
		tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * 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 / y_46_re) - ((y_46_im / hypot(y_46_re, y_46_im)) * (x_46_re / hypot(y_46_re, y_46_im)));
	tmp = 0.0;
	if (y_46_re <= -3.2e-38)
		tmp = t_0;
	elseif (y_46_re <= 6.5e-88)
		tmp = (((y_46_re * x_46_im) / hypot(y_46_re, y_46_im)) / hypot(y_46_re, y_46_im)) - (x_46_re / y_46_im);
	elseif (y_46_re <= 8e+20)
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * 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 / y$46$re), $MachinePrecision] - N[(N[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] * N[(x$46$re / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.2e-38], t$95$0, If[LessEqual[y$46$re, 6.5e-88], N[(N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8e+20], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}

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

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

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -3.19999999999999977e-38 or 8e20 < y.re

    1. Initial program 49.7%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def49.7%

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

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

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

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      6. add-sqr-sqrt52.0%

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      8. hypot-def52.0%

        \[\leadsto \frac{x.im}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      9. fma-def52.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
      10. add-sqr-sqrt52.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\right) \]
      11. pow252.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}\right) \]
      12. hypot-def52.0%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}\right) \]
    3. Applied egg-rr52.0%

      \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)} \]
    4. Step-by-step derivation
      1. sub-neg52.0%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
      2. associate-/r/50.4%

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

        \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      4. *-commutative50.4%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      5. associate-/l*53.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    5. Simplified53.9%

      \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    6. Step-by-step derivation
      1. unpow253.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \mathsf{hypot}\left(y.re, y.im\right)}}{x.re}} \]
      2. hypot-udef53.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)}{x.re}} \]
      3. hypot-udef53.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{x.re}} \]
      4. add-sqr-sqrt53.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{x.re}} \]
      5. add-sqr-sqrt28.3%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      6. sqrt-prod40.2%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im \cdot y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      7. sqr-neg40.2%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      8. sqrt-unprod17.2%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      9. add-sqr-sqrt38.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{-y.im}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      10. associate-/l*37.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{\left(-y.im\right) \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}} \]
      11. add-sqr-sqrt37.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      12. hypot-udef37.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      13. hypot-udef37.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      14. times-frac38.3%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      15. add-sqr-sqrt17.1%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      16. sqrt-unprod41.8%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      17. sqr-neg41.8%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{y.im \cdot y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      18. sqrt-prod38.3%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      19. add-sqr-sqrt71.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    7. Applied egg-rr71.6%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    8. Taylor expanded in y.re around inf 90.7%

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

    if -3.19999999999999977e-38 < y.re < 6.50000000000000006e-88

    1. Initial program 77.9%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def77.9%

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

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

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

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      6. add-sqr-sqrt65.8%

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      8. hypot-def65.8%

        \[\leadsto \frac{x.im}{\frac{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      9. fma-def65.8%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
      10. add-sqr-sqrt65.8%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\right) \]
      11. pow265.8%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}\right) \]
      12. hypot-def65.8%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}\right) \]
    3. Applied egg-rr65.8%

      \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)} \]
    4. Step-by-step derivation
      1. sub-neg65.8%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
      2. associate-/r/59.9%

        \[\leadsto \color{blue}{\frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot y.re} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      3. *-commutative59.9%

        \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      4. *-commutative59.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      5. associate-/l*60.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    5. Simplified60.6%

      \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    6. Step-by-step derivation
      1. unpow260.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \mathsf{hypot}\left(y.re, y.im\right)}}{x.re}} \]
      2. hypot-udef60.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)}{x.re}} \]
      3. hypot-udef60.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}}{x.re}} \]
      4. add-sqr-sqrt60.6%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{y.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{x.re}} \]
      5. add-sqr-sqrt36.8%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      6. sqrt-prod30.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im \cdot y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      7. sqr-neg30.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      8. sqrt-unprod9.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      9. add-sqr-sqrt28.8%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{-y.im}}{\frac{y.re \cdot y.re + y.im \cdot y.im}{x.re}} \]
      10. associate-/l*25.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{\left(-y.im\right) \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}} \]
      11. add-sqr-sqrt25.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      12. hypot-udef25.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      13. hypot-udef25.5%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\left(-y.im\right) \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      14. times-frac30.7%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{-y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      15. add-sqr-sqrt11.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{-y.im} \cdot \sqrt{-y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      16. sqrt-unprod39.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{\left(-y.im\right) \cdot \left(-y.im\right)}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      17. sqr-neg39.9%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\sqrt{\color{blue}{y.im \cdot y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      18. sqrt-prod49.7%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{\sqrt{y.im} \cdot \sqrt{y.im}}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      19. add-sqr-sqrt81.3%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im}}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    7. Applied egg-rr81.3%

      \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
    8. Step-by-step derivation
      1. unpow281.3%

        \[\leadsto y.re \cdot \frac{x.im}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      2. hypot-udef81.3%

        \[\leadsto y.re \cdot \frac{x.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      3. hypot-udef81.3%

        \[\leadsto y.re \cdot \frac{x.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      4. add-sqr-sqrt81.3%

        \[\leadsto y.re \cdot \frac{x.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      5. associate-*r/84.1%

        \[\leadsto \color{blue}{\frac{y.re \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      6. *-commutative84.1%

        \[\leadsto \frac{\color{blue}{x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      7. add-sqr-sqrt84.1%

        \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      8. hypot-udef84.1%

        \[\leadsto \frac{x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      9. hypot-udef84.1%

        \[\leadsto \frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      10. associate-/r*94.2%

        \[\leadsto \color{blue}{\frac{\frac{x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      11. *-commutative94.2%

        \[\leadsto \frac{\frac{\color{blue}{y.re \cdot x.im}}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    9. Applied egg-rr94.2%

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

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

    if 6.50000000000000006e-88 < y.re < 8e20

    1. Initial program 86.5%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification89.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.2 \cdot 10^{-38}:\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 6.5 \cdot 10^{-88}:\\ \;\;\;\;\frac{\frac{y.re \cdot x.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 8 \cdot 10^{+20}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \]

Alternative 4: 78.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot x.im - y.im \cdot x.re\\ \mathbf{if}\;y.re \leq -2.3 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{elif}\;y.re \leq -6.2 \cdot 10^{-110}:\\ \;\;\;\;\frac{t_0}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-199}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+140}:\\ \;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im + \left|y.im \cdot \frac{x.re}{y.re}\right|}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (- (* y.re x.im) (* y.im x.re))))
   (if (<= y.re -2.3e+80)
     (- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))
     (if (<= y.re -6.2e-110)
       (/ t_0 (fma y.re y.re (* y.im y.im)))
       (if (<= y.re 2.5e-199)
         (- (/ x.im (/ (pow y.im 2.0) y.re)) (/ x.re y.im))
         (if (<= y.re 9.5e+140)
           (/ t_0 (+ (* y.re y.re) (* y.im y.im)))
           (/ (+ x.im (fabs (* y.im (/ x.re y.re)))) (hypot y.re y.im))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
	double tmp;
	if (y_46_re <= -2.3e+80) {
		tmp = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
	} else if (y_46_re <= -6.2e-110) {
		tmp = t_0 / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
	} else if (y_46_re <= 2.5e-199) {
		tmp = (x_46_im / (pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 9.5e+140) {
		tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	} else {
		tmp = (x_46_im + fabs((y_46_im * (x_46_re / y_46_re)))) / hypot(y_46_re, y_46_im);
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re))
	tmp = 0.0
	if (y_46_re <= -2.3e+80)
		tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0))));
	elseif (y_46_re <= -6.2e-110)
		tmp = Float64(t_0 / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im)));
	elseif (y_46_re <= 2.5e-199)
		tmp = Float64(Float64(x_46_im / Float64((y_46_im ^ 2.0) / y_46_re)) - Float64(x_46_re / y_46_im));
	elseif (y_46_re <= 9.5e+140)
		tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)));
	else
		tmp = Float64(Float64(x_46_im + abs(Float64(y_46_im * Float64(x_46_re / y_46_re)))) / hypot(y_46_re, y_46_im));
	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$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -2.3e+80], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, -6.2e-110], N[(t$95$0 / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.5e-199], N[(N[(x$46$im / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 9.5e+140], N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im + N[Abs[N[(y$46$im * N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
\mathbf{if}\;y.re \leq -2.3 \cdot 10^{+80}:\\
\;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\

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

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

\mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+140}:\\
\;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\

\mathbf{else}:\\
\;\;\;\;\frac{x.im + \left|y.im \cdot \frac{x.re}{y.re}\right|}{\mathsf{hypot}\left(y.re, y.im\right)}\\


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

    1. Initial program 36.5%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}} + \frac{x.im}{y.re}} \]
    3. Step-by-step derivation
      1. +-commutative65.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      2. mul-1-neg65.8%

        \[\leadsto \frac{x.im}{y.re} + \color{blue}{\left(-\frac{x.re \cdot y.im}{{y.re}^{2}}\right)} \]
      3. unsub-neg65.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} - \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      4. associate-/l*72.4%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{\frac{{y.re}^{2}}{y.im}}} \]
      5. associate-/r/76.3%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{{y.re}^{2}} \cdot y.im} \]
    4. Simplified76.3%

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

    if -2.30000000000000004e80 < y.re < -6.20000000000000014e-110

    1. Initial program 76.7%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def76.7%

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

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

    if -6.20000000000000014e-110 < y.re < 2.4999999999999998e-199

    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. Taylor expanded in y.re around 0 77.4%

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
      2. mul-1-neg77.4%

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
      4. associate-/l*85.7%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{y.im}^{2}}{y.re}}} - \frac{x.re}{y.im} \]
    4. Simplified85.7%

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

    if 2.4999999999999998e-199 < y.re < 9.4999999999999994e140

    1. Initial program 85.7%

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

    if 9.4999999999999994e140 < y.re

    1. Initial program 35.3%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def35.3%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x.im, y.re, \color{blue}{\left(\sqrt{x.re} \cdot \sqrt{x.re}\right)} \cdot y.im\right) \cdot \frac{1}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \]
      9. add-sqr-sqrt32.7%

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

        \[\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}} \]
      11. add-sqr-sqrt32.7%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      12. pow232.7%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}} \]
      13. hypot-def32.7%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}} \]
    3. Applied egg-rr32.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
    4. Step-by-step derivation
      1. unpow232.7%

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

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)} \]
      3. hypot-udef32.7%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      4. add-sqr-sqrt32.7%

        \[\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}} \]
      5. un-div-inv32.7%

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

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

        \[\leadsto \frac{\color{blue}{x.re \cdot y.im + x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} \]
      8. add-sqr-sqrt32.7%

        \[\leadsto \frac{x.re \cdot y.im + x.im \cdot y.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      9. hypot-udef32.7%

        \[\leadsto \frac{x.re \cdot y.im + x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      10. hypot-udef32.7%

        \[\leadsto \frac{x.re \cdot y.im + x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      11. associate-/r*38.8%

        \[\leadsto \color{blue}{\frac{\frac{x.re \cdot y.im + x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      12. +-commutative38.8%

        \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re + x.re \cdot y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      13. *-commutative38.8%

        \[\leadsto \frac{\frac{\color{blue}{y.re \cdot x.im} + x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      14. fma-def38.8%

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(y.re, x.im, x.re \cdot y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      15. *-commutative38.8%

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

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

      \[\leadsto \frac{\color{blue}{x.im + \frac{x.re \cdot y.im}{y.re}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    7. Step-by-step derivation
      1. add-sqr-sqrt60.1%

        \[\leadsto \frac{x.im + \color{blue}{\sqrt{\frac{x.re \cdot y.im}{y.re}} \cdot \sqrt{\frac{x.re \cdot y.im}{y.re}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      2. sqrt-unprod66.0%

        \[\leadsto \frac{x.im + \color{blue}{\sqrt{\frac{x.re \cdot y.im}{y.re} \cdot \frac{x.re \cdot y.im}{y.re}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      3. pow266.0%

        \[\leadsto \frac{x.im + \sqrt{\color{blue}{{\left(\frac{x.re \cdot y.im}{y.re}\right)}^{2}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      4. associate-/l*69.2%

        \[\leadsto \frac{x.im + \sqrt{{\color{blue}{\left(\frac{x.re}{\frac{y.re}{y.im}}\right)}}^{2}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    8. Applied egg-rr69.2%

      \[\leadsto \frac{x.im + \color{blue}{\sqrt{{\left(\frac{x.re}{\frac{y.re}{y.im}}\right)}^{2}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    9. Step-by-step derivation
      1. unpow269.2%

        \[\leadsto \frac{x.im + \sqrt{\color{blue}{\frac{x.re}{\frac{y.re}{y.im}} \cdot \frac{x.re}{\frac{y.re}{y.im}}}}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      2. rem-sqrt-square72.1%

        \[\leadsto \frac{x.im + \color{blue}{\left|\frac{x.re}{\frac{y.re}{y.im}}\right|}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      3. associate-/r/72.1%

        \[\leadsto \frac{x.im + \left|\color{blue}{\frac{x.re}{y.re} \cdot y.im}\right|}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      4. *-commutative72.1%

        \[\leadsto \frac{x.im + \left|\color{blue}{y.im \cdot \frac{x.re}{y.re}}\right|}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    10. Simplified72.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.3 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{elif}\;y.re \leq -6.2 \cdot 10^{-110}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \mathbf{elif}\;y.re \leq 2.5 \cdot 10^{-199}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 9.5 \cdot 10^{+140}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im + \left|y.im \cdot \frac{x.re}{y.re}\right|}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \]

Alternative 5: 75.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -2.7 \cdot 10^{+56} \lor \neg \left(y.re \leq 8.8 \cdot 10^{+26}\right):\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (or (<= y.re -2.7e+56) (not (<= y.re 8.8e+26)))
   (- (/ x.im y.re) (/ y.im (/ (pow (hypot y.re y.im) 2.0) x.re)))
   (/ (fma x.im y.re (* y.im (- x.re))) (fma 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) {
	double tmp;
	if ((y_46_re <= -2.7e+56) || !(y_46_re <= 8.8e+26)) {
		tmp = (x_46_im / y_46_re) - (y_46_im / (pow(hypot(y_46_re, y_46_im), 2.0) / x_46_re));
	} else {
		tmp = fma(x_46_im, y_46_re, (y_46_im * -x_46_re)) / fma(y_46_re, y_46_re, (y_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_re <= -2.7e+56) || !(y_46_re <= 8.8e+26))
		tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im / Float64((hypot(y_46_re, y_46_im) ^ 2.0) / x_46_re)));
	else
		tmp = Float64(fma(x_46_im, y_46_re, Float64(y_46_im * Float64(-x_46_re))) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im)));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -2.7e+56], N[Not[LessEqual[y$46$re, 8.8e+26]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im / N[(N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * y$46$re + N[(y$46$im * (-x$46$re)), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -2.7 \cdot 10^{+56} \lor \neg \left(y.re \leq 8.8 \cdot 10^{+26}\right):\\
\;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -2.7000000000000001e56 or 8.80000000000000028e26 < y.re

    1. Initial program 45.9%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def45.9%

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

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

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

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      6. add-sqr-sqrt48.5%

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      8. hypot-def48.5%

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

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
      10. add-sqr-sqrt48.5%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\right) \]
      11. pow248.5%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}\right) \]
      12. hypot-def48.5%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}\right) \]
    3. Applied egg-rr48.5%

      \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)} \]
    4. Step-by-step derivation
      1. sub-neg48.5%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
      2. associate-/r/46.7%

        \[\leadsto \color{blue}{\frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot y.re} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      3. *-commutative46.7%

        \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      4. *-commutative46.7%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      5. associate-/l*50.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    5. Simplified50.0%

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

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

    if -2.7000000000000001e56 < y.re < 8.80000000000000028e26

    1. Initial program 79.5%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-neg79.5%

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(x.im, y.re, -x.re \cdot y.im\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
      2. distribute-lft-neg-out79.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -2.7 \cdot 10^{+56} \lor \neg \left(y.re \leq 8.8 \cdot 10^{+26}\right):\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, y.re, y.im \cdot \left(-x.re\right)\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \end{array} \]

Alternative 6: 75.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.re \leq -1.9 \cdot 10^{+56} \lor \neg \left(y.re \leq 5.2 \cdot 10^{+25}\right):\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (if (or (<= y.re -1.9e+56) (not (<= y.re 5.2e+25)))
   (- (/ x.im y.re) (/ y.im (/ (pow (hypot y.re y.im) 2.0) x.re)))
   (/ (- (* y.re x.im) (* y.im x.re)) (fma 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) {
	double tmp;
	if ((y_46_re <= -1.9e+56) || !(y_46_re <= 5.2e+25)) {
		tmp = (x_46_im / y_46_re) - (y_46_im / (pow(hypot(y_46_re, y_46_im), 2.0) / x_46_re));
	} else {
		tmp = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / fma(y_46_re, y_46_re, (y_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_re <= -1.9e+56) || !(y_46_re <= 5.2e+25))
		tmp = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im / Float64((hypot(y_46_re, y_46_im) ^ 2.0) / x_46_re)));
	else
		tmp = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im)));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := If[Or[LessEqual[y$46$re, -1.9e+56], N[Not[LessEqual[y$46$re, 5.2e+25]], $MachinePrecision]], N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im / N[(N[Power[N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision], 2.0], $MachinePrecision] / x$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y.re \leq -1.9 \cdot 10^{+56} \lor \neg \left(y.re \leq 5.2 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y.re < -1.89999999999999998e56 or 5.1999999999999997e25 < y.re

    1. Initial program 45.9%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def45.9%

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

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

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

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      6. add-sqr-sqrt48.5%

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

        \[\leadsto \frac{x.im}{\frac{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\right) \]
      8. hypot-def48.5%

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

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{y.re \cdot y.re + y.im \cdot y.im}}\right) \]
      10. add-sqr-sqrt48.5%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}}\right) \]
      11. pow248.5%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}}\right) \]
      12. hypot-def48.5%

        \[\leadsto \frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\color{blue}{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}}^{2}}\right) \]
    3. Applied egg-rr48.5%

      \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} + \left(-\frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}\right)} \]
    4. Step-by-step derivation
      1. sub-neg48.5%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{y.re}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
      2. associate-/r/46.7%

        \[\leadsto \color{blue}{\frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \cdot y.re} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      3. *-commutative46.7%

        \[\leadsto \color{blue}{y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} - \frac{x.re \cdot y.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      4. *-commutative46.7%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \frac{\color{blue}{y.im \cdot x.re}}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} \]
      5. associate-/l*50.0%

        \[\leadsto y.re \cdot \frac{x.im}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}} - \color{blue}{\frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}} \]
    5. Simplified50.0%

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

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

    if -1.89999999999999998e56 < y.re < 5.1999999999999997e25

    1. Initial program 79.5%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def79.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.9 \cdot 10^{+56} \lor \neg \left(y.re \leq 5.2 \cdot 10^{+25}\right):\\ \;\;\;\;\frac{x.im}{y.re} - \frac{y.im}{\frac{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}{x.re}}\\ \mathbf{else}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \end{array} \]

Alternative 7: 75.5% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{if}\;y.re \leq -3.4 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq -2.4 \cdot 10^{-298}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-223}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4.5 \cdot 10^{+26}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
        (t_1 (- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))))
   (if (<= y.re -3.4e+80)
     t_1
     (if (<= y.re -2.4e-298)
       t_0
       (if (<= y.re 2.8e-223)
         (/ (- x.re) y.im)
         (if (<= y.re 4.5e+26) 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
	double tmp;
	if (y_46_re <= -3.4e+80) {
		tmp = t_1;
	} else if (y_46_re <= -2.4e-298) {
		tmp = t_0;
	} else if (y_46_re <= 2.8e-223) {
		tmp = -x_46_re / y_46_im;
	} else if (y_46_re <= 4.5e+26) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
    t_1 = (x_46im / y_46re) - (y_46im * (x_46re / (y_46re ** 2.0d0)))
    if (y_46re <= (-3.4d+80)) then
        tmp = t_1
    else if (y_46re <= (-2.4d-298)) then
        tmp = t_0
    else if (y_46re <= 2.8d-223) then
        tmp = -x_46re / y_46im
    else if (y_46re <= 4.5d+26) then
        tmp = t_0
    else
        tmp = t_1
    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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / Math.pow(y_46_re, 2.0)));
	double tmp;
	if (y_46_re <= -3.4e+80) {
		tmp = t_1;
	} else if (y_46_re <= -2.4e-298) {
		tmp = t_0;
	} else if (y_46_re <= 2.8e-223) {
		tmp = -x_46_re / y_46_im;
	} else if (y_46_re <= 4.5e+26) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
	t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / math.pow(y_46_re, 2.0)))
	tmp = 0
	if y_46_re <= -3.4e+80:
		tmp = t_1
	elif y_46_re <= -2.4e-298:
		tmp = t_0
	elif y_46_re <= 2.8e-223:
		tmp = -x_46_re / y_46_im
	elif y_46_re <= 4.5e+26:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
	t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0))))
	tmp = 0.0
	if (y_46_re <= -3.4e+80)
		tmp = t_1;
	elseif (y_46_re <= -2.4e-298)
		tmp = t_0;
	elseif (y_46_re <= 2.8e-223)
		tmp = Float64(Float64(-x_46_re) / y_46_im);
	elseif (y_46_re <= 4.5e+26)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / (y_46_re ^ 2.0)));
	tmp = 0.0;
	if (y_46_re <= -3.4e+80)
		tmp = t_1;
	elseif (y_46_re <= -2.4e-298)
		tmp = t_0;
	elseif (y_46_re <= 2.8e-223)
		tmp = -x_46_re / y_46_im;
	elseif (y_46_re <= 4.5e+26)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -3.4e+80], t$95$1, If[LessEqual[y$46$re, -2.4e-298], t$95$0, If[LessEqual[y$46$re, 2.8e-223], N[((-x$46$re) / y$46$im), $MachinePrecision], If[LessEqual[y$46$re, 4.5e+26], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\
\mathbf{if}\;y.re \leq -3.4 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y.re \leq -2.4 \cdot 10^{-298}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y.re \leq 4.5 \cdot 10^{+26}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -3.39999999999999992e80 or 4.49999999999999978e26 < y.re

    1. Initial program 44.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}} + \frac{x.im}{y.re}} \]
    3. Step-by-step derivation
      1. +-commutative69.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      2. mul-1-neg69.8%

        \[\leadsto \frac{x.im}{y.re} + \color{blue}{\left(-\frac{x.re \cdot y.im}{{y.re}^{2}}\right)} \]
      3. unsub-neg69.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} - \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      4. associate-/l*70.8%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{\frac{{y.re}^{2}}{y.im}}} \]
      5. associate-/r/75.3%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{{y.re}^{2}} \cdot y.im} \]
    4. Simplified75.3%

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

    if -3.39999999999999992e80 < y.re < -2.39999999999999987e-298 or 2.80000000000000015e-223 < y.re < 4.49999999999999978e26

    1. Initial program 80.0%

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

    if -2.39999999999999987e-298 < y.re < 2.80000000000000015e-223

    1. Initial program 72.7%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
    3. Step-by-step derivation
      1. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot x.re}{y.im}} \]
      2. neg-mul-1100.0%

        \[\leadsto \frac{\color{blue}{-x.re}}{y.im} \]
    4. Simplified100.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -3.4 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{elif}\;y.re \leq -2.4 \cdot 10^{-298}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.re \leq 2.8 \cdot 10^{-223}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 4.5 \cdot 10^{+26}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \end{array} \]

Alternative 8: 77.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{if}\;y.re \leq -7 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq -4.8 \cdot 10^{-118}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.re \leq 6.4 \cdot 10^{-200}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+25}:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im))))
        (t_1 (- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))))
   (if (<= y.re -7e+80)
     t_1
     (if (<= y.re -4.8e-118)
       t_0
       (if (<= y.re 6.4e-200)
         (- (/ x.im (/ (pow y.im 2.0) y.re)) (/ x.re y.im))
         (if (<= y.re 5.5e+25) 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
	double tmp;
	if (y_46_re <= -7e+80) {
		tmp = t_1;
	} else if (y_46_re <= -4.8e-118) {
		tmp = t_0;
	} else if (y_46_re <= 6.4e-200) {
		tmp = (x_46_im / (pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 5.5e+25) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_0 = ((y_46re * x_46im) - (y_46im * x_46re)) / ((y_46re * y_46re) + (y_46im * y_46im))
    t_1 = (x_46im / y_46re) - (y_46im * (x_46re / (y_46re ** 2.0d0)))
    if (y_46re <= (-7d+80)) then
        tmp = t_1
    else if (y_46re <= (-4.8d-118)) then
        tmp = t_0
    else if (y_46re <= 6.4d-200) then
        tmp = (x_46im / ((y_46im ** 2.0d0) / y_46re)) - (x_46re / y_46im)
    else if (y_46re <= 5.5d+25) then
        tmp = t_0
    else
        tmp = t_1
    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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / Math.pow(y_46_re, 2.0)));
	double tmp;
	if (y_46_re <= -7e+80) {
		tmp = t_1;
	} else if (y_46_re <= -4.8e-118) {
		tmp = t_0;
	} else if (y_46_re <= 6.4e-200) {
		tmp = (x_46_im / (Math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 5.5e+25) {
		tmp = t_0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
	t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / math.pow(y_46_re, 2.0)))
	tmp = 0
	if y_46_re <= -7e+80:
		tmp = t_1
	elif y_46_re <= -4.8e-118:
		tmp = t_0
	elif y_46_re <= 6.4e-200:
		tmp = (x_46_im / (math.pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im)
	elif y_46_re <= 5.5e+25:
		tmp = t_0
	else:
		tmp = t_1
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
	t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0))))
	tmp = 0.0
	if (y_46_re <= -7e+80)
		tmp = t_1;
	elseif (y_46_re <= -4.8e-118)
		tmp = t_0;
	elseif (y_46_re <= 6.4e-200)
		tmp = Float64(Float64(x_46_im / Float64((y_46_im ^ 2.0) / y_46_re)) - Float64(x_46_re / y_46_im));
	elseif (y_46_re <= 5.5e+25)
		tmp = t_0;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / (y_46_re ^ 2.0)));
	tmp = 0.0;
	if (y_46_re <= -7e+80)
		tmp = t_1;
	elseif (y_46_re <= -4.8e-118)
		tmp = t_0;
	elseif (y_46_re <= 6.4e-200)
		tmp = (x_46_im / ((y_46_im ^ 2.0) / y_46_re)) - (x_46_re / y_46_im);
	elseif (y_46_re <= 5.5e+25)
		tmp = t_0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7e+80], t$95$1, If[LessEqual[y$46$re, -4.8e-118], t$95$0, If[LessEqual[y$46$re, 6.4e-200], N[(N[(x$46$im / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 5.5e+25], t$95$0, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\
\mathbf{if}\;y.re \leq -7 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y.re \leq -4.8 \cdot 10^{-118}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;y.re \leq 6.4 \cdot 10^{-200}:\\
\;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\

\mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+25}:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.re < -6.99999999999999987e80 or 5.50000000000000018e25 < y.re

    1. Initial program 44.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}} + \frac{x.im}{y.re}} \]
    3. Step-by-step derivation
      1. +-commutative69.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      2. mul-1-neg69.8%

        \[\leadsto \frac{x.im}{y.re} + \color{blue}{\left(-\frac{x.re \cdot y.im}{{y.re}^{2}}\right)} \]
      3. unsub-neg69.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} - \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      4. associate-/l*70.8%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{\frac{{y.re}^{2}}{y.im}}} \]
      5. associate-/r/75.3%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{{y.re}^{2}} \cdot y.im} \]
    4. Simplified75.3%

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

    if -6.99999999999999987e80 < y.re < -4.8000000000000003e-118 or 6.39999999999999965e-200 < y.re < 5.50000000000000018e25

    1. Initial program 82.4%

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

    if -4.8000000000000003e-118 < y.re < 6.39999999999999965e-200

    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. Taylor expanded in y.re around 0 77.4%

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
      2. mul-1-neg77.4%

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
      4. associate-/l*85.7%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{y.im}^{2}}{y.re}}} - \frac{x.re}{y.im} \]
    4. Simplified85.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -7 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{elif}\;y.re \leq -4.8 \cdot 10^{-118}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.re \leq 6.4 \cdot 10^{-200}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 5.5 \cdot 10^{+25}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \end{array} \]

Alternative 9: 77.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := y.re \cdot x.im - y.im \cdot x.re\\ t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{if}\;y.re \leq -7.4 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.re \leq -1.95 \cdot 10^{-108}:\\ \;\;\;\;\frac{t_0}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-199}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+26}:\\ \;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (- (* y.re x.im) (* y.im x.re)))
        (t_1 (- (/ x.im y.re) (* y.im (/ x.re (pow y.re 2.0))))))
   (if (<= y.re -7.4e+80)
     t_1
     (if (<= y.re -1.95e-108)
       (/ t_0 (fma y.re y.re (* y.im y.im)))
       (if (<= y.re 2.1e-199)
         (- (/ x.im (/ (pow y.im 2.0) y.re)) (/ x.re y.im))
         (if (<= y.re 8.8e+26)
           (/ t_0 (+ (* y.re y.re) (* y.im y.im)))
           t_1))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = (y_46_re * x_46_im) - (y_46_im * x_46_re);
	double t_1 = (x_46_im / y_46_re) - (y_46_im * (x_46_re / pow(y_46_re, 2.0)));
	double tmp;
	if (y_46_re <= -7.4e+80) {
		tmp = t_1;
	} else if (y_46_re <= -1.95e-108) {
		tmp = t_0 / fma(y_46_re, y_46_re, (y_46_im * y_46_im));
	} else if (y_46_re <= 2.1e-199) {
		tmp = (x_46_im / (pow(y_46_im, 2.0) / y_46_re)) - (x_46_re / y_46_im);
	} else if (y_46_re <= 8.8e+26) {
		tmp = t_0 / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re))
	t_1 = Float64(Float64(x_46_im / y_46_re) - Float64(y_46_im * Float64(x_46_re / (y_46_re ^ 2.0))))
	tmp = 0.0
	if (y_46_re <= -7.4e+80)
		tmp = t_1;
	elseif (y_46_re <= -1.95e-108)
		tmp = Float64(t_0 / fma(y_46_re, y_46_re, Float64(y_46_im * y_46_im)));
	elseif (y_46_re <= 2.1e-199)
		tmp = Float64(Float64(x_46_im / Float64((y_46_im ^ 2.0) / y_46_re)) - Float64(x_46_re / y_46_im));
	elseif (y_46_re <= 8.8e+26)
		tmp = Float64(t_0 / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)));
	else
		tmp = t_1;
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x$46$im / y$46$re), $MachinePrecision] - N[(y$46$im * N[(x$46$re / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -7.4e+80], t$95$1, If[LessEqual[y$46$re, -1.95e-108], N[(t$95$0 / N[(y$46$re * y$46$re + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 2.1e-199], N[(N[(x$46$im / N[(N[Power[y$46$im, 2.0], $MachinePrecision] / y$46$re), $MachinePrecision]), $MachinePrecision] - N[(x$46$re / y$46$im), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 8.8e+26], N[(t$95$0 / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := y.re \cdot x.im - y.im \cdot x.re\\
t_1 := \frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\
\mathbf{if}\;y.re \leq -7.4 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-199}:\\
\;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\

\mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{t_0}{y.re \cdot y.re + y.im \cdot y.im}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y.re < -7.39999999999999992e80 or 8.80000000000000028e26 < y.re

    1. Initial program 44.2%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}} + \frac{x.im}{y.re}} \]
    3. Step-by-step derivation
      1. +-commutative69.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} + -1 \cdot \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      2. mul-1-neg69.8%

        \[\leadsto \frac{x.im}{y.re} + \color{blue}{\left(-\frac{x.re \cdot y.im}{{y.re}^{2}}\right)} \]
      3. unsub-neg69.8%

        \[\leadsto \color{blue}{\frac{x.im}{y.re} - \frac{x.re \cdot y.im}{{y.re}^{2}}} \]
      4. associate-/l*70.8%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{\frac{{y.re}^{2}}{y.im}}} \]
      5. associate-/r/75.3%

        \[\leadsto \frac{x.im}{y.re} - \color{blue}{\frac{x.re}{{y.re}^{2}} \cdot y.im} \]
    4. Simplified75.3%

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

    if -7.39999999999999992e80 < y.re < -1.94999999999999997e-108

    1. Initial program 76.7%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def76.7%

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

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

    if -1.94999999999999997e-108 < y.re < 2.10000000000000002e-199

    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. Taylor expanded in y.re around 0 77.4%

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} + -1 \cdot \frac{x.re}{y.im}} \]
      2. mul-1-neg77.4%

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

        \[\leadsto \color{blue}{\frac{x.im \cdot y.re}{{y.im}^{2}} - \frac{x.re}{y.im}} \]
      4. associate-/l*85.7%

        \[\leadsto \color{blue}{\frac{x.im}{\frac{{y.im}^{2}}{y.re}}} - \frac{x.re}{y.im} \]
    4. Simplified85.7%

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

    if 2.10000000000000002e-199 < y.re < 8.80000000000000028e26

    1. Initial program 86.5%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification80.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -7.4 \cdot 10^{+80}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \mathbf{elif}\;y.re \leq -1.95 \cdot 10^{-108}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}\\ \mathbf{elif}\;y.re \leq 2.1 \cdot 10^{-199}:\\ \;\;\;\;\frac{x.im}{\frac{{y.im}^{2}}{y.re}} - \frac{x.re}{y.im}\\ \mathbf{elif}\;y.re \leq 8.8 \cdot 10^{+26}:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re} - y.im \cdot \frac{x.re}{{y.re}^{2}}\\ \end{array} \]

Alternative 10: 71.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{if}\;t_0 \leq \infty:\\ \;\;\;\;t_0\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0
         (/ (- (* y.re x.im) (* y.im x.re)) (+ (* y.re y.re) (* y.im y.im)))))
   (if (<= t_0 INFINITY) t_0 (/ 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 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	double tmp;
	if (t_0 <= ((double) INFINITY)) {
		tmp = t_0;
	} else {
		tmp = x_46_im / y_46_re;
	}
	return tmp;
}
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	double tmp;
	if (t_0 <= Double.POSITIVE_INFINITY) {
		tmp = t_0;
	} else {
		tmp = x_46_im / y_46_re;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
	tmp = 0
	if t_0 <= math.inf:
		tmp = t_0
	else:
		tmp = x_46_im / y_46_re
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(Float64(y_46_re * x_46_im) - Float64(y_46_im * x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
	tmp = 0.0
	if (t_0 <= Inf)
		tmp = t_0;
	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)
	t_0 = ((y_46_re * x_46_im) - (y_46_im * x_46_re)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	tmp = 0.0;
	if (t_0 <= Inf)
		tmp = t_0;
	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_] := Block[{t$95$0 = N[(N[(N[(y$46$re * x$46$im), $MachinePrecision] - N[(y$46$im * x$46$re), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, Infinity], t$95$0, N[(x$46$im / y$46$re), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\
\mathbf{if}\;t_0 \leq \infty:\\
\;\;\;\;t_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im))) < +inf.0

    1. Initial program 81.9%

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

    if +inf.0 < (/.f64 (-.f64 (*.f64 x.im y.re) (*.f64 x.re y.im)) (+.f64 (*.f64 y.re y.re) (*.f64 y.im y.im)))

    1. Initial program 0.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im} \leq \infty:\\ \;\;\;\;\frac{y.re \cdot x.im - y.im \cdot x.re}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \]

Alternative 11: 63.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{-x.re}{y.im}\\ \mathbf{if}\;y.im \leq -7 \cdot 10^{+31}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -6.4 \cdot 10^{-53}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq -8 \cdot 10^{-148}:\\ \;\;\;\;\frac{y.im \cdot \left(-x.re\right)}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.im \leq 8.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (/ (- x.re) y.im)))
   (if (<= y.im -7e+31)
     t_0
     (if (<= y.im -6.4e-53)
       (/ x.im y.re)
       (if (<= y.im -8e-148)
         (/ (* y.im (- x.re)) (+ (* y.re y.re) (* y.im y.im)))
         (if (<= y.im 8.5e-40) (/ x.im y.re) t_0))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = -x_46_re / y_46_im;
	double tmp;
	if (y_46_im <= -7e+31) {
		tmp = t_0;
	} else if (y_46_im <= -6.4e-53) {
		tmp = x_46_im / y_46_re;
	} else if (y_46_im <= -8e-148) {
		tmp = (y_46_im * -x_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	} else if (y_46_im <= 8.5e-40) {
		tmp = x_46_im / y_46_re;
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x_46re, x_46im, y_46re, y_46im)
    real(8), intent (in) :: x_46re
    real(8), intent (in) :: x_46im
    real(8), intent (in) :: y_46re
    real(8), intent (in) :: y_46im
    real(8) :: t_0
    real(8) :: tmp
    t_0 = -x_46re / y_46im
    if (y_46im <= (-7d+31)) then
        tmp = t_0
    else if (y_46im <= (-6.4d-53)) then
        tmp = x_46im / y_46re
    else if (y_46im <= (-8d-148)) then
        tmp = (y_46im * -x_46re) / ((y_46re * y_46re) + (y_46im * y_46im))
    else if (y_46im <= 8.5d-40) then
        tmp = x_46im / y_46re
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = -x_46_re / y_46_im;
	double tmp;
	if (y_46_im <= -7e+31) {
		tmp = t_0;
	} else if (y_46_im <= -6.4e-53) {
		tmp = x_46_im / y_46_re;
	} else if (y_46_im <= -8e-148) {
		tmp = (y_46_im * -x_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	} else if (y_46_im <= 8.5e-40) {
		tmp = x_46_im / y_46_re;
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x_46_re, x_46_im, y_46_re, y_46_im):
	t_0 = -x_46_re / y_46_im
	tmp = 0
	if y_46_im <= -7e+31:
		tmp = t_0
	elif y_46_im <= -6.4e-53:
		tmp = x_46_im / y_46_re
	elif y_46_im <= -8e-148:
		tmp = (y_46_im * -x_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im))
	elif y_46_im <= 8.5e-40:
		tmp = x_46_im / y_46_re
	else:
		tmp = t_0
	return tmp
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = Float64(Float64(-x_46_re) / y_46_im)
	tmp = 0.0
	if (y_46_im <= -7e+31)
		tmp = t_0;
	elseif (y_46_im <= -6.4e-53)
		tmp = Float64(x_46_im / y_46_re);
	elseif (y_46_im <= -8e-148)
		tmp = Float64(Float64(y_46_im * Float64(-x_46_re)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)));
	elseif (y_46_im <= 8.5e-40)
		tmp = Float64(x_46_im / y_46_re);
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = -x_46_re / y_46_im;
	tmp = 0.0;
	if (y_46_im <= -7e+31)
		tmp = t_0;
	elseif (y_46_im <= -6.4e-53)
		tmp = x_46_im / y_46_re;
	elseif (y_46_im <= -8e-148)
		tmp = (y_46_im * -x_46_re) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
	elseif (y_46_im <= 8.5e-40)
		tmp = x_46_im / y_46_re;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[((-x$46$re) / y$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -7e+31], t$95$0, If[LessEqual[y$46$im, -6.4e-53], N[(x$46$im / y$46$re), $MachinePrecision], If[LessEqual[y$46$im, -8e-148], N[(N[(y$46$im * (-x$46$re)), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 8.5e-40], N[(x$46$im / y$46$re), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{-x.re}{y.im}\\
\mathbf{if}\;y.im \leq -7 \cdot 10^{+31}:\\
\;\;\;\;t_0\\

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

\mathbf{elif}\;y.im \leq -8 \cdot 10^{-148}:\\
\;\;\;\;\frac{y.im \cdot \left(-x.re\right)}{y.re \cdot y.re + y.im \cdot y.im}\\

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

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y.im < -7e31 or 8.4999999999999998e-40 < y.im

    1. Initial program 49.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
    3. Step-by-step derivation
      1. associate-*r/67.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x.re}{y.im}} \]
      2. neg-mul-167.9%

        \[\leadsto \frac{\color{blue}{-x.re}}{y.im} \]
    4. Simplified67.9%

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

    if -7e31 < y.im < -6.4000000000000002e-53 or -7.99999999999999949e-148 < y.im < 8.4999999999999998e-40

    1. Initial program 74.7%

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

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

    if -6.4000000000000002e-53 < y.im < -7.99999999999999949e-148

    1. Initial program 94.7%

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

      \[\leadsto \frac{\color{blue}{-1 \cdot \left(x.re \cdot y.im\right)}}{y.re \cdot y.re + y.im \cdot y.im} \]
    3. Step-by-step derivation
      1. mul-1-neg61.6%

        \[\leadsto \frac{\color{blue}{-x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
      2. distribute-rgt-neg-in61.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -7 \cdot 10^{+31}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{elif}\;y.im \leq -6.4 \cdot 10^{-53}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq -8 \cdot 10^{-148}:\\ \;\;\;\;\frac{y.im \cdot \left(-x.re\right)}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.im \leq 8.5 \cdot 10^{-40}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{-x.re}{y.im}\\ \end{array} \]

Alternative 12: 64.0% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -6.6 \cdot 10^{+29} \lor \neg \left(y.im \leq 8 \cdot 10^{-40}\right):\\ \;\;\;\;\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 (or (<= y.im -6.6e+29) (not (<= y.im 8e-40)))
   (/ (- 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_im <= -6.6e+29) || !(y_46_im <= 8e-40)) {
		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_46im <= (-6.6d+29)) .or. (.not. (y_46im <= 8d-40))) 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_im <= -6.6e+29) || !(y_46_im <= 8e-40)) {
		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_im <= -6.6e+29) or not (y_46_im <= 8e-40):
		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_im <= -6.6e+29) || !(y_46_im <= 8e-40))
		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_im <= -6.6e+29) || ~((y_46_im <= 8e-40)))
		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[Or[LessEqual[y$46$im, -6.6e+29], N[Not[LessEqual[y$46$im, 8e-40]], $MachinePrecision]], 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.im \leq -6.6 \cdot 10^{+29} \lor \neg \left(y.im \leq 8 \cdot 10^{-40}\right):\\
\;\;\;\;\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.im < -6.59999999999999968e29 or 7.9999999999999994e-40 < y.im

    1. Initial program 49.9%

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

      \[\leadsto \color{blue}{-1 \cdot \frac{x.re}{y.im}} \]
    3. Step-by-step derivation
      1. associate-*r/67.9%

        \[\leadsto \color{blue}{\frac{-1 \cdot x.re}{y.im}} \]
      2. neg-mul-167.9%

        \[\leadsto \frac{\color{blue}{-x.re}}{y.im} \]
    4. Simplified67.9%

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

    if -6.59999999999999968e29 < y.im < 7.9999999999999994e-40

    1. Initial program 77.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -6.6 \cdot 10^{+29} \lor \neg \left(y.im \leq 8 \cdot 10^{-40}\right):\\ \;\;\;\;\frac{-x.re}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \]

Alternative 13: 46.5% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y.im \leq -7.8 \cdot 10^{+221} \lor \neg \left(y.im \leq 2.3 \cdot 10^{+204}\right):\\ \;\;\;\;\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 (or (<= y.im -7.8e+221) (not (<= y.im 2.3e+204)))
   (/ 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_im <= -7.8e+221) || !(y_46_im <= 2.3e+204)) {
		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_46im <= (-7.8d+221)) .or. (.not. (y_46im <= 2.3d+204))) 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_im <= -7.8e+221) || !(y_46_im <= 2.3e+204)) {
		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_im <= -7.8e+221) or not (y_46_im <= 2.3e+204):
		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_im <= -7.8e+221) || !(y_46_im <= 2.3e+204))
		tmp = 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_im <= -7.8e+221) || ~((y_46_im <= 2.3e+204)))
		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[Or[LessEqual[y$46$im, -7.8e+221], N[Not[LessEqual[y$46$im, 2.3e+204]], $MachinePrecision]], 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.im \leq -7.8 \cdot 10^{+221} \lor \neg \left(y.im \leq 2.3 \cdot 10^{+204}\right):\\
\;\;\;\;\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.im < -7.8e221 or 2.2999999999999999e204 < y.im

    1. Initial program 43.4%

      \[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Step-by-step derivation
      1. fma-def43.4%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(x.im, y.re, \color{blue}{\left(\sqrt{x.re} \cdot \sqrt{x.re}\right)} \cdot y.im\right) \cdot \frac{1}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \]
      9. add-sqr-sqrt43.4%

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

        \[\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}} \]
      11. add-sqr-sqrt43.4%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      12. pow243.4%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\color{blue}{{\left(\sqrt{y.re \cdot y.re + y.im \cdot y.im}\right)}^{2}}} \]
      13. hypot-def43.4%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{{\left(\mathsf{hypot}\left(y.re, y.im\right)\right)}^{2}}} \]
    4. Step-by-step derivation
      1. unpow243.4%

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

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \mathsf{hypot}\left(y.re, y.im\right)} \]
      3. hypot-udef43.4%

        \[\leadsto \mathsf{fma}\left(x.im, y.re, x.re \cdot y.im\right) \cdot \frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      4. add-sqr-sqrt43.4%

        \[\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}} \]
      5. un-div-inv43.4%

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

        \[\leadsto \frac{\color{blue}{x.im \cdot y.re + x.re \cdot y.im}}{y.re \cdot y.re + y.im \cdot y.im} \]
      7. +-commutative43.4%

        \[\leadsto \frac{\color{blue}{x.re \cdot y.im + x.im \cdot y.re}}{y.re \cdot y.re + y.im \cdot y.im} \]
      8. add-sqr-sqrt43.4%

        \[\leadsto \frac{x.re \cdot y.im + x.im \cdot y.re}{\color{blue}{\sqrt{y.re \cdot y.re + y.im \cdot y.im} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]
      9. hypot-udef43.4%

        \[\leadsto \frac{x.re \cdot y.im + x.im \cdot y.re}{\color{blue}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \sqrt{y.re \cdot y.re + y.im \cdot y.im}} \]
      10. hypot-udef43.4%

        \[\leadsto \frac{x.re \cdot y.im + x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right) \cdot \color{blue}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      11. associate-/r*44.5%

        \[\leadsto \color{blue}{\frac{\frac{x.re \cdot y.im + x.im \cdot y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}} \]
      12. +-commutative44.5%

        \[\leadsto \frac{\frac{\color{blue}{x.im \cdot y.re + x.re \cdot y.im}}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      13. *-commutative44.5%

        \[\leadsto \frac{\frac{\color{blue}{y.re \cdot x.im} + x.re \cdot y.im}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      14. fma-def44.6%

        \[\leadsto \frac{\frac{\color{blue}{\mathsf{fma}\left(y.re, x.im, x.re \cdot y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
      15. *-commutative44.6%

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

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

      \[\leadsto \frac{\color{blue}{x.re}}{\mathsf{hypot}\left(y.re, y.im\right)} \]
    7. Taylor expanded in y.re around 0 43.9%

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

    if -7.8e221 < y.im < 2.2999999999999999e204

    1. Initial program 68.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -7.8 \cdot 10^{+221} \lor \neg \left(y.im \leq 2.3 \cdot 10^{+204}\right):\\ \;\;\;\;\frac{x.re}{y.im}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \end{array} \]

Alternative 14: 42.9% accurate, 5.0× 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 64.9%

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

    \[\leadsto \color{blue}{\frac{x.im}{y.re}} \]
  3. Final simplification41.6%

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

Reproduce

?
herbie shell --seed 2023322 
(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))))