Average Error: 14.8 → 0.1
Time: 6.6s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x}\]
\[\frac{\frac{-1}{x + 1}}{x}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.8

    \[\frac{1}{x + 1} - \frac{1}{x}\]
  2. Using strategy rm
  3. Applied frac-sub14.2

    \[\leadsto \color{blue}{\frac{1 \cdot x - \left(x + 1\right) \cdot 1}{\left(x + 1\right) \cdot x}}\]
  4. Simplified0.4

    \[\leadsto \frac{\color{blue}{-1}}{\left(x + 1\right) \cdot x}\]
  5. Using strategy rm
  6. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{-1}{x + 1}}{x}}\]
  7. Final simplification0.1

    \[\leadsto \frac{\frac{-1}{x + 1}}{x}\]

Reproduce

herbie shell --seed 2019005 
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))

Details

Time bar (total: 6.3s)Debug log

sample65.0ms

Algorithm
intervals

simplify10.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

10.0ms
(- (/ 1 (+ x 1)) (/ 1 x))

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.7b

localize35.0ms

Local error

Found 2 expressions with local error:

2.6b
(- (/ 1 (+ x 1)) (/ 1 x))
0.0b
(/ 1 (+ x 1))

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

11.0ms
(- (/ 1 (+ x 1)) (/ 1 x))
2.0ms
(/ 1 (+ x 1))

series25.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

16.0ms
(- (/ 1 (+ x 1)) (/ 1 x))
9.0ms
(/ 1 (+ x 1))

simplify434.0ms

Counts
21 → 42
Calls

21 calls. Slowest were:

73.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
54.0ms
(- (+ (/ 1 (pow x 3)) (/ 1 x)) (/ 1 (pow x 2)))
52.0ms
(- (+ (/ 1 (pow x 3)) (/ 1 x)) (/ 1 (pow x 2)))

prune325.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.2b

localize11.0ms

Local error

Found 2 expressions with local error:

0.2b
(/ -1 (* (+ x 1) x))
0.0b
(* (+ x 1) x)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

2.0ms
(* (+ x 1) x)
1.0ms
(/ -1 (* (+ x 1) x))

series26.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

18.0ms
(* (+ x 1) x)
9.0ms
(/ -1 (* (+ x 1) x))

simplify312.0ms

Counts
12 → 32
Calls

12 calls. Slowest were:

77.0ms
(* (- (* x x) (* 1 1)) x)
74.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
63.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune233.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0b

localize6.0ms

Local error

Found 2 expressions with local error:

0.1b
(/ (/ -1 (+ x 1)) x)
0.0b
(/ -1 (+ x 1))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 32
Calls

2 calls. Slowest were:

3.0ms
(/ (/ -1 (+ x 1)) x)
0.0ms
(/ -1 (+ x 1))

series21.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

11.0ms
(/ -1 (+ x 1))
10.0ms
(/ (/ -1 (+ x 1)) x)

simplify438.0ms

Counts
15 → 38
Calls

15 calls. Slowest were:

72.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
72.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
57.0ms
(/ -1 (- (* x x) (* 1 1)))

prune314.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize29.0ms

Local error

Found 3 expressions with local error:

5.1b
(/ (- (pow x 3) x) (- x 1))
0.2b
(/ -1 (/ (- (pow x 3) x) (- x 1)))
0.0b
(- (pow x 3) x)

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
3 → 69
Calls

3 calls. Slowest were:

15.0ms
(/ (- (pow x 3) x) (- x 1))
6.0ms
(- (pow x 3) x)
3.0ms
(/ -1 (/ (- (pow x 3) x) (- x 1)))

series123.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

75.0ms
(/ (- (pow x 3) x) (- x 1))
30.0ms
(- (pow x 3) x)
18.0ms
(/ -1 (/ (- (pow x 3) x) (- x 1)))

simplify1.2s

Counts
55 → 78
Calls

55 calls. Slowest were:

232.0ms
(/ (* (* (- (pow x 3) x) (- (pow x 3) x)) (- (pow x 3) x)) (* (* (- x 1) (- x 1)) (- x 1)))
92.0ms
(- (* (pow x 3) (pow x 3)) (* x x))
57.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune594.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

regimes39.0ms

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample2.1s

Algorithm
intervals