help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Increasing precision in octave


From: Miroslaw Kwasniak
Subject: Re: Increasing precision in octave
Date: Wed, 25 Jun 2008 11:35:09 +0200
User-agent: Mutt/1.5.9i

On Fri, Jun 20, 2008 at 06:09:23PM +0400, DimitryASuplatov wrote:
> Hello,
> I want to calculate the p-value with high precision. 
> I mean that when I use normal_cdf function I get
> 
> normal_cdf (real(24),m,s)
> ans =  1

Are you sure you need such result?

p=
0.99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999986096078814503

;)

> 
> and "1" is not enough precision for me. I want to see something like
> 0.999999999999999999999888

   p=1-erfc(24/sqrt(2))/2

in octave3 you can use

   p=1-erf_Q(24)

but because erf_Q(24)=1.3904e-127 is so small than 1-1.3904e-127 = 1 
 
 
> How to do that?


If you really need such precision switch to another tool that allow an arbitrary
precision. An example is pari-gp:

? default(realprecision,1000);default(format,"g0.28")
? x=24;y=(erfc(x/sqrt(2))/2)
%49 = 1.390392118549703059565827412 E-127
? x=100;y=(erfc(x/sqrt(2))/2)
%50 = 1.344179076744198305073080167 E-2174



reply via email to

[Prev in Thread] Current Thread [Next in Thread]