Average Error: 14.8 → 0.4
Time: 12.7s
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.8

    \[\frac{1}{x + 1} - \frac{1}{x}\]
  2. Using strategy rm
  3. Applied frac-sub14.2

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

Details

Time bar (total: 12.4s)Debug log

sample41.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: 14.7b

localize18.0ms

Local error

Found 2 expressions with local error:

2.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.8s

Counts
73 → 76
Calls

73 calls. Slowest were:

551.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (sqrt (/ 1 x)) (sqrt (/ 1 x)))))
503.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))
432.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))

prune529.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.2b

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

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

series19.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify175.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

72.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
50.0ms
(- 1 (+ x (/ 1 x)))
44.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))

prune110.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.1b

localize18.0ms

Local error

Found 4 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
4 → 80
Calls

4 calls. Slowest were:

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

series289.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

82.0ms
(cbrt (/ -1 (fma x x x)))
76.0ms
(* (cbrt (/ -1 (fma x x x))) (cbrt (/ -1 (fma x x x))))
70.0ms
(cbrt (/ -1 (fma x x x)))
61.0ms
(cbrt (/ -1 (fma x x x)))

simplify3.6s

Counts
53 → 92
Calls

53 calls. Slowest were:

392.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))))
296.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))))
292.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))))

prune833.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.1b

localize5.0ms

Local error

Found 2 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
2 → 50
Calls

2 calls. Slowest were:

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

simplify563.0ms

Counts
29 → 56
Calls

29 calls. Slowest were:

73.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
56.0ms
(* (exp (/ 1 (+ x 1))) (exp (- (/ 1 x))))
51.0ms
(/ 1 (- (* x x) (* 1 1)))

prune428.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0.1b

regimes44.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.8s

Algorithm
intervals