Average Error: 14.2 → 0.1
Time: 6.0s
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.2

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

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

Details

Time bar (total: 5.7s)Debug log

sample31.0ms

Algorithm
intervals

simplify6.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: 11.9b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

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

series18.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify370.0ms

Counts
21 → 42
Calls

21 calls. Slowest were:

55.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
49.0ms
(- (+ (/ 1 (pow x 3)) (/ 1 x)) (/ 1 (pow x 2)))
47.0ms
(- (+ (/ 1 (pow x 3)) (/ 1 x)) (/ 1 (pow x 2)))

prune278.0ms

Pruning

4 alts after pruning (4 fresh and 0 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)

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 26
Calls

2 calls. Slowest were:

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

series49.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

32.0ms
(* (+ x 1) x)
17.0ms
(/ -1 (* (+ x 1) x))

simplify302.0ms

Counts
12 → 32
Calls

12 calls. Slowest were:

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

prune279.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0b

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

series25.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify471.0ms

Counts
15 → 38
Calls

15 calls. Slowest were:

69.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
61.0ms
(- (/ 1 (pow x 2)) (+ (/ 1 (pow x 3)) (/ 1 x)))
59.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune246.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0b

localize7.0ms

Local error

Found 2 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
2 → 40
Calls

2 calls. Slowest were:

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

series25.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

14.0ms
(* (/ -1 (+ x 1)) (/ 1 x))
11.0ms
(/ -1 (+ x 1))

simplify1.1s

Counts
25 → 46
Calls

25 calls. Slowest were:

442.0ms
(* (* (* (/ -1 (+ x 1)) (/ -1 (+ x 1))) (/ -1 (+ x 1))) (* (* (/ 1 x) (/ 1 x)) (/ 1 x)))
132.0ms
(+ (log (/ -1 (+ x 1))) (log (/ 1 x)))
77.0ms
(- (/ 1 (pow x 2)) (+ (/ 1 (pow x 3)) (/ 1 x)))

prune319.0ms

Pruning

4 alts after pruning (1 fresh and 3 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