SQL cross join and multiple joins
This SQL, for what it does, is neat, and concise. There is no obvious place where any optimizations can be made. With the data size as small as it is, there is no reason to recommend indexes, or other improvements.

The only glaring issue has been pointed out already: There are tools other than SQL that are designed to do these types of heavy computation with performance that your database just won't beat.

Apart from anything else, the log functions are notoriously hard to get right, and there are multiple 'standards' for implementation.

Consider math libraries designed for data and computations such as this.