Average Error: 0.1 → 0.1
Time: 19.0s
Precision: 64
Internal precision: 128
\[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
\[{x}^2 + \left(3 \cdot y\right) \cdot y\]

Error

Bits error versus x

Bits error versus y

Target

Original0.1
Comparison0.1
Herbie0.1
\[ {x}^2 + y \cdot \left(y + \left(y + y\right)\right) \]

Derivation

  1. Initial program 0.1

    \[\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y\]
  2. Applied simplify 0.1

    \[\leadsto \color{blue}{\left({y}^2 + {x}^2\right) + \left({y}^2 + {y}^2\right)}\]
  3. Applied taylor 0.1

    \[\leadsto {x}^2 + 3 \cdot {y}^2\]
  4. Taylor expanded around 0 0.1

    \[\leadsto \color{blue}{{x}^2 + 3 \cdot {y}^2}\]
  5. Using strategy rm
  6. Applied square-mult 0.1

    \[\leadsto {x}^2 + 3 \cdot \color{blue}{\left(y \cdot y\right)}\]
  7. Applied associate-*r* 0.1

    \[\leadsto {x}^2 + \color{blue}{\left(3 \cdot y\right) \cdot y}\]
  8. Removed slow pow expressions

Runtime

Time bar (total: 19.0s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(326831277 196120908 3424598801 4214710980 2278662097 1856897109)'
(FPCore (x y)
  :name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"

  :target
  (+ (sqr x) (* y (+ y (+ y y))))

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