Average Error: 25.9 → 10.6
Time: 7.3s
Precision: binary64
\[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
\[\begin{array}{l} t_0 := \mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)\\ \mathbf{if}\;y.im \leq -2.2683578496950447 \cdot 10^{+118}:\\ \;\;\;\;\frac{-t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{elif}\;y.im \leq -1.789042358826724 \cdot 10^{-80}:\\ \;\;\;\;\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\mathsf{fma}\left(y.im, x.im, x.re \cdot y.re\right)}}}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{elif}\;y.im \leq 6.830966876910007 \cdot 10^{-121}:\\ \;\;\;\;\frac{y.im \cdot x.im}{{y.re}^{2}} + \frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq 9.284273264643539 \cdot 10^{+123}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \end{array} \]
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (/ (+ (* x.re y.re) (* x.im y.im)) (+ (* y.re y.re) (* y.im y.im))))
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (let* ((t_0 (fma (/ x.re y.im) y.re x.im)))
   (if (<= y.im -2.2683578496950447e+118)
     (/ (- t_0) (hypot y.im y.re))
     (if (<= y.im -1.789042358826724e-80)
       (/
        (/ 1.0 (/ (hypot y.im y.re) (fma y.im x.im (* x.re y.re))))
        (hypot y.im y.re))
       (if (<= y.im 6.830966876910007e-121)
         (+ (/ (* y.im x.im) (pow y.re 2.0)) (/ x.re y.re))
         (if (<= y.im 9.284273264643539e+123)
           (/
            (/ (fma x.re y.re (* y.im x.im)) (hypot y.im y.re))
            (hypot y.im y.re))
           (/ t_0 (hypot y.im y.re))))))))
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_re * y_46_re) + (x_46_im * y_46_im)) / ((y_46_re * y_46_re) + (y_46_im * y_46_im));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	double t_0 = fma((x_46_re / y_46_im), y_46_re, x_46_im);
	double tmp;
	if (y_46_im <= -2.2683578496950447e+118) {
		tmp = -t_0 / hypot(y_46_im, y_46_re);
	} else if (y_46_im <= -1.789042358826724e-80) {
		tmp = (1.0 / (hypot(y_46_im, y_46_re) / fma(y_46_im, x_46_im, (x_46_re * y_46_re)))) / hypot(y_46_im, y_46_re);
	} else if (y_46_im <= 6.830966876910007e-121) {
		tmp = ((y_46_im * x_46_im) / pow(y_46_re, 2.0)) + (x_46_re / y_46_re);
	} else if (y_46_im <= 9.284273264643539e+123) {
		tmp = (fma(x_46_re, y_46_re, (y_46_im * x_46_im)) / hypot(y_46_im, y_46_re)) / hypot(y_46_im, y_46_re);
	} else {
		tmp = t_0 / hypot(y_46_im, y_46_re);
	}
	return tmp;
}
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	return Float64(Float64(Float64(x_46_re * y_46_re) + Float64(x_46_im * y_46_im)) / Float64(Float64(y_46_re * y_46_re) + Float64(y_46_im * y_46_im)))
end
function code(x_46_re, x_46_im, y_46_re, y_46_im)
	t_0 = fma(Float64(x_46_re / y_46_im), y_46_re, x_46_im)
	tmp = 0.0
	if (y_46_im <= -2.2683578496950447e+118)
		tmp = Float64(Float64(-t_0) / hypot(y_46_im, y_46_re));
	elseif (y_46_im <= -1.789042358826724e-80)
		tmp = Float64(Float64(1.0 / Float64(hypot(y_46_im, y_46_re) / fma(y_46_im, x_46_im, Float64(x_46_re * y_46_re)))) / hypot(y_46_im, y_46_re));
	elseif (y_46_im <= 6.830966876910007e-121)
		tmp = Float64(Float64(Float64(y_46_im * x_46_im) / (y_46_re ^ 2.0)) + Float64(x_46_re / y_46_re));
	elseif (y_46_im <= 9.284273264643539e+123)
		tmp = Float64(Float64(fma(x_46_re, y_46_re, Float64(y_46_im * x_46_im)) / hypot(y_46_im, y_46_re)) / hypot(y_46_im, y_46_re));
	else
		tmp = Float64(t_0 / hypot(y_46_im, y_46_re));
	end
	return tmp
