Average Error: 0.0 → 0.0
Time: 5.8s
Precision: 64
Internal Precision: 128
\[x \cdot \left(x \cdot x\right) + x \cdot x\]
\[x \cdot (x \cdot x + x)_*\]

Error

Bits error versus x

Target

Original0.0
Target0.0
Herbie0.0
\[\left(\left(1.0 + x\right) \cdot x\right) \cdot x\]

Derivation

  1. Initial program 0.0

    \[x \cdot \left(x \cdot x\right) + x \cdot x\]
  2. Initial simplification0.0

    \[\leadsto (\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.0

    \[\leadsto \color{blue}{\sqrt{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*} \cdot \sqrt{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*}}\]
  5. Using strategy rm
  6. Applied pow1/20.0

    \[\leadsto \sqrt{(\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*} \cdot \color{blue}{{\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\frac{1}{2}}}\]
  7. Applied pow1/20.0

    \[\leadsto \color{blue}{{\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\frac{1}{2}}} \cdot {\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\frac{1}{2}}\]
  8. Applied pow-prod-up0.0

    \[\leadsto \color{blue}{{\left((\left(x \cdot x\right) \cdot x + \left(x \cdot x\right))_*\right)}^{\left(\frac{1}{2} + \frac{1}{2}\right)}}\]
  9. Simplified0.0

    \[\leadsto {\color{blue}{\left((x \cdot x + x)_* \cdot x\right)}}^{\left(\frac{1}{2} + \frac{1}{2}\right)}\]
  10. Simplified0.0

    \[\leadsto {\left((x \cdot x + x)_* \cdot x\right)}^{\color{blue}{1}}\]
  11. Final simplification0.0

    \[\leadsto x \cdot (x \cdot x + x)_*\]

Runtime

Time bar (total: 5.8s)Debug logProfile

herbie shell --seed 2018348 +o rules:numerics
(FPCore (x)
  :name "Expression 3, p15"
  :pre (<= 0 x 2)

  :herbie-target
  (* (* (+ 1.0 x) x) x)

  (+ (* x (* x x)) (* x x)))