\frac{\left(\frac{\left(\left(i \cdot i\right) \cdot \left(i \cdot i\right)\right)}{\left(\left(\left(2\right) \cdot i\right) \cdot \left(\left(2\right) \cdot i\right)\right)}\right)}{\left(\left(\left(\left(2\right) \cdot i\right) \cdot \left(\left(2\right) \cdot i\right)\right) - \left(1.0\right)\right)}\left(\frac{\left(\frac{i}{\left(2\right)}\right)}{\left(\frac{\left(i \cdot \left(2\right)\right)}{\left(1.0\right)}\right)}\right) \cdot \left(\frac{\left(\frac{i}{\left(2\right)}\right)}{\left(\left(i \cdot \left(2\right)\right) - \left(1.0\right)\right)}\right)double f(double i) {
double r3172187 = i;
double r3172188 = r3172187 * r3172187;
double r3172189 = r3172188 * r3172188;
double r3172190 = 2.0;
double r3172191 = /* ERROR: no posit support in C */;
double r3172192 = r3172191 * r3172187;
double r3172193 = r3172192 * r3172192;
double r3172194 = r3172189 / r3172193;
double r3172195 = 1.0;
double r3172196 = /* ERROR: no posit support in C */;
double r3172197 = r3172193 - r3172196;
double r3172198 = r3172194 / r3172197;
return r3172198;
}
double f(double i) {
double r3172199 = i;
double r3172200 = 2.0;
double r3172201 = /* ERROR: no posit support in C */;
double r3172202 = r3172199 / r3172201;
double r3172203 = r3172199 * r3172201;
double r3172204 = 1.0;
double r3172205 = /* ERROR: no posit support in C */;
double r3172206 = r3172203 + r3172205;
double r3172207 = r3172202 / r3172206;
double r3172208 = r3172203 - r3172205;
double r3172209 = r3172202 / r3172208;
double r3172210 = r3172207 * r3172209;
return r3172210;
}



Bits error versus i
Initial program 2.4
Simplified1.2
rmApplied associate-*r/1.1
rmApplied associate-/r*0.9
rmApplied associate-/r*0.8
Simplified0.8
rmApplied p16-*-un-lft-identity0.8
Applied difference-of-squares0.8
Applied p16-times-frac0.8
Applied p16-times-frac0.4
Final simplification0.4
herbie shell --seed 2019168
(FPCore (i)
:name "Octave 3.8, jcobi/4, as called"
:pre (and (>.p16 i (real->posit16 0)))
(/.p16 (/.p16 (*.p16 (*.p16 i i) (*.p16 i i)) (*.p16 (*.p16 (real->posit16 2) i) (*.p16 (real->posit16 2) i))) (-.p16 (*.p16 (*.p16 (real->posit16 2) i) (*.p16 (real->posit16 2) i)) (real->posit16 1.0))))