Average Error: 0.3 → 0.2
Time: 16.1s
Precision: 64
\[\left(x.re \cdot y.re\right) - \left(x.im \cdot y.im\right)\]
\[\left(\mathsf{qms}\left(\left(\left(x.re \cdot y.re\right)\right), x.im, y.im\right)\right)\]
\left(x.re \cdot y.re\right) - \left(x.im \cdot y.im\right)
\left(\mathsf{qms}\left(\left(\left(x.re \cdot y.re\right)\right), x.im, y.im\right)\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r657993 = x_re;
        double r657994 = y_re;
        double r657995 = r657993 * r657994;
        double r657996 = x_im;
        double r657997 = y_im;
        double r657998 = r657996 * r657997;
        double r657999 = r657995 - r657998;
        return r657999;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r658000 = x_re;
        double r658001 = y_re;
        double r658002 = r658000 * r658001;
        double r658003 = /*Error: no posit support in C */;
        double r658004 = x_im;
        double r658005 = y_im;
        double r658006 = /*Error: no posit support in C */;
        double r658007 = /*Error: no posit support in C */;
        return r658007;
}

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

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

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

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

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

Reproduce

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