Computation of nonlinear optical properties of molecules with large amplitude anharmonic motions. III. Arbitrary double-well potentials