Average Error: 14.2 → 0.1
Time: 1.2m
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{\frac{-2}{x + 1}}{x - 1}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 14.2

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

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

    \[\leadsto \frac{\color{blue}{-2}}{\left(x + 1\right) \cdot \left(x - 1\right)}\]
  5. Using strategy rm
  6. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{-2}{x + 1}}{x - 1}}\]
  7. Final simplification0.1

    \[\leadsto \frac{\frac{-2}{x + 1}}{x - 1}\]

Reproduce

herbie shell --seed 2018362 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))

Details

Time bar (total: 1.1m)Debug log

start94.0ms

Algorithm
intervals

setup18.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 10.6b

localize26.0ms

Local error

Found 3 expressions with local error:

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

rewrite14.0ms

Algorithm
rewrite-expression-head
Counts
3 → 55
Calls

3 calls. Slowest were:

10.0ms
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))
2.0ms
(/ 1 (+ x 1))
2.0ms
(/ 1 (- x 1))

series86.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify1.8s

Counts
32 → 64
Calls

32 calls. Slowest were:

503.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
436.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
213.0ms
(- (* 1 (- x 1)) (* (+ x 1) 1))

prune572.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0.1b

localize5.0ms

Local error

Found 2 expressions with local error:

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

rewrite6.0ms

Algorithm
rewrite-expression-head
Counts
2 → 48
Calls

2 calls. Slowest were:

4.0ms
(* (+ x 1) (- x 1))
1.0ms
(/ -2 (* (+ x 1) (- x 1)))

series63.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

41.0ms
(* (+ x 1) (- x 1))
22.0ms
(/ -2 (* (+ x 1) (- x 1)))

simplify4.6s

Counts
39 → 54
Calls

39 calls. Slowest were:

918.0ms
(* (* (* (+ x 1) (+ x 1)) (+ x 1)) (* (* (- x 1) (- x 1)) (- x 1)))
472.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
460.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))

prune492.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0b

localize5.0ms

Local error

Found 2 expressions with local error:

0.1b
(/ (/ -2 (+ x 1)) (- x 1))
0.0b
(/ -2 (+ x 1))

rewrite5.0ms

Algorithm
rewrite-expression-head
Counts
2 → 57
Calls

2 calls. Slowest were:

3.0ms
(/ (/ -2 (+ x 1)) (- x 1))
0.0ms
(/ -2 (+ x 1))

series29.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

19.0ms
(/ (/ -2 (+ x 1)) (- x 1))
10.0ms
(/ -2 (+ x 1))

simplify4.4s

Counts
58 → 63
Calls

58 calls. Slowest were:

527.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
477.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
425.0ms
(- (* 2 (/ 1 (pow x 2))) (+ (* 2 (/ 1 (pow x 3))) (* 2 (/ 1 x))))

prune606.0ms

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0b

localize10.0ms

Local error

Found 4 expressions with local error:

13.4b
(cbrt (* (+ x 1) (- x 1)))
13.4b
(cbrt (* (+ x 1) (- x 1)))
13.4b
(cbrt (* (+ x 1) (- x 1)))
0.2b
(* (cbrt (* (+ x 1) (- x 1))) (cbrt (* (+ x 1) (- x 1))))

rewrite22.0ms

Algorithm
rewrite-expression-head
Counts
4 → 155
Calls

4 calls. Slowest were:

11.0ms
(* (cbrt (* (+ x 1) (- x 1))) (cbrt (* (+ x 1) (- x 1))))
2.0ms
(cbrt (* (+ x 1) (- x 1)))
2.0ms
(cbrt (* (+ x 1) (- x 1)))

series602.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

167.0ms
(* (cbrt (* (+ x 1) (- x 1))) (cbrt (* (+ x 1) (- x 1))))
146.0ms
(cbrt (* (+ x 1) (- x 1)))
145.0ms
(cbrt (* (+ x 1) (- x 1)))
144.0ms
(cbrt (* (+ x 1) (- x 1)))

simplify51.9s

Counts
199 → 167
Calls

199 calls. Slowest were:

1.2s
(* (cbrt (* (+ x 1) (- (* x x) (* 1 1)))) (cbrt (* (+ x 1) (- (* x x) (* 1 1)))))
910.0ms
(cbrt (* (+ x 1) (- (* x x) (* 1 1))))
906.0ms
(cbrt (* (+ x 1) (- (* x x) (* 1 1))))

prune3.2s

Pruning

5 alts after pruning (2 fresh and 3 done)

Merged error: 0b

regimes53.0ms

Accuracy

0% (0.1b remaining)

Error of 0.1b against oracle of 0.0b and baseline of 0.1b

bsearch2.0ms