4 ms·
If your goal is accuracy, you are absolutely correct. But in the instances where I've wanted to implement my own versions of transcendental math functions, accu
by jvranish 15y ago
If your goal is accuracy, you are absolutely correct. But in the instances where I've wanted to implement my own versions of transcendental math functions, accuracy was actually pretty low on my list of priorities. Often just a couple terms of a taylor series was accurate enough, fast, and easy to implement.
- stephencanon 15y agoIt's true regardless of what your goal is (unless your goal is to play with Taylor series approximations). Even if you're going purely for speed, you can often replace a third-order Taylor series with a second-order minimax polynomial, and deliver the same or better accuracy with significantly fewer operations.
- jvranish 15y agoDo you know of good resource for how to compute minimax polynomials that approximate transcendental functions? My Google foo appears to be failing me.
- jeremysalwen 15y agoLook up the remez algorithm
- stephencanon 15y agoThe standard approach to minimax approximations is called the "Remez Exchange Algorithm" (or Remez algorithm, or Remes algorithm). It can be fussy, however, and often requires a knowledgeable user to product good results, which is why Chebyshev and Cathedory-Fejer approximants are often used instead -- they are very nearly as good, and much easier to compute.
- balsam 15y agoMathematica, if you have access to it, can give you the minimax polynomial in one line.
- deleted 15y ago[deleted]