Post Reply 
logₓy
01-12-2019, 09:09 PM
Post: #1
logₓy
hi all,

I had cause to work out log₂ of a number today, and was vaguely surprised that I couldn't find it on my calculators, not even as a function, let alone on a key. Nor the more general logₓy.

The WP 34S is to be congratulated for having both on keys, but I can't find either even as a function on my DM42 or HP 50g.

It's trivial to write my own fn for e.g LOGy(x) (e.g. LOG SWAP LOG ÷), but am I missing something?

Cambridge, UK
41CL, DM16, DM42, 30b (WP 34S), 28S, 48GX, 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
01-12-2019, 09:12 PM
Post: #2
RE: logₓy
No, I think it is wanted. The log in different bases are not often used, compared to log_e and log_10 , therefore for other bases you are on your own.

you can contribute here:

http://www.hpmuseum.org/forum/thread-10271.html

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
01-12-2019, 09:45 PM
Post: #3
RE: logₓy
thanks; I've added a comment to that thread.

Cambridge, UK
41CL, DM16, DM42, 30b (WP 34S), 28S, 48GX, 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
01-12-2019, 10:42 PM
Post: #4
RE: logₓy
I was having the opposite problem the other day trying to (somewhat quickly) take the log_10 of some number on a Casio fx-991EX, but the button I was using required an argument for the base and I thought it strange there'd be a button for that but not one for log_10. I did ultimately find it as a shifted function on the (-) key. At the time I thought it interesting that logₓy had its own button but log_10 didn't.
Find all posts by this user
Quote this message in a reply
01-12-2019, 10:49 PM
Post: #5
RE: logₓy
.
Hi,

(01-12-2019 09:09 PM)cdmackay Wrote:  I had cause to work out log₂ of a number today, and was vaguely surprised that I couldn't find it on my calculators, not even as a function, let alone on a key. Nor the more general logₓy.

The HP-71B has several log functions (some in the mainframe and some in various ROMs), including LOG2(X) which admittedly is very handy for all sort of programming tasks.

I also think that the HP-75 had a general Log to any base, not sure if in the mainframa or perhaps in some ROM or other.

V.
Find all posts by this user
Quote this message in a reply
01-13-2019, 12:01 AM
Post: #6
RE: logₓy
thanks both,

(01-12-2019 10:42 PM)Benjer Wrote:  I was having the opposite problem the other day trying to (somewhat quickly) take the log_10 of some number on a Casio fx-991EX, but the button I was using required an argument for the base and I thought it strange there'd be a button for that but not one for log_10. I did ultimately find it as a shifted function on the (-) key. At the time I thought it interesting that logₓy had its own button but log_10 didn't.

yup, it's not even a shifted fn there, but the main key fn.

(01-12-2019 10:49 PM)Valentin Albillo Wrote:  The HP-71B has several log functions (some in the mainframe and some in various ROMs), including LOG2(X) which admittedly is very handy for all sort of programming tasks.

I also think that the HP-75 had a general Log to any base, not sure if in the mainframa or perhaps in some ROM or other.

I'll add one of those to my wish-list Smile

Cambridge, UK
41CL, DM16, DM42, 30b (WP 34S), 28S, 48GX, 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
01-13-2019, 12:40 AM
Post: #7
RE: logₓy
(01-12-2019 09:09 PM)cdmackay Wrote:  It's trivial to write my own fn for e.g LOGy(x) (e.g. LOG SWAP LOG ÷), but am I missing something?


LOGx(y) sounds more natural to me:

« LN XROOT LN »

Shorter, but probably slower.
Find all posts by this user
Quote this message in a reply
01-13-2019, 01:29 AM
Post: #8
RE: logₓy
(01-12-2019 10:49 PM)Valentin Albillo Wrote:  I also think that the HP-75 had a general Log to any base, not sure if in the mainframa or perhaps in some ROM or other.

The HP-75/71 mainframes include:

LOG(X) Base e Log of X
LOG10(X) Base 10 Log of X; 71B can also use LGT(X)


The HP-75/71 MATH ROMs include:

LOG2(X) Base 2 Log of X
LOGA(X,N) Base N Log of X (75 Only)

The 71B also includes LOGP1(X) which is the value of Ln(1+x)


So, pretty complete.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
01-13-2019, 02:13 AM
Post: #9
RE: logₓy
rprosperi Wrote:The HP-75/71 mainframes include:

LOG(X) Base e Log of X
LOG10(X) Base 10 Log of X; 71B can also use LGT(X)

The HP-71B also has LN(X) as an alternate spelling.

Quote:The 71B also includes LOGP1(X) which is the value of Ln(1+x)

So, pretty complete.

Yes, in the HP-71B you have in all six log possibilities, namely LN, LOG, LOG10, LOG2, LOGP1, LGT and if you fancy log to any base you simply define:

10 DEF FNL(X,N)=LN(X)/LN(N)

and then you can use FNL(X,N) as part of any expression in a program, from the command line or in (urg!) CALC mode. Also, creating a new assembly-language keyword LOGA(X,N) in a LEX file is utterly trivial and would take just a few bytes.

V.
.
Find all posts by this user
Quote this message in a reply
01-13-2019, 03:19 AM
Post: #10
RE: logₓy
(01-13-2019 12:40 AM)Gerson W. Barbosa Wrote:  
(01-12-2019 09:09 PM)cdmackay Wrote:  It's trivial to write my own fn for e.g LOGy(x) (e.g. LOG SWAP LOG ÷), but am I missing something?


