Stock-delivery option with a geometric average (source code)

= Stock-delivery option with a geometric average
{title2=$V_0=S_0[r\Phi(d)+ce^{-m+v/2}\Phi(-d+\sqrt v)]$}

A delivery $S_T\max(r,c/A)$ has value $S_0[r\Phi(d)+ce^{-m+v/2}\Phi(-d+\sqrt v)]$, where $m,v$ are the mean and <variance> of $\log A$ under the <stock-numeraire measure in the Black-Scholes model>, and $d=(m-\log(c/r))/\sqrt v$. Split the normal integral at $\log(c/r)$ and complete the square in $e^{-y}$ times its <normal probability density>.