Average Error: 15.6 → 0.0
Time: 5.1s
Precision: 64
Internal precision: 384
\[\frac{x}{{x}^2 + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -4.248855072932943 \cdot 10^{+22}:\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^3}\\ \mathbf{if}\;x \le 95035.66200477978:\\ \;\;\;\;\frac{x}{{x}^2 + 1}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^3}\\ \end{array}\]

Error

Bits error versus x

Target

Original15.6
Comparison0.1
Herbie0.0
\[ \frac{1}{x + \frac{1}{x}} \]

Derivation

  1. Split input into 2 regimes.
  2. if x < -4.248855072932943e+22 or 95035.66200477978 < x

    1. Initial program 32.5

      \[\frac{x}{{x}^2 + 1}\]
    2. Applied taylor 0.0

      \[\leadsto \left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\]
    3. Taylor expanded around inf 0.0

      \[\leadsto \color{blue}{\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}}\]
    4. Applied simplify 0.0

      \[\leadsto \color{blue}{\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^3}}\]

    if -4.248855072932943e+22 < x < 95035.66200477978

    1. Initial program 0.0

      \[\frac{x}{{x}^2 + 1}\]
  3. Recombined 2 regimes into one program.
  4. Removed slow pow expressions

Runtime

Time bar (total: 5.1s) Debug logProfile

Please include this information when filing a bug report:

herbie shell --seed '#(1064524629 4159152179 2999149171 575749698 4006532819 692958815)'
(FPCore (x)
  :name "x / (x^2 + 1)"

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

  (/ x (+ (sqr x) 1)))