Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6632 > unrolled thread

Re: Bad Precision output for SphericaBesselY and

Started byOliver Ruebenkoenig <ruebenko@wolfram.com>
First post2011-11-22 12:24 +0000
Last post2011-11-23 12:03 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Bad Precision output for SphericaBesselY and Oliver Ruebenkoenig <ruebenko@wolfram.com> - 2011-11-22 12:24 +0000
    Re: Bad Precision output for SphericaBesselY and Richard Fateman <fateman@cs.berkeley.edu> - 2011-11-23 12:03 +0000

#6632 — Re: Bad Precision output for SphericaBesselY and

FromOliver Ruebenkoenig <ruebenko@wolfram.com>
Date2011-11-22 12:24 +0000
SubjectRe: Bad Precision output for SphericaBesselY and
Message-ID<jag4aa$6n$1@smc.vnet.net>

On Tue, 22 Nov 2011, Antonio Alvaro Ranha Neves 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
>
>
>

Antonio,

you could use exact arithmetic and only later derive the numeric 
quantities.

n = 150
x = 1203/10
BesselY[n + 1/2, x] // Precision
BesselJ[n + 1/2, x] // Precision

N[BesselY[n + 1/2, x], 100] // Precision
N[BesselJ[n + 1/2, x], 100] // Precision

gives a precision of 100. for both.

Oliver

[toc] | [next] | [standalone]


#6636

FromRichard Fateman <fateman@cs.berkeley.edu>
Date2011-11-23 12:03 +0000
Message-ID<jainfc$ees$1@smc.vnet.net>
In reply to#6632
On 11/22/2011 4:24 AM, Oliver Ruebenkoenig wrote:
> On Tue, 22 Nov 2011, Antonio Alvaro Ranha Neves 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
>>
>>
>>
>
> Antonio,
>
> you could use exact arithmetic and only later derive the numeric
> quantities.
>
> n = 150
> x = 1203/10
> BesselY[n + 1/2, x] // Precision
> BesselJ[n + 1/2, x] // Precision
>
> N[BesselY[n + 1/2, x], 100] // Precision
> N[BesselJ[n + 1/2, x], 100] // Precision
>
> gives a precision of 100. for both.
>
> Oliver
>

First of all, you should realize that x is approximately
120.299999999999997157829056959599256515502929687500000000000000000000\
0000000000000000000000000000000

and perhaps you mean
z=SetPrecision[1203/10, 100]  which is
120.300000000000000000000000000000000000000000000000000000000000000000\
0000000000000000000000000000000

The way Mathematica works is that it assumes that all the digits beyond 
100 are garbage, instead of (say) filling with zero.

This means it sometimes operates as if it has insufficient information 
in the input to satisfy your demands for precision in the output.

If you want to find
100 digits in the answer, you could try using exact numbers until the 
last N operation:

N[BesselJ[150+1/2, 1203/10,  100]

Which provides 100 digits of precision.

RJF






[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web