Average Error: 1.1 → 1.0
Time: 24.5s
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 r2309976 = x_im;
        double r2309977 = y_re;
        double r2309978 = r2309976 * r2309977;
        double r2309979 = x_re;
        double r2309980 = y_im;
        double r2309981 = r2309979 * r2309980;
        double r2309982 = r2309978 - r2309981;
        double r2309983 = r2309977 * r2309977;
        double r2309984 = r2309980 * r2309980;
        double r2309985 = r2309983 + r2309984;
        double r2309986 = r2309982 / r2309985;
        return r2309986;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r2309987 = x_im;
        double r2309988 = y_re;
        double r2309989 = r2309987 * r2309988;
        double r2309990 = /*Error: no posit support in C */;
        double r2309991 = x_re;
        double r2309992 = y_im;
        double r2309993 = /*Error: no posit support in C */;
        double r2309994 = /*Error: no posit support in C */;
        double r2309995 = r2309988 * r2309988;
        double r2309996 = /*Error: no posit support in C */;
        double r2309997 = /*Error: no posit support in C */;
        double r2309998 = /*Error: no posit support in C */;
        double r2309999 = r2309994 / r2309998;
        return r2309999;
}

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 2019158 +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))))