I created this texture in Photoshop. It's 4096x4096 pixels, Grayscale, 16-bit, PNG. At 1.8MB the file size is reasonable, but I feel like if I could create this procedurally with nodes it would be considerably more memory-efficient, and possibly even more accurate. (I do get small artifacts when driving a ColorRamp with this texture - albeit they're only noticeable when zoomed in close.)
This is the sort of case where I usually give up and use textures, but I thought someone who is good with math might be willing to have a go at this... :-)