Waldek Hebisch <[EMAIL PROTECTED]> writes:

> Martin Rubey wrote:
> > (positive) comments welcome... : -)
> > 
> > Martin
> > 
> > PS: RADCAT moved to trigcat, where it belongs.
> > 
> > 
> 
> Concerning description of branch cuts: I am affraid that numeration
> of quadrants is not very canonical, without extra explanation

OK.

> Next, I think that mixing signature lists with tests is a bad idea:
> export list of category should clearly show exports.  Tests add
> almost nothing to description of functions and break continuity of
> export list.  

OK.  A compromise would be to do the tests after a block of exports,
or after the list of exports just before the add.  Would this be
acceptable to you?

> Also, tests test specific domains (mostly Float and DoubleFloat) so
> they are really _not_ connected to category.

(*)

> Actually, descriptions of branch cuts logically do not belog to
> category: asin in Expression INT have _no_ branch cuts -- this asin
> is an element of abstrct field which may be treated as multivalued
> function.  

This is not completely true: we evaluate asin at special values.
Although the special values currently provided (1 and -1) do not
depend on the branch cuts, I don't know whether we want to exclude a
priori special values depending on branch cuts. (although it's
possibly a good idea, not sure right now.)

> More precisely, asin from Expression INT has derivative
> 1/sqrt(1-x^2) while numerical asin with branch cuts has derivative
> which is a distribution (measure) with non-zero singular part.  Due
> to limitation of HyperDoc we have to put documentation of branch
> cuts in the category, but it would make sense to explain that only
> numeric versions have brunch cuts.

I disagree completely with (*), but I agree that I should have
explained.  For a long time, I was unsure where function specific
tests really belong, but I am now convinced that they belong to the
category, where they are declared, if there is such a category.

In my opinion, most operations should be declared in a category - this
is what makes FriCAS strong and easy to use.  Given recent email
exchange about deleting signatures, I think we agree here.  Otherwise
I'm willing to expand.

Thus, the definition in the category should be valid for all domains
that inherit from it.  There may be exceptions, as you noticed (and
I'm grateful that you noticed).

Now, I think it makes sense that the test is placed near (I don't
insist on "next to") to the documentation of the function.  On the one
hand, this helps writing the test, on the other, it may give some
example usage.

It follows, that the tests belong to the category, and should test
*many, if not all* domains that inherit from that category.

I actually intended to add also some tests for power series domains,
but I was low on time.

Bottomline, would the following be OK for you?  (given that I add
tests for other domains in future) If so, I'd like to take it as a
model for other tests...

Martin

<<category ATRIG ArcTrigonometricFunctionCategory>>=
)abbrev category ATRIG ArcTrigonometricFunctionCategory
++ Category for the inverse trigonometric functions
++ Author: ???
++ Date Created: ???
++ Date Last Updated: 14 May 1991
++ Description: Category for the inverse trigonometric functions;
ArcTrigonometricFunctionCategory(): Category == with
    acos: $ -> $       
    ++ acos(x) returns the arc-cosine of x.  When evaluated into some
    ++ subset of the complex numbers, one branch cut for acos lies
    ++ along the negative real axis to the left of -1 (inclusive),
    ++ continuous  with the upper half plane, the other along the
    ++ positive real axis to the right of 1 (inclusive), continuous
    ++ with the lower half plane.
    acot: $ -> $       ++ acot(x) returns the arc-cotangent of x.
    acsc: $ -> $       ++ acsc(x) returns the arc-cosecant of x.
    asec: $ -> $       ++ asec(x) returns the arc-secant of x.
    asin: $ -> $       
    ++ asin(x) returns the arc-sine of x.  When evaluated into some
    ++ subset of the complex numbers, one branch cut for asin lies
    ++ along the negative real axis to the left of -1 (inclusive),
    ++ continuous with the upper half plane, the other along the
    ++ positive real axis to the right of 1 (inclusive), continuous
    ++ with the lower half plane. 
    atan: $ -> $       
    ++ atan(x) returns the arc-tangent of x.  When evaluated into some
    ++ subset of the complex numbers, one branch cut for atan lies 
    ++ along the positive imaginary axis above %i (exclusive), continuous
    ++ with the left half plane, the other along the negative
    ++ imaginary axis below -%i (exclusive) continuous with the right
    ++ half plane.  The domain does not contain %i and -%i.
@
<<TEST branch cuts>>=
testcaseNoClear "acos"
-- upper circle
testCircle(2.0, -%pi, -%pi, -2.0::Complex(FLOAT),  acos$Complex(Float))
testCircle(2.0, -%pi, -%pi, -2.0::Complex(DFLOAT), acos$Complex(DFLOAT))
-- lower circle
testCircle(2.0, -%pi, 0.0, 2.0::Complex(FLOAT),  acos$Complex(Float))
testCircle(2.0, -%pi, 0.0, 2.0::Complex(DFLOAT), acos$Complex(DFLOAT))

testcaseNoClear "asin"
-- upper circle
testCircle(2.0, -%pi, -%pi, -2.0::Complex(FLOAT),  asin$Complex(Float))
testCircle(2.0, -%pi, -%pi, -2.0::Complex(DFLOAT), asin$Complex(DFLOAT))
-- lower circle
testCircle(2.0, -%pi, 0.0, 2.0::Complex(FLOAT),  asin$Complex(Float))
testCircle(2.0, -%pi, 0.0, 2.0::Complex(DFLOAT), asin$Complex(DFLOAT))

testcaseNoClear "atan"
-- right circle
testCircle(2.0, %pi, -%pi/2.0, -2.0*%i::Complex(FLOAT),  atan$Complex(Float))
testCircle(2.0, %pi, -%pi/2.0, -2.0*%i::Complex(DFLOAT), atan$Complex(DFLOAT))
-- left circle
testCircle(2.0, %pi, %pi/2.0, 2.0*%i::Complex(FLOAT),  atan$Complex(Float))
testCircle(2.0, %pi, %pi/2.0, 2.0*%i::Complex(DFLOAT), atan$Complex(DFLOAT))
@
<<TEST singularities>>=
testcaseNoClear "atan"
testLibraryError("atan(%i::Complex Float)")
testLibraryError("atan(-%i::Complex Float)")
testLibraryError("atan(%i::Complex DFLOAT)")
testLibraryError("atan(-%i::Complex DFLOAT)")
testLibraryError("atan(%i)")
testLibraryError("atan(-%i)")
@
<<category ATRIG ArcTrigonometricFunctionCategory>>=
 add


--~--~---------~--~----~------------~-------~--~----~
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