A European call on a non-dividend-paying stock trades at price C. The stock trades at S_0, the call has strike K and expiry T, and the continuously compounded risk-free rate is r.
Compute the arbitrage-free price of the European put with the same strike and expiry.
Five numbers C, S_0, K, r and T.
One real number: the put price, with absolute or relative error at most 1e-9.
0 < S_0, K <= 10^4
-0.05 <= r <= 0.1
0.001 <= T <= 30
C is arbitrage-consistent
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 an absolute tolerance of 1e-09 or a relative tolerance of 1e-09 of the expected value.
8.9160372786 100 100 0.02 1
6.935904609248e+00
6.7768735266 50 60 0.05 2
1.106711860873e+01