?

Average Accuracy: 60.2% → 92.9%
Time: 23.5s
Precision: binary64
Cost: 26760

?

\[\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 := \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{if}\;y.re \leq -1.25 \cdot 10^{+119}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \frac{y.im}{y.re} \cdot x.im, -x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 300000:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, t_0, \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, t_0, x.re\right)}{\mathsf{hypot}\left(y.re, y.im\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 (/ y.im (hypot y.re y.im))))
   (if (<= y.re -1.25e+119)
     (/ (fma -1.0 (* (/ y.im y.re) x.im) (- x.re)) (hypot y.re y.im))
     (if (<= y.re 300000.0)
       (/ (fma x.im t_0 (/ (* y.re x.re) (hypot y.re y.im))) (hypot y.re y.im))
       (/ (fma x.im t_0 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 ((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 = y_46_im / hypot(y_46_re, y_46_im);
	double tmp;
	if (y_46_re <= -1.25e+119) {
		tmp = fma(-1.0, ((y_46_im / y_46_re) * x_46_im), -x_46_re) / hypot(y_46_re, y_46_im);
	} else if (y_46_re <= 300000.0) {
		tmp = fma(x_46_im, t_0, ((y_46_re * x_46_re) / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im);
	} else {
		tmp = fma(x_46_im, t_0, x_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)
	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 = Float64(y_46_im / hypot(y_46_re, y_46_im))
	tmp = 0.0
	if (y_46_re <= -1.25e+119)
		tmp = Float64(fma(-1.0, Float64(Float64(y_46_im / y_46_re) * x_46_im), Float64(-x_46_re)) / hypot(y_46_re, y_46_im));
	elseif (y_46_re <= 300000.0)
		tmp = Float64(fma(x_46_im, t_0, Float64(Float64(y_46_re * x_46_re) / hypot(y_46_re, y_46_im))) / hypot(y_46_re, y_46_im));
	else
		tmp = Float64(fma(x_46_im, t_0, x_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_] := 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[(y$46$im / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y$46$re, -1.25e+119], N[(N[(-1.0 * N[(N[(y$46$im / y$46$re), $MachinePrecision] * x$46$im), $MachinePrecision] + (-x$46$re)), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], If[LessEqual[y$46$re, 300000.0], N[(N[(x$46$im * t$95$0 + N[(N[(y$46$re * x$46$re), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 2], $MachinePrecision]), $MachinePrecision], N[(N[(x$46$im * t$95$0 + x$46$re), $MachinePrecision] / N[Sqrt[y$46$re ^ 2 + y$46$im ^ 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 := \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\
\mathbf{if}\;y.re \leq -1.25 \cdot 10^{+119}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, \frac{y.im}{y.re} \cdot x.im, -x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\

\mathbf{elif}\;y.re \leq 300000:\\
\;\;\;\;\frac{\mathsf{fma}\left(x.im, t_0, \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\

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


\end{array}

Error?

Derivation?

  1. Split input into 3 regimes
  2. if y.re < -1.25e119

    1. Initial program 35.8%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Applied egg-rr56.7%

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

      [Start]35.8

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

      *-un-lft-identity [=>]35.8

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

      add-sqr-sqrt [=>]35.8

      \[ \frac{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}{\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}}} \]

      times-frac [=>]35.8

      \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]

      hypot-def [=>]35.8

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

      fma-def [=>]35.8

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

      hypot-def [=>]56.7

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

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

      [Start]56.7

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

      div-inv [=>]56.6

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

      *-commutative [<=]56.6

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

      fma-udef [=>]56.6

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

      distribute-lft-in [=>]56.6

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

      associate-*l/ [=>]56.7

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

      *-un-lft-identity [<=]56.7

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

      associate-*l/ [=>]56.7

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

      *-un-lft-identity [<=]56.7

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

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

      [Start]56.7

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

      +-commutative [<=]56.7

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

      associate-/l* [=>]64.1

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

      *-commutative [=>]64.1

      \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{\color{blue}{y.re \cdot x.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\right) \]
    5. Applied egg-rr37.0%

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

      [Start]64.1

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

      expm1-log1p-u [=>]63.0

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

      expm1-udef [=>]28.8

      \[ \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)\right)} - 1} \]

      associate-/r/ [<=]28.8

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}}}\right)} - 1 \]

      clear-num [<=]28.8

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}}\right)} - 1 \]

      div-inv [=>]28.8

      \[ e^{\mathsf{log1p}\left(\frac{\color{blue}{x.im \cdot \frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]

      fma-def [=>]28.8

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

      clear-num [<=]28.8

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

      *-commutative [=>]28.8

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

      associate-/l* [=>]37.0

      \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \color{blue}{\frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]
    6. Simplified64.2%

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

      [Start]37.0

      \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]

      expm1-def [=>]90.4

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

      expm1-log1p [=>]99.2

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

      associate-/r/ [=>]99.2

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

      associate-*l/ [=>]64.2

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

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

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

      [Start]79.9

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

      fma-def [=>]79.9

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

      associate-/l* [=>]86.2

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

      associate-/r/ [=>]85.5

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

      mul-1-neg [=>]85.5

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

    if -1.25e119 < y.re < 3e5

    1. Initial program 71.7%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Applied egg-rr82.7%

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

      [Start]71.7

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

      *-un-lft-identity [=>]71.7

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

      add-sqr-sqrt [=>]71.7

      \[ \frac{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}{\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}}} \]

      times-frac [=>]71.7

      \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]

      hypot-def [=>]71.7

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

      fma-def [=>]71.7

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

      hypot-def [=>]82.7

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

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

      [Start]82.7

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

      div-inv [=>]82.5

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

      *-commutative [<=]82.5

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

      fma-udef [=>]82.5

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

      distribute-lft-in [=>]82.5

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

      associate-*l/ [=>]82.6

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

      *-un-lft-identity [<=]82.6

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

      associate-*l/ [=>]82.7

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

      *-un-lft-identity [<=]82.7

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

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

      [Start]82.7

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

      +-commutative [<=]82.7

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

      associate-/l* [=>]96.4

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

      *-commutative [=>]96.4

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

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

      [Start]96.4

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

      expm1-log1p-u [=>]71.6

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

      expm1-udef [=>]35.5

      \[ \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)\right)} - 1} \]

      associate-/r/ [<=]35.5

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}}}\right)} - 1 \]

      clear-num [<=]35.5

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}}\right)} - 1 \]

      div-inv [=>]35.5

      \[ e^{\mathsf{log1p}\left(\frac{\color{blue}{x.im \cdot \frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]

      fma-def [=>]35.5

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

      clear-num [<=]35.5

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

      *-commutative [=>]35.5

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

      associate-/l* [=>]36.3

      \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \color{blue}{\frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]
    6. Simplified96.7%

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

      [Start]36.3

      \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]

      expm1-def [=>]73.2

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

      expm1-log1p [=>]99.2

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

      associate-/r/ [=>]98.3

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

      associate-*l/ [=>]96.7

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

    if 3e5 < y.re

    1. Initial program 48.6%

      \[\frac{x.re \cdot y.re + x.im \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
    2. Applied egg-rr65.1%

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

      [Start]48.6

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

      *-un-lft-identity [=>]48.6

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

      add-sqr-sqrt [=>]48.6

      \[ \frac{1 \cdot \left(x.re \cdot y.re + x.im \cdot y.im\right)}{\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}}} \]

      times-frac [=>]48.6

      \[ \color{blue}{\frac{1}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}} \cdot \frac{x.re \cdot y.re + x.im \cdot y.im}{\sqrt{y.re \cdot y.re + y.im \cdot y.im}}} \]

      hypot-def [=>]48.6

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

      fma-def [=>]48.6

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

      hypot-def [=>]65.1

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

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

      [Start]65.1

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

      div-inv [=>]65.0

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

      *-commutative [<=]65.0

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

      fma-udef [=>]65.0

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

      distribute-lft-in [=>]65.0

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

      associate-*l/ [=>]65.0

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

      *-un-lft-identity [<=]65.0

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

      associate-*l/ [=>]65.1

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

      *-un-lft-identity [<=]65.1

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

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

      [Start]65.1

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

      +-commutative [<=]65.1

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

      associate-/l* [=>]73.9

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

      *-commutative [=>]73.9

      \[ \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{\color{blue}{y.re \cdot x.re}}{\mathsf{hypot}\left(y.re, y.im\right)}\right) \]
    5. Applied egg-rr34.4%

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

      [Start]73.9

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

      expm1-log1p-u [=>]66.7

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

      expm1-udef [=>]27.5

      \[ \color{blue}{e^{\mathsf{log1p}\left(\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)\right)} - 1} \]

      associate-/r/ [<=]27.5

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}}}\right)} - 1 \]

      clear-num [<=]27.5

      \[ e^{\mathsf{log1p}\left(\color{blue}{\frac{\frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}}\right)} - 1 \]

      div-inv [=>]27.5

      \[ e^{\mathsf{log1p}\left(\frac{\color{blue}{x.im \cdot \frac{1}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}} + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]

      fma-def [=>]27.5

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

      clear-num [<=]27.5

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

      *-commutative [=>]27.5

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

      associate-/l* [=>]34.4

      \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \color{blue}{\frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]
    6. Simplified74.1%

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

      [Start]34.4

      \[ e^{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{x.re}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.re}}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\right)} - 1 \]

      expm1-def [=>]86.2

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

      expm1-log1p [=>]99.6

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

      associate-/r/ [=>]99.6

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

      associate-*l/ [=>]74.1

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y.re \leq -1.25 \cdot 10^{+119}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \frac{y.im}{y.re} \cdot x.im, -x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 300000:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \]

