Average Error: 14.7 → 0.4
Time: 16.6s
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.7

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

Details

Time bar (total: 16.1s)Debug log

sample38.0ms

Algorithm
intervals

simplify5.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune3.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 13.2b

localize10.0ms

Local error

Found 2 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 70
Calls

2 calls. Slowest were:

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

series17.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify3.6s

Counts
73 → 76
Calls

73 calls. Slowest were:

532.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (sqrt (/ 1 x)) (sqrt (/ 1 x)))))
481.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))
420.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))

prune512.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.4b

localize6.0ms

Local error

Found 1 expressions with local error:

0.4b
(/ -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))

series19.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify144.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

46.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
45.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
45.0ms
(- 1 (+ x (/ 1 x)))

prune127.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.3b

localize11.0ms

Local error

Found 4 expressions with local error:

13.7b
(cbrt (/ -1 (fma x x x)))
13.7b
(cbrt (/ -1 (fma x x x)))
13.7b
(cbrt (/ -1 (fma x x x)))
0.4b
(* (cbrt (/ -1 (fma x x x))) (cbrt (/ -1 (fma x x x))))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 80
Calls

4 calls. Slowest were:

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

series282.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

96.0ms
(* (cbrt (/ -1 (fma x x x))) (cbrt (/ -1 (fma x x x))))
66.0ms
(cbrt (/ -1 (fma x x x)))
61.0ms
(cbrt (/ -1 (fma x x x)))
59.0ms
(cbrt (/ -1 (fma x x x)))

simplify3.8s

Counts
53 → 92
Calls

53 calls. Slowest were:

337.0ms
(- (+ (* 5/9 (* (pow (/ 1 (pow x 10)) 1/3) (pow (cbrt -1) 2))) (* (pow (/ 1 (pow x 4)) 1/3) (pow (cbrt -1) 2))) (* 2/3 (* (pow (/ 1 (pow x 7)) 1/3) (pow (cbrt -1) 2))))
300.0ms
(- (+ (* 5/9 (* (pow (pow x 4) 1/3) (pow (cbrt -1) 2))) (* (pow (/ 1 (pow x 2)) 1/3) (pow (cbrt -1) 2))) (* 2/3 (* (pow x 1/3) (pow (cbrt -1) 2))))
290.0ms
(- (+ (* 2/9 (* (pow (/ 1 (pow x 8)) 1/3) (cbrt -1))) (* (pow (/ 1 (pow x 2)) 1/3) (cbrt -1))) (* 1/3 (* (pow (/ 1 (pow x 5)) 1/3) (cbrt -1))))

prune842.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.3b

localize19.0ms

Local error

Found 4 expressions with local error:

14.3b
(cbrt (fma x x x))
14.3b
(cbrt (fma x x x))
13.7b
(cbrt (/ -1 (fma x x x)))
0.8b
(/ (* (cbrt -1) (cbrt -1)) (* (cbrt (fma x x x)) (cbrt (fma x x x))))

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 64
Calls

4 calls. Slowest were:

9.0ms
(/ (* (cbrt -1) (cbrt -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))

series296.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

115.0ms
(/ (* (cbrt -1) (cbrt -1)) (* (cbrt (fma x x x)) (cbrt (fma x x x))))
88.0ms
(cbrt (/ -1 (fma x x x)))
58.0ms
(cbrt (fma x x x))
34.0ms
(cbrt (fma x x x))

simplify3.3s

Counts
35 → 76
Calls

35 calls. Slowest were:

347.0ms
(- (+ (* 5/9 (* (pow (/ 1 (pow x 10)) 1/3) (pow (cbrt -1) 2))) (* (pow (/ 1 (pow x 4)) 1/3) (pow (cbrt -1) 2))) (* 2/3 (* (pow (/ 1 (pow x 7)) 1/3) (pow (cbrt -1) 2))))
335.0ms
(- (+ (* 5/9 (* (pow (pow x 4) 1/3) (pow (cbrt -1) 2))) (* (pow (/ 1 (pow x 2)) 1/3) (pow (cbrt -1) 2))) (* 2/3 (* (pow x 1/3) (pow (cbrt -1) 2))))
316.0ms
(- (+ (* 5/9 (* (pow (/ 1 (pow x 10)) 1/3) (pow (cbrt -1) 2))) (* (pow (/ 1 (pow x 4)) 1/3) (pow (cbrt -1) 2))) (* 2/3 (* (pow (/ 1 (pow x 7)) 1/3) (pow (cbrt -1) 2))))

prune933.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.3b

regimes92.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample2.0s

Algorithm
intervals