I am getting odd shadows on a smoothed sphere. Why are they there and how do I get rid of them?

Few years ago @Perjin was so kind and shared his shadow renderer here on the forum. It was a great starting point for me, because I had serious shadow related problems, including artifacts. All I have today evolved from that code sample. Unfortunately it is only for point lights, but you should try it anyway.