double non_expert(const double *array, int len) { double val, tolerance; double *scratch; /* set default tolerance value */ tolerance = 1e-6; /* allocate scratch */ scratch = (double *)malloc((size_t)len); if ( scratch == NULL ) /* error! */ ; val = expert(array,len,tolerance,scratch); /* de-allocate scratch */ free(scratch); return val; }