?

Average Accuracy: 58.3% → 98.3%
Time: 36.6s
Precision: binary64

?

\[\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im} \]
\[\mathsf{fma}\left(-1, \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.im}{{\left(\sqrt{\mathsf{hypot}\left(y.im, y.re\right)}\right)}^{2}}, -\frac{x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{-\mathsf{hypot}\left(y.re, y.im\right)}\right) \]
(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))))
(FPCore (x.re x.im y.re y.im)
 :precision binary64
 (fma
  -1.0
  (* (/ x.re (hypot y.im y.re)) (/ y.im (pow (sqrt (hypot y.im y.re)) 2.0)))
  (- (/ (* x.im (/ y.re (hypot y.re y.im))) (- (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_im * y_46_re) - (x_46_re * 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) {
	return fma(-1.0, ((x_46_re / hypot(y_46_im, y_46_re)) * (y_46_im / pow(sqrt(hypot(y_46_im, y_46_re)), 2.0))), -((x_46_im * (y_46_re / hypot(y_46_re, y_46_im))) / -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(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 code(x_46_re, x_46_im, y_46_re, y_46_im)
	return fma(-1.0, Float64(Float64(x_46_re / hypot(y_46_im, y_46_re)) * Float64(y_46_im / (sqrt(hypot(y_46_im, y_46_re)) ^ 2.0))), Float64(-Float64(Float64(x_46_im * Float64(y_46_re / hypot(y_46_re, y_46_im))) / Float64(-hypot(y_46_re, 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]
code[x$46$re_, x$46$im_, y$46$re_, y$46$im_] := N[(-1.0 * N[(N[(x$46$re / N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]), $MachinePrecision] * N[(y$46$im / N[Power[N[Sqrt[N[Sqrt[y$46$im ^ 2 + y$46$re ^ 2], $MachinePrecision]], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + (-N[(N[(x$46$im * N[(y$46$re / 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])), $MachinePrecision]
\frac{x.im \cdot y.re - x.re \cdot y.im}{y.re \cdot y.re + y.im \cdot y.im}
\mathsf{fma}\left(-1, \frac{x.re}{\mathsf{hypot}\left(y.im, y.re\right)} \cdot \frac{y.im}{{\left(\sqrt{\mathsf{hypot}\left(y.im, y.re\right)}\right)}^{2}}, -\frac{x.im \cdot \frac{y.re}{\mathsf{hypot}\left(y.re, y.im\right)}}{-\mathsf{hypot}\left(y.re, y.im\right)}\right)

Error?

Derivation?

  1. Initial program 58.3%

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

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

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

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

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

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

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

Reproduce?

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