This paper presents a principled and practical framework for approximating complex nonlinear functions with "polygonal" (piecewise linear) models. By optimizing both the line segments themselves and where they are placed, the authors provide a roadmap for ultra-fast, high-fidelity function evaluation suitable for real-time systems.
TL;DR
The authors develop a method to linearize continuous nonlinear functions using optimal $L_1$ (absolute error) polygonal models. By strategically placing "knots" where a function's curvature is highest, they achieve significant accuracy gains—often reducing the number of required segments by half compared to standard uniform grids—while enabling lightning-fast evaluation on modern hardware like GPUs.
What Problem Does This Paper Address?
Nonlinear functions are ubiquitous in science and engineering, but they are often computationally expensive to evaluate directly (e.g., exponentials, trigonometric functions). A common solution is to use piecewise linear (PWL) approximations—essentially "connecting the dots" with straight lines.
However, two major challenges remain:
- Where to put the breaks? Most implementations use a uniform grid, which wastes segments on flat parts of a function and fails to capture sharp bends.
- How to fit the lines? Simple interpolation (connecting function values at the endpoints) is easy but rarely provides the "best" fit in terms of total error.
The authors tackle these by seeking the optimal partition and the best $L_1$ approximation, which is more robust than the more common $L_2$ (least squares) approach.
Methods
The paper introduces several key techniques:
- Best $L_1$ Approximation: Instead of simple interpolation, the authors solve for line segments that minimize the total absolute area between the line and the function. They show that the "best" line doesn't necessarily pass through the function's endpoints (see Figure 3: interpolant vs arbitrary line).
- Asymptotic Error Analysis: They derive a tight 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$.
- Error Equalization & Optimal Partitioning: The core innovation is a strategy to place knots so that every segment contributes an equal amount of error. This leads to an optimal knot density proportional to $|f''(x)|^{1/3}$.
- Companding Function: They use a monotonically increasing function $F(x)$ to map a uniform grid into this optimized, non-uniform partition (see Figure 4: suboptimal partition computation).
- GPU Implementation: The authors leverage the fact that GPUs have dedicated hardware for linear interpolation (texture units), making their polygonal models extremely efficient to evaluate in parallel.
Datasets
The method was evaluated on classic mathematical functions that represent common computational burdens:
- Gaussian Function: $f(x) = \exp(-x^2/2)/\sqrt{2\pi}$, representing smooth, bell-shaped data.
- Linear Chirp Function: $f(x) = \sin(10\pi x^2)$, which tests the algorithm's ability to handle rapidly increasing oscillations.
- Seventh-degree Polynomial: Used for initial visualization of the approximation techniques (see Figure 1: polynomial approximation).
Key Insights and Ideas
- The 8/3 Factor: A surprising theoretical result is that the best $L_1$ approximation is asymptotically 2.67 times (8/3) more accurate than a simple linear interpolant for the same number of segments.
- Curvature, not Slope: Knot placement should be driven by the "bendiness" (second derivative) of the function, not its steepness. The $|f''|^{1/3}$ rule provides a precise mathematical recipe for this intuition.
- Hardware Synergy: By using "hat" basis functions (Figure 2: hat basis function), any polygonal function can be represented as a simple sum, which maps perfectly to modern circuit architectures and GPU texture filtering.
Key Results
- Efficiency Gains: For a target $L_1$ error of $10^{-5}$ on a Gaussian function, the optimized $L_1$ model required only 130 segments, whereas a standard uniform interpolant required 254 segments—nearly a 50% reduction in memory and computation.
- Speed: On an NVIDIA GTX 580 GPU, evaluating these approximations took between 7.8 and 211 picoseconds per evaluation, significantly faster than calculating the original nonlinear functions.
- Convergence: The measured errors closely followed the predicted $O(N^{-2})$ convergence rate, confirming the theoretical analysis (see Figure 5: error comparison).
Limitations and Future Work
- Higher Dimensions: The current work is strictly 1D. The authors suggest that extending this "error equalization" logic to multidimensional functions (surfaces and volumes) is a promising but complex next step.
- Constraints: The "best" $L_1$ line might sometimes violate physical constraints (e.g., a function that must remain positive might dip slightly below zero). Incorporating these constraints into the optimization is left for future research.
- Search Overhead: While uniform partitions allow $O(1)$ constant-time lookup, optimized partitions require a binary search ($O(\log N)$). Developing faster search heuristics for specific signal types could further bridge this performance gap.
Summary updated