code: static double weightedAverage(double x1, double w1, double x2, double w2) {
          if (x1 <= x2) {
              return weightedAverageSorted(x1, w1, x2, w2);
          } else {
              return weightedAverageSorted(x2, w2, x1, w1);
          }
      }
docs: Same as {@link #weightedAverageSorted(double, double, double, double)} but flips
  the order of the variables if <code>x2</code> is greater than
  <code>x1</code>.