News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Fast and precise pow (Rebuilding _libm_sse2_pow_precise)

Started by guga, May 16, 2025, 09:48:42 PM

Previous topic - Next topic

guga

Quote from: InfiniteLoop on May 20, 2025, 09:29:12 AMHave you come full circle? Weren't these approximations done almost 10 years ago on this very forum?

It is straight forward enough to generate the Chebyshev coefficients using simultaneous linear equations. I have no idea what those integer numbers are for.  Pow needs log2(x) and 2^x.







Hi InfiniteLoop

Yeah, i could use Chebyshev coefs. Siekmanski has some excellent material on it. But...i want to understand precisely how those numbers in M$ dll were generated. This will grant precision up to the 19th digit. Currently, i fixed the Log part of the function, extending the precision to the 18th to 19th digit. But, when it tries to finishes (calculating the exp), then it starts loosing precision (fall to 16th or 17th for some unknown reason).

The values in the tables used by M$ are scaled with some unknown method. And this method i´m trying to identify to avoid using huge tables containing more than 130.000 values (That are the values i´m using to grant precision). But, if i couldn't´t figure it out what mathematical equation was using on M$ library, i´ll have no other way, except using those tables. Even in M$ it looses precision. What i´m trying to do is grant the same precision (or closer as possible) to the values returned in wolframalpha.

To extend precision is necessary a huge look up table (I´m using it right now), but still i need to fix the rest of the code that calculates the exp of a number to then apply on the pow function. I´m coming up with a solution, but i´m fixing now other function i created to better visualizes the numbers on that tables.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

Quote from: jack on May 20, 2025, 01:23:55 AMguga
ask your favorite AI can you explain how the LUT are computed using the "Harmonized Parabolic Synthesis" for the power function?

ChatGPT session


I already did, but neither of them are able to find the exact mathematical equation used to scale the values of the tables in M$ library (Which also looses precision, btw). I found out how one of the tables were created, but the others are still a mystery. I´m coming up with a solution, using another table. (I hope)
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com