Ralf Hemmecke <[email protected]> writes:

> On 07/05/2010 06:27 PM, Martin Rubey wrote:
>> Ralf Hemmecke<[email protected]>  writes:
>>
>>> Any idea what happens here?
>>>
>>> Don't ask whether that is useful. I just realized that 'sin' is
>>> implemented in UnivariateTaylorSeries if the coefficient domain
>>> satisfies Algebra(Fraction Integer).
>>>
>>> Looks somehow like a bug to me. I have the suspicion that the code to
>>> compute the sine series relies on differentiation and therefore on
>>> CharacteristicZero.
>>
>> No, it should not.
>
> What should it not?

Sorry: my comment was too short and nonsense.  I wanted to say: it
should not rely on differentiation.  However, I overlooked a problem.

> It's a bug. Either it should show me a power series with PF(2)
> coefficients or (if there is none reasonable definition for it,
> sin(x) should be conditional and for PF(2) not available. Either way,
> it's a bug.

You are quite right!  Please accept my apologies.

>> as a *formal* power series (and that's in my opinion
>> what FriCAS deals with) sin makes sense also over PF 2
>
> What's the exact mathematical definition of sin(x) as an element of
> F[[x]] where F=GaloisField(2)?

sin x := sum_{n\geq 0} (-1)^n/(2n+1)! x^(2n+1)

The problem is: the coefficients are undefined over PF p for any p,
since (2p+1)! contains p as a factor... :-(

Same for cos, exp, tan, atanh, atan, asin, tanh, sinh,...

So, I guess the easiest thing is to require characteristic 0 for
TranscendentalFunctionCategory - that's what you suggested, right?

Unfortunately, it seems that we cannot make the exports in TRANFUN
conditional, so I'm afraid that we need to check every constructor that
exports TRANFUN.  Possibly we could raise an error in TRANFUN if it's
called with CharacteristicNonZero, but I do not know whether this works
reliably.  In the code below, calling foo()$Dom1 will raise an error
"hi", but bar()$Dom1 will raise

   Internal Error
   The function bar with signature hashcode is missing from domain Dom1

which is not really better than what we have now...

Sorry again,

Martin

)abbrev category TEST Test
Test(): Category == BasicType with
        foo: () -> %
        bar: () -> %
    add
        if % has CharacteristicNonZero then 
            error "hi"

        if % has Ring then
            foo() == 1$%

)abbrev domain DOM1 Dom1
Dom1(): Exports == Implementation where
    Exports ==> Join(Test, CharacteristicNonZero) with
        hi: () -> %

    Implementation ==> add
        Rep := PrimeField 17
        hi() == 1$PrimeField(17)

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to