bc is a quirky but useful calculator. It is a standard Unix utility and is also available for Windows. One nice feature of bc is that you can set the parameter scale to indicate the desired precision. For example, if…

bc is a quirky but useful calculator. It is a standard Unix utility and is also available for Windows. One nice feature of bc is that you can set the parameter scale to indicate the desired precision. For example, if…

This post will give several examples of functions include in the standard C math library that seem unnecessary at first glance. Function log1p(x) = log(1 + x) The function log1p computes log(1 + x). How hard could this be to…

The question came up on StackOverflow this morning how to compute the error function erf(x) in Python. The standard answer for how to compute anything numerical in Python is “Look in SciPy.” However, this person didn’t want to take on…

The gamma function Γ(x) is the most important function not on a calculator. It comes up constantly in math. In some areas, such as probability and statistics, you will see the gamma function more often than other functions that are…

The error function erf(x) and the normal distribution Φ(x) are essentially the same function. The former is more common in math, the latter in statistics. I often have to convert between the two. It’s a simple exercise to move between erf(x)…

This morning I posted some notes on orthogonal polynomials and Gaussian quadrature. “Orthogonal” just means perpendicular. So how can two polynomials be perpendicular to each other? In geometry, two vectors are perpendicular if and only if their dot product of…

I posted a four-page set of notes on Chebyshev polynomials on my web site this morning. These polynomials have many elegant properties that are simple to prove. They’re also useful in applications. Mr. Chebyshev may have the honor of the…