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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 38.8

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

    \[\leadsto \color{blue}{\left(x + 2\right) \cdot x}\]
  3. Using strategy rm
  4. Applied *-commutative0.0

    \[\leadsto \color{blue}{x \cdot \left(x + 2\right)}\]
  5. Using strategy rm
  6. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{x \cdot x + x \cdot 2}\]
  7. Final simplification0.0

    \[\leadsto x \cdot x + x \cdot 2\]

Reproduce

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

Details

Time bar (total: 2.0s)Debug log

sample101.0ms

Algorithm
intervals

simplify159.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

4.0ms
(* (+ x 2) x)

series25.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

24.0ms
(* (+ x 2) x)

simplify202.0ms

Counts
7 → 16
Calls

7 calls. Slowest were:

161.0ms
(* (- (* x x) (* 2 2)) x)
18.0ms
(* (+ (pow x 3) (pow 2 3)) x)
6.0ms
(+ (* 2 x) (pow x 2))

prune72.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

localize3.0ms

Local error

Found 1 expressions with local error:

0.0b
(* x (+ x 2))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

1.0ms
(* x (+ x 2))

series19.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

19.0ms
(* x (+ x 2))

simplify72.0ms

Counts
10 → 18
Calls

10 calls. Slowest were:

43.0ms
(+ (* x x) (- (* 2 2) (* x 2)))
7.0ms
(+ (* 2 x) (pow x 2))
6.0ms
(+ (* 2 x) (pow x 2))

prune74.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize8.0ms

Local error

Found 1 expressions with local error:

0.0b
(+ (* x x) (* x 2))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
1 → 12
Calls

1 calls. Slowest were:

2.0ms
(+ (* x x) (* x 2))

series23.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

23.0ms
(+ (* x x) (* x 2))

simplify45.0ms

Counts
5 → 15
Calls

5 calls. Slowest were:

25.0ms
(* (exp (* x x)) (exp (* x 2)))
6.0ms
(+ (* 2 x) (pow x 2))
6.0ms
(+ (* 2 x) (pow x 2))

prune64.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes19.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.1s

Algorithm
intervals