Average Error: 0.3 → 0.2
Time: 40.8s
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 r2490155 = x_re;
        double r2490156 = y_re;
        double r2490157 = r2490155 * r2490156;
        double r2490158 = x_im;
        double r2490159 = y_im;
        double r2490160 = r2490158 * r2490159;
        double r2490161 = r2490157 - r2490160;
        return r2490161;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r2490162 = x_re;
        double r2490163 = y_re;
        double r2490164 = r2490162 * r2490163;
        double r2490165 = /*Error: no posit support in C */;
        double r2490166 = x_im;
        double r2490167 = y_im;
        double r2490168 = /*Error: no posit support in C */;
        double r2490169 = /*Error: no posit support in C */;
        return r2490169;
}

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