Average Error: 6.8 → 0.2
Time: 45.8s
Precision: 64
Internal Precision: 384
\[\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.im \cdot x.im\right) \cdot \left(x.re - x.im\right) + \left(x.im \cdot x.re\right) \cdot \left(\left(x.re + x.re\right) + \left(x.re - x.im\right)\right)\]

Error

Bits error versus x.re

Bits error versus x.im

Derivation

  1. Initial program 6.8

    \[\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. Using strategy rm
  3. Applied difference-of-squares6.8

    \[\leadsto \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)} \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
  4. Applied associate-*l*0.2

    \[\leadsto \color{blue}{\left(x.re + x.im\right) \cdot \left(\left(x.re - x.im\right) \cdot x.im\right)} + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
  5. Taylor expanded around 0 0.2

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

    \[\leadsto \color{blue}{\left(x.im \cdot x.im\right) \cdot \left(x.re - x.im\right) + \left(x.im \cdot x.re\right) \cdot \left(\left(x.re + x.re\right) + \left(x.re - x.im\right)\right)}\]

Runtime

Time bar (total: 45.8s)Debug logProfile

herbie shell --seed '#(1064269945 2896236262 301053905 1701069080 1701464310 1614783279)' 
(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)))