replaced speedometer driven gear with recommended 40 tooth and still not accurate...

Ouch. I sure hope not but who knows? The transmission shop here in Michigan didn't know tooth count /mph difference and referred me to this place...
Just think about this: 3mph at what mph? 40 tooth to 41 tooth is around 2.5%. It slows the speedometer 2.5%. So 5mph = 4.9mph, 40mph = 39mph, 60mph = 58.5mph, etc... The math here is extremely simple.