Average Error: 0.0 → 0.0
Time: 821.0ms
Precision: 64
\[x.re \cdot y.im + x.im \cdot y.re\]
\[\mathsf{fma}\left(y.re, x.im, y.im \cdot x.re\right)\]
x.re \cdot y.im + x.im \cdot y.re
\mathsf{fma}\left(y.re, x.im, y.im \cdot x.re\right)
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return ((x_46_re * y_46_im) + (x_46_im * y_46_re));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
	return fma(y_46_re, x_46_im, (y_46_im * x_46_re));
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x.re \cdot y.im + x.im \cdot y.re\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(x.re, y.im, x.im \cdot y.re\right)}\]
  3. Taylor expanded around inf 0.0

    \[\leadsto \color{blue}{y.re \cdot x.im + y.im \cdot x.re}\]
  4. Simplified0.0

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

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

Reproduce

herbie shell --seed 2020105 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "_multiplyComplex, imaginary part"
  :precision binary64
  (+ (* x.re y.im) (* x.im y.re)))