[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] special functions
From: |
Bill Page |
Subject: |
[Axiom-developer] special functions |
Date: |
Tue, 31 Jan 2006 13:04:15 -0500 |
-----Original Message-----
From: Bill Page [mailto:address@hidden
Sent: January 31, 2006 11:44 AM
To: 'Vanuxem GrĂ©gory'
Subject: RE: [Axiom-math] special functions
GrĂ©gory,
On January 31, 2006 6:15 AM you wrote:
>
> I have modified your spad code in SandBoxGamma.
> The problem come from the fact that 1 and 0 are functions.
> I don't really understand why but that's work now.
Thank you! Yes, I think you are right. In this case in SPAD
it appears necessary to distinguish between '1.0' and '1'. As
I understand it in the Axiom interpreter '1.0' is actually
translated as the function 'float(1,0,10)$Domain' and '0.0' as
'float(0,0,10)$Domain' while '1$Domain' is always defined as
the multiplicative identity and '0$Domain' is the additive
identity in any Domain (if it exists). It seems that the SPAD
compiler does not quite get this right without a little more
help.
You were very clever to realize this! :)
> I suggest to change EPS to 1e-15 since it's double and not
> float
>
Yes you are right. For the domain Float the EPS is adjustable so
we really should compute it, perhaps like this:
(1) -> EPS := (10.0^(-digits()$Float))$Float
(1) 0.1 E -19
Type: Float
That's the default value but the precision can be adjusted
for example:
(2) -> digits(400)$Float
(2) 20
Type: PositiveInteger
(3) -> EPS := (10.0^(-digits()$Float))$Float
(3) 0.1 E -399
Type: Float
But the precision of DoubleFloat is fixed by the machine
representation:
(4) -> digits()$DoubleFloat
(4) 15
Type: PositiveInteger
(5) -> (1.0+10.0^(-digits()$DoubleFloat)=1.0)$DoubleFloat
(5) false
Type: Boolean
(6) -> (1.0+10.0^(-digits()$DoubleFloat-1)=1.0)$DoubleFloat
(6) true
Type: Boolean
I have a little more trouble deciding on the value of FPMIN.
In principle in the Float domain there is no minimum floating
point value since the exponent is represented by an arbitrary
precision integer.
In the domain DoubleFloat is seems that FPMIN is approximately:
(7) -> (10.0^-323=0)$DoubleFloat
(7) false
Type: Boolean
(8) -> (10.0^-324=0)$DoubleFloat
(8) true
Type: Boolean
Is there any Axiom function like 'digits' that I could call to
determine this value?
Anyway, I modified the example at
http://wiki.axiom-developer.org/SandBoxGamma
to test these values and they seem to work.
Thanks again.
Regards,
Bill Page.