Average Error: 15.0 → 15.0
Time: 1.3s
Precision: binary64
\[\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}}\]
\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))))));
}

Error

Bits error versus roughness

Bits error versus ndoth

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 15.0

    \[\frac{{roughness}^{2}}{\pi \cdot {\left(\left(ndoth \cdot {roughness}^{2} - ndoth\right) \cdot ndoth + 1\right)}^{2}}\]
  2. Final simplification15.0

    \[\leadsto \frac{{roughness}^{2}}{\pi \cdot {\left(\left(ndoth \cdot {roughness}^{2} - ndoth\right) \cdot ndoth + 1\right)}^{2}}\]

Reproduce

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))))