Average Error: 6.9 → 0.1
Time: 2.0m
Precision: 64
Internal Precision: 576
\[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im\]
\[(\left(x.re \cdot \left(x.im + x.im\right)\right) \cdot \left(-x.im\right) + \left((\left(x.re \cdot x.im\right) \cdot \left(-x.im\right) + \left({x.re}^{3}\right))_*\right))_* + 0\]

Error

Bits error versus x.re

Bits error versus x.im

Derivation

  1. Initial program 6.9

    \[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im\]
  2. Using strategy rm
  3. Applied prod-diff6.9

    \[\leadsto \color{blue}{(\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re + \left(-x.im \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)\right))_* + (\left(-x.im\right) \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right) + \left(x.im \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)\right))_*}\]
  4. Applied simplify0.1

    \[\leadsto \color{blue}{(\left(x.re \cdot \left(x.im + x.im\right)\right) \cdot \left(-x.im\right) + \left((\left(x.re \cdot x.im\right) \cdot \left(-x.im\right) + \left({x.re}^{3}\right))_*\right))_*} + (\left(-x.im\right) \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right) + \left(x.im \cdot \left(x.re \cdot x.im + x.im \cdot x.re\right)\right))_*\]
  5. Applied simplify0.1

    \[\leadsto (\left(x.re \cdot \left(x.im + x.im\right)\right) \cdot \left(-x.im\right) + \left((\left(x.re \cdot x.im\right) \cdot \left(-x.im\right) + \left({x.re}^{3}\right))_*\right))_* + \color{blue}{0}\]

Runtime

Time bar (total: 2.0m)Debug logProfile

herbie shell --seed 2019053 +o rules:numerics
(FPCore (x.re x.im)
  :name "math.cube on complex, real part"
  (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))