end
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(N[(N[(x$46$re * y$46$re), $MachinePrecision] + N[(x$46$im * y$46$im), $MachinePrecision]), $MachinePrecision] / N[(N[(y$46$re * y$46$re), $MachinePrecision] + N[(y$46$im * y$46$im), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := Block[{t$95$0 = N[(N[(x$46$re / y$46$im), $MachinePrecision] * y$46$re + x$46$im), $MachinePrecision]}, If[LessEqual[y$46$im, -2.2683578496950447e+118], N[((-t$95$0) / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, -1.789042358826724e-80], N[(N[(1.0 / N[(N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision] / N[(y$46$im * x$46$im + N[(x$46$re * y$46$re), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 6.830966876910007e-121], N[(N[(N[(y$46$im * x$46$im), $MachinePrecision] / N[Power[y$46$re, 2.0], $MachinePrecision]), $MachinePrecision] + N[(x$46$re / y$46$re), $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$im, 9.284273264643539e+123], N[(N[(N[(x$46$re * y$46$re + N[(y$46$im * x$46$im), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision], N[(t$95$0 / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision]]]]]]
\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)\\
\mathbf{if}\;y.im \leq -2.2683578496950447 \cdot 10^{+118}:\\
\;\;\;\;\frac{-t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\

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

\mathbf{elif}\;y.im \leq 6.830966876910007 \cdot 10^{-121}:\\
\;\;\;\;\frac{y.im \cdot x.im}{{y.re}^{2}} + \frac{x.re}{y.re}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{t_0}{\mathsf{hypot}\left(y.im, y.re\right)}\\


\end{array}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Split input into 5 regimes
  2. if y.im < -2.2683578496950447e118

    1. Initial program 40.9

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Simplified40.9

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}} \]
    3. Applied add-sqr-sqrt_binary6440.9

      \[\leadsto \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \cdot \sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}}} \]
    4. Applied *-un-lft-identity_binary6440.9

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

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

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

      \[\leadsto \frac{1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)}} \]
    8. Applied associate-*l/_binary6426.4

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

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

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

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

    if -2.2683578496950447e118 < y.im < -1.7890423588267239e-80

    1. Initial program 16.9

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Simplified16.9

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}} \]
    3. Applied add-sqr-sqrt_binary6416.9

      \[\leadsto \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \cdot \sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}}} \]
    4. Applied *-un-lft-identity_binary6416.9

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

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

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

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

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

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

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

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

    if -1.7890423588267239e-80 < y.im < 6.83096687691000727e-121

    1. Initial program 20.1

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Simplified20.1

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

      \[\leadsto \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \cdot \sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}}} \]
    4. Applied *-un-lft-identity_binary6420.1

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

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

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

      \[\leadsto \frac{1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)}} \]
    8. Applied associate-*l/_binary6411.4

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

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

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

    if 6.83096687691000727e-121 < y.im < 9.28427326464353912e123

    1. Initial program 17.0

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Simplified17.0

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}} \]
    3. Applied add-sqr-sqrt_binary6417.0

      \[\leadsto \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \cdot \sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}}} \]
    4. Applied *-un-lft-identity_binary6417.0

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

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

      \[\leadsto \color{blue}{\frac{1}{\mathsf{hypot}\left(y.im, y.re\right)}} \cdot \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}} \]
    7. Simplified11.9

      \[\leadsto \frac{1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)}} \]
    8. Applied associate-*l/_binary6411.8

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

      \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}}{\mathsf{hypot}\left(y.im, y.re\right)} \]
    10. Applied clear-num_binary6412.2

      \[\leadsto \color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}}} \]
    11. Applied *-un-lft-identity_binary6412.2

      \[\leadsto \frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\color{blue}{1 \cdot \mathsf{hypot}\left(y.im, y.re\right)}}}} \]
    12. Applied *-un-lft-identity_binary6412.2

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

      \[\leadsto \frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\color{blue}{\frac{1}{1} \cdot \frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}}} \]
    14. Applied *-un-lft-identity_binary6412.2

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

      \[\leadsto \frac{1}{\color{blue}{\frac{1}{\frac{1}{1}} \cdot \frac{\mathsf{hypot}\left(y.im, y.re\right)}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}}} \]
    16. Applied add-cube-cbrt_binary6412.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{1}{\frac{1}{1}} \cdot \frac{\mathsf{hypot}\left(y.im, y.re\right)}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}} \]
    17. Applied times-frac_binary6412.2

      \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{1}{\frac{1}{1}}} \cdot \frac{\sqrt[3]{1}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}}} \]
    18. Simplified12.2

      \[\leadsto \color{blue}{1} \cdot \frac{\sqrt[3]{1}}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}} \]
    19. Simplified11.8

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

    if 9.28427326464353912e123 < y.im

    1. Initial program 41.6

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Simplified41.6

      \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}} \]
    3. Applied add-sqr-sqrt_binary6441.6

      \[\leadsto \frac{\mathsf{fma}\left(x.re, y.re, x.im \cdot y.im\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)} \cdot \sqrt{\mathsf{fma}\left(y.re, y.re, y.im \cdot y.im\right)}}} \]
    4. Applied *-un-lft-identity_binary6441.6

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

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

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

      \[\leadsto \frac{1}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \color{blue}{\frac{\mathsf{fma}\left(y.im, x.im, y.re \cdot x.re\right)}{\mathsf{hypot}\left(y.im, y.re\right)}} \]
    8. Applied associate-*l/_binary6427.4

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.im \leq -2.2683578496950447 \cdot 10^{+118}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{elif}\;y.im \leq -1.789042358826724 \cdot 10^{-80}:\\ \;\;\;\;\frac{\frac{1}{\frac{\mathsf{hypot}\left(y.im, y.re\right)}{\mathsf{fma}\left(y.im, x.im, x.re \cdot y.re\right)}}}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{elif}\;y.im \leq 6.830966876910007 \cdot 10^{-121}:\\ \;\;\;\;\frac{y.im \cdot x.im}{{y.re}^{2}} + \frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq 9.284273264643539 \cdot 10^{+123}:\\ \;\;\;\;\frac{\frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{x.re}{y.im}, y.re, x.im\right)}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \end{array} \]

Reproduce

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