Aurel Page on Thu, 19 Sep 2024 12:30:38 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: A missing (?) function: exponentfp(x)


On 19/09/2024 12:24, Ilya Zakharevich wrote:
On Thu, Sep 19, 2024 at 10:39:51AM +0200, Loïc Grenié wrote:
Unfortunately, thinking of this more: no go.  You cannot pass through
a double without a correction of large exponents…

      
    The proposed patch of Aurel passes only the first word of the mantissa
  to log2.
Ah!  Sorry!  Did not pay enough attention (to rootpol.c, of all the places!)

Unfortunately, the complex branch of dbllog2() seems to be majorly
wrong…

Using flog2() wrapper defined earlier in this thread:

      	       flog2delta(x)=flog2(x)-log(abs(x))/log(2);
  (03:01) gp > flog2delta(1+0.0008*I)
  %284 = -4.6166226535255913560320062458846938056 E-7

It seems that somebody wanted to write a Taylor series of order
BYTES_IN_LONG/4 (in 4**(-abs(x-y))/2?), but stopped at writing the 0th
term only…
I was quite puzzled by the complex branch too. But in any case when adding other types we would apply the same recursion for t_COMPLEX as for exponent(), i.e. maximum of result for real and imaginary parts.

Aurel