I am unable to forgive the author for the following:
#include <cmath>
#include <stdio.h>
The code looks almost like pure C, but that little `c`...