Here you can find the source of geometricMean(double... values)
public static double geometricMean(double... values)
//package com.java2s; //License from project: Apache License public class Main { public static double geometricMean(double... values) { return Math.pow(product(values), 1. / values.length); }/*from w w w . j a va 2 s. c om*/ public static double product(double... values) { double sum = 1; for (double v : values) { sum *= v; } return sum; } }