2023-09-04 00:01:10 It's a pretty simplie idea - you have some number of basis vectors, and if p of them square to +1 and q of them square to negative one, that's the Clifford algebra Cl(p,q). It's always the case that distinct basis vectors anti-commute: e1*e2 = - e2*e1. Those rules are enough to specify the whole deal. 2023-09-04 00:01:38 Special relativity treats time and space differently, so you can use either Cl(1,3) or Cl(3,1). 2023-09-04 00:02:04 Complex arithmetic is Cl(0,1). 2023-09-04 00:02:27 And quaternion arithmetic is Cl(3,0). 2023-09-04 00:03:19 Wait - maybe that's Cl(0,3). 2023-09-04 00:04:39 Because I think all of the i, j, k gizmos in quaternions square like imaginary numbers. 2023-09-04 00:37:47 The stuff I speculated on earlier - using Newton's method to find quadratic factors of polynomials - that raises the question of the initial guess on each iteration. Newton's method is always subject to trouble if your initial guess is poor. However, there's a trick that can be used generally. Let's say I've got a cubic polynomial ax^3 + bx^2 + cx + d and I'm looking for a quadratic factor x^2 + Ax + B. 2023-09-04 00:37:49 One possibility is to form the modified cubic; 2023-09-04 00:39:16 f*ax^3 + g*bx^2 + cx + d, and initially set f=0 and g=1/b. then use A=c and b=d. For those initial settings of f and g that's an exact solution. 2023-09-04 00:40:09 Now perturb f and g slightly; your candidate quadratic will still be "close," so Newton's method should quickly converge. Then nudge f and g up and repeat. Just keep going until you get f and g set so you've got your full target polynomial "engaged.' 2023-09-04 00:40:39 I think that would entirely solve the initialization problem. 2023-09-04 00:44:12 what I'm scratching my head over now is the best way to get that Jacobian matrix. The brute force way would be to calculate the partial derivatives numerically, but I wonder if the polynomial division algorith could be modified to get an exact calculation of them as an additional result of the division process. 2023-09-04 01:16:36 I just have a feeling that could be slipped in to the division process. I worked through an example, with the cubic main poly and the candidate quadratic above, and was able to write down concise expressions at the end for the partials. I'm sure they'd get more complicated as the main poly order went up, but... this is kind of what computers are for. 2023-09-04 01:17:56 If I were to write it in Python, though, then the main calculation would be in Python, whereas if I use numpy or something the division process would be much faster. It might wind up being more efficient to do that and just accept having to do the partials numerically. 2023-09-04 01:18:36 I'd just have to ru it three times, for (A,B), (A+dA,B), (A,B+dB). 2023-09-04 01:20:23 Of course, the whole point here is really for fun - if I were using Python I'd just have numpy find the roots and be done with it. 2023-09-04 11:57:28 is '.' an alias for some more meaningful word? 2023-09-04 12:03:47 "display n in free field format" according to ANS 2023-09-04 12:07:29 No - it's just the name that got chosen for that, for whatever reason. 2023-09-04 12:07:49 I use . as a "prefix" for a subset of my words, and in that context I attach a particular meaning to it. 2023-09-04 12:08:08 It means "do what the non-prefixed word would do, but hang on to the deepest stack item that would normally be discarded." 2023-09-04 12:09:18 It's useful when you need to test a value against a whole set of comparison cases. = will leave the flag on the stack as normal, and it discards the second argument - the value you compared TO, but it keeps the value you were comapring so you can easily compare it to something else. 2023-09-04 12:09:31 That is, .= would do that. 2023-09-04 12:09:47 No "reason" for the character choice - I just "decided on something." 2023-09-04 12:10:10 But it worked out well with .. which does exactly what . does but keeps the argument. 2023-09-04 12:10:15 That's handy for debugging. 2023-09-04 12:10:25 Just a "peek at the top item" ability. 2023-09-04 12:10:59 and to be clear, there is no intelligence around this in my compiler - they're just names of words. 2023-09-04 12:11:42 Like, if I were to try to type a b .+ in hopes of winding up with a a+b that wouldn't work; it doesn't "figure anything out." 2023-09-04 12:12:51 So, indeed polynomial roots are easy in Python. 2023-09-04 12:12:58 import numpy as np 2023-09-04 12:13:12 np.roots([1, 4, 6, 4]) 2023-09-04 12:13:14 for example. 2023-09-04 12:56:49 KipIngram, i see 2023-09-04 13:00:01 You know, on these calculators that have a limited stack, when you drop the stack the deepest reg will keep its value. So if you fill the stack with a value, you get as many copies of it as you want. It's great for evaluating polynomials - you just fill the stack with x and then iterate on coef + *. 2023-09-04 13:00:45 I just realized, though, that it's not as nice for evaluating a poly's derivative, because you'd at least have to specify the starting exponent, which you don't need to specify for straight evaluation. 2023-09-04 13:00:45 i see 2023-09-04 13:01:56 In case it's not obvious, I'm thinking about doing a DM-42 polynomial package. 2023-09-04 13:03:48 yeah indeed 2023-09-04 13:04:55 On this model every register (RAM and stack) can hold arrays, so I'm thinking of just implementing a polynomial stack. 2023-09-04 13:07:44 KipIngram, what about this syntax: '2 3 4 5 poly4' to represent 2x4 + 3x3 + 4x2 + 5x + 1 ? 2023-09-04 13:07:46 Then I could have a tool that could feed into that by generating the Taylor poly of order whatever from an arbitrary non-linear function. 2023-09-04 13:09:37 That's close to what I was thinking. For getting polys in I was thinking of putting the thing in deep stack mode and then being able to say coef coef ... coef n poly 2023-09-04 13:10:16 Then the native functionality will let me save those arrays in named variables if I want to. 2023-09-04 13:11:30 For the Taylor series thing, I'd put the point I wanted the expansion around in X, run the program taylor, and it would show me a menu of available functions - I'd pick one and it would produce the polynomial. 2023-09-04 13:11:48 Oh, and I'd also specify the order. 2023-09-04 13:12:12 Anyway, I'm in that "thinking" phase of figuring out just how I'd like all the pieces to come together. 2023-09-04 13:12:48 i see 2023-09-04 13:12:54 pre waterfall 2023-09-04 13:14:15 At some point I'd like to write a plotting package too. The display on this calculator is too nice to not have that. 2023-09-04 13:14:43 Unfortunately, I don't think they've got any built in font resources, so I'm not quite sure how I'd get labeling on there. 2023-09-04 13:16:50 Unfortunately there seems to be very little community work on general plotting. The thing is a derivative of the HP-42S, and most of what I find is oriented toward plotting on the IR printer that was available for that one. 2023-09-04 13:23:35 Oh, I take it back. There are some font resources. 2023-09-04 13:44:37 https://www.youtube.com/watch?v=A8DOWgo4oXU 2023-09-04 13:47:43 hmm. I know it can do some simple graphing 2023-09-04 14:06:32 Yeah; it looks like you generate output as alpha strings, with each character specifying an eight-pixel tall, one-pixel wide strip. 2023-09-04 14:06:55 And then there are ways to output the various font characters more directly. 2023-09-04 14:07:00 Looks reasonable. 2023-09-04 14:07:26 A general purpose plotting program will probably be a somewhat big program, but it looks "straightforward." 2023-09-04 14:07:39 like sixels but with eight instead of six? 2023-09-04 14:07:44 Yes, more or less. 2023-09-04 14:13:07 Watching that video it seems reaonably responsive too. This calculator runs at 24 MHz on battery power, and goes up to 80 MHz when on USB. 2023-09-04 14:17:56 how many MIPS? 2023-09-04 14:20:27 or more precisely millions of operations per second 2023-09-04 14:23:55 I don't know - I haven't seen a number for that. 2023-09-04 14:27:35 The guy says that depending on exactly how deep you're trying to go a Mandelbrot rendering can take an hour or more. Of course, that's an entirely open-ended problem, so I could make any system take an hour or more if I pushed it far enough. So they've got some sense of "commonly of interest" built into that. 2023-09-04 14:41:23 It's an ARM Cortex M4F. 2023-09-04 14:41:37 Hey, that's the same processor I have on that little board I'm working with. 2023-09-04 14:43:35 I see a table of various ARM units that gives a DMIPS benchmark; they vary from a bit under to a bit over 1 DMIPS/MHz. 2023-09-04 14:50:40 KipIngram: thats weird. i thought it had a graphing mode like the simple mode on the hp42 2023-09-04 14:53:02 There are other ways of doing graphics. You can control individual pixels too. 2023-09-04 14:53:27 Which would likely be the better way to draw an actual data curve. 2023-09-04 14:53:52 The alpha string method is probably better for drawing grids, backgrounds, etc. 2023-09-04 14:54:11 I do think it has most / all of the old HP-42S functionality. 2023-09-04 14:54:51 It's not an image-faithful emulation of the 42S - no 42S ROM required. It's a "faithful rewrite." 2023-09-04 14:55:05 Rather, that's what Free42 is, and the DM42 uses Free42. 2023-09-04 14:55:30 Apparently it's quite an open platform - you can load other software on there if you've got it. 2023-09-04 15:01:43 ya Free42 is very, very close to the original 2023-09-04 15:04:21 That combined with that 128-bit intel float library, and that's a pretty nice platform. 2023-09-04 15:44:24 Here's a video on re-loading the DM-42 with HP-48GX OS: 2023-09-04 15:44:27 https://www.youtube.com/watch?v=I5jgLzw_0-o 2023-09-04 15:44:39 Don't know if it's precise or just "very similar." 2023-09-04 15:49:22 I don't know if the 42 does this, but the WP-34S supports not only the usual LBL instruction in programs but also has "BACK" and SKIP which jumps a specified distance in the program. You don't have to have a LBL there to receive the jump, and it's much faster since it doesn't have to look for the label. 2023-09-04 15:49:46 Of course, if you edit your program you might have to adjust all of those, but once you have something working well it's a nice way to speed it up. 2023-09-04 18:03:16 Aha. I figured out how to use the alpha mode of the bulk of hte keyboard. There are three alpha modes - the default is the standard HP-42S one that uses the group key followed by the item key. The other two modes use the full keyboard, one mode uppercase one lower. 2023-09-04 18:32:27 I checked my calculator clock again (I last did it six days ago and noted down the exact time I did it). It had gained 16 seconds. I calculated an RTC correction factor and loaded it in. I'll check it again in a week or so. 2023-09-04 19:14:37 https://www.youtube.com/watch?v=ea_ybeslGpA 2023-09-04 19:14:54 ^ More on the HP-48 style firmware for the DM-42. 2023-09-04 19:16:44 MrMobius: You probably ought to watch that. It looks to me like it would make my calculator into the sort of thing you were recommending the other day. 2023-09-04 19:17:00 And you can run both models side-by-side; it's easy to switch back and forth. 2023-09-04 19:19:35 His built-in help system looks particularly nice. You can open help and it will just take you to the pertinent place. 2023-09-04 19:20:19 No separate "program entry" mode - you just put stuff between special brackets that look like single char versions of << and >>; that program item goes onto the stack, and you can save it in a variable. 2023-09-04 19:20:24 Those are then executable. 2023-09-04 19:20:43 Not too different at all from putting your code between : : and ; 2023-09-04 19:21:10 I'll probably want try this out at some point. 2023-09-04 19:27:17 Oh yeah - you definitely want to watch that last video I linked. 2023-09-04 19:35:05 Oh, interesting. His first attempt was to just shove the pieces into the hardware. Free42, the intel library, etc. He ran out of RAM. So now he's about to talk about "starting from scratch." 2023-09-04 19:35:49 I'm already wondering how well I could do using this very compact F18A based Forth. 2023-09-04 19:36:08 And implement everything from scratch. 2023-09-04 19:36:33 how much ram did he have? 2023-09-04 19:50:58 96 kB. 2023-09-04 19:51:22 On the DM42. My docs say I've got about 72 kB for "user stuff." 2023-09-04 19:51:30 As a Forth fan, that seems like a ton to me. 2023-09-04 19:51:55 He's describing his internals - he shares some characteristics with Forth, but it's noT "a Forth." 2023-09-04 19:52:17 Of course, he has to have some degree of typing, so it can't be exactly a Forth. 2023-09-04 19:52:36 But what he's describing seems an awful lot like that typed "Octave like" system I've mused on. 2023-09-04 19:55:48 He uses { ... } for lists, [ ... ] for arrays, " ... " for text, and that << ... >> for code. 2023-09-04 19:56:30 A reference to any type of object can be stored in a cell, so that's where it's like that system I talked about. Any object can sit on the stack. 2023-09-04 19:56:44 I think that's just essential for anything I'd think of as a "scientific" platform. 2023-09-04 19:57:07 I think you just can't be confined to integers as your only true "first class" sort of data. 2023-09-04 19:57:36 When you're working "at the metal" on the system implementation aspects of things, traditional Forth's integer-only approach makes great sense. 2023-09-04 19:57:59 But when you're up at the working application level, I think it needs to be more friendly. 2023-09-04 19:58:18 Forth might give you + for integers, f+ for floating point, etc. 2023-09-04 19:58:44 But on a calculator you only have one + button. So that translates into one function needing to be able to do the right thing to anything you might want to "add." 2023-09-04 20:04:13 I like how he handles the menus. Really takes advantage of all that screen space. And I like his auto-completion. 2023-09-04 20:04:29 MrMobius: You were mentioning that aspect of the 48 a night or two ago. 2023-09-04 20:04:58 Wow - he claims 100x to 1000x the speed of the original calculators. 2023-09-04 20:05:09 Mostly from being on a 32-bit platform instead of a 4-bit Saturn. 2023-09-04 20:06:25 Oh, he supports algebraic expressions as a type as well. That's ' ... ' 2023-09-04 20:07:44 The help system is triggered by pressing and holding a key. So pressing and holding SIN would take you directly to the help section on that function. Nice. 2023-09-04 20:42:05 Mrmobius: Here's his latest update; this video was just posted a week ago. 2023-09-04 20:42:07 https://www.youtube.com/watch?v=nEDGWjpwBv0 2023-09-04 20:46:44 KipIngram: all of this just sounds like the original 48 2023-09-04 20:47:16 I skimmed the video and he seems to be making some firmware from scratch inspired by the 48 from what I can tell 2023-09-04 21:20:53 Yes, my impression is that most of his "work" has been on implementing a leaner system. 2023-09-04 23:29:29 Actually that's a kind of work I enjoy. Taking something conceived by someone else, that I've already gotten to try out and know I like, and make it "better" in some way. Smaller, faster, etc. 2023-09-04 23:30:07 I'm sure that Chuck and his disciples like Jeff Fox would contend that doing it (well) in Forth would make it substantially smaller and simpler. 2023-09-04 23:30:17 That was his general position on such things. 2023-09-04 23:41:54 Somehow they never quite explained, *exactly* where those savings would originate from. 2023-09-04 23:44:13 I feel like part of it is in avoiding having your working data in RAM and moving it to and from the stack on every function call. Forth sort of works with it "in place" in a way that other languages don't. 2023-09-04 23:45:01 Partially at least - sure, you still use @ and !. But you move things in, work with them for "a while" and move them back out - instead of a round trip to the stack on every function call. 2023-09-04 23:46:05 It would be interesting to try to instrument that for various languages - what portion of the effort just involves moving data from one place to another? That seems like it ought to be fairly well quantifiable. 2023-09-04 23:47:52 This F18A architecture doesn't really make calls theselves any more efficient. If you do N calls one after another, that's going to consume N cells. The gain comes from intermingling primitives - very often they'll go right into those same cells, so in that sense many of them are "space free." 2023-09-04 23:48:37 That makes me feel like the compactness advantage of this architecutre will be more pronounced the closer to the metal you are. 2023-09-04 23:49:06 That an assumption, though - I dont have any data to prove it. 2023-09-04 23:54:33 Oh, by hte way, another way of doing graph backgrounds (or parts of it, at least) might be to just load full bitmap images. The grid, that sort of thing. Then label it appropriately, and draw the curve. 2023-09-04 23:55:04 Those would be much more useful bitmaps than these cutesy "off screen" files they've got loaded on the thing. 2023-09-04 23:55:15 Though some of those are pretty neat, actually. 2023-09-04 23:55:27 It rotates through them, every time you turn it off.