Average Error: 14.4 → 0.1
Time: 48.5s
Precision: 64
\[\frac{x}{x \cdot x + 1}\]
\[\frac{\frac{1}{\sqrt{1}}}{x + 1 \cdot \frac{1}{x}}\]
\frac{x}{x \cdot x + 1}
\frac{\frac{1}{\sqrt{1}}}{x + 1 \cdot \frac{1}{x}}
double f(double x) {
        double r66175 = x;
        double r66176 = r66175 * r66175;
        double r66177 = 1.0;
        double r66178 = r66176 + r66177;
        double r66179 = r66175 / r66178;
        return r66179;
}

double f(double x) {
        double r66180 = 1.0;
        double r66181 = sqrt(r66180);
        double r66182 = r66180 / r66181;
        double r66183 = x;
        double r66184 = 1.0;
        double r66185 = r66180 / r66183;
        double r66186 = r66184 * r66185;
        double r66187 = r66183 + r66186;
        double r66188 = r66182 / r66187;
        return r66188;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.4
Target0.1
Herbie0.1
\[\frac{1}{x + \frac{1}{x}}\]

Derivation

  1. Initial program 14.4

    \[\frac{x}{x \cdot x + 1}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt14.4

    \[\leadsto \frac{x}{\color{blue}{\sqrt{x \cdot x + 1} \cdot \sqrt{x \cdot x + 1}}}\]
  4. Applied associate-/r*14.3

    \[\leadsto \color{blue}{\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}}\]
  5. Using strategy rm
  6. Applied *-un-lft-identity14.3

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

    \[\leadsto \frac{\frac{x}{\color{blue}{\sqrt{1} \cdot \sqrt{x \cdot x + 1}}}}{\sqrt{x \cdot x + 1}}\]
  8. Applied *-un-lft-identity14.3

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot x}}{\sqrt{1} \cdot \sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}\]
  9. Applied times-frac14.3

    \[\leadsto \frac{\color{blue}{\frac{1}{\sqrt{1}} \cdot \frac{x}{\sqrt{x \cdot x + 1}}}}{\sqrt{x \cdot x + 1}}\]
  10. Applied associate-/l*14.4

    \[\leadsto \color{blue}{\frac{\frac{1}{\sqrt{1}}}{\frac{\sqrt{x \cdot x + 1}}{\frac{x}{\sqrt{x \cdot x + 1}}}}}\]
  11. Simplified14.4

    \[\leadsto \frac{\frac{1}{\sqrt{1}}}{\color{blue}{\frac{1 + x \cdot x}{x}}}\]
  12. Taylor expanded around 0 0.1

    \[\leadsto \frac{\frac{1}{\sqrt{1}}}{\color{blue}{x + 1 \cdot \frac{1}{x}}}\]
  13. Final simplification0.1

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

Reproduce

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

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

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