\frac{x}{x \cdot x + 1}\frac{1}{\mathsf{hypot}\left(1, x\right)} \cdot \frac{x}{\mathsf{hypot}\left(1, x\right)}double f(double x) {
double r1978612 = x;
double r1978613 = r1978612 * r1978612;
double r1978614 = 1.0;
double r1978615 = r1978613 + r1978614;
double r1978616 = r1978612 / r1978615;
return r1978616;
}
double f(double x) {
double r1978617 = 1.0;
double r1978618 = x;
double r1978619 = hypot(r1978617, r1978618);
double r1978620 = r1978617 / r1978619;
double r1978621 = r1978618 / r1978619;
double r1978622 = r1978620 * r1978621;
return r1978622;
}




Bits error versus x
Results
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 15.1
Simplified15.1
rmApplied *-un-lft-identity15.1
Applied associate-/l*15.1
rmApplied *-un-lft-identity15.1
Applied add-sqr-sqrt15.1
Applied times-frac15.1
Applied add-cube-cbrt15.1
Applied times-frac15.1
Simplified15.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2019144 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))