\frac{{roughness}^{2}}{\pi \cdot {\left(\left(ndoth \cdot {roughness}^{2} - ndoth\right) \cdot ndoth + 1\right)}^{2}}\frac{{roughness}^{2}}{\pi \cdot {\left(\left(ndoth \cdot {roughness}^{2} - ndoth\right) \cdot ndoth + 1\right)}^{2}}double code(double roughness, double ndoth) {
return ((double) (((double) pow(roughness, 2.0)) / ((double) (((double) M_PI) * ((double) pow(((double) (((double) (((double) (((double) (ndoth * ((double) pow(roughness, 2.0)))) - ndoth)) * ndoth)) + 1.0)), 2.0))))));
}
double code(double roughness, double ndoth) {
return ((double) (((double) pow(roughness, 2.0)) / ((double) (((double) M_PI) * ((double) pow(((double) (((double) (((double) (((double) (ndoth * ((double) pow(roughness, 2.0)))) - ndoth)) * ndoth)) + 1.0)), 2.0))))));
}



Bits error versus roughness



Bits error versus ndoth
Results
Initial program 15.0
Final simplification15.0
herbie shell --seed 2020152
(FPCore (roughness ndoth)
:name "(/ (pow roughness 2) (* PI (pow (+ (* (- (* ndoth (pow roughness 2)) ndoth) ndoth) 1) 2)))"
:precision binary64
(/ (pow roughness 2.0) (* PI (pow (+ (* (- (* ndoth (pow roughness 2.0)) ndoth) ndoth) 1.0) 2.0))))