Average Error: 15.5 → 0.0
Time: 23.0s
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

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

Derivation

  1. Initial program 15.5

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

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

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

    \[\leadsto \frac{1}{\frac{(x \cdot x + 1)_*}{\color{blue}{1 \cdot x}}}\]
  7. Applied add-sqr-sqrt15.5

    \[\leadsto \frac{1}{\frac{\color{blue}{\sqrt{(x \cdot x + 1)_*} \cdot \sqrt{(x \cdot x + 1)_*}}}{1 \cdot x}}\]
  8. Applied times-frac15.5

    \[\leadsto \frac{1}{\color{blue}{\frac{\sqrt{(x \cdot x + 1)_*}}{1} \cdot \frac{\sqrt{(x \cdot x + 1)_*}}{x}}}\]
  9. Applied add-cube-cbrt15.5

    \[\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}}\]
  10. Applied times-frac15.5

    \[\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}}}\]
  11. Simplified15.5

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

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

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

Reproduce

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

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

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