# HP Forums

You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Thanks to Tony Hutchins for the idea of using an intermediate variable and nesting divisions.

This Black-Scholes 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 Black-Scholes.

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(SOLVE-S×SQRT(T)<0:0:-1)
+((((1.061405429
÷(1+.2316419×ABS(SOLVE-S×SQRT(T)))-1.453152027)
÷(1+.2316419×ABS(SOLVE-S×SQRT(T)))+1.421413741)
÷(1+.2316419×ABS(SOLVE-S×SQRT(T)))-.284496736)
÷(1+.2316419×ABS(SOLVE-S×SQRT(T)))+.254829592)
÷(1+.2316419×ABS(SOLVE-S×SQRT(T)))
×EXP(-((SOLVE-S×SQRT(T))^2)÷2)÷2)
-CALLV:
-PS+PE×EXP(-RF%×T÷100)+CALLV-PUTV))
```

Thanks, Bob.

I wonder if HP let out L and G, in the first 17 batch so maybe to "match" the solver in the 49 series?

Let me be a bit of an iconoclast:

I'm no expert on Black-Scholes (or any other formulae which purport to calculate the future value of investments), but it seems to me that no matter what you calculate, the actual results of an investment depend on the true-life variability of the market - which can not be modelled all that accurately! I therefore doubt that even 5-digit precision is necessary in such calculations.

It's like my physics students who continually provide 10 digit "answers" (because that's what the calculator reports) to problems with only one or two significant figures!

Quote:
It's like my physics students who continually provide 10 digit "answers" (because that's what the calculator reports) to problems with only one or two significant figures!

That's one of the nice things about slide rules; it's pretty hard to learn to use one properly without also learning the importance of significant digits, and the difference between precision and accuracy. It's also pretty hard to come up with a 10-digit answer! (Well, at least without "cheating" and using a book of log tables. :-)

I remember my own physics teacher, back in 1973, giving us the "precision vs. accuracy" lecture when one of those new-fangled calculators had the temerity to show up in her classroom...

Dave:

These formulae are not intended for real world use. Think of them as "proof of concept" exercises. Just as I am amazed by Hutchins, Derenzo and Carr, I hope SOMEBODY, besides myself, finds these formulae interesting ;-)

Bob

P.S. *IF* HP financial calculators had UTPN, Black-Scholes could be implemented to the limit of machine accuracy. However, such an exercise would also be trivial and uninteresting.