help-octave
[Top][All Lists]

## Re: variable precision arithmetic

 From: Ben Sapp Subject: Re: variable precision arithmetic Date: Fri, 06 Oct 2000 10:46:22 -0600

```Hi Maurice,

At http://www.neutrino.lanl.gov/þbsapp/octave  there is a file called
symbolic.tar.gz.   With some work on your part you can use this to have
variable precision arimthmetic.  First, you will need the bleeding eadge
version of octave,  Bruno Haible's Class library for numbers(CLN) and
GiNaC.(http://www.ginac.de)  Once you have compiled these then you can
use the symbolic.tar.gz package to access some of the functionality of
these programs in Octave.    Here is an example session of using the
numeric class:

GNU Octave, version 2.1.31 (i686-pc-linux-gnu).
Copyright (C) 1996, 1997, 1998, 1999, 2000 John W. Eaton.
This is free software with ABSOLUTELY NO WARRANTY.
For details, type `warranty'.

*** This is a development version of Octave.  Development releases
*** are provided for people who want to help test, debug, and improve
*** Octave.
***
*** If you want a stable, well-tested version of Octave, you should be
*** using one of the stable releases (when this development release
*** was made, the latest stable version was 2.0.16).

octave:1> symbols
installing ex type at type-id = 18
installing sym type at type-id = 19
installing numeric type at type-id = 20
octave:2> digits(100)
octave:3> Pi
ans =

3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067982148
octave:4> 1/numeric(7)
ans =

0.14285714285714285714285714285714285714285714285714285714285714285714285714285714285714285714285714285714285
octave:5> ans*Pi
ans =

0.44879895051282760549466334046850041202816705705358654585356351318683091518374414266114783219173100971173545
octave:6>

The symbolic stuff is pretty unstable.   But, I think if you just use
the variable precision arithmetic it will not crash octave.

Good Luck.

"Janssen MFP (Maurice)" wrote:
>
> Hello,
>
> At this moment my company is using Matlab under Windows NT in combination
> with the Symbolic Math toolbox. We use it only for the vpa routines, because
> we need more digits for solving a numerical problem. At home I have a trial
> version of Matlab for Linux and this toolbox and I found out that Matlab
> runs much better under Linux than under NT (regarding memory usage and total
> running time).
> I'd like to stay with Linux, but my company will not buy me a Linux-version
> of Matlab. I was looking for a replacement and found Octave. It looks really
> good, but wandering through the archives of the list, I couldn't find
> anything about variable precision arithmetic, like the vpa routines in the
> symbolic math toolbox. Is it possible to use more precision in Octave? Maybe
> with Fortran libs or something like that? I have absolutely no experience
> with Fortran, but I am willing to try :-)
>
> Maurice Janssen

--
Ben Sapp                         Los Alamos National Laboratory
Fax:   (505)665-7920             URL:   http://www.neutrino.lanl.gov/
--

-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------

```