Average Error: 14.5 → 0.1
Time: 39.9s
Precision: 64
Internal Precision: 128
\[\frac{x}{x \cdot x + 1}\]
\[\frac{1}{x + \frac{1}{x}}\]

Error

Bits error versus x

Target

Original14.5
Target0.1
Herbie0.1
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Initial program 14.5

    \[\frac{x}{x \cdot x + 1}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity14.5

    \[\leadsto \frac{\color{blue}{1 \cdot x}}{x \cdot x + 1}\]
  4. Applied associate-/l*14.6

    \[\leadsto \color{blue}{\frac{1}{\frac{x \cdot x + 1}{x}}}\]
  5. Taylor expanded around -inf 0.1

    \[\leadsto \frac{1}{\color{blue}{x + \frac{1}{x}}}\]
  6. Final simplification0.1

    \[\leadsto \frac{1}{x + \frac{1}{x}}\]

Reproduce

herbie shell --seed 2019091 
(FPCore (x)
  :name "x / (x^2 + 1)"

  :herbie-target
  (/ 1 (+ x (/ 1 x)))

  (/ x (+ (* x x) 1)))