Average Error: 0.3 → 0.2
Time: 6.0s
Precision: 64
\[\frac{\left(x.re \cdot y.im\right)}{\left(x.im \cdot y.re\right)}\]
\[\left(\mathsf{qma}\left(\left(\left(x.re \cdot y.im\right)\right), x.im, y.re\right)\right)\]
\frac{\left(x.re \cdot y.im\right)}{\left(x.im \cdot y.re\right)}
\left(\mathsf{qma}\left(\left(\left(x.re \cdot y.im\right)\right), x.im, y.re\right)\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r957838 = x_re;
        double r957839 = y_im;
        double r957840 = r957838 * r957839;
        double r957841 = x_im;
        double r957842 = y_re;
        double r957843 = r957841 * r957842;
        double r957844 = r957840 + r957843;
        return r957844;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r957845 = x_re;
        double r957846 = y_im;
        double r957847 = r957845 * r957846;
        double r957848 = /*Error: no posit support in C */;
        double r957849 = x_im;
        double r957850 = y_re;
        double r957851 = /*Error: no posit support in C */;
        double r957852 = /*Error: no posit support in C */;
        return r957852;
}

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 0.3

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

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

    \[\leadsto \color{blue}{\left(\mathsf{qma}\left(\left(\left(x.re \cdot y.im\right)\right), x.im, y.re\right)\right)}\]
  5. Final simplification0.2

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

Reproduce

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