Average Error: 0.0 → 0.0
Time: 4.5s
Precision: 64
Internal Precision: 128
\[\frac{1}{x - 1} + \frac{x}{x + 1}\]
\[(\left(\frac{1}{(x \cdot x + -1)_*}\right) \cdot \left(x + 1\right) + \left(\frac{x}{x + 1}\right))_*\]

Error

Bits error versus x

Derivation

  1. Initial program 0.0

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

    \[\leadsto \frac{1}{\color{blue}{\frac{x \cdot x - 1 \cdot 1}{x + 1}}} + \frac{x}{x + 1}\]
  4. Applied associate-/r/0.0

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

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

    \[\leadsto (\color{blue}{\left(\frac{1}{(x \cdot x + -1)_*}\right)} \cdot \left(x + 1\right) + \left(\frac{x}{x + 1}\right))_*\]
  7. Final simplification0.0

    \[\leadsto (\left(\frac{1}{(x \cdot x + -1)_*}\right) \cdot \left(x + 1\right) + \left(\frac{x}{x + 1}\right))_*\]

Reproduce

herbie shell --seed 2019005 +o rules:numerics
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1 (- x 1)) (/ x (+ x 1))))

Details

Time bar (total: 4.3s)Debug log

sample20.0ms

Algorithm
intervals

simplify6.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune11.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize26.0ms

Local error

Found 3 expressions with local error:

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

rewrite12.0ms

Algorithm
rewrite-expression-head
Counts
3 → 59
Calls

3 calls. Slowest were:

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

series42.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

25.0ms
(+ (/ 1 (- x 1)) (/ x (+ x 1)))
10.0ms
(/ x (+ x 1))
7.0ms
(/ 1 (- x 1))

simplify1.1s

Counts
29 → 68
Calls

29 calls. Slowest were:

191.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
121.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
114.0ms
(- (+ x (+ (pow x 2) 1)))

prune493.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize10.0ms

Local error

Found 3 expressions with local error:

0.2b
(/ 1 (fma x x -1))
0.0b
(fma (/ 1 (fma x x -1)) (+ x 1) (/ x (+ x 1)))
0.0b
(/ x (+ x 1))

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
3 → 45
Calls

3 calls. Slowest were:

1.0ms
(/ 1 (fma x x -1))
0.0ms
(/ x (+ x 1))
0.0ms
(fma (/ 1 (fma x x -1)) (+ x 1) (/ x (+ x 1)))

series76.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

51.0ms
(fma (/ 1 (fma x x -1)) (+ x 1) (/ x (+ x 1)))
15.0ms
(/ 1 (fma x x -1))
10.0ms
(/ x (+ x 1))

simplify765.0ms

Counts
18 → 54
Calls

18 calls. Slowest were:

206.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
120.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
97.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))

prune487.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes29.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample1.2s

Algorithm
intervals