Skip to Main Content
Two simple heuristic algorithms for piecewise-linear approximation of functions of one variable are described. Both use a limit on the absolute value of error and strive to minimize the number of approximating segnents subject to the error limit. The first algorithm is faster and gives satisfactory results for sufficiently smooth functions. The second algorithm is not as fast but gives better approximations for less well-behaved functions. The two algorithms are ilustrated by several examples.