\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)1 \cdot \left(a - \frac{1.0}{3.0}\right) + \left(1 \cdot rand\right) \cdot \frac{1.0}{\frac{\sqrt{\left(a - \frac{1.0}{3.0}\right) \cdot 9}}{a - \frac{1.0}{3.0}}}double f(double a, double rand) {
double r1461846 = a;
double r1461847 = 1.0;
double r1461848 = /* ERROR: no posit support in C */;
double r1461849 = 3.0;
double r1461850 = /* ERROR: no posit support in C */;
double r1461851 = r1461848 / r1461850;
double r1461852 = r1461846 - r1461851;
double r1461853 = 1.0;
double r1461854 = /* ERROR: no posit support in C */;
double r1461855 = 9.0;
double r1461856 = /* ERROR: no posit support in C */;
double r1461857 = r1461856 * r1461852;
double r1461858 = sqrt(r1461857);
double r1461859 = r1461854 / r1461858;
double r1461860 = rand;
double r1461861 = r1461859 * r1461860;
double r1461862 = r1461854 + r1461861;
double r1461863 = r1461852 * r1461862;
return r1461863;
}
double f(double a, double rand) {
double r1461864 = 1.0;
double r1461865 = a;
double r1461866 = 1.0;
double r1461867 = 3.0;
double r1461868 = r1461866 / r1461867;
double r1461869 = r1461865 - r1461868;
double r1461870 = r1461864 * r1461869;
double r1461871 = rand;
double r1461872 = r1461864 * r1461871;
double r1461873 = 9.0;
double r1461874 = r1461869 * r1461873;
double r1461875 = sqrt(r1461874);
double r1461876 = r1461875 / r1461869;
double r1461877 = r1461866 / r1461876;
double r1461878 = r1461872 * r1461877;
double r1461879 = r1461870 + r1461878;
return r1461879;
}



Bits error versus a



Bits error versus rand
Initial program 0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
rmApplied distribute-rgt-in0.2
Simplified0.2
rmApplied *p16-lft-identity-expand0.2
Applied p16-times-frac0.2
Simplified0.2
rmApplied p16-*-un-lft-identity0.2
Applied associate-/l*0.2
Final simplification0.2
herbie shell --seed 2019152
(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))))