BlackScholes on 17bII+, accurate to 5th decimal place Message #1 Posted by Bob Wang on 13 Jan 2005, 5:18 p.m.
Thanks to Tony Hutchins for the idea of using an intermediate variable and nesting divisions.
This BlackScholes formula relies on a 5th order polynomial approximation. The worst case scenario, given below, is till accurate to 5 decimal places.
Enter PS, PE, RF%, S, T, then "MORE", then "SOLVE", then "CALLV", and if needed, "PUTV"
I had stopped working on this, waiting for the new 17bII+ ROM. But now that we know L() and G() don't work, I decided I should post this for anyone who wants a relatively accurate and fast BlackScholes.
I'll post another VERY accurate version using Taylor series, as suggested by Tizedes Csaba. But that version is VERY VERY SLOW. Takes over a minute to execute.
PS=68
PE=29
Rf%=.5
T=6
S=.2054
Exact Call = 40.2016616074
Formula = 40.2016671122
Exact Put = .344582080329
Formula = .3445875851
Abramowitz and Stegun 7.1.26 HP17BII+
Character Count: 679
BLK.SCHLS.5TH.SOLVE:
0×(PS+PE+RF%+T+S)
+IF(S(SOLVE):(LN(PS÷PE)+(RF%÷100+S^2÷2)×T)÷S÷SQRT(T)SOLVE:
IF(S(CALLV):
PS×ABS(
IF(SOLVE<0:0:1)
+((((1.061405429
÷(1+.2316419×ABS(SOLVE))1.453152027)
÷(1+.2316419×ABS(SOLVE))+1.421413741)
÷(1+.2316419×ABS(SOLVE)).284496736)
÷(1+.2316419×ABS(SOLVE))+.254829592)
÷(1+.2316419×ABS(SOLVE))
×EXP((SOLVE^2)÷2)÷2)
PE×EXP(RF%×T÷100)×ABS(
IF(SOLVES×SQRT(T)<0:0:1)
+((((1.061405429
÷(1+.2316419×ABS(SOLVES×SQRT(T)))1.453152027)
÷(1+.2316419×ABS(SOLVES×SQRT(T)))+1.421413741)
÷(1+.2316419×ABS(SOLVES×SQRT(T))).284496736)
÷(1+.2316419×ABS(SOLVES×SQRT(T)))+.254829592)
÷(1+.2316419×ABS(SOLVES×SQRT(T)))
×EXP(((SOLVES×SQRT(T))^2)÷2)÷2)
CALLV:
PS+PE×EXP(RF%×T÷100)+CALLVPUTV))
