Average Error: 6.8 → 6.8
Time: 13.2s
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\]
\[(\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right) + \left({x.re}^{3}\right))_*\]

Error

Bits error versus x.re

Bits error versus x.im

Target

Original6.8
Target0.3
Herbie6.8
\[\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.8

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

    \[\leadsto (x.re \cdot \left((\left(-x.im\right) \cdot \left(x.im + x.im\right) + \left(x.re \cdot x.re\right))_*\right) + \left(\left(x.im \cdot x.im\right) \cdot \left(-x.re\right)\right))_*\]
  3. Taylor expanded around 0 6.8

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

    \[\leadsto \color{blue}{(\left(x.re \cdot -3\right) \cdot \left(x.im \cdot x.im\right) + \left({x.re}^{3}\right))_*}\]
  5. Final simplification6.8

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

Runtime

Time bar (total: 13.2s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes6.86.86.70.10%
herbie shell --seed 2018296 +o rules:numerics
(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)))