Average Error: 14.6 → 0.1
Time: 20.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.6

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

Details

Time bar (total: 20.4s)Debug log

sample31.0ms

Algorithm
intervals

simplify6.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune16.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 15.1b

localize21.0ms

Local error

Found 2 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
2 → 36
Calls

2 calls. Slowest were:

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

series28.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify387.0ms

Counts
21 → 42
Calls

21 calls. Slowest were:

59.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
49.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
38.0ms
(+ (* x x) (- (* 1 1) (* x 1)))

prune261.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.5b

localize5.0ms

Local error

Found 1 expressions with local error:

0.5b
(/ -1 (* (+ x 1) x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 13
Calls

1 calls. Slowest were:

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

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

13.0ms
(/ -1 (* (+ x 1) x))

simplify192.0ms

Counts
5 → 16
Calls

5 calls. Slowest were:

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

prune91.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.0b

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

series18.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify358.0ms

Counts
15 → 38
Calls

15 calls. Slowest were:

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

prune211.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize50.0ms

Local error

Found 4 expressions with local error:

17.8b
(/ x (+ (* x x) (- (* 1 1) (* x 1))))
4.7b
(/ (/ -1 (+ 1 (pow x 3))) (/ x (+ (* x x) (- (* 1 1) (* x 1)))))
0.3b
(/ -1 (+ 1 (pow x 3)))
0.0b
(+ (* x x) (- (* 1 1) (* x 1)))

rewrite26.0ms

Algorithm
rewrite-expression-head
Counts
4 → 107
Calls

4 calls. Slowest were:

9.0ms
(+ (* x x) (- (* 1 1) (* x 1)))
8.0ms
(/ (/ -1 (+ 1 (pow x 3))) (/ x (+ (* x x) (- (* 1 1) (* x 1)))))
7.0ms
(/ x (+ (* x x) (- (* 1 1) (* x 1))))

series100.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

41.0ms
(/ -1 (+ 1 (pow x 3)))
29.0ms
(/ (/ -1 (+ 1 (pow x 3))) (/ x (+ (* x x) (- (* 1 1) (* x 1)))))
19.0ms
(/ x (+ (* x x) (- (* 1 1) (* x 1))))
10.0ms
(+ (* x x) (- (* 1 1) (* x 1)))

simplify16.0s

Counts
112 → 119
Calls

112 calls. Slowest were:

639.0ms
(/ 1 (/ x (+ (pow (* x x) 3) (pow (- (* 1 1) (* x 1)) 3))))
623.0ms
(/ (sqrt (/ -1 (+ 1 (pow x 3)))) (/ x (+ (pow (* x x) 3) (pow (- (* 1 1) (* x 1)) 3))))
576.0ms
(/ -1 (/ x (+ (pow (* x x) 3) (pow (- (* 1 1) (* x 1)) 3))))

prune1.3s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes18.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample1.2s

Algorithm
intervals