POLS and names of mathematical functions

Ask a Question related to Ruby, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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"...
    3. 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...
    4. [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* ...
    5. [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...
  3. #2

    Default 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

  4. #3

    Default Re: POLS and names of mathematical functions

    Saluton!

    * Yukihiro Matsumoto; 2003-08-22, 12:12 UTC:
    > |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.
    You possibly misunderstood me. The function names are *not*
    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.
    > Those names show Ruby's respect to the UNIX heritage.
    This answers the question how to apply the POLS in this case. I was
    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

  5. #4

    Default Re: POLS and names of mathematical functions

    Saluton!

    * Yukihiro Matsumoto; 2003-08-23, 14:32 UTC:
    > You possibly misunderstood me.
    I did.
    > 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?

    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

  6. #5

    Default 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

  7. #6

    Default Re: POLS and names of mathematical functions

    Scripsit ille »Daniel Carrera« <dcarrera@math.umd.edu>:
    > > > 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.
    No, they use sin^-1 etc.

    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

  8. #7

    Default Re: POLS and names of mathematical functions

    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.
    > 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.
    > 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.
    Well... I find ATN very surprising for arctan.

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

  9. #8

    Default 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

    > 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?
    Certainly.

    --
    Hal Fulton
    [email]hal9000@hypermetrics.com[/email]


    Hal E. Fulton Guest

  10. #9

    Default Re: POLS and names of mathematical functions

    Scripsit ille »Daniel Carrera« <dcarrera@math.umd.edu>:
    > 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.
    The computer algebra system "maxima" uses the a-prefix method. BTW, it
    also supports cot, acot, coth and acoth. Maple always uses the arc-prefix
    and always has the cot family of functions.
    > > 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.
    The one which is already there.

    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

  11. #10

    Default Re: POLS and names of mathematical functions

    Saluton!

    * 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? 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

  12. #11

    Default Re: POLS and names of mathematical functions

    Scripsit illa aut ille »Josef 'Jupp' Schugt« <jupp@gmx.de>:
    > * 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?
    Yes - it shows that the functions DO have enough in common to be
    treated similarily.
    Rudolf Polzer Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139