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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Final simplification0.0

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

Reproduce

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

Details

Time bar (total: 18.9s)Debug log

sample29.0ms

Algorithm
intervals

simplify5.0ms

Counts
1 → 1
Calls

1 calls. Slowest were:

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

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize17.0ms

Local error

Found 2 expressions with local error:

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

rewrite2.0ms

Algorithm
rewrite-expression-head
Counts
2 → 37
Calls

2 calls. Slowest were:

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

series23.0ms

Counts
2 → 6
Calls

2 calls. Slowest were:

15.0ms
(/ x (+ x 1))
8.0ms
(/ 1 (- x 1))

simplify426.0ms

Counts
17 → 43
Calls

17 calls. Slowest were:

124.0ms
(- (+ x (+ (pow x 2) 1)))
120.0ms
(- (+ x (pow x 3)) (pow x 2))
41.0ms
(- (+ (/ 1 (pow x 2)) 1) (/ 1 x))

prune307.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize14.0ms

Local error

Found 3 expressions with local error:

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

rewrite8.0ms

Algorithm
rewrite-expression-head
Counts
3 → 68
Calls

3 calls. Slowest were:

5.0ms
(* (/ 1 (- (* x x) (* 1 1))) (+ x 1))
2.0ms
(/ 1 (- (* x x) (* 1 1)))
0.0ms
(/ x (+ x 1))

series43.0ms

Counts
3 → 9
Calls

3 calls. Slowest were:

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

simplify4.3s

Counts
41 → 77
Calls

41 calls. Slowest were:

1.4s
(* (/ 1 (- (* x x) (* 1 1))) (+ x 1))
583.0ms
(* (* (* (/ 1 (- (* x x) (* 1 1))) (/ 1 (- (* x x) (* 1 1)))) (/ 1 (- (* x x) (* 1 1)))) (* (* (+ x 1) (+ x 1)) (+ x 1)))
524.0ms
(* (- (* x x) (* 1 1)) (+ (* x x) (- (* 1 1) (* x 1))))

prune569.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize18.0ms

Local error

Found 4 expressions with local error:

17.7b
(cbrt (/ 1 (- (* x x) (* 1 1))))
17.7b
(cbrt (/ 1 (- (* x x) (* 1 1))))
17.7b
(cbrt (/ 1 (- (* x x) (* 1 1))))
17.3b
(* (* (* (cbrt (/ 1 (- (* x x) (* 1 1)))) (cbrt (/ 1 (- (* x x) (* 1 1))))) (cbrt (/ 1 (- (* x x) (* 1 1))))) (+ x 1))

rewrite39.0ms

Algorithm
rewrite-expression-head
Counts
4 → 99
Calls

4 calls. Slowest were:

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

series396.0ms

Counts
4 → 12
Calls

4 calls. Slowest were:

148.0ms
(cbrt (/ 1 (- (* x x) (* 1 1))))
121.0ms
(cbrt (/ 1 (- (* x x) (* 1 1))))
105.0ms
(cbrt (/ 1 (- (* x x) (* 1 1))))
21.0ms
(* (* (* (cbrt (/ 1 (- (* x x) (* 1 1)))) (cbrt (/ 1 (- (* x x) (* 1 1))))) (cbrt (/ 1 (- (* x x) (* 1 1))))) (+ x 1))

simplify10.1s

Counts
85 → 111
Calls

85 calls. Slowest were:

590.0ms
(* (* (* (/ 1 (- (* x x) (* 1 1))) (/ 1 (- (* x x) (* 1 1)))) (/ 1 (- (* x x) (* 1 1)))) (* (* (+ x 1) (+ x 1)) (+ x 1)))
397.0ms
(* (* (* (cbrt (/ 1 (- (* x x) (* 1 1)))) (cbrt (/ 1 (- (* x x) (* 1 1))))) (cbrt (/ 1 (- (* x x) (* 1 1))))) (+ x 1))
392.0ms
(* (* (* (cbrt (/ 1 (- (* x x) (* 1 1)))) (cbrt 1)) (cbrt (/ 1 (- (* x x) (* 1 1))))) (+ x 1))

prune1.3s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes33.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample1.3s

Algorithm
intervals