What is the fastest way to numerically compute Black-Scholes-Merton option prices?

I'm trying to find fastest and still precise method. Currently I'm using numerical approximation of Normal cdf with 10-9 precision and standard formulae.

Is there another way to compute them numerically using any programming language without built-in libraries for option pricing and cdf computation? If any what is the speed of the algorithm in comparison with standard method and what is precision of an answer?

There is a question about approximations to the Black-Scholes formula, but there are aproximations for ATM options. And it is not obvious that this methods would show better results.

| improve this question | | | | |
  • 4
    $\begingroup$ Make sure you do not over-engineer things. In the end nobody cares about implied vols beyond a single decimal digit and 2 for the option price. $\endgroup$ – Matthias Wolf Jun 25 '13 at 8:21
  • 1
    $\begingroup$ @MattWolf Your warning is reasonable, but there are cases where precision is still valuable. For instance when using these prices/vols as inputs to more complicated models. If you round early, the effect is magnified by further calculations. So it depends on how the OP is going to be using the answers. $\endgroup$ – RaveTheTadpole Jun 25 '13 at 17:40
  • $\begingroup$ Can you elaborate on what data you have given and what you intend to do with it? I don't really see need for a numerical method yet, but perhaps I'm just looking from the wrong angle here... $\endgroup$ – zuiqo Jun 25 '13 at 21:33
  • $\begingroup$ @phi It is used in real time computatoin of option prices, as a part of implied volatility calibration etc. Performance is crucial. For example there is no analytical representarion of Normal cdf, that can be computed easily. Thus we use approximations with some polynomials rather then compute integrals each time. Thus I'm testing the fastest way to compute OP. $\endgroup$ – Ilya Jun 26 '13 at 6:11

Fastest method is a pre-generated lookup table with carefully selected in-memory structure so you don't get too many CPU cache misses (avoiding the memory latency).

If you want an absolute speed, you also can go for a hardware specific implementation (GPU, FPGA).

| improve this answer | | | | |
  • $\begingroup$ Thank you for your comment. It would dramatically improve performance if done correctly, but the algorithm used to compute this table should be still optimized. $\endgroup$ – Ilya Jun 26 '13 at 11:25
  • 2
    $\begingroup$ @Ilya You need to compute this table only once. Then you can store it in a file and load on the start of application. $\endgroup$ – Alexey Kalmykov Jun 26 '13 at 12:40
  • $\begingroup$ Even if the table is simplified to time-IV-underlying-OPspace it is necessary to compute it once a day or more frequently if, for example, underlying had large shock. And if it is made not for one option, but for tenths or hundreds. $\endgroup$ – Ilya Jun 26 '13 at 19:41
  • 1
    $\begingroup$ @Ilya, I thought we are talking about the normal cdf here. Why would you have to generate such lookup table more than once? $\endgroup$ – Matthias Wolf Jun 27 '13 at 3:54

The only special function needed for computing Black-Scholes option prices is the cumulative normal function ("N" or "Phi") or equivalently the error function ("erf"). These are very widely available with good standard library implementations. The erf function in single and double precision is part of the c99 and c++11 math standard libraries. For your favorite language, search for "error function" possibly in a "special functions" library. Generally there is no need to trade speed vs. accuracy; the library functions here give full precision with timing in the 10s or 100s of processor cycles. In almost any application the math expense is completely negligible.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.