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

Details

Time bar (total: 12.0s)Debug log

sample49.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: 15.1b

localize12.0ms

Local error

Found 2 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
2 → 70
Calls

2 calls. Slowest were:

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

series26.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify3.5s

Counts
73 → 76
Calls

73 calls. Slowest were:

484.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (sqrt (/ 1 x)) (sqrt (/ 1 x)))))
389.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))
370.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))

prune561.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.5b

localize16.0ms

Local error

Found 1 expressions with local error:

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

series20.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify163.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

58.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
58.0ms
(- (/ 1 (pow x 3)) (+ (/ 1 (pow x 4)) (/ 1 (pow x 2))))
38.0ms
(- 1 (+ x (/ 1 x)))

prune169.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.4b

localize15.0ms

Local error

Found 4 expressions with local error:

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

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
4 → 95
Calls

4 calls. Slowest were:

8.0ms
(/ (/ -1 (sqrt (fma x x x))) (sqrt (fma x x x)))
2.0ms
(sqrt (fma x x x))
1.0ms
(sqrt (fma x x x))

series106.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

37.0ms
(/ -1 (sqrt (fma x x x)))
26.0ms
(sqrt (fma x x x))
24.0ms
(sqrt (fma x x x))
20.0ms
(/ (/ -1 (sqrt (fma x x x))) (sqrt (fma x x x)))

simplify2.2s

Counts
84 → 107
Calls

84 calls. Slowest were:

315.0ms
(/ (* (* (/ -1 (sqrt (fma x x x))) (/ -1 (sqrt (fma x x x)))) (/ -1 (sqrt (fma x x x)))) (* (* (sqrt (fma x x x)) (sqrt (fma x x x))) (sqrt (fma x x x))))
217.0ms
(- (* 1/2 (/ 1 (pow x 2))) (+ (* 3/8 (/ 1 (pow x 3))) (/ 1 x)))
203.0ms
(- (+ (* 3/8 (/ 1 (pow x 3))) (/ 1 x)) (* 1/2 (/ 1 (pow x 2))))

prune998.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.4b

localize21.0ms

Local error

Found 4 expressions with local error:

18.6b
(cbrt (fma x x x))
18.6b
(cbrt (fma x x x))
17.7b
(sqrt (fma x x x))
0.2b
(* (fabs (cbrt (fma x x x))) (sqrt (cbrt (fma x x x))))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 65
Calls

4 calls. Slowest were:

5.0ms
(* (fabs (cbrt (fma x x x))) (sqrt (cbrt (fma x x x))))
1.0ms
(sqrt (fma x x x))
1.0ms
(cbrt (fma x x x))

series182.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

64.0ms
(* (fabs (cbrt (fma x x x))) (sqrt (cbrt (fma x x x))))
51.0ms
(cbrt (fma x x x))
43.0ms
(cbrt (fma x x x))
24.0ms
(sqrt (fma x x x))

simplify1.5s

Counts
36 → 77
Calls

36 calls. Slowest were:

317.0ms
(- (+ (* 1/6 (* (pow (/ 1 (pow x 2)) 1/3) (fabs (pow (fma x x x) 1/3)))) (* (pow x 1/3) (fabs (pow (fma x x x) 1/3)))) (* 5/72 (* (pow (/ 1 (pow x 5)) 1/3) (fabs (pow (fma x x x) 1/3)))))
269.0ms
(- (+ (* (pow (* x -1) 1/3) (fabs (pow (fma x x x) 1/3))) (* 1/6 (* (pow (/ -1 (pow x 2)) 1/3) (fabs (pow (fma x x x) 1/3))))) (* 5/72 (* (pow (/ -1 (pow x 5)) 1/3) (fabs (pow (fma x x x) 1/3)))))
232.0ms
(- (+ (* (pow x 1/6) (fabs (pow (fma x x x) 1/3))) (* 1/6 (* (pow (pow x 7) 1/6) (fabs (pow (fma x x x) 1/3))))) (* 5/72 (* (pow (pow x 13) 1/6) (fabs (pow (fma x x x) 1/3)))))

prune958.0ms

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0.4b

regimes43.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.4s

Algorithm
intervals