The technique is ad-hoc though, as it is using smoothstep to generate the antialiased values, and the sample code has no gamma correction either. I think clamped line + gamma correction could result nearly exact results though!
This looks like something I'll have to play with later.