Average Error: 6.7 → 0.2
Time: 1.6m
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(x.im + \left(x.im + x.im\right)\right) \cdot \left(x.im \cdot \left(-x.re\right)\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 6.7

    \[\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 simplify6.8

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

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

    \[\leadsto x.re \cdot \color{blue}{\left(x.re \cdot x.re + \left(\left(-x.im \cdot x.im\right) - x.im \cdot \left(x.im + x.im\right)\right)\right)}\]
  6. Applied distribute-lft-in6.8

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

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

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

Runtime

Time bar (total: 1.6m)Debug logProfile

herbie shell --seed 2022160 
(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)))