Average Error: 14.6 → 0.5
Time: 32.6s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{(x \cdot x + -1)_*} \cdot -2\]

Error

Bits error versus x

Derivation

  1. Initial program 14.6

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

    \[\leadsto \frac{1}{x + 1} - \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}}\]
  4. Applied associate-/r/29.4

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

    \[\leadsto \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x - 1}}} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\]
  6. Applied associate-/r/14.6

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x - 1\right)} - \frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(x + 1\right)\]
  7. Applied distribute-lft-out--14.0

    \[\leadsto \color{blue}{\frac{1}{x \cdot x - 1 \cdot 1} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)}\]
  8. Simplified14.0

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

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

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

Reproduce

herbie shell --seed 2019008 +o rules:numerics
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))

Details

Time bar (total: 32.0s)Debug log

sample54.0ms

Algorithm
intervals

simplify11.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 13.8b

localize36.0ms

Local error

Found 3 expressions with local error:

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

rewrite10.0ms

Algorithm
rewrite-expression-head
Counts
3 → 103
Calls

3 calls. Slowest were:

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

series56.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify18.0s

Counts
108 → 112
Calls

108 calls. Slowest were:

1.1s
(fma (- (+ x 1)) (/ 1 (- (* x x) (* 1 1))) (* (+ x 1) (/ 1 (- (* x x) (* 1 1)))))
1.1s
(fma (- (+ x 1)) (/ 1 (- (* x x) (* 1 1))) (* (+ x 1) (/ 1 (- (* x x) (* 1 1)))))
1.1s
(fma (- (+ x 1)) (/ 1 (- (* x x) (* 1 1))) (* (+ x 1) (/ 1 (- (* x x) (* 1 1)))))

prune748.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.1b

localize9.0ms

Local error

Found 2 expressions with local error:

0.1b
(/ 1 (fma x x -1))
0.0b
(* (/ 1 (fma x x -1)) -2)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 33
Calls

2 calls. Slowest were:

3.0ms
(* (/ 1 (fma x x -1)) -2)
1.0ms
(/ 1 (fma x x -1))

series41.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

26.0ms
(* (/ 1 (fma x x -1)) -2)
16.0ms
(/ 1 (fma x x -1))

simplify1.7s

Counts
13 → 39
Calls

13 calls. Slowest were:

712.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
700.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
130.0ms
(+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 2))

prune253.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize15.0ms

Local error

Found 4 expressions with local error:

14.2b
(cbrt (fma x x -1))
14.2b
(cbrt (fma x x -1))
14.2b
(cbrt (fma x x -1))
0.7b
(/ 1 (* (cbrt (fma x x -1)) (cbrt (fma x x -1))))

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

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

series522.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

150.0ms
(cbrt (fma x x -1))
141.0ms
(cbrt (fma x x -1))
124.0ms
(/ 1 (* (cbrt (fma x x -1)) (cbrt (fma x x -1))))
108.0ms
(cbrt (fma x x -1))

simplify1.4s

Counts
29 → 74
Calls

29 calls. Slowest were:

224.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
203.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
152.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))

prune682.0ms

Pruning

6 alts after pruning (5 fresh and 1 done)

Merged error: 0.1b

localize10.0ms

Local error

Found 4 expressions with local error:

14.2b
(cbrt (fma x x -1))
14.2b
(cbrt (fma x x -1))
14.2b
(cbrt (fma x x -1))
0.1b
(/ (/ 1 (cbrt (fma x x -1))) (cbrt (fma x x -1)))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 92
Calls

4 calls. Slowest were:

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

series562.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

157.0ms
(cbrt (fma x x -1))
154.0ms
(/ (/ 1 (cbrt (fma x x -1))) (cbrt (fma x x -1)))
125.0ms
(cbrt (fma x x -1))
125.0ms
(cbrt (fma x x -1))

simplify5.0s

Counts
86 → 104
Calls

86 calls. Slowest were:

602.0ms
(/ (* (* (/ 1 (cbrt (fma x x -1))) (/ 1 (cbrt (fma x x -1)))) (/ 1 (cbrt (fma x x -1)))) (fma x x -1))
473.0ms
(- (pow (/ 1 x) -2/3) (+ (* 1/9 (pow (/ 1 (pow x 10)) 1/3)) (* 1/3 (pow (/ 1 (pow x 4)) 1/3))))
234.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))

prune1.1s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.1b

regimes54.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample1.7s

Algorithm
intervals