logₓy
01-12-2019, 09:09 PM
Post: #1
 cdmackay Member Posts: 175 Joined: Sep 2018
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
DM16, DM42, 30b (WP 34S), 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
01-12-2019, 09:12 PM
Post: #2
 pier4r Senior Member Posts: 1,835 Joined: Nov 2014
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:

Wikis are great, Contribute :)
01-12-2019, 09:45 PM
Post: #3
 cdmackay Member Posts: 175 Joined: Sep 2018
RE: logₓy

Cambridge, UK
DM16, DM42, 30b (WP 34S), 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
01-12-2019, 10:42 PM
Post: #4
 Benjer Junior Member Posts: 19 Joined: Apr 2017
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.
01-12-2019, 10:49 PM
Post: #5
 Valentin Albillo Member Posts: 283 Joined: Feb 2015
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.
01-13-2019, 12:01 AM
Post: #6
 cdmackay Member Posts: 175 Joined: Sep 2018
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

Cambridge, UK
DM16, DM42, 30b (WP 34S), 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
01-13-2019, 12:40 AM
Post: #7
 Gerson W. Barbosa Senior Member Posts: 1,103 Joined: Dec 2013
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.
01-13-2019, 01:29 AM
Post: #8
 rprosperi Senior Member Posts: 3,113 Joined: Dec 2013
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
01-13-2019, 02:13 AM
Post: #9
 Valentin Albillo Member Posts: 283 Joined: Feb 2015
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.
.
01-13-2019, 03:19 AM
Post: #10
 cdmackay Member Posts: 175 Joined: Sep 2018
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
DM16, DM42, 30b (WP 34S), 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
01-13-2019, 08:47 AM
Post: #11
 Dieter Senior Member Posts: 2,342 Joined: Dec 2013
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
01-13-2019, 09:11 AM (This post was last modified: 01-13-2019 10:01 AM by pier4r.)
Post: #12
 pier4r Senior Member Posts: 1,835 Joined: Nov 2014
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 :)
01-13-2019, 09:49 AM
Post: #13
 grsbanks Senior Member Posts: 669 Joined: Jan 2017
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
01-13-2019, 09:58 AM (This post was last modified: 01-13-2019 03:29 PM by StephenG1CMZ.)
Post: #14
 StephenG1CMZ Senior Member Posts: 695 Joined: May 2015
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)
01-13-2019, 10:28 AM
Post: #15
 Thomas Klemm Senior Member Posts: 1,317 Joined: Dec 2013
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
01-13-2019, 11:07 AM
Post: #16
 Paul Dale Senior Member Posts: 1,428 Joined: Dec 2013
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
01-13-2019, 12:56 PM
Post: #17
 Dieter Senior Member Posts: 2,342 Joined: Dec 2013
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
01-13-2019, 07:40 PM
Post: #18
 cdmackay Member Posts: 175 Joined: Sep 2018
RE: logₓy
I apologise to those who prefer the other ordering/labelling

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
DM16, DM42, 30b (WP 34S), 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
01-14-2019, 03:57 PM
Post: #19
 Ángel Martin Senior Member Posts: 917 Joined: Dec 2013
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 ;-)
01-15-2019, 06:07 PM
Post: #20
 cdmackay Member Posts: 175 Joined: Sep 2018
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
DM16, DM42, 30b (WP 34S), 50g, 50g (newRPL), Prime G2
various Casio, Rockwell 18R :)
 « Next Oldest | Next Newest »

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