Average Error: 0.0 → 0.0
Time: 27.8s
Precision: 64
Internal Precision: 128
\[x.re \cdot y.re - x.im \cdot y.im\]
\[(x.re \cdot y.re + \left(-x.im \cdot y.im\right))_*\]

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.0

    \[x.re \cdot y.re - x.im \cdot y.im\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.0

    \[\leadsto x.re \cdot \color{blue}{\left(1 \cdot y.re\right)} - x.im \cdot y.im\]
  4. Applied associate-*r*0.0

    \[\leadsto \color{blue}{\left(x.re \cdot 1\right) \cdot y.re} - x.im \cdot y.im\]
  5. Applied fma-neg0.0

    \[\leadsto \color{blue}{(\left(x.re \cdot 1\right) \cdot y.re + \left(-x.im \cdot y.im\right))_*}\]
  6. Simplified0.0

    \[\leadsto (\color{blue}{x.re} \cdot y.re + \left(-x.im \cdot y.im\right))_*\]
  7. Final simplification0.0

    \[\leadsto (x.re \cdot y.re + \left(-x.im \cdot y.im\right))_*\]

Reproduce

herbie shell --seed 2019072 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "_multiplyComplex, real part"
  (- (* x.re y.re) (* x.im y.im)))