Average Error: 14.7 → 0.1
Time: 4.9s
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.7

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

    \[\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 2019002 
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))

Details

Time bar (total: 4.6s)Debug log

sample40.0ms

Algorithm
intervals

simplify5.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 13.2b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

6.0ms
(- (/ 1 (+ x 1)) (/ 1 x))
1.0ms
(/ 1 (+ x 1))

series28.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

20.0ms
(- (/ 1 (+ x 1)) (/ 1 x))
7.0ms
(/ 1 (+ x 1))

simplify332.0ms

Counts
21 → 42
Calls

21 calls. Slowest were:

72.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
39.0ms
(- 1 (+ x (/ 1 x)))
37.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune352.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.4b

localize9.0ms

Local error

Found 2 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

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

series28.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify293.0ms

Counts
12 → 32
Calls

12 calls. Slowest were:

75.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
66.0ms
(* (- (* x x) (* 1 1)) x)
47.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune311.0ms

Pruning

5 alts after pruning (5 fresh and 0 done)

Merged error: 0b

localize10.0ms

Local error

Found 2 expressions with local error:

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
2 → 32
Calls

2 calls. Slowest were:

6.0ms
(/ (/ -1 (+ x 1)) x)
1.0ms
(/ -1 (+ x 1))

series22.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

14.0ms
(/ (/ -1 (+ x 1)) x)
8.0ms
(/ -1 (+ x 1))

simplify333.0ms

Counts
15 → 38
Calls

15 calls. Slowest were:

56.0ms
(- (/ 1 (pow x 2)) (+ (/ 1 (pow x 3)) (/ 1 x)))
48.0ms
(- (/ 1 (pow x 2)) (+ (/ 1 (pow x 3)) (/ 1 x)))
48.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune279.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

localize11.0ms

Local error

Found 1 expressions with local error:

0.4b
(/ -1 (+ x (pow x 2)))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 16
Calls

1 calls. Slowest were:

1.0ms
(/ -1 (+ x (pow x 2)))

series10.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify393.0ms

Counts
8 → 19
Calls

8 calls. Slowest were:

224.0ms
(+ (* x x) (- (* (pow x 2) (pow x 2)) (* x (pow x 2))))
66.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
56.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune147.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

regimes54.0ms

Accuracy

0% (0.1b remaining)

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

bsearch2.0ms

end0.0ms

sample1.9s

Algorithm
intervals