LISP to Math formula / Ruby code

My attempt at translating this LISP function is below in post 5


Let us say that this topic would be a follow on from this one …