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

Math has never been simple to me (lol) but I get what you're saying. What would you do? The speedometer was working correctly before the engine/rear end swap and the shop that replaced the rear end gears swears it's a 3.91
Krazykuda has the right idea.