  The problem of optimally discriminating between two completely unknown qubit
states is generalized by allowing an error margin. It is visualized as a
device---the programmable discriminator---with one data and two program ports,
each fed with a number of identically prepared qubits---the data and the
programs. The device aims at correctly identifying the data state with one of
the two program states. This scheme has the unambiguous and the minimum-error
schemes as extremal cases, when the error margin is set to zero or it is
sufficiently large, respectively. Analytical results are given in the two
situations where the margin is imposed on the average error probability---weak
condition---or it is imposed separately on the two probabilities of assigning
the state of the data to the wrong program---strong condition. It is a general
feature of our scheme that the success probability rises sharply as soon as a
small error margin is allowed, thus providing a significant gain over the
unambiguous scheme while still having high confidence results.
