\left(a - \left(\frac{\left(1.0\right)}{\left(3.0\right)}\right)\right) \cdot \left(\frac{\left(1\right)}{\left(\left(\frac{\left(1\right)}{\left(\sqrt{\left(\left(9\right) \cdot \left(a - \left(\frac{\left(1.0\right)}{\left(3.0\right)}\right)\right)\right)}\right)}\right) \cdot rand\right)}\right)\left(a - \left(\frac{\left(1.0\right)}{\left(3.0\right)}\right)\right) \cdot \left(\frac{\left(1\right)}{\left(\frac{\left(rand \cdot \left(1\right)\right)}{\left(\sqrt{\left(\left(\left(\frac{\left(a - \left(\frac{\left(1.0\right)}{\left(3.0\right)}\right)\right)}{\left(\frac{a}{\left(\frac{\left(1.0\right)}{\left(3.0\right)}\right)}\right)}\right) \cdot \left(\frac{\left(\frac{\left(1.0\right)}{\left(3.0\right)}\right)}{a}\right)\right) \cdot \left(9\right)\right)}\right)}\right)}\right)double f(double a, double rand) {
double r2951861 = a;
double r2951862 = 1.0;
double r2951863 = /* ERROR: no posit support in C */;
double r2951864 = 3.0;
double r2951865 = /* ERROR: no posit support in C */;
double r2951866 = r2951863 / r2951865;
double r2951867 = r2951861 - r2951866;
double r2951868 = 1.0;
double r2951869 = /* ERROR: no posit support in C */;
double r2951870 = 9.0;
double r2951871 = /* ERROR: no posit support in C */;
double r2951872 = r2951871 * r2951867;
double r2951873 = sqrt(r2951872);
double r2951874 = r2951869 / r2951873;
double r2951875 = rand;
double r2951876 = r2951874 * r2951875;
double r2951877 = r2951869 + r2951876;
double r2951878 = r2951867 * r2951877;
return r2951878;
}
double f(double a, double rand) {
double r2951879 = a;
double r2951880 = 1.0;
double r2951881 = /* ERROR: no posit support in C */;
double r2951882 = 3.0;
double r2951883 = /* ERROR: no posit support in C */;
double r2951884 = r2951881 / r2951883;
double r2951885 = r2951879 - r2951884;
double r2951886 = 1.0;
double r2951887 = /* ERROR: no posit support in C */;
double r2951888 = rand;
double r2951889 = r2951888 * r2951887;
double r2951890 = r2951879 + r2951884;
double r2951891 = r2951885 / r2951890;
double r2951892 = r2951884 + r2951879;
double r2951893 = r2951891 * r2951892;
double r2951894 = 9.0;
double r2951895 = /* ERROR: no posit support in C */;
double r2951896 = r2951893 * r2951895;
double r2951897 = sqrt(r2951896);
double r2951898 = r2951889 / r2951897;
double r2951899 = r2951887 + r2951898;
double r2951900 = r2951885 * r2951899;
return r2951900;
}



Bits error versus a



Bits error versus rand
Initial program 0.2
rmApplied *p16-rgt-identity-expand0.2
Applied associate-*l*0.2
Simplified0.2
rmApplied p16-flip--0.2
Simplified0.2
rmApplied *p16-rgt-identity-expand0.2
Applied p16-times-frac0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019168
(FPCore (a rand)
:name "Octave 3.8, oct_fill_randg"
(*.p16 (-.p16 a (/.p16 (real->posit16 1.0) (real->posit16 3.0))) (+.p16 (real->posit16 1) (*.p16 (/.p16 (real->posit16 1) (sqrt.p16 (*.p16 (real->posit16 9) (-.p16 a (/.p16 (real->posit16 1.0) (real->posit16 3.0)))))) rand))))