code: public static double[] exp(double[] a) {
      double[] result = new double[a.length];
      for (int i = 0; i < a.length; i++) {
        result[i] = Math.exp(a[i]);
      }
      return result;
    }
docs: OPERATIONS ON AN ARRAY - NONDESTRUCTIVE