Made an AD primitive for smoothing function.