\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 r2443430 = a;
double r2443431 = 1.0;
double r2443432 = /* ERROR: no posit support in C */;
double r2443433 = 3.0;
double r2443434 = /* ERROR: no posit support in C */;
double r2443435 = r2443432 / r2443434;
double r2443436 = r2443430 - r2443435;
double r2443437 = 1.0;
double r2443438 = /* ERROR: no posit support in C */;
double r2443439 = 9.0;
double r2443440 = /* ERROR: no posit support in C */;
double r2443441 = r2443440 * r2443436;
double r2443442 = sqrt(r2443441);
double r2443443 = r2443438 / r2443442;
double r2443444 = rand;
double r2443445 = r2443443 * r2443444;
double r2443446 = r2443438 + r2443445;
double r2443447 = r2443436 * r2443446;
return r2443447;
}
double f(double a, double rand) {
double r2443448 = a;
double r2443449 = 1.0;
double r2443450 = /* ERROR: no posit support in C */;
double r2443451 = 3.0;
double r2443452 = /* ERROR: no posit support in C */;
double r2443453 = r2443450 / r2443452;
double r2443454 = r2443448 - r2443453;
double r2443455 = 1.0;
double r2443456 = /* ERROR: no posit support in C */;
double r2443457 = rand;
double r2443458 = r2443457 * r2443456;
double r2443459 = r2443448 + r2443453;
double r2443460 = r2443454 / r2443459;
double r2443461 = r2443453 + r2443448;
double r2443462 = r2443460 * r2443461;
double r2443463 = 9.0;
double r2443464 = /* ERROR: no posit support in C */;
double r2443465 = r2443462 * r2443464;
double r2443466 = sqrt(r2443465);
double r2443467 = r2443458 / r2443466;
double r2443468 = r2443456 + r2443467;
double r2443469 = r2443454 * r2443468;
return r2443469;
}



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 +o rules:numerics
(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))))