Average Error: 6.7 → 0.2
Time: 24.2s
Precision: 64
Internal Precision: 320
\[\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} - x.im \cdot \left(x.im \cdot \left(x.re + \left(x.re + x.re\right)\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

Target

Original6.7
Target0.3
Herbie0.2
\[\left(x.re \cdot x.re\right) \cdot \left(x.re - x.im\right) + \left(x.re \cdot x.im\right) \cdot \left(x.re - 3 \cdot x.im\right)\]

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. Initial simplification6.6

    \[\leadsto {x.re}^{3} - \left(x.im \cdot x.im\right) \cdot \left(\left(x.re + x.re\right) + x.re\right)\]
  3. Using strategy rm
  4. Applied associate-*l*0.2

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

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

Runtime

Time bar (total: 24.2s)Debug logProfile

herbie shell --seed 2018221 
(FPCore (x.re x.im)
  :name "math.cube on complex, real part"

  :herbie-target
  (+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3 x.im))))

  (- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))