Average Error: 14.6 → 0.4
Time: 12.1s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x}\]
\[\frac{-1}{(x \cdot x + x)_*}\]

Error

Bits error versus x

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. Simplified0.4

    \[\leadsto \frac{-1}{\color{blue}{(x \cdot x + x)_*}}\]
  6. Final simplification0.4

    \[\leadsto \frac{-1}{(x \cdot x + x)_*}\]

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))

Details

Time bar (total: 11.4s)Debug log

sample43.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.8b

localize14.0ms

Local error

Found 2 expressions with local error:

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

rewrite15.0ms

Algorithm
rewrite-expression-head
Counts
2 → 70
Calls

2 calls. Slowest were:

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

series29.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify3.3s

Counts
73 → 76
Calls

73 calls. Slowest were:

474.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (sqrt (/ 1 x)) (sqrt (/ 1 x)))))
381.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))
336.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))

prune604.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.1b

localize12.0ms

Local error

Found 1 expressions with local error:

0.1b
(/ -1 (fma x x x))

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

1.0ms
(/ -1 (fma x x x))

series12.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

12.0ms
(/ -1 (fma x x x))

simplify154.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

71.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
44.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
35.0ms
(- 1 (+ x (/ 1 x)))

prune160.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.1b

localize23.0ms

Local error

Found 4 expressions with local error:

14.5b
(cbrt (fma x x x))
14.5b
(cbrt (fma x x x))
14.5b
(cbrt (fma x x x))
0.9b
(/ -1 (* (cbrt (fma x x x)) (cbrt (fma x x x))))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

3.0ms
(/ -1 (* (cbrt (fma x x x)) (cbrt (fma x x x))))
1.0ms
(cbrt (fma x x x))
1.0ms
(cbrt (fma x x x))

series195.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

56.0ms
(cbrt (fma x x x))
52.0ms
(/ -1 (* (cbrt (fma x x x)) (cbrt (fma x x x))))
44.0ms
(cbrt (fma x x x))
43.0ms
(cbrt (fma x x x))

simplify882.0ms

Counts
22 → 64
Calls

22 calls. Slowest were:

116.0ms
(- (* 2/3 (pow (/ 1 (pow x 7)) 1/3)) (+ (* 5/9 (pow (/ 1 (pow x 10)) 1/3)) (pow (/ 1 (pow x 4)) 1/3)))
82.0ms
(- (* 2/3 (pow x 1/3)) (+ (pow (/ 1 (pow x 2)) 1/3) (* 5/9 (pow (pow x 4) 1/3))))
82.0ms
(- (* 2/3 (pow (/ 1 (pow x 7)) 1/3)) (+ (* 5/9 (pow (/ 1 (pow x 10)) 1/3)) (pow (/ 1 (pow x 4)) 1/3)))

prune697.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize18.0ms

Local error

Found 4 expressions with local error:

14.5b
(cbrt (fma x x x))
14.5b
(cbrt (fma x x x))
14.5b
(cbrt (fma x x x))
0.3b
(/ (/ -1 (cbrt (fma x x x))) (cbrt (fma x x x)))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 88
Calls

4 calls. Slowest were:

8.0ms
(/ (/ -1 (cbrt (fma x x x))) (cbrt (fma x x x)))
1.0ms
(cbrt (fma x x x))
1.0ms
(cbrt (fma x x x))

series194.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

57.0ms
(cbrt (fma x x x))
53.0ms
(cbrt (fma x x x))
45.0ms
(cbrt (fma x x x))
39.0ms
(/ (/ -1 (cbrt (fma x x x))) (cbrt (fma x x x)))

simplify2.1s

Counts
79 → 100
Calls

79 calls. Slowest were:

123.0ms
(/ (* (* (/ -1 (cbrt (fma x x x))) (/ -1 (cbrt (fma x x x)))) (/ -1 (cbrt (fma x x x)))) (fma x x x))
118.0ms
(- (* 2/3 (pow (/ 1 (pow x 7)) 1/3)) (+ (* 5/9 (pow (/ 1 (pow x 10)) 1/3)) (pow (/ 1 (pow x 4)) 1/3)))
79.0ms
(- (+ (* 1/3 (pow (/ 1 x) 1/3)) (pow (/ -1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))

prune993.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.1b

regimes42.0ms

Accuracy

0% (0.0b remaining)

Error of 0.4b against oracle of 0.4b and baseline of 0.4b

bsearch1.0ms

end0.0ms

sample1.9s

Algorithm
intervals