Average Error: 14.6 → 0.5
Time: 26.4s
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.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}{-1 + x \cdot x}} \cdot \left(\left(x - 1\right) - \left(x + 1\right)\right)\]
  9. Simplified0.5

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

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

Reproduce

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

Details

Time bar (total: 26.1s)Debug log

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

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

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

series433.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify1.6s

Counts
32 → 64
Calls

32 calls. Slowest were:

475.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
388.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
163.0ms
(- (* 1 (- x 1)) (* (+ x 1) 1))

prune424.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.1b

localize20.0ms

Local error

Found 2 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
2 → 33
Calls

2 calls. Slowest were:

6.0ms
(* (/ 1 (+ -1 (* x x))) -2)
2.0ms
(/ 1 (+ -1 (* x x)))

series44.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.9s

Counts
17 → 39
Calls

17 calls. Slowest were:

460.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
417.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
307.0ms
(/ 1 (- (* -1 -1) (* (* x x) (* x x))))

prune258.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.1b

localize14.0ms

Local error

Found 4 expressions with local error:

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

rewrite9.0ms

Algorithm
rewrite-expression-head
Counts
4 → 68
Calls

4 calls. Slowest were:

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

series476.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

138.0ms
(/ 1 (* (cbrt (+ -1 (* x x))) (cbrt (+ -1 (* x x)))))
120.0ms
(cbrt (+ -1 (* x x)))
118.0ms
(cbrt (+ -1 (* x x)))
101.0ms
(cbrt (+ -1 (* x x)))

simplify4.4s

Counts
43 → 80
Calls

43 calls. Slowest were:

447.0ms
(* (cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (cbrt (- -1 (* x x))))
412.0ms
(cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x)))))
396.0ms
(* (cbrt (- -1 (* x x))) (cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))))

prune790.0ms

Pruning

5 alts after pruning (4 fresh and 1 done)

Merged error: 0.1b

localize23.0ms

Local error

Found 4 expressions with local error:

14.2b
(cbrt (+ -1 (* x x)))
14.2b
(cbrt (+ -1 (* x x)))
14.2b
(cbrt (+ -1 (* x x)))
0.1b
(/ (/ 1 (cbrt (+ -1 (* x x)))) (cbrt (+ -1 (* x x))))

rewrite17.0ms

Algorithm
rewrite-expression-head
Counts
4 → 106
Calls

4 calls. Slowest were:

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

series532.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

146.0ms
(cbrt (+ -1 (* x x)))
132.0ms
(cbrt (+ -1 (* x x)))
128.0ms
(cbrt (+ -1 (* x x)))
126.0ms
(/ (/ 1 (cbrt (+ -1 (* x x)))) (cbrt (+ -1 (* x x))))

simplify11.5s

Counts
120 → 118
Calls

120 calls. Slowest were:

658.0ms
(/ (* (* (/ 1 (cbrt (+ -1 (* x x)))) (/ 1 (cbrt (+ -1 (* x x))))) (/ 1 (cbrt (+ -1 (* x x))))) (+ -1 (* x x)))
482.0ms
(/ (cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (cbrt (+ -1 (* x x))))
482.0ms
(/ (cbrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (cbrt (sqrt (+ -1 (* x x)))))

prune1.3s

Pruning

5 alts after pruning (3 fresh and 2 done)

Merged error: 0.1b

regimes40.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample2.0s

Algorithm
intervals