Optimized gyrosynchrotron algorithms and fast codes