Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
Both the BeckmannDistribution and TrowbridgeReitzDistribution divide by the anisotropic alpha values which can result in NaNs if either of those alpha values are 0. This can arise in the following condition:
A material does not map roughness to alpha, as the RoughnessToAlpha provides a lower bound as part of its calculation.
alphax or alphay is zero while the other is non zero. (When both are zero a Specular distribution is used.)
Both the BeckmannDistribution and TrowbridgeReitzDistribution divide by the anisotropic alpha values which can result in NaNs if either of those alpha values are 0. This can arise in the following condition:
A material does not map roughness to alpha, as the RoughnessToAlpha provides a lower bound as part of its calculation.
alphax or alphay is zero while the other is non zero. (When both are zero a Specular distribution is used.)
An example is attached -
remap_glass_crash.pbrt.gz