LOGx(y) sounds more natural to me:

« LN XROOT LN »

Shorter, but probably slower.

nice. I think I'd just have put in an extra SWAP, but yours is more elegant.

Cambridge, UK
41CL, DM16, DM42, 30b (WP 34S), 28S, 48GX, 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
01-13-2019, 08:47 AM
Post: #11
RE: logₓy
(01-13-2019 12:40 AM)Gerson W. Barbosa Wrote:  LOGx(y) sounds more natural to me:

Yes, and I'm glad it is defined this way on the WP34s.

(01-13-2019 12:40 AM)Gerson W. Barbosa Wrote:  « LN XROOT LN »

That's a nice one. And it also works in RPN, e.g. on the 35s.

Dieter
Find all posts by this user
Quote this message in a reply
01-13-2019, 09:11 AM (This post was last modified: 01-13-2019 10:01 AM by pier4r.)
Post: #12
RE: logₓy
(01-13-2019 01:29 AM)rprosperi Wrote:  The HP-75/71 mainframes include:

why is the 75/71 a mainframe? were those not pocket computers?

edit: ah, maybe you mean the basic library without expansion cards.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
01-13-2019, 09:49 AM
Post: #13
RE: logₓy
(01-13-2019 09:11 AM)pier4r Wrote:  why is the 75/71 a mainframe? were those not pocket computers?

Nobody is saying that they are mainframes. They have mainframes.

(01-13-2019 09:11 AM)pier4r Wrote:  edit: a maybe you mean the basic library without expansion cards.

Correct Smile
Find all posts by this user
Quote this message in a reply
01-13-2019, 09:58 AM (This post was last modified: 01-13-2019 03:29 PM by StephenG1CMZ.)
Post: #14
RE: logₓy
A pocket computer has a mainframe?

Like Dr Who's Tardis, I guess - it's bigger on the inside.

It doesn't help that the forums on this site combine calculators and computers, so it's not immediately obvious unless you remember all the model numbers.

Stephen Lewkowicz (G1CMZ)
Visit this user's website Find all posts by this user
Quote this message in a reply
01-13-2019, 10:28 AM
Post: #15
RE:logᵧx
(01-13-2019 12:40 AM)Gerson W. Barbosa Wrote:  LOGx(y) sounds more natural to me:

We write \(\log_b(x)\) and Mathematica uses:
Quote:Log[b,z]
gives the logarithm to base b.

Thus my intuition is to use: logy(x)
Exactly as you suggested.

(01-13-2019 08:47 AM)Dieter Wrote:  Yes, and I'm glad it is defined this way on the WP34s.

No, it's sad it is defined this way on the WP-34s.

Cheers
Thomas
Find all posts by this user
Quote this message in a reply
01-13-2019, 11:07 AM
Post: #16
RE: logₓy
All of the programming languages I used that have log to a specified base, put the base second. I.e. log(x, b).

The 34S did originally calculate logxy, but we changed the arguments around. I have a vague memory that this was to be consistent with yx, but I could be wrong.


Pauli
Find all posts by this user
Quote this message in a reply
01-13-2019, 12:56 PM
Post: #17
RE: logₓy
(01-13-2019 11:07 AM)Paul Dale Wrote:  All of the programming languages I used that have log to a specified base, put the base second. I.e. log(x, b).

The 34S did originally calculate logxy, but we changed the arguments around. I have a vague memory that this was to be consistent with yx, but I could be wrong.

?!? – all 34s versions I ever used calculate logxy. That's also what is shown on the emulator skins.

I remember well the discussion about the argument order. My point is that you usually have a number in X and then you want to calculate the base-x-log of it. For a base-5-log you now simply enter 5 [logxy]. Just as you do it with powers: 5 [yx].

5 [ENTER] 3 [yx] =>125
5 [logxy] => 3

So this is similar to he mentioned log(x, b) function in the programming languages: enter x first, then the base. It's only that in RPN the x-value happens to end up in Y and the base b in X. ;-)

Dieter
Find all posts by this user
Quote this message in a reply
01-13-2019, 07:40 PM
Post: #18
RE: logₓy
I apologise to those who prefer the other ordering/labelling Smile

I don't think I gave it much thought, but my naive thinking involved seeing e.g. log₂ as the function, and I normally use x to denote the input of f(), leaving y as the base.

but I quite see the alternative, especially when you consider it as a function with two arguments, which of course it is.

thanks!

PS and I would normally write x-to-the-y, but it's often y-to-the-x on calculators.

Cambridge, UK
41CL, DM16, DM42, 30b (WP 34S), 28S, 48GX, 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
01-14-2019, 03:57 PM
Post: #19
RE: logₓy
(01-13-2019 11:07 AM)Paul Dale Wrote:  All of the programming languages I used that have log to a specified base, put the base second. I.e. log(x, b).

The 34S did originally calculate logxy, but we changed the arguments around. I have a vague memory that this was to be consistent with yx, but I could be wrong.

FWIW, and adding insult to injury, the SandMath has LOGYX where Y denotes the base and X the argument - blame it to the reverse part of RPN ;-)
Find all posts by this user
Quote this message in a reply
01-15-2019, 06:07 PM
Post: #20
RE: logₓy
In the interests of fairness, I'm pleased to note that the Prime has both a key for logb (the 'C' key's collection of fill-in examples), and a LOG(x, b) function [CAS logb(x, b)].

Cambridge, UK
41CL, DM16, DM42, 30b (WP 34S), 28S, 48GX, 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)