Average Error: 16.1 → 0.0
Time: 16.3s
Precision: 64
\[\frac{{x}^{2}}{\sqrt{1 + {x}^{2}} + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.34187617831678346445877735820560354144 \cdot 10^{154}:\\ \;\;\;\;\frac{{x}^{\left(\frac{2}{2}\right)}}{\left(1 - x\right) - \frac{0.5}{x}} \cdot {x}^{\left(\frac{2}{2}\right)}\\ \mathbf{elif}\;x \le 101112.9288762892392696812748908996582031:\\ \;\;\;\;{x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}\\ \mathbf{else}:\\ \;\;\;\;{x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\left(x + \frac{0.5}{x}\right) + 1}\\ \end{array}\]
\frac{{x}^{2}}{\sqrt{1 + {x}^{2}} + 1}
\begin{array}{l}
\mathbf{if}\;x \le -1.34187617831678346445877735820560354144 \cdot 10^{154}:\\
\;\;\;\;\frac{{x}^{\left(\frac{2}{2}\right)}}{\left(1 - x\right) - \frac{0.5}{x}} \cdot {x}^{\left(\frac{2}{2}\right)}\\

\mathbf{elif}\;x \le 101112.9288762892392696812748908996582031:\\
\;\;\;\;{x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}\\

\mathbf{else}:\\
\;\;\;\;{x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\left(x + \frac{0.5}{x}\right) + 1}\\

\end{array}
double f(double x) {
        double r1750453 = x;
        double r1750454 = 2.0;
        double r1750455 = pow(r1750453, r1750454);
        double r1750456 = 1.0;
        double r1750457 = r1750456 + r1750455;
        double r1750458 = sqrt(r1750457);
        double r1750459 = r1750458 + r1750456;
        double r1750460 = r1750455 / r1750459;
        return r1750460;
}

double f(double x) {
        double r1750461 = x;
        double r1750462 = -1.3418761783167835e+154;
        bool r1750463 = r1750461 <= r1750462;
        double r1750464 = 2.0;
        double r1750465 = 2.0;
        double r1750466 = r1750464 / r1750465;
        double r1750467 = pow(r1750461, r1750466);
        double r1750468 = 1.0;
        double r1750469 = r1750468 - r1750461;
        double r1750470 = 0.5;
        double r1750471 = r1750470 / r1750461;
        double r1750472 = r1750469 - r1750471;
        double r1750473 = r1750467 / r1750472;
        double r1750474 = r1750473 * r1750467;
        double r1750475 = 101112.92887628924;
        bool r1750476 = r1750461 <= r1750475;
        double r1750477 = pow(r1750461, r1750464);
        double r1750478 = r1750468 + r1750477;
        double r1750479 = sqrt(r1750478);
        double r1750480 = r1750479 + r1750468;
        double r1750481 = r1750467 / r1750480;
        double r1750482 = r1750467 * r1750481;
        double r1750483 = r1750461 + r1750471;
        double r1750484 = r1750483 + r1750468;
        double r1750485 = r1750467 / r1750484;
        double r1750486 = r1750467 * r1750485;
        double r1750487 = r1750476 ? r1750482 : r1750486;
        double r1750488 = r1750463 ? r1750474 : r1750487;
        return r1750488;
}

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.3418761783167835e+154

    1. Initial program 64.0

      \[\frac{{x}^{2}}{\sqrt{1 + {x}^{2}} + 1}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity64.0

      \[\leadsto \frac{{x}^{2}}{\color{blue}{1 \cdot \left(\sqrt{1 + {x}^{2}} + 1\right)}}\]
    4. Applied sqr-pow64.0

      \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}}}{1 \cdot \left(\sqrt{1 + {x}^{2}} + 1\right)}\]
    5. Applied times-frac62.8

      \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{2}{2}\right)}}{1} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}}\]
    6. Simplified62.8

      \[\leadsto \color{blue}{{x}^{\left(\frac{2}{2}\right)}} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}\]
    7. Taylor expanded around -inf 0

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

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

    if -1.3418761783167835e+154 < x < 101112.92887628924

    1. Initial program 0.0

      \[\frac{{x}^{2}}{\sqrt{1 + {x}^{2}} + 1}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity0.0

      \[\leadsto \frac{{x}^{2}}{\color{blue}{1 \cdot \left(\sqrt{1 + {x}^{2}} + 1\right)}}\]
    4. Applied sqr-pow0.0

      \[\leadsto \frac{\color{blue}{{x}^{\left(\frac{2}{2}\right)} \cdot {x}^{\left(\frac{2}{2}\right)}}}{1 \cdot \left(\sqrt{1 + {x}^{2}} + 1\right)}\]
    5. Applied times-frac0.0

      \[\leadsto \color{blue}{\frac{{x}^{\left(\frac{2}{2}\right)}}{1} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}}\]
    6. Simplified0.0

      \[\leadsto \color{blue}{{x}^{\left(\frac{2}{2}\right)}} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}\]
    7. Using strategy rm
    8. Applied *-commutative0.0

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

    if 101112.92887628924 < x

    1. Initial program 32.1

      \[\frac{{x}^{2}}{\sqrt{1 + {x}^{2}} + 1}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity32.1

      \[\leadsto \frac{{x}^{2}}{\color{blue}{1 \cdot \left(\sqrt{1 + {x}^{2}} + 1\right)}}\]
    4. Applied sqr-pow32.1

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

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

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

      \[\leadsto {x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\color{blue}{x + \left(0.5 \cdot \frac{1}{x} + 1\right)}}\]
    8. Simplified0.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -1.34187617831678346445877735820560354144 \cdot 10^{154}:\\ \;\;\;\;\frac{{x}^{\left(\frac{2}{2}\right)}}{\left(1 - x\right) - \frac{0.5}{x}} \cdot {x}^{\left(\frac{2}{2}\right)}\\ \mathbf{elif}\;x \le 101112.9288762892392696812748908996582031:\\ \;\;\;\;{x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\sqrt{1 + {x}^{2}} + 1}\\ \mathbf{else}:\\ \;\;\;\;{x}^{\left(\frac{2}{2}\right)} \cdot \frac{{x}^{\left(\frac{2}{2}\right)}}{\left(x + \frac{0.5}{x}\right) + 1}\\ \end{array}\]

Reproduce

herbie shell --seed 1 
(FPCore (x)
  :name "x^2/(sqrt(1+x^2)+1)"
  (/ (pow x 2.0) (+ (sqrt (+ 1.0 (pow x 2.0))) 1.0)))