Average Error: 1.1 → 1.0
Time: 31.6s
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 r634841 = x_im;
        double r634842 = y_re;
        double r634843 = r634841 * r634842;
        double r634844 = x_re;
        double r634845 = y_im;
        double r634846 = r634844 * r634845;
        double r634847 = r634843 - r634846;
        double r634848 = r634842 * r634842;
        double r634849 = r634845 * r634845;
        double r634850 = r634848 + r634849;
        double r634851 = r634847 / r634850;
        return r634851;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r634852 = x_im;
        double r634853 = y_re;
        double r634854 = r634852 * r634853;
        double r634855 = /*Error: no posit support in C */;
        double r634856 = x_re;
        double r634857 = y_im;
        double r634858 = /*Error: no posit support in C */;
        double r634859 = /*Error: no posit support in C */;
        double r634860 = r634853 * r634853;
        double r634861 = /*Error: no posit support in C */;
        double r634862 = /*Error: no posit support in C */;
        double r634863 = /*Error: no posit support in C */;
        double r634864 = r634859 / r634863;
        return r634864;
}

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(\left(x.im \cdot y.re\right) - \left(x.re \cdot y.im\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)}\]
  4. Applied insert-quire-fdp-add1.1

    \[\leadsto \frac{\left(\left(x.im \cdot y.re\right) - \left(x.re \cdot y.im\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)}}\]
  5. Using strategy rm
  6. 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(\left(\mathsf{qma}\left(\left(\left(y.re \cdot y.re\right)\right), y.im, y.im\right)\right)\right)}\]
  7. Applied insert-quire-fdp-sub1.0

    \[\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(\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 2019151 +o rules:numerics
(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))))