I should probably also note that xdiv(take(sc(-(k+pn)),p),q,XMFLR) is
not exactly normal division.

In some cases, it's taking the floor after dividing by xbase^x (for some x).

But in other cases (and this seems to be important), it's adding
leading "zeros" which presumably extend the precision of the result
somewhat like multiplying by xbase^x (otherwise 1%q would produce a
zero result).

Anyways, it seems like this should be simple, but I'm still struggling with it.

Thanks,

-- 
Raul

On Thu, Oct 13, 2022 at 1:19 PM Raul Miller <[email protected]> wrote:
>
> On Thu, Oct 13, 2022 at 12:29 PM Henry Rich <[email protected]> wrote:
> > I don't understand the question: what are you trying to compute?  Doesn't
> > gmp support division?
>
> Sure, and mpq_get_d() documented at
> https://gmplib.org/manual/Rational-Conversions fails J's accuracy
> tests, with off-by-least-significant-bit errors.
>
> I've got most of those worked out, but I still fail on this test.
>
> > Knuth has code for division IIRC.
>
> It's not just division, it's the stability of the algorithm when
> discarding precision.
>
> Probably I just need to find a relevant reference on numerical analysis.
>
> Thanks,
>
> --
> Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to