MDLD/cosine function (R)