Average Error: 15.1 → 0.0
Time: 2.1s
Precision: 64
\[\frac{x}{x \cdot x + 1}\]
\[\begin{array}{l} \mathbf{if}\;x \le -6272088098.2590008 \lor \neg \left(x \le 460.75227704809595\right):\\ \;\;\;\;\left(1 \cdot \frac{1}{{x}^{5}} + \frac{1}{x}\right) - 1 \cdot \frac{1}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x \cdot x + 1}\\ \end{array}\]
\frac{x}{x \cdot x + 1}
\begin{array}{l}
\mathbf{if}\;x \le -6272088098.2590008 \lor \neg \left(x \le 460.75227704809595\right):\\
\;\;\;\;\left(1 \cdot \frac{1}{{x}^{5}} + \frac{1}{x}\right) - 1 \cdot \frac{1}{{x}^{3}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot x + 1}\\

\end{array}
double f(double x) {
        double r53502 = x;
        double r53503 = r53502 * r53502;
        double r53504 = 1.0;
        double r53505 = r53503 + r53504;
        double r53506 = r53502 / r53505;
        return r53506;
}

double f(double x) {
        double r53507 = x;
        double r53508 = -6272088098.259001;
        bool r53509 = r53507 <= r53508;
        double r53510 = 460.75227704809595;
        bool r53511 = r53507 <= r53510;
        double r53512 = !r53511;
        bool r53513 = r53509 || r53512;
        double r53514 = 1.0;
        double r53515 = 1.0;
        double r53516 = 5.0;
        double r53517 = pow(r53507, r53516);
        double r53518 = r53515 / r53517;
        double r53519 = r53514 * r53518;
        double r53520 = r53515 / r53507;
        double r53521 = r53519 + r53520;
        double r53522 = 3.0;
        double r53523 = pow(r53507, r53522);
        double r53524 = r53515 / r53523;
        double r53525 = r53514 * r53524;
        double r53526 = r53521 - r53525;
        double r53527 = r53507 * r53507;
        double r53528 = r53527 + r53514;
        double r53529 = r53507 / r53528;
        double r53530 = r53513 ? r53526 : r53529;
        return r53530;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

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

Derivation

  1. Split input into 2 regimes
  2. if x < -6272088098.259001 or 460.75227704809595 < x

    1. Initial program 30.6

      \[\frac{x}{x \cdot x + 1}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt31.1

      \[\leadsto \frac{x}{\color{blue}{\left(\sqrt[3]{x \cdot x + 1} \cdot \sqrt[3]{x \cdot x + 1}\right) \cdot \sqrt[3]{x \cdot x + 1}}}\]
    4. Applied *-un-lft-identity31.1

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

      \[\leadsto \color{blue}{\frac{1}{\sqrt[3]{x \cdot x + 1} \cdot \sqrt[3]{x \cdot x + 1}} \cdot \frac{x}{\sqrt[3]{x \cdot x + 1}}}\]
    6. Taylor expanded around inf 0.0

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

    if -6272088098.259001 < x < 460.75227704809595

    1. Initial program 0.0

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -6272088098.2590008 \lor \neg \left(x \le 460.75227704809595\right):\\ \;\;\;\;\left(1 \cdot \frac{1}{{x}^{5}} + \frac{1}{x}\right) - 1 \cdot \frac{1}{{x}^{3}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{x \cdot x + 1}\\ \end{array}\]

Reproduce

herbie shell --seed 2020056 
(FPCore (x)
  :name "x / (x^2 + 1)"
  :precision binary64

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

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