Average Error: 14.2 → 0.4
Time: 16.9s
Precision: 64
Internal Precision: 128
\[\frac{1}{x + 1} - \frac{1}{x - 1}\]
\[\frac{1}{-1 + x \cdot x} \cdot -2\]

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 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}{-1 + x \cdot x}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  9. Simplified0.4

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

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

Reproduce

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

Details

Time bar (total: 16.5s)Debug log

sample35.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

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
3 → 55
Calls

3 calls. Slowest were:

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

series51.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify1.5s

Counts
32 → 64
Calls

32 calls. Slowest were:

397.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
396.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
193.0ms
(- (* 1 (- x 1)) (* (+ x 1) 1))

prune436.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 (+ -1 (* x x)))
0.0b
(* (/ 1 (+ -1 (* x x))) -2)

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
2 → 33
Calls

2 calls. Slowest were:

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

series29.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

16.0ms
(* (/ 1 (+ -1 (* x x))) -2)
14.0ms
(/ 1 (+ -1 (* x x)))

simplify1.9s

Counts
17 → 39
Calls

17 calls. Slowest were:

447.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
411.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
297.0ms
(+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))

prune278.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.2b

localize19.0ms

Local error

Found 4 expressions with local error:

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

rewrite11.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

8.0ms
(/ 1 (* (cbrt (+ -1 (* x x))) (cbrt (+ -1 (* x x)))))
1.0ms
(cbrt (+ -1 (* x x)))
1.0ms
(cbrt (+ -1 (* x x)))

series426.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

114.0ms
(cbrt (+ -1 (* x x)))
109.0ms
(/ 1 (* (cbrt (+ -1 (* x x))) (cbrt (+ -1 (* x x)))))
102.0ms
(cbrt (+ -1 (* x x)))
100.0ms
(cbrt (+ -1 (* x x)))

simplify4.5s

Counts
43 → 80
Calls

43 calls. Slowest were:

518.0ms
(- (pow -1 1/3) (+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (* 1/9 (* (pow x 4) (pow -1 1/3)))))
373.0ms
(* (cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (cbrt (- -1 (* x x))))
368.0ms
(cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x)))))

prune934.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.2b

localize21.0ms

Local error

Found 4 expressions with local error:

17.5b
(cbrt (+ -1 (* x x)))
17.5b
(cbrt (+ -1 (* x x)))
17.5b
(cbrt (+ -1 (* x x)))
17.5b
(cbrt (+ -1 (* x x)))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
4 → 52
Calls

4 calls. Slowest were:

1.0ms
(cbrt (+ -1 (* x x)))
1.0ms
(cbrt (+ -1 (* x x)))
1.0ms
(cbrt (+ -1 (* x x)))

series520.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

147.0ms
(cbrt (+ -1 (* x x)))
146.0ms
(cbrt (+ -1 (* x x)))
139.0ms
(cbrt (+ -1 (* x x)))
89.0ms
(cbrt (+ -1 (* x x)))

simplify3.3s

Counts
32 → 64
Calls

32 calls. Slowest were:

320.0ms
(cbrt (- (* -1 -1) (* (* x x) (* x x))))
315.0ms
(cbrt (- (* -1 -1) (* (* x x) (* x x))))
281.0ms
(cbrt (- (* -1 -1) (* (* x x) (* x x))))

prune758.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0.2b

regimes40.0ms

Accuracy

0% (0.1b remaining)

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

bsearch8.0ms

end0.0ms

sample1.6s

Algorithm
intervals