\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) + \frac{rand}{1.0} \cdot \frac{1 \cdot \left(a - \frac{1.0}{3.0}\right)}{\sqrt{9 \cdot a + 9 \cdot \left(-\frac{1.0}{3.0}\right)}}double f(double a, double rand) {
double r2646167 = a;
double r2646168 = 1.0;
double r2646169 = /* ERROR: no posit support in C */;
double r2646170 = 3.0;
double r2646171 = /* ERROR: no posit support in C */;
double r2646172 = r2646169 / r2646171;
double r2646173 = r2646167 - r2646172;
double r2646174 = 1.0;
double r2646175 = /* ERROR: no posit support in C */;
double r2646176 = 9.0;
double r2646177 = /* ERROR: no posit support in C */;
double r2646178 = r2646177 * r2646173;
double r2646179 = sqrt(r2646178);
double r2646180 = r2646175 / r2646179;
double r2646181 = rand;
double r2646182 = r2646180 * r2646181;
double r2646183 = r2646175 + r2646182;
double r2646184 = r2646173 * r2646183;
return r2646184;
}
double f(double a, double rand) {
double r2646185 = 1.0;
double r2646186 = a;
double r2646187 = 1.0;
double r2646188 = 3.0;
double r2646189 = r2646187 / r2646188;
double r2646190 = r2646186 - r2646189;
double r2646191 = r2646185 * r2646190;
double r2646192 = rand;
double r2646193 = r2646192 / r2646187;
double r2646194 = 9.0;
double r2646195 = r2646194 * r2646186;
double r2646196 = -r2646189;
double r2646197 = r2646194 * r2646196;
double r2646198 = r2646195 + r2646197;
double r2646199 = sqrt(r2646198);
double r2646200 = r2646191 / r2646199;
double r2646201 = r2646193 * r2646200;
double r2646202 = r2646191 + r2646201;
return r2646202;
}



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 distribute-rgt-in0.2
rmApplied p16-*-un-lft-identity0.2
Applied p16-times-frac0.2
Applied associate-*l*0.2
Simplified0.2
rmApplied sub-neg0.2
Applied distribute-lft-in0.2
Final simplification0.2
herbie shell --seed 2019158
(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))))