Average Error: 14.5 → 0.0
Time: 30.7s
Precision: 64
Internal Precision: 128
\[\frac{x}{x \cdot x + 1}\]
\[\frac{1}{\sqrt{1^2 + x^2}^*} \cdot \frac{x}{\sqrt{1^2 + x^2}^*}\]

Error

Bits error versus x

Target

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

Derivation

  1. Initial program 14.5

    \[\frac{x}{x \cdot x + 1}\]
  2. Simplified14.5

    \[\leadsto \color{blue}{\frac{x}{(x \cdot x + 1)_*}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity14.5

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

    \[\leadsto \color{blue}{\frac{1}{\frac{(x \cdot x + 1)_*}{x}}}\]
  6. Using strategy rm
  7. Applied *-un-lft-identity14.6

    \[\leadsto \frac{1}{\frac{(x \cdot x + 1)_*}{\color{blue}{1 \cdot x}}}\]
  8. Applied add-sqr-sqrt14.6

    \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{(x \cdot x + 1)_*} \cdot \sqrt{(x \cdot x + 1)_*}}}{1 \cdot x}}\]
  9. Applied times-frac14.6

    \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{(x \cdot x + 1)_*}}{1} \cdot \frac{\sqrt{(x \cdot x + 1)_*}}{x}}}\]
  10. Applied add-cube-cbrt14.6

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\frac{\sqrt{(x \cdot x + 1)_*}}{1} \cdot \frac{\sqrt{(x \cdot x + 1)_*}}{x}}\]
  11. Applied times-frac14.6

    \[\leadsto \color{blue}{\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\frac{\sqrt{(x \cdot x + 1)_*}}{1}} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt{(x \cdot x + 1)_*}}{x}}}\]
  12. Simplified14.6

    \[\leadsto \color{blue}{\frac{1}{\sqrt{1^2 + x^2}^*}} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt{(x \cdot x + 1)_*}}{x}}\]
  13. Simplified0.0

    \[\leadsto \frac{1}{\sqrt{1^2 + x^2}^*} \cdot \color{blue}{\frac{x}{\sqrt{1^2 + x^2}^*}}\]
  14. Final simplification0.0

    \[\leadsto \frac{1}{\sqrt{1^2 + x^2}^*} \cdot \frac{x}{\sqrt{1^2 + x^2}^*}\]

Reproduce

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

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

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