A large cash-settled contract on a stock expires at time T. Over the session [0, T], the stock's log-price X_t is a Gaussian process with continuous paths, starting at X_0 = 0, with
E[X_t] = b * t / T
Cov(X_s, X_t) = sigma^2 * (min(s, t) - s * t / T)
A barrier option knocks in if the log-price reaches the level a > 0 at any time in [0, T]. Compute the probability that the option knocks in.
Four numbers sigma, a, b and T, each with at most 6 digits after the decimal point.
One real number: the knock-in probability, with relative error at most 1e-9.
0.01 <= sigma <= 5
0.001 <= a <= 20
-20 <= b <= 20
0.001 <= T <= 30
2 * a * (a - b) <= 600 * sigma^2 * T
This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.
Numeric answers are accepted if they are within a relative tolerance of 1e-09 of the expected value.
1 1 0 1
1.353352832366127e-01
0.2 0.5 1 2
1.000000000000000e+00