Based on the standard coupled equations describing bi-directionally pumped fiber Raman amplifiers (BDP-FRAs), a generalized automatic algorithm with the help of genetic algorithm and cascaded global convergent Broyden method is proposed for the design of broadband BDP-FRAs. The main advantages of this algorithm are higher efficiency, easier convergence and wider application. The numerical calculation illustrates that the gain flatness for 10 THz gain bandwidth is well within ±0.6 dB for three kinds of FRAs