Average Error: 0.3 → 0.2
Time: 33.0s
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 r1755605 = x_re;
        double r1755606 = y_re;
        double r1755607 = r1755605 * r1755606;
        double r1755608 = x_im;
        double r1755609 = y_im;
        double r1755610 = r1755608 * r1755609;
        double r1755611 = r1755607 - r1755610;
        return r1755611;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1755612 = x_re;
        double r1755613 = y_re;
        double r1755614 = r1755612 * r1755613;
        double r1755615 = /*Error: no posit support in C */;
        double r1755616 = x_im;
        double r1755617 = y_im;
        double r1755618 = /*Error: no posit support in C */;
        double r1755619 = /*Error: no posit support in C */;
        return r1755619;
}

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 2019158 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "_multiplyComplex, real part"
  (-.p16 (*.p16 x.re y.re) (*.p16 x.im y.im)))