Average Error: 14.2 → 0.4
Time: 10.3s
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.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. 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 2019007 +o rules:numerics
(FPCore (x)
  :name "2frac (problem 3.3.1)"
  (- (/ 1 (+ x 1)) (/ 1 x)))

Details

Time bar (total: 9.8s)Debug log

sample63.0ms

Algorithm
intervals

simplify10.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 11.9b

localize22.0ms

Local error

Found 2 expressions with local error:

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

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

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

simplify3.5s

Counts
73 → 76
Calls

73 calls. Slowest were:

450.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (sqrt (/ 1 x)) (sqrt (/ 1 x)))))
378.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))
378.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))

prune550.0ms

Pruning

4 alts after pruning (4 fresh and 0 done)

Merged error: 0.2b

localize6.0ms

Local error

Found 1 expressions with local error:

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

rewrite1.0ms

Algorithm
rewrite-expression-head
Counts
1 → 15
Calls

1 calls. Slowest were:

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

series13.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify122.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

52.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
40.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
26.0ms
(- 1 (+ x (/ 1 x)))

prune156.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.2b

localize11.0ms

Local error

Found 4 expressions with local error:

17.8b
(cbrt (fma x x x))
17.8b
(cbrt (fma x x x))
17.8b
(cbrt (fma x x x))
1.1b
(/ -1 (* (cbrt (fma x x x)) (cbrt (fma x x x))))

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

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

series184.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

52.0ms
(cbrt (fma x x x))
47.0ms
(cbrt (fma x x x))
45.0ms
(cbrt (fma x x x))
41.0ms
(/ -1 (* (cbrt (fma x x x)) (cbrt (fma x x x))))

simplify766.0ms

Counts
22 → 64
Calls

22 calls. Slowest were:

93.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)))
70.0ms
(- (+ (* 1/3 (pow (/ 1 x) 1/3)) (pow (/ 1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))
67.0ms
(- (+ (* 1/3 (pow (/ 1 x) 1/3)) (pow (/ -1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))

prune761.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.2b

localize31.0ms

Local error

Found 4 expressions with local error:

17.8b
(cbrt (fma x x x))
17.8b
(cbrt (fma x x x))
17.8b
(cbrt (fma x x x))
17.8b
(cbrt (fma x x x))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

1.0ms
(cbrt (fma x x x))
1.0ms
(cbrt (fma x x x))
1.0ms
(cbrt (fma x x x))

series143.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

44.0ms
(cbrt (fma x x x))
34.0ms
(cbrt (fma x x x))
32.0ms
(cbrt (fma x x x))
32.0ms
(cbrt (fma x x x))

simplify718.0ms

Counts
24 → 64
Calls

24 calls. Slowest were:

74.0ms
(- (+ (* 1/3 (pow (/ 1 x) 1/3)) (pow (/ 1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))
67.0ms
(- (+ (* 1/3 (pow (/ 1 x) 1/3)) (pow (/ 1 x) -2/3)) (* 1/9 (pow (/ 1 (pow x 4)) 1/3)))
63.0ms
(- (+ (* 1/3 (pow (pow x 4) 1/3)) (pow x 1/3)) (* 1/9 (pow (pow x 7) 1/3)))

prune701.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.2b

regimes45.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample1.9s

Algorithm
intervals