Average Error: 15.3 → 0.0
Time: 34.9s
Precision: 64
Internal Precision: 320
\[\frac{x}{\sqrt{x \cdot x + 1}}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.3352415157792068 \cdot 10^{+154}:\\ \;\;\;\;\frac{x}{\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \left(\frac{\frac{1}{2}}{x} + x\right)}\\ \mathbf{if}\;x \le 296.75299396492323:\\ \;\;\;\;\frac{x}{\sqrt{x \cdot x + 1}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\left(x + \frac{\frac{1}{2}}{x}\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}}\\ \end{array}\]

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if x < -1.3352415157792068e+154

    1. Initial program 62.0

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

      \[\leadsto \frac{x}{\color{blue}{\frac{1}{8} \cdot \frac{1}{{x}^{3}} - \left(\frac{1}{2} \cdot \frac{1}{x} + x\right)}}\]
    3. Applied simplify0

      \[\leadsto \color{blue}{\frac{x}{\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \left(\frac{\frac{1}{2}}{x} + x\right)}}\]

    if -1.3352415157792068e+154 < x < 296.75299396492323

    1. Initial program 0.0

      \[\frac{x}{\sqrt{x \cdot x + 1}}\]

    if 296.75299396492323 < x

    1. Initial program 30.0

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

      \[\leadsto \frac{x}{\color{blue}{\left(\frac{1}{2} \cdot \frac{1}{x} + x\right) - \frac{1}{8} \cdot \frac{1}{{x}^{3}}}}\]
    3. Applied simplify0.0

      \[\leadsto \color{blue}{\frac{x}{\left(x + \frac{\frac{1}{2}}{x}\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}}}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 34.9s)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)' 
(FPCore (x)
  :name "x/sqrt(x*x+1)"
  (/ x (sqrt (+ (* x x) 1))))