Average Error: 38.7 → 0.0
Time: 12.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 38.7

    \[\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 2019008 +o rules:numerics
(FPCore (x)
  :name "Expanding a square"
  (- (* (+ x 1) (+ x 1)) 1))

Details

Time bar (total: 12.2s)Debug log

sample101.0ms

Algorithm
intervals

simplify434.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune12.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)

simplify247.0ms

Counts
7 → 18
Calls

7 calls. Slowest were:

210.0ms
(* (- (* 2 2) (* x x)) x)
15.0ms
(* (+ (pow 2 3) (pow x 3)) x)
6.0ms
(+ (* 2 x) (pow x 2))

prune72.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

0.9b
(cbrt (+ 2 x))
0.9b
(cbrt (+ 2 x))
0.9b
(cbrt (+ 2 x))
0.4b
(* (* (cbrt (+ 2 x)) (cbrt (+ 2 x))) (* (cbrt (+ 2 x)) x))

rewrite21.0ms

Algorithm
rewrite-expression-head
Counts
4 → 89
Calls

4 calls. Slowest were:

18.0ms
(* (* (cbrt (+ 2 x)) (cbrt (+ 2 x))) (* (cbrt (+ 2 x)) x))
1.0ms
(cbrt (+ 2 x))
1.0ms
(cbrt (+ 2 x))

series115.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

34.0ms
(cbrt (+ 2 x))
32.0ms
(cbrt (+ 2 x))
32.0ms
(cbrt (+ 2 x))
17.0ms
(* (* (cbrt (+ 2 x)) (cbrt (+ 2 x))) (* (cbrt (+ 2 x)) x))

simplify4.4s

Counts
76 → 101
Calls

76 calls. Slowest were:

297.0ms
(* (* (+ 2 x) (+ 2 x)) (* (* (* (cbrt (+ 2 x)) x) (* (cbrt (+ 2 x)) x)) (* (cbrt (+ 2 x)) x)))
283.0ms
(- (+ (* 1/6 (* x (pow 2 1/3))) (pow 2 1/3)) (* 1/36 (* (pow x 2) (pow 2 1/3))))
283.0ms
(- (+ (* 1/6 (* x (pow 2 1/3))) (pow 2 1/3)) (* 1/36 (* (pow x 2) (pow 2 1/3))))

prune563.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.0b

localize11.0ms

Local error

Found 4 expressions with local error:

0.9b
(cbrt (* (* (cbrt (+ 2 x)) (cbrt (+ 2 x))) (cbrt (+ 2 x))))
0.9b
(cbrt (+ 2 x))
0.9b
(cbrt (+ 2 x))
0.9b
(cbrt (+ 2 x))

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
4 → 83
Calls

4 calls. Slowest were:

9.0ms
(cbrt (* (* (cbrt (+ 2 x)) (cbrt (+ 2 x))) (cbrt (+ 2 x))))
1.0ms
(cbrt (+ 2 x))
1.0ms
(cbrt (+ 2 x))

series122.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

31.0ms
(cbrt (+ 2 x))
31.0ms
(cbrt (* (* (cbrt (+ 2 x)) (cbrt (+ 2 x))) (cbrt (+ 2 x))))
30.0ms
(cbrt (+ 2 x))
30.0ms
(cbrt (+ 2 x))

simplify3.3s

Counts
55 → 95
Calls

55 calls. Slowest were:

281.0ms
(- (+ (* 1/6 (* x (pow 2 1/3))) (pow 2 1/3)) (* 1/36 (* (pow x 2) (pow 2 1/3))))
279.0ms
(- (+ (* 1/6 (* x (pow 2 1/3))) (pow 2 1/3)) (* 1/36 (* (pow x 2) (pow 2 1/3))))
279.0ms
(- (+ (* 1/6 (* x (pow 2 1/3))) (pow 2 1/3)) (* 1/36 (* (pow x 2) (pow 2 1/3))))

prune685.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.0b

localize12.0ms

Local error

Found 2 expressions with local error:

5.8b
(/ (* x (- 4 (* x x))) (- 2 x))
0.1b
(* x (- 4 (* x x)))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
2 → 44
Calls

2 calls. Slowest were:

4.0ms
(/ (* x (- 4 (* x x))) (- 2 x))
1.0ms
(* x (- 4 (* x x)))

series70.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

43.0ms
(/ (* x (- 4 (* x x))) (- 2 x))
27.0ms
(* x (- 4 (* x x)))

simplify491.0ms

Counts
30 → 50
Calls

30 calls. Slowest were:

117.0ms
(* x (- (* 4 4) (* (* x x) (* x x))))
62.0ms
(/ (* (* (* x (- 4 (* x x))) (* x (- 4 (* x x)))) (* x (- 4 (* x x)))) (* (* (- 2 x) (- 2 x)) (- 2 x)))
57.0ms
(* x (- (pow 4 3) (pow (* x x) 3)))

prune213.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

regimes24.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample1.3s

Algorithm
intervals