There is no formula to determine it based on quality and durability
this was theorycrafted back at launch, and lets just say its more like this

Base sp + X sp = total SP, where X = a random number that is unaffected by anything, just plain random