A method for obtaining an optimal reflectivity value for complex
multilayer stacks is disclosed. Aspects of the present invention include
generating a model of a multilayer stack and parameterizing each layer by
a thickness and an index of refraction; allowing a user to input values
for the parameters; calculating an extrema for a cost function of
reflectivity R using the input parameter values; calculating sensitivity
values S for the extrema points; and obtaining an optimal value by
calculating a cost function R+S.