1. A method for obtaining an optimal reflectivity value for complex multilayer stacks, comprising: (a) generating a model of a multilayer stack and parameterizing each layer by a thickness and an index of refraction; (b) allowing a user to input values for the parameters; (c) calculating an extrema for a cost function of reflectivity R using the input parameter values; (d) calculating sensitivity values S for the extrema points; and (e) obtaining an optimal value by calculating a cost function R+S.