Average Error: 0.0 → 0.0
Time: 17.0s
Precision: 64
Internal precision: 128
\[\left(a + b\right) \cdot \left(a + b\right)\]
\[{b}^2 + \left({a}^2 + 2 \cdot \left(b \cdot a\right)\right)\]

Error

Bits error versus a

Bits error versus b

Target

Original0.0
Comparison0.0
Herbie0.0
\[ \left(\left(b \cdot a + b \cdot b\right) + b \cdot a\right) + a \cdot a \]

Derivation

  1. Initial program 0.0

    \[\left(a + b\right) \cdot \left(a + b\right)\]
  2. Applied simplify 0.0

    \[\leadsto \color{blue}{{\left(a + b\right)}^2}\]
  3. Applied taylor 0.0

    \[\leadsto {b}^2 + \left({a}^2 + 2 \cdot \left(b \cdot a\right)\right)\]
  4. Taylor expanded around 0 0.0

    \[\leadsto \color{blue}{{b}^2 + \left({a}^2 + 2 \cdot \left(b \cdot a\right)\right)}\]
  5. Removed slow pow expressions

Runtime

Time bar (total: 17.0s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(294831098 1133296474 374561459 2414440143 3502935057 1836066634)'
(FPCore (a b)
  :name "Expression 4, p15"
  :pre (and (<= 5 a 10) (<= 0 b 0.001))

  :target
  (+ (+ (+ (* b a) (* b b)) (* b a)) (* a a))

  (* (+ a b) (+ a b)))