Special math. functions (erf, erfc, ...)

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Special math. functions (erf, erfc, ...)

Johann Glaser
Hi!

I'm searching for FreePascal implementations of some special
mathematical functions related to statistics like erf, erfc and some
other cumulative probability functions. Did anybody implement such
functions already (e.g. from the Numerical Recipies)?

Is it allowed to use the Numerical Recipies PDF files (e.g.
http://www.nrbook.com/b/bookcpdf/c6-2.pdf) and type ones Pascal program
one-by-one to the printed source code?

Thanks
  Hansi

--
Johann Glaser   <[hidden email]>
   Vienna University of Technology
       Electrical Engineering
____ http://www.johann-glaser.at/ ____

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Florian Klaempfl
Johann Glaser schrieb:

> Hi!
>
> I'm searching for FreePascal implementations of some special
> mathematical functions related to statistics like erf, erfc and some
> other cumulative probability functions. Did anybody implement such
> functions already (e.g. from the Numerical Recipies)?
>
> Is it allowed to use the Numerical Recipies PDF files (e.g.
> http://www.nrbook.com/b/bookcpdf/c6-2.pdf) and type ones Pascal program
> one-by-one to the printed source code?
>

http://www.numerical-recipes.com/infotop.html#distinfo
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Johann Glaser
Hi!

Am Freitag, den 15.12.2006, 21:31 +0100 schrieb Florian Klaempfl:

> Johann Glaser schrieb:
> > Hi!
> >
> > I'm searching for FreePascal implementations of some special
> > mathematical functions related to statistics like erf, erfc and some
> > other cumulative probability functions. Did anybody implement such
> > functions already (e.g. from the Numerical Recipies)?
> >
> > Is it allowed to use the Numerical Recipies PDF files (e.g.
> > http://www.nrbook.com/b/bookcpdf/c6-2.pdf) and type ones Pascal program
> > one-by-one to the printed source code?
> >
>
> http://www.numerical-recipes.com/infotop.html#distinfo

Thanks for pointing this out. So, it is not possible to use the source
code from the PDFs to do anything "useful".

But I found the GNU Scientific Library (GSL) which includes a lot, and
especially some functions I'm seeking for. Did anybody write some
FreePascal bindings for that?

Bye
  Hansi


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

astlab
In reply to this post by Johann Glaser
Hi Hansi,

> I'm searching for FreePascal implementations of some special
> mathematical functions related to statistics like erf, erfc and some
> other cumulative probability functions. Did anybody implement such
> functions already (e.g. from the Numerical Recipies)?

Some functions are available here in the unit ustat.zip:

http://www.polarhome.com/~franco

Franco

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Johann Glaser
Hi!

Am Samstag, den 16.12.2006, 11:30 +0000 schrieb [hidden email]:

> Hi Hansi,
>
> > I'm searching for FreePascal implementations of some special
> > mathematical functions related to statistics like erf, erfc and some
> > other cumulative probability functions. Did anybody implement such
> > functions already (e.g. from the Numerical Recipies)?
>
> Some functions are available here in the unit ustat.zip:
>
> http://www.polarhome.com/~franco

Thanks for the hint! I can now calculate normal distribution and
chiĀ²-distribution. Do you know where I can find documentation on how to
calculate the ciritcal values (i.e. inverse) of students' (t)
distribution, F-distribution and for some non-parametric tests
(Newman-Keuls-test, Cochran-Test, U-Test, ...)

Thanks
  Hansi


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

astlab
Hi Hansi,

> > I'm searching for FreePascal implementations of some special
> > mathematical functions related to statistics like erf, erfc and some
> > other cumulative probability functions. Did anybody implement such
> > functions already (e.g. from the Numerical Recipies)?
>
> Some functions are available here in the unit ustat.zip:
>
> http://www.polarhome.com/~franco
>
> Thanks for the hint! I can now calculate normal distribution and
> chi-distribution. Do you know where I can find documentation on how
> to calculate the ciritcal values (i.e. inverse) of students' (t)
> distribution, F-distribution and for some non-parametric tests
> (Newman-Keuls-test, Cochran-Test, U-Test, ...)

The direct/inverse students' distribution and F-distribution are
in the sources stdtrl.c and fdtrl.c of the Moshier's ldouble C library:

http://www.moshier.net/ldouble.zip

You can read about Cochran and SNK methods in many books, also available
via web. A starting point for statistics resources may be the site

http://home.ubalt.edu/ntsbarsh/Business-stat/R.htm

Franco

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Johann Glaser
Hi!

> The direct/inverse students' distribution and F-distribution are
> in the sources stdtrl.c and fdtrl.c of the Moshier's ldouble C library:
>
> http://www.moshier.net/ldouble.zip
>
> You can read about Cochran and SNK methods in many books, also available
> via web. A starting point for statistics resources may be the site
>
> http://home.ubalt.edu/ntsbarsh/Business-stat/R.htm

Great!

Thanks a lot!

Bye
  Hansi


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Jeff Miller
In reply to this post by Johann Glaser

This is slightly off-topic, but nonetheless somewhat
relevant to these special math functions...

Can anyone explain what is the precision of fpc's
built-in math functions like sqrt, ln, exp, and so on?

According to the online documentation, these take
a ValReal argument and return a ValReal result:
  e.g.:  function sqrt(d: ValReal):ValReal;
But what exactly is a ValReal?  Real? Double? Extended?

It would be ideal if these math functions would take arguments
of different precision and return results in the same precision.
Is that what happens?

I am asking because I need extended precision versions
of sqrt, etc, and I do not believe fpc provides that
(at least by default).  I have seen the mpcalc unit,
but I was hoping for a solution that doesn't involve
a special unit (with special coding).

Thank you for any information or suggestions...

Jeff

[hidden email]


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Jonas Maebe-2

On 17 dec 2006, at 23:40, Jeff Miller wrote:

> This is slightly off-topic, but nonetheless somewhat
> relevant to these special math functions...
>
> Can anyone explain what is the precision of fpc's
> built-in math functions like sqrt, ln, exp, and so on?
>
> According to the online documentation, these take
> a ValReal argument and return a ValReal result:
>   e.g.:  function sqrt(d: ValReal):ValReal;
> But what exactly is a ValReal?  Real? Double? Extended?

The highest supported precision by the compiler on the used fpu. For  
x86 and x86_64 (except for Win64, because it no longer supports the  
x87) that is 80 bits "extended", on other platforms that's currently  
64 bits (except maybe those that use emulation, they may be limited  
to 32 bits).

> It would be ideal if these math functions would take arguments
> of different precision and return results in the same precision.
> Is that what happens?

No, they always return a result with the highest possible  precision.

> I am asking because I need extended precision versions
> of sqrt, etc, and I do not believe fpc provides that
> (at least by default).

It does (on x86 and non-Win64 x86-64 at least).


Jonas
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Special math. functions (erf, erfc, ...)

Alexey Pavluchenko
In reply to this post by Johann Glaser
Hello Johann,

Friday, December 15, 2006, 10:28:04 PM, you wrote:

JG> I'm searching for FreePascal implementations of some special
JG> mathematical functions related to statistics like erf, erfc and some
JG> other cumulative probability functions. Did anybody implement such
JG> functions already (e.g. from the Numerical Recipies)?

http://www.unilim.fr/pages_perso/jean.debord/index.htm

Also check

http://www-rab.larc.nasa.gov/nmp/fNMPhome.htm

--
Best regards,
 Alexey


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal