Average Error: 0.0 → 0.0
Time: 20.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 2019007 +o rules:numerics
(FPCore (x)
  :name "Asymptote B"
  (+ (/ 1 (- x 1)) (/ x (+ x 1))))

Details

Time bar (total: 20.1s)Debug log

sample38.0ms

Algorithm
intervals

simplify10.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune13.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

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

rewrite7.0ms

Algorithm
rewrite-expression-head
Counts
3 → 59
Calls

3 calls. Slowest were:

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

series53.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify976.0ms

Counts
29 → 68
Calls

29 calls. Slowest were:

155.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
109.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
96.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))

prune520.0ms

Pruning

3 alts after pruning (3 fresh and 0 done)

Merged error: 0b

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

rewrite4.0ms

Algorithm
rewrite-expression-head
Counts
3 → 45
Calls

3 calls. Slowest were:

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

series95.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

54.0ms
(fma (/ 1 (fma x x -1)) (+ x 1) (/ x (+ x 1)))
25.0ms
(/ 1 (fma x x -1))
15.0ms
(/ x (+ x 1))

simplify706.0ms

Counts
18 → 54
Calls

18 calls. Slowest were:

187.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
118.0ms
(- (+ x (pow x 3)) (pow x 2))
115.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))

prune464.0ms

Pruning

3 alts after pruning (2 fresh and 1 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

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

rewrite39.0ms

Algorithm
rewrite-expression-head
Counts
4 → 94
Calls

4 calls. Slowest were:

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

series70.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

31.0ms
(* (+ (/ 1 (- x 1)) (/ x (+ x 1))) (+ (/ 1 (- x 1)) (/ x (+ x 1))))
16.0ms
(/ x (+ x 1))
12.0ms
(/ x (+ x 1))
12.0ms
(/ x (+ x 1))

simplify8.7s

Counts
66 → 106
Calls

66 calls. Slowest were:

995.0ms
(* (+ (* (/ 1 (- x 1)) (/ 1 (- x 1))) (- (* (/ x (+ x 1)) (/ x (+ x 1))) (* (/ 1 (- x 1)) (/ x (+ x 1))))) (+ (* (/ 1 (- x 1)) (/ 1 (- x 1))) (- (* (/ x (+ x 1)) (/ x (+ x 1))) (* (/ 1 (- x 1)) (/ x (+ x 1))))))
644.0ms
(* (+ (pow (/ 1 (- x 1)) 3) (pow (/ x (+ x 1)) 3)) (+ (* 1 (+ x 1)) (* (- x 1) x)))
454.0ms
(* (- (/ 1 (- x 1)) (/ x (+ x 1))) (+ (* (/ 1 (- x 1)) (/ 1 (- x 1))) (- (* (/ x (+ x 1)) (/ x (+ x 1))) (* (/ 1 (- x 1)) (/ x (+ x 1))))))

prune939.0ms

Pruning

3 alts after pruning (1 fresh and 2 done)

Merged error: 0b

localize24.0ms

Local error

Found 4 expressions with local error:

20.5b
(cbrt (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1))))
0.1b
(* (/ 1 (- x 1)) (/ 1 (- x 1)))
0.1b
(* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1)))
0.0b
(/ x (+ x 1))

rewrite56.0ms

Algorithm
rewrite-expression-head
Counts
4 → 138
Calls

4 calls. Slowest were:

24.0ms
(* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1)))
18.0ms
(cbrt (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1))))
9.0ms
(* (/ 1 (- x 1)) (/ 1 (- x 1)))

series69.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

23.0ms
(cbrt (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1))))
16.0ms
(* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1)))
15.0ms
(/ x (+ x 1))
15.0ms
(* (/ 1 (- x 1)) (/ 1 (- x 1)))

simplify4.9s

Counts
127 → 150
Calls

127 calls. Slowest were:

541.0ms
(* (* (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1))) (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1)))) (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1))))
333.0ms
(* (* (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (* (/ 1 (- x 1)) (/ 1 (- x 1)))) (* (/ 1 (- x 1)) (/ 1 (- x 1)))) (* (* (/ 1 (- x 1)) (/ 1 (- x 1))) (/ 1 (- x 1))))
254.0ms
(- (+ (* 3 x) (+ (* 6 (pow x 2)) 1)))

prune1.4s

Pruning

3 alts after pruning (0 fresh and 3 done)

Merged error: 0b

regimes37.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample938.0ms

Algorithm
intervals