def approximateMinmax(interval): if type(interval) is list: return minmax.main(f_str=func, start=interval[0], end=interval[1], degree=deg, precision=precision)
def main(f_str, start, end, degree, precision): alternance = [ start + (end - start) * k / float(degree + 1) for k in range(degree + 2) ] del alternance[0] return minmax.main(f_str, start, end, degree, precision, alternance, pol)
def min_max(): data = json.loads(request.data) start = time.time() result = minmax.main(data['func'].replace('e', str(np.e)), data['start'], data['end'], data['deg'], data['precision']) end = time.time() result['1']['computation_time'] = end - start result['1']['precision'] = data['precision'] return jsonify(result)