Average Error: 14.4 → 0.4
Time: 16.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.4

    \[\frac{1}{x + 1} - \frac{1}{x}\]
  2. Initial simplification14.4

    \[\leadsto \frac{1}{x + 1} - \frac{1}{x}\]
  3. Using strategy rm
  4. Applied frac-sub13.9

    \[\leadsto \color{blue}{\frac{1 \cdot x - \left(x + 1\right) \cdot 1}{\left(x + 1\right) \cdot x}}\]
  5. Simplified0.4

    \[\leadsto \frac{\color{blue}{-1}}{\left(x + 1\right) \cdot x}\]
  6. Simplified0.4

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

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

Reproduce

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

Details

Time bar (total: 11.4s)Debug log

start107.0ms

Algorithm
intervals

setup11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.2b

localize12.0ms

Local error

Found 2 expressions with local error:

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

series41.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify4.1s

Counts
73 → 76
Calls

73 calls. Slowest were:

680.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (sqrt (/ 1 x)) (sqrt (/ 1 x)))))
485.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))
365.0ms
(fma (/ 1 (+ (pow x 3) (pow 1 3))) (+ (* x x) (- (* 1 1) (* x 1))) (- (* (/ 1 x) 1)))

prune662.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.5b

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

series19.0ms

Counts
1 → 3
Calls

1 calls. Slowest were:

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

simplify177.0ms

Counts
6 → 18
Calls

6 calls. Slowest were:

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

prune223.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.4b

localize16.0ms

Local error

Found 4 expressions with local error:

17.7b
(sqrt (fma x x x))
17.7b
(sqrt (fma x x x))
0.2b
(/ (/ -1 (sqrt (fma x x x))) (sqrt (fma x x x)))
0.0b
(/ -1 (sqrt (fma x x x)))

rewrite15.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))
2.0ms
(sqrt (fma x x x))

series104.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

31.0ms
(/ -1 (sqrt (fma x x x)))
25.0ms
(/ (/ -1 (sqrt (fma x x x))) (sqrt (fma x x x)))
25.0ms
(sqrt (fma x x x))
23.0ms
(sqrt (fma x x x))

simplify2.6s

Counts
84 → 107
Calls

84 calls. Slowest were:

368.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))))
232.0ms
(- (* 1/2 (/ 1 (pow x 2))) (+ (* 3/8 (/ 1 (pow x 3))) (/ 1 x)))
228.0ms
(- (+ (* 3/8 (/ 1 (pow x 3))) (/ 1 x)) (* 1/2 (/ 1 (pow x 2))))

prune960.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.4b

localize8.0ms

Local error

Found 4 expressions with local error:

17.7b
(sqrt (fma x x x))
17.7b
(sqrt (fma x x x))
17.7b
(sqrt (fma x x x))
0.5b
(* (sqrt (sqrt (fma x x x))) (sqrt (sqrt (fma x x x))))

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
4 → 80
Calls

4 calls. Slowest were:

6.0ms
(* (sqrt (sqrt (fma x x x))) (sqrt (sqrt (fma x x x))))
1.0ms
(sqrt (fma x x x))
1.0ms
(sqrt (fma x x x))

series92.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

29.0ms
(sqrt (fma x x x))
25.0ms
(sqrt (fma x x x))
19.0ms
(sqrt (fma x x x))
19.0ms
(* (sqrt (sqrt (fma x x x))) (sqrt (sqrt (fma x x x))))

simplify1.0s

Counts
52 → 92
Calls

52 calls. Slowest were:

100.0ms
(* (* (* (sqrt (sqrt (fma x x x))) (sqrt (sqrt (fma x x x)))) (sqrt (sqrt (fma x x x)))) (* (* (sqrt (sqrt (fma x x x))) (sqrt (sqrt (fma x x x)))) (sqrt (sqrt (fma x x x)))))
100.0ms
(- (* 1/8 (/ 1 x)) (+ x 1/2))
96.0ms
(- (+ x 1/2) (* 1/8 (/ 1 x)))

prune1.1s

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0.4b

regimes67.0ms

Accuracy

0% (0.0b remaining)

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

bsearch0.0ms