Alternatives

Alternative 1
Accuracy81.7%
Cost21088
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ t_1 := \frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \frac{\mathsf{fma}\left(x.re, y.re, y.im \cdot x.im\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -4.6 \cdot 10^{+108}:\\ \;\;\;\;\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -5 \cdot 10^{-204}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 1.28 \cdot 10^{-110}:\\ \;\;\;\;\frac{x.re}{y.re} + x.im \cdot \left(\frac{y.im}{y.re} \cdot \frac{1}{y.re}\right)\\ \mathbf{elif}\;y.im \leq 4.5 \cdot 10^{-24}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq 52000000000:\\ \;\;\;\;\frac{\frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{x.re}}\\ \mathbf{elif}\;y.im \leq 1.9 \cdot 10^{+122}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Accuracy92.7%
Cost20616
\[\begin{array}{l} t_0 := \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{if}\;y.re \leq -2.5 \cdot 10^{+116}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \frac{y.im}{y.re} \cdot x.im, -x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq 300000:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.im \cdot t_0 + \frac{y.re \cdot x.re}{\mathsf{hypot}\left(y.re, y.im\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, t_0, x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \]
Alternative 3
Accuracy83.7%
Cost20172
\[\begin{array}{l} \mathbf{if}\;y.re \leq -9.5 \cdot 10^{+87}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \frac{y.im}{y.re} \cdot x.im, -x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq -1.25 \cdot 10^{-159}:\\ \;\;\;\;\frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.re \leq 1.85 \cdot 10^{-110}:\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(x.im, \frac{y.im}{\mathsf{hypot}\left(y.re, y.im\right)}, x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \end{array} \]
Alternative 4
Accuracy83.5%
Cost14028
\[\begin{array}{l} \mathbf{if}\;y.re \leq -1.8 \cdot 10^{+89}:\\ \;\;\;\;\frac{\mathsf{fma}\left(-1, \frac{y.im}{y.re} \cdot x.im, -x.re\right)}{\mathsf{hypot}\left(y.re, y.im\right)}\\ \mathbf{elif}\;y.re \leq -1.25 \cdot 10^{-159}:\\ \;\;\;\;\frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.re \leq 6.8 \cdot 10^{-79}:\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\mathsf{hypot}\left(y.re, y.im\right)} \cdot \left(x.re + \frac{x.im}{\frac{\mathsf{hypot}\left(y.re, y.im\right)}{y.im}}\right)\\ \end{array} \]
Alternative 5
Accuracy78.2%
Cost13640
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -7.5 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -1.3 \cdot 10^{+109}:\\ \;\;\;\;\frac{y.re}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)}\\ \mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -6.3 \cdot 10^{-152}:\\ \;\;\;\;\frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.im \leq 1080000000000:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{\frac{x.im}{\frac{y.re}{y.im}}}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.re}}\\ \end{array} \]
Alternative 6
Accuracy68.3%
Cost1499
\[\begin{array}{l} \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135} \lor \neg \left(y.im \leq -1.4 \cdot 10^{+109} \lor \neg \left(y.im \leq -2.9 \cdot 10^{+15}\right) \land \left(y.im \leq -2.65 \cdot 10^{-17} \lor \neg \left(y.im \leq -1.02 \cdot 10^{-79}\right) \land y.im \leq 1.52 \cdot 10^{+15}\right)\right):\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \end{array} \]
Alternative 7
Accuracy68.5%
Cost1496
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -1.4 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -2.7 \cdot 10^{+15}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -2 \cdot 10^{-17}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -7 \cdot 10^{-81}:\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{elif}\;y.im \leq 365000000000:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 8
Accuracy68.5%
Cost1496
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -1.4 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -13500000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -6.5 \cdot 10^{-18}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -1.62 \cdot 10^{-80}:\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{elif}\;y.im \leq 5 \cdot 10^{+14}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.re}}\\ \end{array} \]
Alternative 9
Accuracy74.8%
Cost1496
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ t_1 := \frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -1.4 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -14000000000000:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -9.2 \cdot 10^{-18}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y.im \leq -1.3 \cdot 10^{-56}:\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{elif}\;y.im \leq 16000000000000:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.re}}\\ \end{array} \]
Alternative 10
Accuracy75.5%
Cost1496
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -1.4 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -3.05 \cdot 10^{+16}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -4.3 \cdot 10^{-18}:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{y.im}{y.re} \cdot \frac{x.im}{y.re}\\ \mathbf{elif}\;y.im \leq -3.2 \cdot 10^{-52}:\\ \;\;\;\;\frac{1}{y.im} \cdot \left(x.im + x.re \cdot \frac{y.re}{y.im}\right)\\ \mathbf{elif}\;y.im \leq 82000000000:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{\frac{x.im}{\frac{y.re}{y.im}}}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.re}}\\ \end{array} \]
Alternative 11
Accuracy77.9%
Cost1488
\[\begin{array}{l} t_0 := \frac{x.im}{y.im} + \frac{y.re}{y.im} \cdot \frac{x.re}{y.im}\\ \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -1.4 \cdot 10^{+109}:\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{elif}\;y.im \leq -1.5 \cdot 10^{+18}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;y.im \leq -9.5 \cdot 10^{-152}:\\ \;\;\;\;\frac{y.re \cdot x.re + y.im \cdot x.im}{y.re \cdot y.re + y.im \cdot y.im}\\ \mathbf{elif}\;y.im \leq 15800000000000:\\ \;\;\;\;\frac{x.re}{y.re} + \frac{\frac{x.im}{\frac{y.re}{y.im}}}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im} + \frac{\frac{y.re}{y.im}}{\frac{y.im}{x.re}}\\ \end{array} \]
Alternative 12
Accuracy62.9%
Cost986
\[\begin{array}{l} \mathbf{if}\;y.im \leq -7.2 \cdot 10^{+135}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \mathbf{elif}\;y.im \leq -1.3 \cdot 10^{+109} \lor \neg \left(y.im \leq -43000000000000\right) \land \left(y.im \leq -2.55 \cdot 10^{-17} \lor \neg \left(y.im \leq -3.2 \cdot 10^{-52}\right) \land y.im \leq 1.55 \cdot 10^{+14}\right):\\ \;\;\;\;\frac{x.re}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \end{array} \]
Alternative 13
Accuracy42.1%
Cost324
\[\begin{array}{l} \mathbf{if}\;y.re \leq -1.65 \cdot 10^{+201}:\\ \;\;\;\;\frac{x.im}{y.re}\\ \mathbf{else}:\\ \;\;\;\;\frac{x.im}{y.im}\\ \end{array} \]
Alternative 14
Accuracy41.5%
Cost192
\[\frac{x.im}{y.im} \]

Error

Reproduce?

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