Average Error: 14.8 → 0.4
Time: 14.5s
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.8

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

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

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

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

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

    \[\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 2019005 
(FPCore (x)
  :name "Asymptote A"
  (- (/ 1 (+ x 1)) (/ 1 (- x 1))))

Details

Time bar (total: 13.8s)Debug log

sample69.0ms

Algorithm
intervals

simplify22.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune9.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.7b

localize28.0ms

Local error

Found 3 expressions with local error:

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

series63.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

41.0ms
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))
11.0ms
(/ 1 (+ x 1))
11.0ms
(/ 1 (- x 1))

simplify1.6s

Counts
32 → 64
Calls

32 calls. Slowest were:

380.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
378.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
234.0ms
(- (* 1 (- x 1)) (* (+ x 1) 1))

prune499.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0.2b

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

series40.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

24.0ms
(* (/ 1 (+ -1 (* x x))) -2)
15.0ms
(/ 1 (+ -1 (* x x)))

simplify2.0s

Counts
17 → 39
Calls

17 calls. Slowest were:

449.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
406.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
369.0ms
(+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))

prune319.0ms

Pruning

4 alts after pruning (3 fresh and 1 done)

Merged error: 0.1b

localize12.0ms

Local error

Found 4 expressions with local error:

14.5b
(cbrt (/ 1 (+ -1 (* x x))))
14.5b
(cbrt (/ 1 (+ -1 (* x x))))
14.5b
(cbrt (/ 1 (+ -1 (* x x))))
0.2b
(/ 1 (+ -1 (* x x)))

rewrite3.0ms

Algorithm
rewrite-expression-head
Counts
4 → 63
Calls

4 calls. Slowest were:

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

series444.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

153.0ms
(cbrt (/ 1 (+ -1 (* x x))))
141.0ms
(cbrt (/ 1 (+ -1 (* x x))))
137.0ms
(cbrt (/ 1 (+ -1 (* x x))))
13.0ms
(/ 1 (+ -1 (* x x)))

simplify2.4s

Counts
39 → 75
Calls

39 calls. Slowest were:

375.0ms
(+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))
342.0ms
(cbrt (/ 1 (- (* -1 -1) (* (* x x) (* x x)))))
305.0ms
(cbrt (/ 1 (- (* -1 -1) (* (* x x) (* x x)))))

prune799.0ms

Pruning

4 alts after pruning (2 fresh and 2 done)

Merged error: 0.1b

localize17.0ms

Local error

Found 2 expressions with local error:

22.9b
(* (/ 1 (- 1 (pow x 4))) (* (- -1 (* x x)) -2))
0.1b
(/ 1 (- 1 (pow x 4)))

rewrite16.0ms

Algorithm
rewrite-expression-head
Counts
2 → 42
Calls

2 calls. Slowest were:

13.0ms
(* (/ 1 (- 1 (pow x 4))) (* (- -1 (* x x)) -2))
2.0ms
(/ 1 (- 1 (pow x 4)))

series97.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

56.0ms
(/ 1 (- 1 (pow x 4)))
40.0ms
(* (/ 1 (- 1 (pow x 4))) (* (- -1 (* x x)) -2))

simplify3.2s

Counts
27 → 48
Calls

27 calls. Slowest were:

444.0ms
(* (- 1 (pow x 4)) (+ (* -1 -1) (+ (* (* x x) (* x x)) (* -1 (* x x)))))
401.0ms
(* 1 (* (- (pow -1 3) (pow (* x x) 3)) -2))
377.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))

prune543.0ms

Pruning

4 alts after pruning (1 fresh and 3 done)

Merged error: 0.1b

regimes31.0ms

Accuracy

0% (0.1b remaining)

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

bsearch1.0ms

end0.0ms

sample1.7s

Algorithm
intervals