Average Error: 6.9 → 0.2
Time: 37.2s
Precision: 64
Internal precision: 128
\[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
\[\left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right) + \left(x.im \cdot \left(-{x.im}^2\right) + \left(x.re \cdot x.im\right) \cdot x.re\right)\]

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.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
  2. Applied simplify 6.9

    \[\leadsto \color{blue}{x.im \cdot \left(\left(x.re \cdot x.re + x.re \cdot x.re\right) - \left({x.im}^2 - x.re \cdot x.re\right)\right)}\]
  3. Using strategy rm
  4. Applied sub-neg 6.9

    \[\leadsto x.im \cdot \color{blue}{\left(\left(x.re \cdot x.re + x.re \cdot x.re\right) + \left(-\left({x.im}^2 - x.re \cdot x.re\right)\right)\right)}\]
  5. Applied distribute-lft-in 6.9

    \[\leadsto \color{blue}{x.im \cdot \left(x.re \cdot x.re + x.re \cdot x.re\right) + x.im \cdot \left(-\left({x.im}^2 - x.re \cdot x.re\right)\right)}\]
  6. Applied simplify 6.9

    \[\leadsto \color{blue}{\left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right)} + x.im \cdot \left(-\left({x.im}^2 - x.re \cdot x.re\right)\right)\]
  7. Using strategy rm
  8. Applied sub-neg 6.9

    \[\leadsto \left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right) + x.im \cdot \left(-\color{blue}{\left({x.im}^2 + \left(-x.re \cdot x.re\right)\right)}\right)\]
  9. Applied distribute-neg-in 6.9

    \[\leadsto \left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right) + x.im \cdot \color{blue}{\left(\left(-{x.im}^2\right) + \left(-\left(-x.re \cdot x.re\right)\right)\right)}\]
  10. Applied distribute-lft-in 6.9

    \[\leadsto \left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right) + \color{blue}{\left(x.im \cdot \left(-{x.im}^2\right) + x.im \cdot \left(-\left(-x.re \cdot x.re\right)\right)\right)}\]
  11. Applied simplify 0.2

    \[\leadsto \left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right) + \left(x.im \cdot \left(-{x.im}^2\right) + \color{blue}{\left(x.re \cdot x.im\right) \cdot x.re}\right)\]
  12. Removed slow pow expressions

Runtime

Time bar (total: 37.2s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(635502725 906933731 1636599634 401818776 1004505524 1036149687)'
(FPCore (x.re x.im)
  :name "math.cube on complex, imaginary part"
  (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))