Average Error: 6.9 → 0.2
Time: 6.1m
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(\left(x.re + x.im\right) \cdot x.re\right) \cdot \left(x.re - x.im\right) + \left(\left(-2 \cdot x.im\right) \cdot \left(x.re \cdot x.im\right)\right))_*\]

Error

Bits error versus x.re

Bits error versus x.im

Derivation

  1. Initial program 6.9

    \[\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. Taylor expanded around inf 6.9

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

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

Runtime

Time bar (total: 6.1m)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' +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)))