We define some functionality of returning the inverse function here so maybe we should simply depend on https://github.com/JuliaMath/InverseFunctions.jl.