comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: IDL is not accurate enough!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: IDL is not accurate enough! [message #62177] Thu, 28 August 2008 13:50 Go to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.232081d2b8625528989730@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:

> noahh.schwartz@gmail.com writes:
>
>> I've been having problems with IDL accuracy. I'm trying to perform
>> calculations using the gamma function. The problem is that it grows
>> VERY fast! Performing this calculation in double (namely gamma(x)/
>> gamma(y) with x and y big) yields the result: NaN...
>> Would it be possible to use a program like 'Mathematica' (or any
>> other) and to plug it in my ILD program? Some kind of CALL_EXTERNAL
>> that is to say. If it is possible, how can I do it and what is the
>> best program to use?
>
> It seems *highly* unlikely to me that IDL's implementation
> of DOUBLE is any less accurate than any other program's
> implementation. In fact, this probably has something to
> do with the *computer* and not with the program. :-)

Mathematica can do arbitrary-precision arithmetic ... with hundreds of digits,
if necessary. Don't expect it to be fast, though, as it is all done
in software, not with the hardware floating-point unit with which we
normally do single- and double-precision arithmetic.

Ken
Re: IDL is not accurate enough! [message #62188 is a reply to message #62177] Thu, 28 August 2008 09:42 Go to previous messageGo to next message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 28 Aug 2008, noahh.schwartz@gmail.com wrote:

> Hi,
>
> I've been having problems with IDL accuracy. I'm trying to perform
> calculations using the gamma function. The problem is that it grows
> VERY fast! Performing this calculation in double (namely gamma(x)/
> gamma(y) with x and y big) yields the result: NaN...
> Would it be possible to use a program like 'Mathematica' (or any
> other) and to plug it in my ILD program? Some kind of CALL_EXTERNAL
> that is to say. If it is possible, how can I do it and what is the
> best program to use?
>
> Thanks,
> Noah
>

gamma(x)/gamma(y) => exp(lngamma(x)-lngamma(y))

regards,
lajos
Re: IDL is not accurate enough! [message #62190 is a reply to message #62188] Thu, 28 August 2008 09:35 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
noahh.schwartz@gmail.com writes:

> I've been having problems with IDL accuracy. I'm trying to perform
> calculations using the gamma function. The problem is that it grows
> VERY fast! Performing this calculation in double (namely gamma(x)/
> gamma(y) with x and y big) yields the result: NaN...
> Would it be possible to use a program like 'Mathematica' (or any
> other) and to plug it in my ILD program? Some kind of CALL_EXTERNAL
> that is to say. If it is possible, how can I do it and what is the
> best program to use?

It seems *highly* unlikely to me that IDL's implementation
of DOUBLE is any less accurate than any other program's
implementation. In fact, this probably has something to
do with the *computer* and not with the program. :-)

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: IDL is not accurate enough! [message #62356 is a reply to message #62177] Thu, 04 September 2008 11:46 Go to previous messageGo to next message
rtk is currently offline  rtk
Messages: 22
Registered: September 2008
Junior Member
On Aug 28, 2:50 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
> Mathematica can do arbitrary-precision arithmetic ... with hundreds of digits,
> if necessary. Don't expect it to be fast, though, as it is all done
> in software, not with the hardware floating-point unit with which we
> normally do single- and double-precision arithmetic.

Check on the IDL code contrib site sometime next week. I just
uploaded DLMs that add arbitrary precision floating point as well as
integer and rational types to IDL. These are wrappers on the MPFR and
GMP libraries, respectively. Caveat emptor, but I'll answer emails.
You will need to recompile if using something later than IDL 6.3.
Examples included.

Ron Kneusel
rkneusel@ittvis.com
Re: IDL is not accurate enough! [message #62407 is a reply to message #62356] Mon, 08 September 2008 06:45 Go to previous messageGo to next message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
Ron,
that code sounds interesting. Can you provide me with a direct link to the
page. The new interface is completely unusable for me and search does not
give any results.

Thanks,
Haje


"rtk" <oneelkruns@hotmail.com> wrote in message
news:e32f4688-b58e-4f27-b2f9-17faea24285a@i24g2000prf.google groups.com...
> On Aug 28, 2:50 pm, "Kenneth P. Bowman" <k-bow...@null.edu> wrote:
>> Mathematica can do arbitrary-precision arithmetic ... with hundreds of
>> digits,
>> if necessary. Don't expect it to be fast, though, as it is all done
>> in software, not with the hardware floating-point unit with which we
>> normally do single- and double-precision arithmetic.
>
> Check on the IDL code contrib site sometime next week. I just
> uploaded DLMs that add arbitrary precision floating point as well as
> integer and rational types to IDL. These are wrappers on the MPFR and
> GMP libraries, respectively. Caveat emptor, but I'll answer emails.
> You will need to recompile if using something later than IDL 6.3.
> Examples included.
>
> Ron Kneusel
> rkneusel@ittvis.com
>
Re: IDL is not accurate enough! [message #62511 is a reply to message #62188] Thu, 11 September 2008 07:10 Go to previous message
noahh.schwartz is currently offline  noahh.schwartz
Messages: 10
Registered: February 2008
Junior Member
On 28 août, 18:42, FÖLDY Lajos <fo...@rmki.kfki.hu> wrote:
> On Thu, 28 Aug 2008, noahh.schwa...@gmail.com wrote:
>> Hi,
>
>> I've been having problems with IDL accuracy. I'm trying to perform
>> calculations using the gamma function. The problem is that it grows
>> VERY fast! Performing this calculation in double (namely gamma(x)/
>> gamma(y) with x and y big) yields the result: NaN...
>> Would it be possible to use a program like 'Mathematica' (or any
>> other) and to plug it in my ILD program? Some kind of CALL_EXTERNAL
>> that is to say. If it is possible, how can I do it and what is the
>> best program to use?
>
>> Thanks,
>> Noah
>
> gamma(x)/gamma(y) => exp(lngamma(x)-lngamma(y))
>
> regards,
> lajos


lngamma works fine for my propose! Would you know if an equivalent
function exists for the beselk function? Something like lnbeselk?
beselk(x) for x>709 doesn't seen to work.
If not, I guess that I'll have to wait for the DLMs that add arbitrary
precision floating point...

cheers,
Noah
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Some questions about "axis"
Next Topic: Re: Segmentation in ENVI

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:41:14 PDT 2025

Total time taken to generate the page: 0.00626 seconds