Average Error: 39.2 → 0.0
Time: 2.4s
Precision: 64
Internal Precision: 128
\[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
\[\left(x + 2\right) \cdot x\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 39.2

    \[\left(x + 1\right) \cdot \left(x + 1\right) - 1\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(2 + x\right) \cdot x}\]
  3. Final simplification0.0

    \[\leadsto \left(x + 2\right) \cdot x\]

Reproduce

herbie shell --seed 2019002 +o rules:numerics
(FPCore (x)
  :name "Expanding a square"
  (- (* (+ x 1) (+ x 1)) 1))

Details

Time bar (total: 2.1s)Debug log

sample102.0ms

Algorithm
intervals

simplify459.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

459.0ms
(- (* (+ x 1) (+ x 1)) 1)

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize7.0ms

Local error

Found 1 expressions with local error:

0.0b
(* (+ 2 x) x)

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

4.0ms
(* (+ 2 x) x)

series24.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

24.0ms
(* (+ 2 x) x)

simplify266.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

230.0ms
(* (- (* 2 2) (* x x)) x)
14.0ms
(* (+ (pow 2 3) (pow x 3)) x)
6.0ms
(+ (* 2 x) (pow x 2))

prune71.0ms

Pruning

1 alts after pruning (0 fresh and 1 done)

Merged error: 0.0b

end0.0ms

sample1.1s

Algorithm
intervals