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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 39.1

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

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

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

Reproduce

herbie shell --seed 2018365 
(FPCore (x)
  :name "Expanding a square"
  (- (* (+ x 1) (+ x 1)) 1))

Details

Time bar (total: 2.0s)Debug log

start343.0ms

Algorithm
intervals

setup194.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize8.0ms

Local error

Found 1 expressions with local error:

0.0b
(* (+ x 2) x)

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

4.0ms
(* (+ x 2) x)

series26.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

25.0ms
(* (+ x 2) x)

simplify202.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

156.0ms
(* (- (* x x) (* 2 2)) x)
25.0ms
(* (+ (pow x 3) (pow 2 3)) x)
6.0ms
(+ (* 2 x) (pow x 2))

prune81.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize14.0ms

Local error

Found 2 expressions with local error:

6.1b
(/ (+ (* -4 x) (pow x 3)) (- x 2))
0.0b
(+ (* -4 x) (pow x 3))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
2 → 47
Calls

2 calls. Slowest were:

9.0ms
(/ (+ (* -4 x) (pow x 3)) (- x 2))
2.0ms
(+ (* -4 x) (pow x 3))

series83.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

50.0ms
(/ (+ (* -4 x) (pow x 3)) (- x 2))
33.0ms
(+ (* -4 x) (pow x 3))

simplify650.0ms

Counts
43 → 53
Calls

43 calls. Slowest were:

121.0ms
(- (* (* -4 x) (* -4 x)) (* (pow x 3) (pow x 3)))
89.0ms
(+ (pow (* -4 x) 3) (pow (pow x 3) 3))
80.0ms
(/ (* (* (+ (* -4 x) (pow x 3)) (+ (* -4 x) (pow x 3))) (+ (* -4 x) (pow x 3))) (* (* (- x 2) (- x 2)) (- x 2)))

prune389.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes20.0ms

Accuracy

0% (0.0b remaining)

Error of 0.0b against oracle of 0.0b and baseline of 0.0b

bsearch1.0ms