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!feeder.eternal-september.org!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Any good package for mathematical function in Ada? Date: Mon, 1 Jun 2020 13:34:59 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <45af26dc-c35f-4a01-8115-7b30021cc064@googlegroups.com> <835a8c6a-54a8-4157-bcf1-e889d18b1b46@googlegroups.com> NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:58920 Date: 2020-06-01T13:34:59+02:00 List-Id: On 01/06/2020 12:48, Nasser M. Abbasi wrote: > On 6/1/2020 5:19 AM, Dmitry A. Kazakov wrote: > >> The test produces: >> >> J0(1)= 7.65197686557967E-01 > > That is good. In Mathematica > > N[BesselJ[0, 1], 100] > > 0.76519768655796655144971752610266322090927428975532524186154754911927\ > 89122152724401671806000989156340 > > In Maple > > Digits:=100; >                          Digits := 100 > evalf(BesselJ(0,1)) > 0.76519768655796655144971752610266322090927428975532524186154754911927\ > 89122152724401671806000989156340 > > Want 1,000 digits? 2,000 digits? all can be done. In how many microseconds? > I think these systems both link to GMP "GNU Multiple Precision > Arithmetic Library" > for this. "There are no practical limits to the precision " > https://en.wikipedia.org/wiki/GNU_Multiple_Precision_Arithmetic_Library There is no best numerical library as requirements greatly vary. One would probably never want to use multiple precision arithmetic in production code. Less improbable, but still, in laboratory computations when other factors control precision. As for GMP specifically, I think that arbitrary precision numeric types must be an integral part of Ada. Unfortunately, this would introduce same mess Unbounded_String did. So, for now, I would not push for them until the language type system mature to accommodate them smoothly. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de