Average Error: 14.8 → 0.0
Time: 27.0s
Precision: 64
Internal Precision: 384
\[\frac{x}{x \cdot x + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -19409101.03762743:\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\\ \mathbf{if}\;x \le 144528077.66840905:\\ \;\;\;\;\frac{x}{x \cdot x + 1}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\\ \end{array}\]

Error

Bits error versus x

Target

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

Derivation

  1. Split input into 2 regimes
  2. if x < -19409101.03762743 or 144528077.66840905 < x

    1. Initial program 30.6

      \[\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 -19409101.03762743 < x < 144528077.66840905

    1. Initial program 0.0

      \[\frac{x}{x \cdot x + 1}\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 27.0s)Debug logProfile

herbie shell --seed '#(1070991898 1055468627 4280279443 640792587 928206309 3646738750)' 
(FPCore (x)
  :name "x / (x^2 + 1)"

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

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