Average Error: 14.2 → 0.1
Time: 7.4s
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 2018362 
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))

Details

Time bar (total: 3.3s)Debug log

start128.0ms

Algorithm
intervals

setup23.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 10.6b

localize23.0ms

Local error

Found 2 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

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

series39.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify407.0ms

Counts
21 → 42
Calls

21 calls. Slowest were:

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

prune361.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.1b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite7.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:

33.0ms
(* (+ x 1) x)
16.0ms
(/ -1 (* (+ x 1) x))

simplify385.0ms

Counts
12 → 32
Calls

12 calls. Slowest were:

89.0ms
(* (- (* x x) (* 1 1)) x)
75.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
74.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 32
Calls

2 calls. Slowest were:

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

series16.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify459.0ms

Counts
15 → 38
Calls

15 calls. Slowest were:

74.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
70.0ms
(- (/ 1 (pow x 2)) (+ (/ 1 (pow x 3)) (/ 1 x)))
69.0ms
(- (/ 1 (pow x 2)) (+ (/ 1 (pow x 3)) (/ 1 x)))

prune385.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

localize11.0ms

Local error

Found 2 expressions with local error:

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 28
Calls

2 calls. Slowest were:

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

series46.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

31.0ms
(* x (+ x 1))
15.0ms
(/ -1 (* x (+ x 1)))

simplify261.0ms

Counts
16 → 34
Calls

16 calls. Slowest were:

73.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
50.0ms
(- 1 (+ x (/ 1 x)))
45.0ms
(+ (* x x) (- (* 1 1) (* x 1)))

prune241.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

regimes30.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms