From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: Fun with Unbounded Rational Numbers Date: Mon, 10 Apr 2017 12:39:24 -0700 Organization: A noiseless patient Spider Message-ID: <87fuhg6oib.fsf@nightsong.com> References: <87zifq831u.fsf@nightsong.com> <87mvbp8el4.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="a3cff8cb11164143d7656bbe7803b502"; logging-data="7841"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18wDBqE5cXdaWpyu0fl2WU1" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:EhITgHnJkCBv0cY3FX6Q/I828dw= sha1:b+Gf4LnrLxd6ySICrtYK4KwODDs= Xref: news.eternal-september.org comp.lang.ada:46567 Date: 2017-04-10T12:39:24-07:00 List-Id: "Jeffrey R. Carter" writes: > As I said in another post, the thing that was taking the time was > subtracting R (2) in the calculation of Y. I'm trying to understand why that caused a bottleneck in the Ada implementation when it didn't with other implementations. > I made some improvements to the addition algorithm Oh, ok, you mean the rational number functions were something you were working on rather than a released library. That makes more sense--there was some kind of algorithmic bug in it that's taken care of now. I'd be interested to know if you get reasonable answers after 10 or 15 iterations. Fwiw, for depth 7, I get: 4946041176255201878775086487573351061418968498177 / 3497379255757941172020851852070562919437964212608 Higher depths get bigger numbers very quickly but I can supply the values if you want to check them against your own implementation.