Average Error: 6.7 → 0.7
Time: 49.7s
Precision: 64
Internal Precision: 576
\[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
\[(\left(x.re - x.im\right) \cdot \left(\left(\sqrt[3]{x.re + x.im} \cdot \sqrt[3]{x.re + x.im}\right) \cdot \left(\sqrt[3]{x.re + x.im} \cdot x.im\right)\right) + \left(\left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right)\right))_*\]

Error

Bits error versus x.re

Bits error versus x.im

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Derivation

  1. Initial program 6.7

    \[\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re\]
  2. Applied simplify0.2

    \[\leadsto \color{blue}{(\left(x.re - x.im\right) \cdot \left(\left(x.re + x.im\right) \cdot x.im\right) + \left(\left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right)\right))_*}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.7

    \[\leadsto (\left(x.re - x.im\right) \cdot \left(\color{blue}{\left(\left(\sqrt[3]{x.re + x.im} \cdot \sqrt[3]{x.re + x.im}\right) \cdot \sqrt[3]{x.re + x.im}\right)} \cdot x.im\right) + \left(\left(x.re + x.re\right) \cdot \left(x.re \cdot x.im\right)\right))_*\]
  5. Applied associate-*l*0.7

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

Runtime

Time bar (total: 49.7s)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +o rules:numerics
(FPCore (x.re x.im)
  :name "math.cube on complex, imaginary part"
  (+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))