Average Error: 14.4 → 0.4
Time: 32.3s
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.4

    \[\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-+14.5

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

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

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

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

Details

Time bar (total: 28.0s)Debug log

start126.0ms

Algorithm
intervals

setup15.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 14.2b

localize12.0ms

Local error

Found 3 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Counts
3 → 55
Calls

3 calls. Slowest were:

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

series69.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

40.0ms
(- (/ 1 (+ x 1)) (/ 1 (- x 1)))
18.0ms
(/ 1 (+ x 1))
11.0ms
(/ 1 (- x 1))

simplify1.8s

Counts
32 → 64
Calls

32 calls. Slowest were:

509.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
450.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
186.0ms
(- (* 1 (- x 1)) (* (+ x 1) 1))

prune599.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.5b

localize10.0ms

Local error

Found 2 expressions with local error:

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

series39.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

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

simplify1.9s

Counts
17 → 39
Calls

17 calls. Slowest were:

482.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
418.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
332.0ms
(/ 1 (- (* -1 -1) (* (* x x) (* x x))))

prune410.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.5b

localize20.0ms

Local error

Found 4 expressions with local error:

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

rewrite57.0ms

Algorithm
rewrite-expression-head
Counts
4 → 146
Calls

4 calls. Slowest were:

33.0ms
(/ (/ 1 (sqrt (+ -1 (* x x)))) (sqrt (+ -1 (* x x))))
16.0ms
(* (/ (/ 1 (sqrt (+ -1 (* x x)))) (sqrt (+ -1 (* x x)))) -2)
1.0ms
(sqrt (+ -1 (* x x)))

series91.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

33.0ms
(sqrt (+ -1 (* x x)))
30.0ms
(sqrt (+ -1 (* x x)))
15.0ms
(* (/ (/ 1 (sqrt (+ -1 (* x x)))) (sqrt (+ -1 (* x x)))) -2)
14.0ms
(/ (/ 1 (sqrt (+ -1 (* x x)))) (sqrt (+ -1 (* x x))))

simplify16.9s

Counts
159 → 158
Calls

159 calls. Slowest were:

797.0ms
(/ (sqrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (sqrt (+ -1 (* x x))))
544.0ms
(/ (sqrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (cbrt (sqrt (+ -1 (* x x)))))
523.0ms
(/ (sqrt (+ (* -1 -1) (- (* (* x x) (* x x)) (* -1 (* x x))))) (sqrt (cbrt (+ -1 (* x x)))))

prune1.8s

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.4b

localize5.0ms

Local error

Found 3 expressions with local error:

17.7b
(sqrt (+ -1 (* x x)))
0.0b
(* (pow (sqrt (+ -1 (* x x))) -2) -2)
0.0b
(pow (sqrt (+ -1 (* x x))) -2)

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
3 → 48
Calls

3 calls. Slowest were:

4.0ms
(* (pow (sqrt (+ -1 (* x x))) -2) -2)
1.0ms
(pow (sqrt (+ -1 (* x x))) -2)
1.0ms
(sqrt (+ -1 (* x x)))

series91.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

48.0ms
(pow (sqrt (+ -1 (* x x))) -2)
25.0ms
(sqrt (+ -1 (* x x)))
18.0ms
(* (pow (sqrt (+ -1 (* x x))) -2) -2)

simplify3.4s

Counts
32 → 57
Calls

32 calls. Slowest were:

541.0ms
(- (+ (* 1/2 (/ (pow x 2) (sqrt -1))) (sqrt -1)) (* 1/8 (/ (pow x 4) (pow (sqrt -1) 3))))
528.0ms
(- (+ (* 2 (/ 1 (pow x 4))) (+ (* 2 (/ 1 (pow x 6))) (* 2 (/ 1 (pow x 2))))))
495.0ms
(- (+ (* 1/2 (/ (pow x 4) (pow (sqrt -1) 2))) (* 1/4 (/ (pow x 4) (pow (sqrt -1) 6)))) (+ (pow x 2) (+ (* 1/4 (pow x 4)) 1)))

prune510.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0.0b

regimes20.0ms

Accuracy

0% (0.4b remaining)

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

bsearch1.0ms