Semiconductor lasers are modeled by single-mode rate equations with Langevin noise terms and the influence of nonlinear gain is investigated. For cw operation the probability distribution for the carrier number and the photon number in the laser cavity is obtained. The corresponding (2+1)-dimensional Fokker-Planck equation is derived and integrated on an Amdahl VP1100 vector processor. Above threshold the resulting probability density agrees with the rate-equation predictions. The case of high-speed modulation is also considered. The nonlinear gain is found to stabilize the laser.