function Variance(int[] calldata x, int[] calldata weights, uint8 precision) returns the unbiased weighted sample variance according to the following formula:
i∑wi(xi−mean)2/(sumiwi−1)
Lenghts of x and weights have to be equal. Precision represents the number of decimal places and can be set between 0 and 18. It is applied to x, mean and output.