Average Error: 14.2 → 0.4
Time: 29.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.2

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

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

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

    \[\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.2

    \[\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--13.6

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

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

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

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

Reproduce

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

Details

Time bar (total: 29.2s)Debug log

sample47.0ms

Algorithm
intervals

simplify6.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 11.9b

localize23.0ms

Local error

Found 3 expressions with local error:

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

series43.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify18.3s

Counts
108 → 112
Calls

108 calls. Slowest were:

1.2s
(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.0s
(fma (- (+ x 1)) (/ 1 (- (* x x) (* 1 1))) (* (+ x 1) (/ 1 (- (* x x) (* 1 1)))))

prune738.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.2b

localize18.0ms

Local error

Found 2 expressions with local error:

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

series42.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.8s

Counts
13 → 39
Calls

13 calls. Slowest were:

768.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
756.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
96.0ms
(+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 2))

prune280.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.2b

localize14.0ms

Local error

Found 4 expressions with local error:

17.5b
(cbrt (fma x x -1))
17.5b
(cbrt (fma x x -1))
17.5b
(cbrt (fma x x -1))
1.0b
(/ 1 (* (cbrt (fma x x -1)) (cbrt (fma x x -1))))

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
4 → 62
Calls

4 calls. Slowest were:

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

series475.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

139.0ms
(/ 1 (* (cbrt (fma x x -1)) (cbrt (fma x x -1))))
126.0ms
(cbrt (fma x x -1))
120.0ms
(cbrt (fma x x -1))
90.0ms
(cbrt (fma x x -1))

simplify1.5s

Counts
29 → 74
Calls

29 calls. Slowest were:

242.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
229.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
210.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))

prune699.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.2b

localize35.0ms

Local error

Found 4 expressions with local error:

17.5b
(cbrt (fma x x -1))
17.5b
(cbrt (fma x x -1))
17.5b
(cbrt (fma x x -1))
17.5b
(cbrt (fma x x -1))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

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

series486.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

137.0ms
(cbrt (fma x x -1))
128.0ms
(cbrt (fma x x -1))
127.0ms
(cbrt (fma x x -1))
94.0ms
(cbrt (fma x x -1))

simplify1.7s

Counts
24 → 64
Calls

24 calls. Slowest were:

238.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
229.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
199.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))

prune739.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0.2b

regimes27.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample2.1s

Algorithm
intervals