\left(3 \cdot s\right) \cdot \log \left(\frac{1}{1 - \frac{u - 0.25}{0.75}}\right)\left(\sqrt{-\log \left(1.3333333333333333 - 1.3333333333333333 \cdot u\right)} \cdot \left(3 \cdot s\right)\right) \cdot \sqrt{-\log \left(1 - \frac{u - 0.25}{0.75}\right)}(FPCore (s u) :precision binary32 (* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))
(FPCore (s u) :precision binary32 (* (* (sqrt (- (log (- 1.3333333333333333 (* 1.3333333333333333 u))))) (* 3.0 s)) (sqrt (- (log (- 1.0 (/ (- u 0.25) 0.75)))))))
float code(float s, float u) {
return (3.0f * s) * logf(1.0f / (1.0f - ((u - 0.25f) / 0.75f)));
}
float code(float s, float u) {
return (sqrtf(-logf(1.3333333333333333f - (1.3333333333333333f * u))) * (3.0f * s)) * sqrtf(-logf(1.0f - ((u - 0.25f) / 0.75f)));
}



Bits error versus s



Bits error versus u
Results
Initial program 1.3
rmApplied add-sqr-sqrt_binary321.4
Applied associate-*r*_binary321.4
Simplified1.1
Taylor expanded around 0 1.1
Simplified1.1
rmApplied inv-pow_binary321.1
Applied log-pow_binary321.0
Final simplification1.0
herbie shell --seed 2021174
(FPCore (s u)
:name "Disney BSSRDF, sample scattering profile, upper"
:precision binary32
:pre (and (<= 0.0 s 256.0) (<= 0.25 u 1.0))
(* (* 3.0 s) (log (/ 1.0 (- 1.0 (/ (- u 0.25) 0.75))))))