Calculation of an Optical Merit Function and Its Derivatives with Respect to the System Parameters* | Synapse