Adding the "complicated function" from the 100-digit challenge.