Bringing Back Moore's Law

Harshad Deo

3 minutes read

The Black formula is arguably the most important function in quantitative finance, and is either used directly (for pricing) or indirectly (for quotation), in most pricing calls. This article presents benchmarks for evaluating the formula.

Four cases of evaluating the formula for the price of a vanilla option:

  1. The Spot Price, i.e. the discounted price
  2. The Spot Price and Greeks, i.e. the discounted price and all first order sensitivities
  3. The Forward Price, i.e. the undiscounted price
  4. The Forward Price and Greeks, i.e. the undiscounted price and all first order sensitivities

In each case, the time taken to evaluate the relevant formula provided by Strata’s formula repositories was compared with that taken by a numerically equivalent implementation generated using the SimianQuant library. Aside from the time taken by the generated scalar implementations, the amortized time taken by a vectorized implementation was also measured. In practice, the vector case is the one that is the most relevant.

To summarize the results, the SimianQuant implementation is upto 72x faster than the equivalent Strata implementation. For exotic options, or cases where simulation is required (e.g. market risk), these numbers are a lower bound on the performance step achievable.

All measurements were made on an AWS c5 instance with a clock speed of 3GHz.

Spot Price

The first case considered is the evaluation of the discounted premium (technically the pips in the numeraire). The performance of the SimianQuant JVM implementation is roughly the same as that of its C++ implementation, both being close to 3x faster than Strata. The vectorized implementation is predictably faster.

Spot Price and Greeks

The second case considered is the evaluation of the discounted price and all first order sensitivities. Here, the benefits of graph compression become obvious, with the SimianQuant implementations taking scarcely more time to evaluate the six additional formulae.

Forward Price

The third case is the evaluation of the undiscounted price. Since the functional form is simpler, the time taken is predictably lower and there are fewer things that the SimianQuant library can do to optimize the code.

Forward Price and Greeks

The final case considered is the evaluation of the undiscounted price and all first order sensitivities. In this case, Strata provides a method that implements, by hand, an approach analogous to graph compression, called adjoint mode algorithimic differentiation. As is obvious, this approach is faster than separately evaluating the formulae for the price and the four greeks.

This approach, however, is not scalable because the implementation, while nominally open source, is effectively a black box because it is very difficult to read. This makes it difficult to maintain and extend. On the other hand, the SimianQuant specification can be understood by anyone with an introductory knowledge of calculus and programming.

About Strata

Strata is an award winning open source analytics and market risk library published by Open Gamma. The company, however, is opaque about its performance and that of its subcomponents. This article is the second in a series that will benchmark the library against open source alternatives and code generated using the SimianQuant library. The source code for the majority of the benchmarks can be found in the companion github repository. Other articles in this series are:

  1. Elementary Functions
  2. SABR Volatility
  3. One Dimensional Interpolation
  4. Two Dimensional Interpolation


You can train people to be competent but not exceptional.

Recent posts

See more