At some point, I'll learn CORDIC. But part of me doesn't want to because I don't want the magic ruined. Kinda like Rubik's cubes.
It feels like like a cheat code to calculate complex functions. Like, it shouldn't work at all.
At some point, I'll learn CORDIC. But part of me doesn't want to because I don't want the magic ruined. Kinda like Rubik's cubes.
It feels like like a cheat code to calculate complex functions. Like, it shouldn't work at all.
According to @kenshirriff, the original 8087 uses CORDIC. With all the rounding bullshit that FP arith has to do it surprises me that it's a good fit.
But I also don't understand it well.
@cr1901 @kenshirriff CORDIC has no role in arithmetic, only trig functions. The x87 trig insns have always been useless for implementing decent trig functions. Slower & less accurate than the obvious implementations.
@dalias @kenshirriff Well, @steve deleted his hellsite acct, so context is missing.
https://x.com/cr1901/status/1601969347899133954
But according to my FF History, the correct way to do FP trig functions is arg reduce to +/-pi/4:
https://userpages.cs.umbc.edu/phatak/645/supl/Ng-ArgReduction.pdf
Then do a polynomial approx. Except I remember Steve saying the polynomial shouldn't be a Taylor series for some reason (slow convergence?).
@cr1901 @kenshirriff @steve Yes all that is basically correct.
@steve @cr1901 @kenshirriff What is atan argument reduction? atan isn't periodic.
@dalias @cr1901 @kenshirriff what they said. A few steps of CORDIC still useful for atan(2) argument reduction, more if the only fast operation you have is addition. Otherwise use polynomial approximations everywhere.
@steve @cr1901 @kenshirriff Yes, I didn't immediately realize how that would work for atan but surely there are trig identities or whatnot that should do it, and I guess you apply CORDIC to the inverse functions involved in that.
@dalias @cr1901 @kenshirriff expanding a bit more, I would say argument reduction is any process you use to go from evaluating a function on a larger interval to evaluating a related function on a smaller (in the sense of “computationally easier”) interval.
@dalias @cr1901 @kenshirriff that doesn’t mean you can’t reduce the argument! log and exp aren’t periodic either (at least, not on the real line), and we do argument reduction for them as well.
GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.
All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.