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

Error

Bits error versus a

Bits error versus b

Target

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

Derivation

  1. Initial program 0.0

    \[{a}^2 - {b}^2\]
  2. Using strategy rm
  3. Applied difference-of-squares 0.0

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

Runtime

Time bar (total: 4.5s) Debug log

Please include this information when filing a bug report:

herbie --seed '#(1759487034 3955778870 3823528084 2073827127 3422033944 2904380788)'
(FPCore (a b)
  :name "Difference of squares"

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

  (- (sqr a) (sqr b)))