Function exercised
fn exercised<R: Scalar>(payoff: impl Fn(f64) -> R, payer: bool) -> RExpand description
E[max(±X(z), 0)] over a standard normal driver z, for a payoff X
rising in z: the payer’s side above the exercise boundary, the
receiver’s below it, each by Gauss–Legendre. The boundary is found
passively — the payoff is zero on it, so it carries no first-order term.