Solved by tom in post #2 
              
              
                You could clip the term somewhere outside the range and then multiply, even if it isn’t the most efficient solution. 
Best regards 
Thomas