implement dyadic scalar function