# “Off-label use” of Mathematica functions for performance

Assisting an acquaintance with a simulation where a very large number of binomial probability calculations are required, I pointed them to a slightly obscure function to dramatically speed up their algorithm. Specifically, for

Probability[x == b, x \[Distributed] BinomialDistribution[n, p]]


the same result can be had with

BernsteinBasis[n, b, p]


but the latter is 15-20X faster (and surprisingly generally more accurate with inexact p) than the former, and 1.5-2X faster than PDF calculation. Only explicit calculation using the formula for binomial probability is faster.

I'm curious what other "off-label" uses of built-in functions have been noted to have performance advantages.

-
Please define "acquaintance" –  belisarius Mar 20 at 23:56
@belisarius: Only the names have been changed to protect the innocent... –  rasher Mar 20 at 23:59