function lerp(a, b, t) {
  return b * t + a * (1 - t);
} 

@@ -18,16 +18,38 @@
 b, t) %7B%0A
+  t = clamp(0, t, 1);%0A
   return
@@ -73,8 +73,214 @@
  t);%0A%7D %0A
+%0Afunction clamp(a, v, b) %7B%0A  return Math.min(b, Math.max(v, a));%0A%7D%0A%0Afunction smoothstep(a, b, t) %7B%0A  t = clamp(0, t, 1);%0A  var v = t * t * t * (t * (t * 6.0 - 15.0) + 10.0);%0A  return b * v + a * (1 - v);%0A%7D%0A

Add more, clamp existing interpolations