Optimizations for von Mangoldt function