Average Error: 0.3 → 0.2
Time: 6.5s
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 r1996548 = x_re;
        double r1996549 = y_im;
        double r1996550 = r1996548 * r1996549;
        double r1996551 = x_im;
        double r1996552 = y_re;
        double r1996553 = r1996551 * r1996552;
        double r1996554 = r1996550 + r1996553;
        return r1996554;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r1996555 = x_re;
        double r1996556 = y_im;
        double r1996557 = r1996555 * r1996556;
        double r1996558 = /*Error: no posit support in C */;
        double r1996559 = x_im;
        double r1996560 = y_re;
        double r1996561 = /*Error: no posit support in C */;
        double r1996562 = /*Error: no posit support in C */;
        return r1996562;
}

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 2019152 
(FPCore (x.re x.im y.re y.im)
  :name "_multiplyComplex, imaginary part"
  (+.p16 (*.p16 x.re y.im) (*.p16 x.im y.re)))