I am trying to understand how Houdini generates terrain, but I cannot find the relevant documentation. For example, I am looking for a mathematical description of the algorithms used to calculate terrain erosion and animal path determination.
You can inspect the implementation of the erosion nodes within Houdini.
There are 4 terrain erosion nodes in Houdini 17.5:
Each one of the nodes above is implemented by a Geometry (SOP) network. You can navigate/inspect these node networks in the Network editor.
The screenshots below show an eroded terrain with the top level geometry network that generates it and 2 example nodes you will find inside each of the top level nodes.
The OpenCL Node allows you to write code to implement the node with OpenCL.
The Attribute Wrangle Node contains VEX code that can read and write Houdini geometry attributes.