A perfect power, and then?

Niels Möller nisse at lysator.liu.se
Fri Oct 26 15:30:06 CEST 2012


Torbjorn Granlund <tg at gmplib.org> writes:

> I just got a crazy idea.  Compute the logarithm of the number (to a few
> bits of precision, perhaps using table lookup).  Multiply this logarithm
> by k.  Exponentiate using the logbase (again using a small table).
> Conservatively compare to number being investigated.

Clever.

Say, use a base 2 logarithm including an 8-bit fraction, and do both log
and exp as 8-bit table lookups (and some shifts to handle the integral
part of the logarithm).

It's more or less the same way you would do it if you used standard
floating point operations, but with less precision and table lookups.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list