Solver for finding feasible function composition