Average Error: 15.2 → 0.0
Time: 30.6s
Precision: 64
Internal Precision: 576
\[\frac{x}{x \cdot x + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -3.389751380187937 \cdot 10^{+19}:\\ \;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\\ \mathbf{if}\;x \le 11565126.45514931:\\ \;\;\;\;\log_* (1 + (e^{\frac{x}{(x \cdot x + 1)_*}} - 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.2
Target0.1
Herbie0.0
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Split input into 2 regimes
  2. if x < -3.389751380187937e+19 or 11565126.45514931 < x

    1. Initial program 31.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 -3.389751380187937e+19 < x < 11565126.45514931

    1. Initial program 0.0

      \[\frac{x}{x \cdot x + 1}\]
    2. Using strategy rm
    3. Applied log1p-expm1-u0.0

      \[\leadsto \color{blue}{\log_* (1 + (e^{\frac{x}{x \cdot x + 1}} - 1)^*)}\]
    4. Applied simplify0.0

      \[\leadsto \log_* (1 + \color{blue}{(e^{\frac{x}{(x \cdot x + 1)_*}} - 1)^*})\]
  3. Recombined 2 regimes into one program.

Runtime

Time bar (total: 30.6s)Debug logProfile

herbie shell --seed '#(1071373924 2949776965 1885069702 3247780810 90874544 2263903749)' +o rules:numerics
(FPCore (x)
  :name "x / (x^2 + 1)"

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

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