Unfortunately my real inputs are a bit more complicated. They are piecewise linear functions.
Here is one concrete example:
sympy.Piecewise((0, x < 13.15674088), (2.53293291925833, x < 26.15674011), (0, x < 598.1566851), (0.192617824677816, x < 1063.1566411), (0, True))
