Real Function Approximation Around a Point with Taylor Polynomials Using Custom Machine Code
摘要
This paper presents an approach to real function approximation around a point using Taylor polynomials. This approach generates a target-specific machine code using Taylor polynomials of some standard mathematical functions and polynomial arithmetic. Furthermore, it improves performance by eliminating excess function calls and minimizing spatial locality, while modelling the behaviour of approximation error(s). The implementation relies on LLVM for intermediate representation and target-specific machine code generation. Performance benchmarks demonstrate a ~ 50% reduction in evaluation time, measured in clock cycles, compared to GNU C Library implementation. This method is sufficient for optimizing real mathematical functions with known input ranges at compile time, offering potential applications in general-purpose compilers.