Extended waveform inversion globalizes the convergence of seismic waveform inversion by adding nonphysical degrees of freedom to the model, thus permitting it to fit the data well throughout the inversion process. These extra degrees of freedom must be curtailed at the solution, for example, by penalizing them as part of an optimization formulation. For separable (partly linear) models, a natural objective function combines a mean square data residual and a quadratic regularization term penalizing the nonphysical (linear) degrees of freedom. The linear variables are eliminated in an inner optimization step, leaving a function of the outer (nonlinear) variables to be optimized. This variable projection method is convenient for computation, but it requires that the penalty weight be increased as the estimated model tends to the (physical) solution. We describe an algorithm based on discrepancy, that is, maintaining the data residual at the inner optimum within a prescribed range, to control the penalty weight during the outer optimization. We evaluate this algorithm in the context of constant density acoustic waveform inversion, by recovering background model and perturbation fitting bandlimited waveform data in the Born approximation.