Average Error: 7.0 → 0.2
Time: 57.9s
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\]
\[{x.re}^{3} - \left(3 \cdot x.im\right) \cdot \left(x.im \cdot x.re\right)\]

Error

Bits error versus x.re

Bits error versus x.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 7.0

    \[\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. Applied simplify7.0

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

    \[\leadsto \color{blue}{{x.re}^{3} - 3 \cdot \left({x.im}^{2} \cdot x.re\right)}\]
  4. Using strategy rm
  5. Applied unpow27.0

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

    \[\leadsto {x.re}^{3} - 3 \cdot \color{blue}{\left(x.im \cdot \left(x.im \cdot x.re\right)\right)}\]
  7. Using strategy rm
  8. Applied associate-*r*0.2

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

Runtime

Time bar (total: 57.9s)Debug logProfile

herbie shell --seed 2020178 +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)))