[Bug 10073] New: Problems with the definitions of the trigonometric functions (math:)

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10073

           Summary: Problems with the definitions of the trigonometric
                    functions (math:)
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
               URL: http://www.w3.org/TR/xpath-functions-11/#trigonometry
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 1.1
        AssignedTo: mike@saxonica.com
        ReportedBy: dnovatchev@gmail.com
         QAContact: public-qt-comments@w3.org


There are a number of problems with the way trigonometric functions are
currently defined in the WD of F&O 1.1:

1. The name of the group of functions. The widely accepted term is
"trigonometric" functions, not "trigonometrical" which is used in section 4.7.

2. The table at the start of section 4.7 in its column "Meaning" specifies the
range of the three reverse trigonometric functions. However the range of the
trigonometric functions (sin(), cos() and tan()) are not specified. Why is this
selectivity?

3. The term "range" is used without specifying if this is closed or semi-closed
or open range.

4. The summary of 4.7.1 for math:pi() states: "Returns the value of the
mathematical constant ð". This is not true. ð is a transcendental number and
its value cannot be expressed as a number with finite number of digits (in any
numerical system), thus its value cannot be returned. We always work wit more
or less *approximation* of pi.

5. Section 4.7.2 math:sqrt states: "Returns the square root of the argument".
This is incorrect, because every positive number has *two* square roots -- a
positive and a negative one. I guess that what the document meant was to return
the positive square root of the argument. Another problem is that sqrt() is not
a trigonometric function at all and should not be defined in section 4.7 (this
has been filed as a separate bug).

6. Unnecessary limitation for the arguments of math:sin(), math:cos() and
math:tan(). In the corresponding sections it is stated that: "If $è is in the
range -2ð to +2ð then the result is the xs:double value ·either side of the
mathematical sine of the angle; if it is outside this range, then the precision
of the result is ·implementation-dependent". It is very unclear how the
interval -2ð to +2ð (closed or open) was chosen. There isn't any technical
problem of calculating the value of these functions with the same accuracy for
any value in the domain of the functions. In case the chosen interval is a hint
for a desired method of implementation, then this is not the best hint. It will
be cumbersome, repetitive, time consuming and error-prone for the users to
always specify their own code that gets the remainder of the argument modulo
2ð.

7. "Either side of". This is defined as: "[Definition] In this section, when
the rules for a function say that the returned value must be the xs:double
either side of some mathematical quantity, then if the mathematical quantity is
precisely representable in the value space of xs:double the exact result must
be returned; otherwise it is acceptable to return either the nearest higher
xs:double or the nearest lower xs:double, and it is ·implementation-dependent·
which of the two is returned". The problem with this is that generally it is
challenging to test if a given returned value is really "the either side of" of
the value of the mathematical function (typically an irrational number).

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Saturday, 3 July 2010 04:37:51 UTC