Average Error: 15.4 → 0.0
Time: 31.2s
Precision: 64
Internal Precision: 4416
\[5 \cdot x + \frac{4 \cdot {x}^{2} + 2}{\sqrt{{x}^{2} + 1}}\]
\[\begin{array}{l} \mathbf{if}\;x \le -77.03422800661305:\\ \;\;\;\;\left(x - \frac{\frac{\frac{1}{2}}{x}}{x \cdot x}\right) + \frac{\frac{1}{2}}{{x}^{5}}\\ \mathbf{elif}\;x \le 191.66696380123295:\\ \;\;\;\;\frac{1}{\frac{\sqrt{x \cdot x + 1}}{2 \cdot 2 - \left(\left(x \cdot x\right) \cdot 4\right) \cdot \left(\left(x \cdot x\right) \cdot 4\right)} \cdot \left(2 - \left(x \cdot x\right) \cdot 4\right)} + x \cdot 5\\ \mathbf{else}:\\ \;\;\;\;9 \cdot x + \left(\frac{\frac{\frac{1}{2}}{x}}{x \cdot x} - \frac{\frac{1}{2}}{{x}^{5}}\right)\\ \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 < -77.03422800661305

    1. Initial program 32.9

      \[5 \cdot x + \frac{4 \cdot {x}^{2} + 2}{\sqrt{{x}^{2} + 1}}\]
    2. Initial simplification32.9

      \[\leadsto \frac{2 + \left(x \cdot x\right) \cdot 4}{\sqrt{x \cdot x + 1}} + 5 \cdot x\]
    3. Using strategy rm
    4. Applied *-un-lft-identity32.9

      \[\leadsto \frac{\color{blue}{1 \cdot \left(2 + \left(x \cdot x\right) \cdot 4\right)}}{\sqrt{x \cdot x + 1}} + 5 \cdot x\]
    5. Applied associate-/l*33.0

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{x \cdot x + 1}}{2 + \left(x \cdot x\right) \cdot 4}}} + 5 \cdot x\]
    6. Taylor expanded around -inf 0.0

      \[\leadsto \color{blue}{\left(\frac{1}{2} \cdot \frac{1}{{x}^{5}} + x\right) - \frac{1}{2} \cdot \frac{1}{{x}^{3}}}\]
    7. Simplified0.0

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

    if -77.03422800661305 < x < 191.66696380123295

    1. Initial program 0.0

      \[5 \cdot x + \frac{4 \cdot {x}^{2} + 2}{\sqrt{{x}^{2} + 1}}\]
    2. Initial simplification0.0

      \[\leadsto \frac{2 + \left(x \cdot x\right) \cdot 4}{\sqrt{x \cdot x + 1}} + 5 \cdot x\]
    3. Using strategy rm
    4. Applied *-un-lft-identity0.0

      \[\leadsto \frac{\color{blue}{1 \cdot \left(2 + \left(x \cdot x\right) \cdot 4\right)}}{\sqrt{x \cdot x + 1}} + 5 \cdot x\]
    5. Applied associate-/l*0.0

      \[\leadsto \color{blue}{\frac{1}{\frac{\sqrt{x \cdot x + 1}}{2 + \left(x \cdot x\right) \cdot 4}}} + 5 \cdot x\]
    6. Using strategy rm
    7. Applied flip-+0.0

      \[\leadsto \frac{1}{\frac{\sqrt{x \cdot x + 1}}{\color{blue}{\frac{2 \cdot 2 - \left(\left(x \cdot x\right) \cdot 4\right) \cdot \left(\left(x \cdot x\right) \cdot 4\right)}{2 - \left(x \cdot x\right) \cdot 4}}}} + 5 \cdot x\]
    8. Applied associate-/r/0.0

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

    if 191.66696380123295 < x

    1. Initial program 28.8

      \[5 \cdot x + \frac{4 \cdot {x}^{2} + 2}{\sqrt{{x}^{2} + 1}}\]
    2. Initial simplification28.8

      \[\leadsto \frac{2 + \left(x \cdot x\right) \cdot 4}{\sqrt{x \cdot x + 1}} + 5 \cdot x\]
    3. Taylor expanded around inf 0.1

      \[\leadsto \color{blue}{\left(9 \cdot x + \frac{1}{2} \cdot \frac{1}{{x}^{3}}\right) - \frac{1}{2} \cdot \frac{1}{{x}^{5}}}\]
    4. Simplified0.1

      \[\leadsto \color{blue}{\left(\frac{\frac{\frac{1}{2}}{x}}{x \cdot x} - \frac{\frac{1}{2}}{{x}^{5}}\right) + 9 \cdot x}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification0.0

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -77.03422800661305:\\ \;\;\;\;\left(x - \frac{\frac{\frac{1}{2}}{x}}{x \cdot x}\right) + \frac{\frac{1}{2}}{{x}^{5}}\\ \mathbf{elif}\;x \le 191.66696380123295:\\ \;\;\;\;\frac{1}{\frac{\sqrt{x \cdot x + 1}}{2 \cdot 2 - \left(\left(x \cdot x\right) \cdot 4\right) \cdot \left(\left(x \cdot x\right) \cdot 4\right)} \cdot \left(2 - \left(x \cdot x\right) \cdot 4\right)} + x \cdot 5\\ \mathbf{else}:\\ \;\;\;\;9 \cdot x + \left(\frac{\frac{\frac{1}{2}}{x}}{x \cdot x} - \frac{\frac{1}{2}}{{x}^{5}}\right)\\ \end{array}\]

Runtime

Time bar (total: 31.2s)Debug log

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