Ah nice for noticing d!=0 is d>0. Not sure how I missed the multiplication to get rid of the vector form; I guess I was too obsessed with the x-x trick...
I added your changes to the Shadertoy version with your HN nickname. I'll integrate it to the original later.
Thanks!