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

Details

Time bar (total: 7.0s)Debug log

sample30.0ms

Algorithm
intervals
Results
21.0ms256×body80valid

simplify5.0ms

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

prune4.0ms

Pruning

1 alts after pruning (1 fresh and 0 done)

Merged error: 0.0b

localize19.0ms

Local error

Found 3 expressions with local error:

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

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

series73.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
38.0ms
(+ (/ 1 (- x 1)) (/ x (+ x 1)))
24.0ms
(/ x (+ x 1))
11.0ms
(/ 1 (- x 1))

simplify1.1s

Counts
29 → 68
Calls
29 calls:
Slowest
198.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
155.0ms
(- (+ x (+ (pow x 2) 1)))
133.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
123.0ms
(+ (* 1 (+ x 1)) (* (- x 1) x))
89.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))

prune446.0ms

Pruning

2 alts after pruning (2 fresh and 0 done)

Merged error: 0b

localize11.0ms

Local error

Found 3 expressions with local error:

0.1b
(/ 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
Rules
associate-/r*
add-cube-cbrt
*-un-lft-identity
add-sqr-sqrt
add-exp-log
pow1
add-log-exp
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
div-inv
associate-/r/
frac-2neg
clear-num
inv-pow
pow-flip
fma-udef
flip-+
flip3-+
rec-exp
Counts
3 → 45
Calls
3 calls:
Slowest
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)))

series71.0ms

Counts
3 → 9
Calls
3 calls:
Slowest
43.0ms
(fma (/ 1 (fma x x -1)) (+ x 1) (/ x (+ x 1)))
15.0ms
(/ 1 (fma x x -1))
13.0ms
(/ x (+ x 1))

simplify644.0ms

Counts
18 → 54
Calls
18 calls:
Slowest
148.0ms
(- (+ (* 2 (pow x 2)) (+ (* 2 (pow x 4)) 1)))
87.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
87.0ms
(+ (* 2 (/ 1 (pow x 4))) (+ 1 (* 2 (/ 1 (pow x 2)))))
82.0ms
(- (+ x (pow x 3)) (pow x 2))
77.0ms
(- (+ (pow x 2) (+ (pow x 4) 1)))

prune416.0ms

Pruning

2 alts after pruning (1 fresh and 1 done)

Merged error: 0b

localize13.0ms

Local error

Found 4 expressions with local error:

14.0b
(cbrt (/ 1 (fma x x -1)))
14.0b
(cbrt (/ 1 (fma x x -1)))
14.0b
(cbrt (/ 1 (fma x x -1)))
0.2b
(* (cbrt (/ 1 (fma x x -1))) (cbrt (/ 1 (fma x x -1))))

rewrite8.0ms

Algorithm
rewrite-expression-head
Rules
20×cbrt-prod
11×add-cube-cbrt
11×*-un-lft-identity
11×add-sqr-sqrt
pow1
associate-*l*
associate-*r*
pow1/3
cbrt-div
add-exp-log
div-inv
add-log-exp
log1p-expm1-u
add-cbrt-cube
expm1-log1p-u
pow-prod-up
pow-prod-down
cbrt-unprod
*-commutative
associate-*r/
prod-exp
associate-*l/
pow-plus
frac-times
pow2
Counts
4 → 80
Calls
4 calls:
Slowest
5.0ms
(* (cbrt (/ 1 (fma x x -1))) (cbrt (/ 1 (fma x x -1))))
1.0ms
(cbrt (/ 1 (fma x x -1)))
1.0ms
(cbrt (/ 1 (fma x x -1)))
1.0ms
(cbrt (/ 1 (fma x x -1)))

series477.0ms

Counts
4 → 12
Calls
4 calls:
Slowest
136.0ms
(cbrt (/ 1 (fma x x -1)))
123.0ms
(cbrt (/ 1 (fma x x -1)))
113.0ms
(* (cbrt (/ 1 (fma x x -1))) (cbrt (/ 1 (fma x x -1))))
105.0ms
(cbrt (/ 1 (fma x x -1)))

simplify1.7s

Counts
53 → 92
Calls
53 calls:
Slowest
181.0ms
(+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (+ (* 2/9 (* (pow x 4) (pow -1 1/3))) (pow -1 1/3)))
157.0ms
(+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (+ (* 2/9 (* (pow x 4) (pow -1 1/3))) (pow -1 1/3)))
124.0ms
(+ (* 1/3 (* (pow x 2) (pow -1 1/3))) (+ (* 2/9 (* (pow x 4) (pow -1 1/3))) (pow -1 1/3)))
106.0ms
(* (/ 1 (fma x x -1)) (/ 1 (fma x x -1)))
77.0ms
(* (cbrt (cbrt (/ 1 (fma x x -1)))) (cbrt (cbrt (/ 1 (fma x x -1)))))

prune1.0s

Pruning

2 alts after pruning (0 fresh and 2 done)

Merged error: 0b

regimes32.0ms

Accuracy

0% (0.0b remaining)

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

bsearch2.0ms

end0.0ms

sample838.0ms

Algorithm
intervals
Results
677.0ms8000×body80valid