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

It depends on the toot count. at 40t, a 1 tooth change is 2.5%. It sounds like you need more like 20%. According to these calculations, you would need at least a 45t. Doesn't make sense. Are you sure you don't have a 4:56? Does your speedometer read 31mph at 25gpsmph?
Close to it. I don't remember the exact numbers. Speedometer is accurate to about 12mph, then the faster the speed the higher it is off. Doing 50mph (per gps) the speedometer was reading 62mph. Had the rear end rebuilt a couple of years ago and was told it's a 3.91 gear... I was thinking about putting a 41 T in it but sounds like I need even more?