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

Details

Time bar (total: 12.0s)Debug log

sample36.0ms

Algorithm
intervals

simplify10.0ms

Counts
1 → 1
Calls
1 calls:
Slowest
10.0ms
(+ (/ 1 (- x 1)) (/ x (+ x 1)))

prune7.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize27.0ms

Local error

Found 3 expressions with local error:

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

rewrite13.0ms

Algorithm
rewrite-expression-head
Rules
*-un-lft-identity
add-cube-cbrt
associate-/r/
fma-def
associate-/r*
add-sqr-sqrt
add-log-exp
div-inv
add-exp-log
pow1
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
distribute-lft-out
flip--
flip-+
flip3--
flip3-+
frac-2neg
clear-num
inv-pow
pow-flip
frac-add
sum-log
rec-exp
+-commutative
Counts
3 → 59
Calls
3 calls:
Slowest
10.0ms
(+ (/ 1 (- x 1)) (/ x (+ x 1)))
2.0ms
(/ 1 (- x 1))
1.0ms
(/ x (+ x 1))

series60.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
36.0ms
(+ (/ 1 (- x 1)) (/ x (+ x 1)))
14.0ms
(/ x (+ x 1))
10.0ms
(/ 1 (- x 1))

simplify1.1s

Counts
29 → 68
Calls
29 calls:
Slowest
166.0ms
(- (+ x (+ (pow x 2) 1)))
151.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
122.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
118.0ms
(- (+ x (pow x 3)) (pow x 2))
99.0ms
(+ (* 1 (+ x 1)) (* (- x 1) x))

prune480.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize32.0ms

Local error

Found 4 expressions with local error:

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

rewrite30.0ms

Algorithm
rewrite-expression-head
Rules
add-exp-log
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
associate-/r*
pow1
add-log-exp
flip-+
associate-/r/
associate-*l*
add-cbrt-cube
flip3-+
frac-add
log1p-expm1-u
associate-*r/
frac-times
expm1-log1p-u
div-inv
associate-*r*
flip--
prod-exp
associate-*l/
flip3--
distribute-lft-in
frac-2neg
clear-num
associate-+l+
rec-exp
distribute-rgt-in
difference-of-squares
inv-pow
pow-flip
cbrt-unprod
*-commutative
pow-prod-down
fma-def
sum-log
+-commutative
Counts
4 → 89
Calls
4 calls:
Slowest
13.0ms
(+ (* (/ 1 (- (* x x) (* 1 1))) (+ x 1)) (/ x (+ x 1)))
11.0ms
(* (/ 1 (- (* x x) (* 1 1))) (+ x 1))
4.0ms
(/ 1 (- (* x x) (* 1 1)))
1.0ms
(/ x (+ x 1))

series102.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
55.0ms
(+ (* (/ 1 (- (* x x) (* 1 1))) (+ x 1)) (/ x (+ x 1)))
23.0ms
(* (/ 1 (- (* x x) (* 1 1))) (+ x 1))
13.0ms
(/ 1 (- (* x x) (* 1 1)))
10.0ms
(/ x (+ x 1))

simplify8.2s

Counts
58 → 101
Calls
58 calls:
Slowest
1.3s
(* (/ 1 (- (* x x) (* 1 1))) (+ x 1))
705.0ms
(* (* (- (* x x) (* 1 1)) (- x 1)) (+ x 1))
679.0ms
(* (* (- (* x x) (* 1 1)) (+ (* x x) (- (* 1 1) (* x 1)))) (+ x 1))
636.0ms
(* (* (* (/ 1 (- (* x x) (* 1 1))) (/ 1 (- (* x x) (* 1 1)))) (/ 1 (- (* x x) (* 1 1)))) (* (* (+ x 1) (+ x 1)) (+ x 1)))
588.0ms
(* (- (* x x) (* 1 1)) (+ (* x x) (- (* 1 1) (* x 1))))

prune916.0ms

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes51.0ms

Accuracy

0% (0.0b remaining)

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

bsearch1.0ms

end0.0ms

sample950.0ms

Algorithm
intervals