The subprogram VARIANCE produces a negative variance. Ho to avoid this bug?

Variances are by definition non-negative.

Variance_Bug.nb (3.61 KB)