Abstract
Piecewise linear (PWL) approximations are essential for the real-time evaluation of complex nonlinear functions in science and engineering. This paper introduces a principled framework for generating optimal $L_1$ polygonal models by optimizing both knot placement and line segment fitting. By leveraging asymptotic error analysis, the authors demonstrate that an optimal partition—where knot density is proportional to the cube root of the function's second derivative—significantly reduces the number of segments required for a target accuracy. Combined with hardware-accelerated interpolation on modern GPUs, this approach enables ultra-fast, high-fidelity function evaluation.
Introduction
Nonlinear functions such as exponentials, trigonometric functions, and chirps are computationally expensive to evaluate directly. A common mitigation strategy is to use piecewise linear approximations. However, traditional methods often rely on uniform grids and simple endpoint interpolation, which are inefficient for functions with varying curvature. This paper addresses these challenges by seeking the best $L_1$ (absolute error) approximation and an optimal non-uniform partition, providing a roadmap for high-performance numerical systems.
Methodology
Best $L_1$ Approximation
Unlike standard linear interpolation, which connects function values at the endpoints of an interval, the authors solve for line segments that minimize the total absolute area between the line and the function. This $L_1$ approach is more robust than $L_2$ (least squares) and often yields a better fit for complex curves.
As illustrated in the figure above, the "best" line segment in an $L_1$ sense allows for deviations at the boundaries to minimize the integrated error across the segment. Theoretically, this best $L_1$ approximation is asymptotically 2.67 times (8/3) more accurate than a simple linear interpolant for the same number of segments.
Optimal Partitioning and Error Equalization
To further optimize the model, the authors derive a tight asymptotic error bound showing that for a large number of segments $N$, the error is proportional to the second derivative $|f''|$ and the cube of the segment length $h^3$. To minimize the global error, they employ an "error equalization" strategy: placing knots so that every segment contributes an equal amount of error. This results in an optimal knot density proportional to $|f''(x)|^{1/3}$. A companding function $F(x)$ is used to map a uniform grid into this optimized, non-uniform partition.
Results and Performance
The framework was evaluated on several benchmark functions, including Gaussian distributions and linear chirps. The results confirm that the optimized partitions and $L_1$ fits provide substantial efficiency gains.
As shown in the convergence plot, the measured errors closely follow the predicted $O(N^{-2})$ rate. For a target $L_1$ error of $10^{-5}$ on a Gaussian function, the optimized model required only 130 segments, compared to 254 segments for a standard uniform interpolant—a nearly 50% reduction in memory and computational overhead. Furthermore, implementation on an NVIDIA GTX 580 GPU demonstrated evaluation speeds between 7.8 and 211 picoseconds per call, leveraging dedicated texture filtering hardware for linear interpolation.
Conclusion
This work provides a mathematically rigorous yet practical approach to function linearization. By focusing on curvature-driven knot placement and $L_1$ optimality, the authors achieve significant performance improvements over traditional uniform interpolation. Future research will explore extending this error equalization logic to multidimensional surfaces and incorporating physical constraints into the optimization process.
Summary updated