nip performs two useful optimisations on expressions. First, it finds and removes common sub-expressions in functions. So for example:
if a + b < 12 then a + b else b
will only evaluate a + b once. This can save a lot of time if a or b is a large image.
Second, nip detects arithmetic operations on unsigned char images, and replaces them with look-up tables. For example:
a = vips_image "campin.v" b = a * (a - 1) ** 0.5
Provided campin.v is an 8 bit image image, this expression will evaluate with a single call to im_maplut().