def hermval(self, x, n_array, tensor=True):
        """
        computes the Hermit polynomial as numpy.polynomial.hermite.hermval
        difference: for values more than sqrt(n_max + 1) * cut_scale, the value is set to zero
        this should be faster and numerically stable

        :param x: array of values
        :param n_array: list of coeffs in H_n
        :param cut_scale: scale where the polynomial will be set to zero
        :return: see numpy.polynomial.hermite.hermval
        """
        if not self._stable_cut:
            return hermite.hermval(x, n_array)
        else:
            n_max = len(n_array)
            x_cut = np.sqrt(n_max + 1) * self._cut_scale
            if isinstance(x, int) or isinstance(x, float):
                if x >= x_cut:
                    return 0
                else:
                    return hermite.hermval(x, n_array)
            else:
                out = np.zeros_like(x)
                out[x < x_cut] = hermite.hermval(x[x < x_cut], n_array, tensor=tensor)
                return out