Average Error: 10.1 → 0.1
Time: 1.1m
Precision: 64
Internal Precision: 1088
\[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
\[\frac{\frac{2}{x + 1}}{\left(x - 1\right) \cdot x}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original10.1
Target0.2
Herbie0.1
\[\frac{2}{x \cdot \left(x \cdot x - 1\right)}\]

Derivation

  1. Initial program 10.1

    \[\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\]
  2. Initial simplification10.1

    \[\leadsto \frac{1}{x + 1} + \left(\frac{1}{x - 1} - \frac{2}{x}\right)\]
  3. Using strategy rm
  4. Applied frac-sub26.2

    \[\leadsto \frac{1}{x + 1} + \color{blue}{\frac{1 \cdot x - \left(x - 1\right) \cdot 2}{\left(x - 1\right) \cdot x}}\]
  5. Applied frac-add25.6

    \[\leadsto \color{blue}{\frac{1 \cdot \left(\left(x - 1\right) \cdot x\right) + \left(x + 1\right) \cdot \left(1 \cdot x - \left(x - 1\right) \cdot 2\right)}{\left(x + 1\right) \cdot \left(\left(x - 1\right) \cdot x\right)}}\]
  6. Taylor expanded around inf 0.2

    \[\leadsto \frac{\color{blue}{2}}{\left(x + 1\right) \cdot \left(\left(x - 1\right) \cdot x\right)}\]
  7. Using strategy rm
  8. Applied associate-/r*0.1

    \[\leadsto \color{blue}{\frac{\frac{2}{x + 1}}{\left(x - 1\right) \cdot x}}\]
  9. Final simplification0.1

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

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed 2018230 
(FPCore (x)
  :name "3frac (problem 3.3.3)"

  :herbie-target
  (/ 2 (* x (- (* x x) 1)))

  (+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1))))