Average Error: 6.8 → 0.2
Time: 2.7m
Precision: 64
Internal Precision: 384
\[\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(x.im + 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.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. 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(x.im + x.im\right) \cdot \left(x.re \cdot x.im\right)}\]
  3. Using strategy rm
  4. Applied fma-neg0.2

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

Runtime

Time bar (total: 2.7m)Debug logProfile

herbie shell --seed '#(1064300848 3212030778 2049303162 3567222883 2277747821 1384278011)' +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)))