W3C home > Mailing lists > Public > www-archive@w3.org > December 2003

cwm's tanh builtin

From: Jos De_Roo <jos.deroo@agfa.com>
Date: Tue, 2 Dec 2003 14:09:14 +0100
To: "timbl" <timbl@w3.org>, "connolly" <connolly@w3.org>
Cc: www-archive+n3bugs@w3.org, "Piet Dewaele" <piet.dewaele@agfa.com>
Message-ID: <OFF7687206.20DA9F22-ONC1256DF0.00475554-C1256DF0.0048419F@agfa.be>

Tim, Dan,

While doing some tests with angle measurements I found
different conclusions with cwm than I found with euler.
I simplified the case to a simpler one:

###################################################
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix : <testP#>.

:M :ratio 1.
{:M :ratio ?R. ?R math:tanh ?A} => {:M :angle_rad ?A}.
{:M :angle_rad ?A. ?A math:degrees ?D} => {:M :angle_deg ?D}.
#############################################################

and cwm thought

    :M     :angle_deg 43.636130838093536;
         :angle_rad 0.76159415595576485;
         :ratio 1 .

but euler got

:M :angle_deg [iw:Variable "_:X_2"; = 45.0].


I experimented a bit and got a likewise result with a change
in cwm_trigo.py
__cvsid__ = '$Id: cwm_trigo.py,v 1.10 2003/10/20 17:31:54 timbl Exp $'

line 123
        return tanh(numeric(subj_py))
               ^^^^atan

i.e. cwm then thought

    :M     :angle_deg 45.0;
         :angle_rad 0.78539816339744828;
         :ratio 1 .

This was with Python 2.2.1 - the is running quite well :)

--
Jos De Roo, AGFA http://www.agfa.com/w3c/jdroo/
Received on Tuesday, 2 December 2003 08:09:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:17:37 GMT