Average Error: 15.0 → 0.0
Time: 14.6s
Precision: 64
Internal Precision: 320
\[\frac{x}{x \cdot x + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -23253.23141424013 \lor \neg \left(x \le 5842628.826673498\right):\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot x + 1} \cdot x\\ \end{array}\]

Error

Bits error versus x

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Target

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

Derivation

  1. Split input into 2 regimes
  2. if x < -23253.23141424013 or 5842628.826673498 < x

    1. Initial program 30.5

      \[\frac{x}{x \cdot x + 1}\]
    2. Taylor expanded around inf 0.0

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

    if -23253.23141424013 < x < 5842628.826673498

    1. Initial program 0.0

      \[\frac{x}{x \cdot x + 1}\]
    2. Using strategy rm
    3. Applied div-inv0.0

      \[\leadsto \color{blue}{x \cdot \frac{1}{x \cdot x + 1}}\]
  3. Recombined 2 regimes into one program.
  4. Applied simplify0.0

    \[\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;x \le -23253.23141424013 \lor \neg \left(x \le 5842628.826673498\right):\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{x \cdot x + 1} \cdot x\\ \end{array}}\]

Runtime

Time bar (total: 14.6s)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' 
(FPCore (x)
  :name "x / (x^2 + 1)"

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

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