Shading model artifacts

i have a problem with my custom Shading model.
im doing toon shading model, and it shows me this artifacts.

this is the code

BxDF.txt (1.3 KB)