In mathematics, we use superpositions of functions often. Obviously, we can define superpositions of any number of functions, e.g., (h∘g∘f)(x)(h∘g∘f)(x). My question is following -> How to define a superposition binary operator %@% ?
Let's start with a simple example.
sin %@% -pi/4
The above expression returns the value sin(−π/4) when evaluated. I would like to get an implementation of the %@% operator which allows for superposing any finite number of functions like in the following example (please see below). Could you please provide me with the solution without any additional R-packages? It will be very helpful.
tanh %@% exp %@% abs %@% sin %@% -pi/4