      static double mp_find(_cimg_math_parser& mp) {
        const int _step = (int)_mp_arg(6), step = _step?_step:-1;
        const ulongT siz = (ulongT)mp.opcode[3];
        longT ind = (longT)(mp.opcode[5]!=_cimg_mp_slot_nan?_mp_arg(5):step>0?0:siz - 1);
        if (ind<0 || ind>=(longT)siz) return -1.;
        const double
          *const ptrb = &_mp_arg(2) + 1,
          *const ptre = ptrb + siz,
          val = _mp_arg(4),
          *ptr = ptrb + ind;

        // Forward search
        if (step>0) {
          while (ptr<ptre && *ptr!=val) ptr+=step;
          return ptr>=ptre?-1.:(double)(ptr - ptrb);
        }

        // Backward search.
        while (ptr>=ptrb && *ptr!=val) ptr+=step;
        return ptr<ptrb?-1.:(double)(ptr - ptrb);
      }
      static double mp_find(_cimg_math_parser& mp) {
        const int _step = (int)_mp_arg(6), step = _step?_step:-1;
        const ulongT siz = (ulongT)mp.opcode[3];
        longT ind = (longT)(mp.opcode[5]!=_cimg_mp_slot_nan?_mp_arg(5):step>0?0:siz - 1);
        if (ind<0 || ind>=(longT)siz) return -1.;
        const double
          *const ptrb = &_mp_arg(2) + 1,
          *const ptre = ptrb + siz,
          val = _mp_arg(4),
          *ptr = ptrb + ind;

         
        if (step>0) {
          while (ptr<ptre && *ptr!=val) ptr+=step;
          return ptr>=ptre?-1.:(double)(ptr - ptrb);
        }

         
        while (ptr>=ptrb && *ptr!=val) ptr+=step;
        return ptr<ptrb?-1.:(double)(ptr - ptrb);
      }