Average Error: 1.1 → 1.0
Time: 24.7s
Precision: 64
\[\frac{\left(\left(x.im \cdot y.re\right) - \left(x.re \cdot y.im\right)\right)}{\left(\frac{\left(y.re \cdot y.re\right)}{\left(y.im \cdot y.im\right)}\right)}\]
\[\frac{\left(\mathsf{qms}\left(\left(\left(x.im \cdot y.re\right)\right), x.re, y.im\right)\right)}{\left(\mathsf{qma}\left(\left(\left(y.re \cdot y.re\right)\right), y.im, y.im\right)\right)}\]
\frac{\left(\left(x.im \cdot y.re\right) - \left(x.re \cdot y.im\right)\right)}{\left(\frac{\left(y.re \cdot y.re\right)}{\left(y.im \cdot y.im\right)}\right)}
\frac{\left(\mathsf{qms}\left(\left(\left(x.im \cdot y.re\right)\right), x.re, y.im\right)\right)}{\left(\mathsf{qma}\left(\left(\left(y.re \cdot y.re\right)\right), y.im, y.im\right)\right)}
double f(double x_re, double x_im, double y_re, double y_im) {
        double r1814483 = x_im;
        double r1814484 = y_re;
        double r1814485 = r1814483 * r1814484;
        double r1814486 = x_re;
        double r1814487 = y_im;
        double r1814488 = r1814486 * r1814487;
        double r1814489 = r1814485 - r1814488;
        double r1814490 = r1814484 * r1814484;
        double r1814491 = r1814487 * r1814487;
        double r1814492 = r1814490 + r1814491;
        double r1814493 = r1814489 / r1814492;
        return r1814493;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1814494 = x_im;
        double r1814495 = y_re;
        double r1814496 = r1814494 * r1814495;
        double r1814497 = /*Error: no posit support in C */;
        double r1814498 = x_re;
        double r1814499 = y_im;
        double r1814500 = /*Error: no posit support in C */;
        double r1814501 = /*Error: no posit support in C */;
        double r1814502 = r1814495 * r1814495;
        double r1814503 = /*Error: no posit support in C */;
        double r1814504 = /*Error: no posit support in C */;
        double r1814505 = /*Error: no posit support in C */;
        double r1814506 = r1814501 / r1814505;
        return r1814506;
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Initial program 1.1

    \[\frac{\left(\left(x.im \cdot y.re\right) - \left(x.re \cdot y.im\right)\right)}{\left(\frac{\left(y.re \cdot y.re\right)}{\left(y.im \cdot y.im\right)}\right)}\]
  2. Using strategy rm
  3. Applied introduce-quire1.1

    \[\leadsto \frac{\left(\color{blue}{\left(\left(\left(x.im \cdot y.re\right)\right)\right)} - \left(x.re \cdot y.im\right)\right)}{\left(\frac{\left(y.re \cdot y.re\right)}{\left(y.im \cdot y.im\right)}\right)}\]
  4. Applied insert-quire-fdp-sub1.1

    \[\leadsto \frac{\color{blue}{\left(\left(\mathsf{qms}\left(\left(\left(x.im \cdot y.re\right)\right), x.re, y.im\right)\right)\right)}}{\left(\frac{\left(y.re \cdot y.re\right)}{\left(y.im \cdot y.im\right)}\right)}\]
  5. Using strategy rm
  6. Applied introduce-quire1.1

    \[\leadsto \frac{\left(\left(\mathsf{qms}\left(\left(\left(x.im \cdot y.re\right)\right), x.re, y.im\right)\right)\right)}{\left(\frac{\color{blue}{\left(\left(\left(y.re \cdot y.re\right)\right)\right)}}{\left(y.im \cdot y.im\right)}\right)}\]
  7. Applied insert-quire-fdp-add1.0

    \[\leadsto \frac{\left(\left(\mathsf{qms}\left(\left(\left(x.im \cdot y.re\right)\right), x.re, y.im\right)\right)\right)}{\color{blue}{\left(\left(\mathsf{qma}\left(\left(\left(y.re \cdot y.re\right)\right), y.im, y.im\right)\right)\right)}}\]
  8. Final simplification1.0

    \[\leadsto \frac{\left(\mathsf{qms}\left(\left(\left(x.im \cdot y.re\right)\right), x.re, y.im\right)\right)}{\left(\mathsf{qma}\left(\left(\left(y.re \cdot y.re\right)\right), y.im, y.im\right)\right)}\]

Reproduce

herbie shell --seed 2019162 
(FPCore (x.re x.im y.re y.im)
  :name "_divideComplex, imaginary part"
  (/.p16 (-.p16 (*.p16 x.im y.re) (*.p16 x.re y.im)) (+.p16 (*.p16 y.re y.re) (*.p16 y.im y.im))))