Average Error: 13.9 → 0.3
Time: 32.2s
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 13.9

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

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

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

    \[\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/13.9

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

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

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

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

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

Reproduce

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

Details

Time bar (total: 27.5s)Debug log

start61.0ms

Algorithm
intervals

setup31.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 12.5b

localize15.0ms

Local error

Found 3 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
3 → 103
Calls

3 calls. Slowest were:

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

series36.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify18.4s

Counts
108 → 112
Calls

108 calls. Slowest were:

1.2s
(fma (/ 1 (- (* x x) (* 1 1))) (- x 1) (- (* (/ 1 (- x 1)) 1)))
1.2s
(fma (/ 1 (- (* x x) (* 1 1))) (- x 1) (- (* (/ 1 (- x 1)) 1)))
844.0ms
(fma (/ 1 (- (* x x) (* 1 1))) (- x 1) (- (* (cbrt (/ 1 (- x 1))) (* (cbrt (/ 1 (- x 1))) (cbrt (/ 1 (- x 1)))))))

prune1.0s

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.3b

localize20.0ms

Local error

Found 2 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
2 → 33
Calls

2 calls. Slowest were:

9.0ms
(* (/ 1 (fma x x -1)) -2)
2.0ms
(/ 1 (fma x x -1))

series51.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.2s

Counts
13 → 39
Calls

13 calls. Slowest were:

503.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
483.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
81.0ms
(* (cbrt (/ 1 (fma x x -1))) (cbrt (/ 1 (fma x x -1))))

prune364.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0.3b

localize10.0ms

Local error

Found 4 expressions with local error:

15.1b
(cbrt (* (/ 1 (fma x x -1)) -2))
15.1b
(cbrt (* (/ 1 (fma x x -1)) -2))
15.1b
(cbrt (* (/ 1 (fma x x -1)) -2))
0.3b
(/ 1 (fma x x -1))

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
4 → 54
Calls

4 calls. Slowest were:

2.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
2.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
2.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))

series495.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

171.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
167.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
143.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
15.0ms
(/ 1 (fma x x -1))

simplify1.5s

Counts
22 → 66
Calls

22 calls. Slowest were:

258.0ms
(+ (* (cbrt -2) (pow -1 1/3)) (+ (* 1/3 (* (* (pow x 2) (cbrt -2)) (pow -1 1/3))) (* 2/9 (* (* (pow x 4) (cbrt -2)) (pow -1 1/3)))))
203.0ms
(+ (* (cbrt -2) (pow -1 1/3)) (+ (* 1/3 (* (* (pow x 2) (cbrt -2)) (pow -1 1/3))) (* 2/9 (* (* (pow x 4) (cbrt -2)) (pow -1 1/3)))))
173.0ms
(+ (* (cbrt -2) (pow -1 1/3)) (+ (* 1/3 (* (* (pow x 2) (cbrt -2)) (pow -1 1/3))) (* 2/9 (* (* (pow x 4) (cbrt -2)) (pow -1 1/3)))))

prune1.0s

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.3b

localize30.0ms

Local error

Found 4 expressions with local error:

15.1b
(cbrt (* (/ 1 (fma x x -1)) -2))
15.1b
(cbrt (* (/ 1 (fma x x -1)) -2))
14.9b
(cbrt (fma x x -1))
1.0b
(cbrt -2)

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 47
Calls

4 calls. Slowest were:

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

series468.0ms

Counts
4 → 10
Calls

4 calls. Slowest were:

182.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
179.0ms
(cbrt (* (/ 1 (fma x x -1)) -2))
107.0ms
(cbrt (fma x x -1))
0.0ms
(cbrt -2)

simplify1.8s

Counts
17 → 57
Calls

17 calls. Slowest were:

471.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
227.0ms
(+ (* (cbrt -2) (pow -1 1/3)) (+ (* 1/3 (* (* (pow x 2) (cbrt -2)) (pow -1 1/3))) (* 2/9 (* (* (pow x 4) (cbrt -2)) (pow -1 1/3)))))
202.0ms
(+ (* (cbrt -2) (pow -1 1/3)) (+ (* 1/3 (* (* (pow x 2) (cbrt -2)) (pow -1 1/3))) (* 2/9 (* (* (pow x 4) (cbrt -2)) (pow -1 1/3)))))

prune813.0ms

Pruning

6 alts after pruning (3 fresh and 3 done)

Merged error: 0.2b

regimes67.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms