\frac{\left(\left(\frac{\left(1\right)}{\left(\frac{x}{\left(1\right)}\right)}\right) - \left(\frac{\left(2\right)}{x}\right)\right)}{\left(\frac{\left(1\right)}{\left(x - \left(1\right)\right)}\right)}\frac{\left(\frac{\left(1\right)}{\left(\frac{x}{\left(1\right)}\right)}\right)}{\left(\left(\frac{\left(1\right)}{\left(x - \left(1\right)\right)}\right) - \left(\frac{\left(2\right)}{x}\right)\right)}double f(double x) {
double r8251548 = 1.0;
double r8251549 = /* ERROR: no posit support in C */;
double r8251550 = x;
double r8251551 = r8251550 + r8251549;
double r8251552 = r8251549 / r8251551;
double r8251553 = 2.0;
double r8251554 = /* ERROR: no posit support in C */;
double r8251555 = r8251554 / r8251550;
double r8251556 = r8251552 - r8251555;
double r8251557 = r8251550 - r8251549;
double r8251558 = r8251549 / r8251557;
double r8251559 = r8251556 + r8251558;
return r8251559;
}
double f(double x) {
double r8251560 = 1.0;
double r8251561 = /* ERROR: no posit support in C */;
double r8251562 = x;
double r8251563 = r8251562 + r8251561;
double r8251564 = r8251561 / r8251563;
double r8251565 = r8251562 - r8251561;
double r8251566 = r8251561 / r8251565;
double r8251567 = 2.0;
double r8251568 = /* ERROR: no posit support in C */;
double r8251569 = r8251568 / r8251562;
double r8251570 = r8251566 - r8251569;
double r8251571 = r8251564 + r8251570;
return r8251571;
}



Bits error versus x
Initial program 1.0
rmApplied +p16-rgt-identity-expand1.0
Applied associate--l+1.0
Applied associate-+l+1.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2019168 +o rules:numerics
(FPCore (x)
:name "3frac (problem 3.3.3)"
(+.p16 (-.p16 (/.p16 (real->posit16 1) (+.p16 x (real->posit16 1))) (/.p16 (real->posit16 2) x)) (/.p16 (real->posit16 1) (-.p16 x (real->posit16 1)))))