Ask a Question related to Ruby, Design and Development.
-
Gordon James Miller #1
Re: POLS and names of mathematical functions
I personally have always seen the use of acosh, asinh, and atanh in
software libraries. It should be quite trivial to just alias the longer
names.
On Thu, 2003-08-21 at 17:44, Josef 'Jupp' Schugt wrote:> Saluton!
>
> Implementing some additional mathematical functions I came across
> acosh, asinh, and atanh. Here the Principle of Least Surprise runs
> into a severe problem.
>
> On the one hand it is not that uncommon to use these names. On the
> other hand mathematicians prefer to call them arcosh, arsinh and
> atanh.
>
> What about allowing for *both* names in later versions of Ruby?
>
> Several names for one method are not that uncommon in Ruby. For a
> hash h the follwing methods are identical:
>
> h.key?
> h.has_key?
> h.include?
> h.member?
>
> Gis,
>
> Josef 'Jupp' Schugt
Gordon James Miller Guest
-
Anyone mathematical?
Are you any good at maths? If so I was wondering if you can come up with a nice formular that I can program in Lingo that will calculate the angle... -
POLS ANT file pattern in Ruby
This is a multi-part message in MIME format. ------=_NextPart_000_094E_01C39585.7A570C60 Content-Type: text/plain; charset="iso-8859-1"... -
POLS ANT file pattern in Ruby<Pine.LNX.4.44.0310181631510.7967-100000@ool-4355dfae.dyn.optonline.net>
Hi -- On Sat, 18 Oct 2003, Robert Dawson wrote: Just eyeballing it, I would expect this assertion to be true. I guess that means I would... -
[PHP] Mathematical differences?!
How could that be?! 1:1 the same code but different outputs? Is this a PHP-bug? :-? *feelin' kinda' smart arsed today, if no one noticed* ... -
[PHP] Help with Mod mathematical function
http://us4.php.net/math The operator you want is % Eg: 5%3 = 2 <desa15@necso.es> wrote in message... -
Yukihiro Matsumoto #2
Re: POLS and names of mathematical functions
Hi,
In message "POLS and names of mathematical functions"
on 03/08/22, "Josef 'Jupp' Schugt" <jupp@gmx.de> writes:
|Implementing some additional mathematical functions I came across
|acosh, asinh, and atanh. Here the Principle of Least Surprise runs
|into a severe problem.
Ah, please stop mentioning POLS whenever your personal expectation is
not satisfied. I'm sick of them.
|On the one hand it is not that uncommon to use these names. On the
|other hand mathematicians prefer to call them arcosh, arsinh and
|atanh.
|
|What about allowing for *both* names in later versions of Ruby?
Those names show Ruby's respect to the UNIX heritage. If you want to
have alias to those functions, submit request with reasons that they
are worth adding lines in the reference manual.
matz.
Yukihiro Matsumoto Guest
-
Josef 'Jupp' Schugt #3
Re: POLS and names of mathematical functions
Saluton!
* Yukihiro Matsumoto; 2003-08-22, 12:12 UTC:You possibly misunderstood me. The function names are *not*> |Implementing some additional mathematical functions I came across
> |acosh, asinh, and atanh. Here the Principle of Least Surprise runs
> |into a severe problem.
>
> Ah, please stop mentioning POLS whenever your personal expectation
> is not satisfied. I'm sick of them.
unexpected to me. arcosh and the like would not be unexpected to me,
either. I was wondering how you did resolve the question which name
to actually use.
This answers the question how to apply the POLS in this case. I was> Those names show Ruby's respect to the UNIX heritage.
aware that Ruby has a UNIX heritage but I did not know that
respecting the UNIX heritage is a design principle Ruby targets at.
Given that it makes no sense to use names for inverse hyperbolic
functions than are different from those used by UNIX. Taking a look
at the local atanh man page I also found out that the names used are
POSIX and ISO 9899 compliant.
Thank you for making me learn something about mathematical functions
under UNIX I didn't know before.
Josef 'Jupp' Schugt
Josef 'Jupp' Schugt Guest
-
Josef 'Jupp' Schugt #4
Re: POLS and names of mathematical functions
Saluton!
* Yukihiro Matsumoto; 2003-08-23, 14:32 UTC:I did.> You possibly misunderstood me.
What about making this explicit in the comp.lang.ruby FAQ's posting> I just wanted you not to mention POLS when you ask/propose
> something, because it's based on your personal background.
guidelines section? Opinions about that?
Gis,
Josef 'Jupp' Schugt
--
LICENSE AGREEMENT: By adding my mail address to your Outlook or
Outlook Express address book you accept paying me 10 EUR for each
message containing malware that I receive from you.
Josef 'Jupp' Schugt Guest
-
Yukihiro Matsumoto #5
Re: POLS and names of mathematical functions
Hi,
In message "Re: POLS and names of mathematical functions"
on 03/08/24, "Josef 'Jupp' Schugt" <jupp@gmx.de> writes:
|> I just wanted you not to mention POLS when you ask/propose
|> something, because it's based on your personal background.
|
|What about making this explicit in the comp.lang.ruby FAQ's posting
|guidelines section? Opinions about that?
Sounds nice, Hal, could you?
matz.
Yukihiro Matsumoto Guest
-
Rudolf Polzer #6
Re: POLS and names of mathematical functions
Scripsit ille »Daniel Carrera« <dcarrera@math.umd.edu>:
No, they use sin^-1 etc.>> >> > > Implementing some additional mathematical functions I came across
> > > acosh, asinh, and atanh. Here the Principle of Least Surprise runs
> > > into a severe problem.
> > >
> > > On the one hand it is not that uncommon to use these names. On the
> > > other hand mathematicians prefer to call them arcosh, arsinh and
> > > atanh.
> > Here (Frankfurt) they're called arcosh or arccosh (I saw both), arcsinh
> > and arctanh. But it may depend on the professor.
> As a mathematecian, I see no problem at all with atanh, asinh, etc.
> Anyone who has used a scientific calculator will be familiar with the
> shorter forms.
SCNR
But I think it's enough to have ONE form for them - one can get used to
it. BASIC for example uses ATN for the arcus tangent. One can even get
used to THAT. And "just put an a in front of the name" is a clear rule.
--
"Windows löschen" fällt m.E. unter die bestimmungsgemässe Nutzung der
Software. Also zulässig. [Holger Lembke in de.soc.recht.marken+urheber]
Rudolf Polzer Guest
-
Daniel Carrera #7
Re: POLS and names of mathematical functions
On Mon, Aug 25, 2003 at 02:42:37AM +0900, Rudolf Polzer wrote:
I've seen both in scientific claculators. I didn't mention sin^-1 because>> > As a mathematecian, I see no problem at all with atanh, asinh, etc.
> > Anyone who has used a scientific calculator will be familiar with the
> > shorter forms.
> No, they use sin^-1 etc.
that's not in the discussion.
What do Maple and Mathematica use? I can't remember, I haven't used those
in years. Perhaps that's who Ruby should be copying.
I think one is enough. Just figure out which is least surprising.> But I think it's enough to have ONE form for them - one can get used to
> it.
Well... I find ATN very surprising for arctan.> BASIC for example uses ATN for the arcus tangent. One can even get
> used to THAT. And "just put an a in front of the name" is a clear rule.
--
Daniel Carrera, Math PhD student at UMD. PGP KeyID: 9AF77A88
.-"~~~"-.
/ O O \ ATTENTION ALL PASCAL USERS:
: s :
\ \___/ / To commemorate the anniversary of Blaise Pascal's
`-.___.-' birth (today) all your programs will run at hals speed.
Daniel Carrera Guest
-
Hal E. Fulton #8
Re: POLS and names of mathematical functions
----- Original Message -----
From: "Yukihiro Matsumoto" <matz@ruby-lang.org>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Sunday, August 24, 2003 3:30 AM
Subject: Re: POLS and names of mathematical functions
Certainly.> Hi,
>
> In message "Re: POLS and names of mathematical functions"
> on 03/08/24, "Josef 'Jupp' Schugt" <jupp@gmx.de> writes:
>
> |> I just wanted you not to mention POLS when you ask/propose
> |> something, because it's based on your personal background.
> |
> |What about making this explicit in the comp.lang.ruby FAQ's posting
> |guidelines section? Opinions about that?
>
> Sounds nice, Hal, could you?
--
Hal Fulton
[email]hal9000@hypermetrics.com[/email]
Hal E. Fulton Guest
-
Rudolf Polzer #9
Re: POLS and names of mathematical functions
Scripsit ille »Daniel Carrera« <dcarrera@math.umd.edu>:
The computer algebra system "maxima" uses the a-prefix method. BTW, it> On Mon, Aug 25, 2003 at 02:42:37AM +0900, Rudolf Polzer wrote:
>>> >> > > As a mathematecian, I see no problem at all with atanh, asinh, etc.
> > > Anyone who has used a scientific calculator will be familiar with the
> > > shorter forms.
> > No, they use sin^-1 etc.
> I've seen both in scientific claculators. I didn't mention sin^-1 because
> that's not in the discussion.
>
> What do Maple and Mathematica use? I can't remember, I haven't used those
> in years. Perhaps that's who Ruby should be copying.
also supports cot, acot, coth and acoth. Maple always uses the arc-prefix
and always has the cot family of functions.
The one which is already there.>> > But I think it's enough to have ONE form for them - one can get used to
> > it.
> I think one is enough. Just figure out which is least surprising.
rpolzer@katsuragi ~ $ irb
irb(main):001:0> Math.atan(17)
=> 1.51204050407917
irb(main):002:0> Math.atanh(17)
Errno::EDOM: Numerical argument out of domain - atanh
from (irb):2:in `atanh'
from (irb):2
Until now tan and tanh don't have much in common, mathematically.
But this makes them nearly the same functions:
irb(main):003:0> require 'complex'
=> true
irb(main):004:0> Math.atanh(17)
=> Complex(0.0588915178281917, 1.5707963267949)
irb(main):005:0> Math.atanh(17 * Complex::I)
=> Complex(0.0, 1.51204050407917)
That makes it obvious that it would be good to use the same prefix for
the inverse functions.
--
|Is there any documentation of the O() notation for Array operations.
The source. ;-) It answers everything (including bugs), except for
"why" part.
[Yukihiro Matsumoto ("Matz") in comp.lang.ruby]
Rudolf Polzer Guest
-
Josef 'Jupp' Schugt #10
Re: POLS and names of mathematical functions
Saluton!
* Rudolf Polzer; 2003-08-25, 12:41 UTC:You mean that> Until now tan and tanh don't have much in common, mathematically.
> But this makes them nearly the same functions:
>
> irb(main):003:0> require 'complex'
> => true
> irb(main):004:0> Math.atanh(17)
> => Complex(0.0588915178281917, 1.5707963267949)
> irb(main):005:0> Math.atanh(17 * Complex::I)
> => Complex(0.0, 1.51204050407917)
>
> That makes it obvious that it would be good to use the same prefix
> for the inverse functions.
sin(Complex::I * x) = Complex::I * sinh(x)
sinh(Complex::I * x) = Complex::I * sin(x)
cos(Complex::I * x) = cosh(x)
cosh(Complex::I * x) = cos(x)
explains why to use the symbols asin, asinh, acos, and acosh? Well,
that's quite obvious if one expresses trigonometric and hyperbolic
functions in terms of complex exponential functions:
sinh(x) = (exp(x) - exp(-x)) / 2
and
sin(x) = (exp(ix) - exp(-ix)) / 2i
If you apply sinh on ix the result obviously is i times that of
sin(x).
Gis,
Josef 'Jupp' Schugt
--
LICENSE AGREEMENT: By adding my mail address to your Outlook or
Outlook Express address book you accept paying me 10 EUR for each
message containing malware that I receive from you.
Josef 'Jupp' Schugt Guest
-
Rudolf Polzer #11
Re: POLS and names of mathematical functions
Scripsit illa aut ille »Josef 'Jupp' Schugt« <jupp@gmx.de>:
Yes - it shows that the functions DO have enough in common to be> * Rudolf Polzer; 2003-08-25, 12:41 UTC:>> > Until now tan and tanh don't have much in common, mathematically.
> > But this makes them nearly the same functions:
> >
> > irb(main):003:0> require 'complex'
> > => true
> > irb(main):004:0> Math.atanh(17)
> > => Complex(0.0588915178281917, 1.5707963267949)
> > irb(main):005:0> Math.atanh(17 * Complex::I)
> > => Complex(0.0, 1.51204050407917)
> >
> > That makes it obvious that it would be good to use the same prefix
> > for the inverse functions.
> You mean that
>
> sin(Complex::I * x) = Complex::I * sinh(x)
> sinh(Complex::I * x) = Complex::I * sin(x)
> cos(Complex::I * x) = cosh(x)
> cosh(Complex::I * x) = cos(x)
>
> explains why to use the symbols asin, asinh, acos, and acosh?
treated similarily.
Rudolf Polzer Guest



Reply With Quote

