# Black-Scholes fastest computation method

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.

• 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. Jun 25, 2013 at 8:21
• @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. Jun 25, 2013 at 17:40
• 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... Jun 25, 2013 at 21:33
• @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.
– Ilya
Jun 26, 2013 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).

• 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.
– Ilya
Jun 26, 2013 at 11:25
• @Ilya You need to compute this table only once. Then you can store it in a file and load on the start of application. Jun 26, 2013 at 12:40
• 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.
– Ilya
Jun 26, 2013 at 19:41
• @Ilya, I thought we are talking about the normal cdf here. Why would you have to generate such lookup table more than once? Jun 27, 2013 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.