[Date Index] [Thread Index] [Author Index]
Re: Bad Precision output for SphericaBesselY and BesselY
On Tue, 22 Nov 2011 10:43:52 -0000, Antonio Alvaro Ranha Neves <aneves at gmail.com> wrote: > Dear users, > > Recently I'm working with precision calculations of spherical functions. > Example, let, > > n = 150 > x = SetPrecision[120.3, 100] > BesselY[n + 1/2, x] // Precision > BesselJ[n+ 1/2, x] // Precision > > > Yields 67.2708 and 96.9297 respectively. The two questions are: > 1) Why does BesselY results in a worse than BesselJ? > 2) How to redefine, BesselY to automatically output a result with a > desired pecision? > > Note: Simply using N[expr,90], does not yield a result of expr with 90 > precision but maintains the same 67.2708. > > Thanks, > Antonio > > Both functions lose precision, and BesselY loses a lot. Why this would be I don't know off-hand as I'm not sure what method these functions use to calculate their outputs. However, the essential problem is that there isn't enough precision in your input. If you try x = SetPrecision[120.3, Infinity] or better x = Rationalize[120.3] then N is able to give you an output with the full 90 digits of precision in both cases.