Average Error: 6.9 → 0.5
Time: 42.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(\left(x.re - x.im\right) \cdot x.re\right) \cdot \left(x.im + x.re\right) - \left(\sqrt[3]{x.im} \cdot \left(\sqrt[3]{\left(x.re \cdot x.im + x.re \cdot x.im\right) \cdot x.im} \cdot \sqrt[3]{x.re \cdot x.im + x.re \cdot x.im}\right)\right) \cdot \sqrt[3]{\left(x.re \cdot x.im + x.re \cdot x.im\right) \cdot x.im}\]

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.9
Target0.2
Herbie0.5
\[\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.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. Using strategy rm
  3. Applied difference-of-squares6.9

    \[\leadsto \color{blue}{\left(\left(x.re + x.im\right) \cdot \left(x.re - x.im\right)\right)} \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im\]
  4. Applied associate-*l*0.2

    \[\leadsto \color{blue}{\left(x.re + x.im\right) \cdot \left(\left(x.re - x.im\right) \cdot x.re\right)} - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im\]
  5. Using strategy rm
  6. Applied add-cube-cbrt0.5

    \[\leadsto \left(x.re + x.im\right) \cdot \left(\left(x.re - x.im\right) \cdot x.re\right) - \color{blue}{\left(\sqrt[3]{\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im} \cdot \sqrt[3]{\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im}\right) \cdot \sqrt[3]{\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im}}\]
  7. Using strategy rm
  8. Applied cbrt-prod0.5

    \[\leadsto \left(x.re + x.im\right) \cdot \left(\left(x.re - x.im\right) \cdot x.re\right) - \left(\sqrt[3]{\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im} \cdot \color{blue}{\left(\sqrt[3]{x.re \cdot x.im + x.im \cdot x.re} \cdot \sqrt[3]{x.im}\right)}\right) \cdot \sqrt[3]{\left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im}\]
  9. Applied associate-*r*0.5

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

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

Runtime

Time bar (total: 42.2s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes0.50.50.00.50%
herbie shell --seed 2018339 
(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)))