Conversation
Signed-off-by: jcbenoist <61346755+jcbenoist@users.noreply.github.com>
|
@c3d You does not communicate very much. I have resolved conflicts (using existing ToFractionPi), but I had to figure out the problem myself. I'll add the documentation to DFC here, in absence of other instructions. Best regards and all my thanks for this astonishing calculator, anyways. |
|
Go ahead for the doc. I auto generated the release notes and it somehow missed these commands. Sorry. As for not communicating much, I just signed my divorce so my mind was elsewhere and now I am playing catch up. Should improve. |
|
@c3d Oh, so sorry to hear this new. Please don't worry being out of touch; focus on yourself and manage your priorities for the best ! |
|
I noticed based on the commit date that you apparently started working on this a couple of days before I did. Sorry about the duplicate effort. |
|
Reading your documentation, I noticed that you define →Qπ as not expanding logs, etc. However, the HP50G version apparently does. Maybe we need a compatibility flag for that behaviour? |
|
->QPi HP50 documentation is very sparce. I admit I have not fully understood this command, and taken the simplest way. For example, https://literature.hpcalc.org/official/hp50g-aur-en.pdf does not give any advanced examples, and examples given are exactly the results of ->Q. If ln, squares etc. are taken into account, I don't really see differences with XQ. |
|
I usually use the physical device to check when in doubt. Well… '3/4×e' gives me 31072/15241 with both XQ and →Qπ on the HP50G, so 'e' detection is not as strong as on DB48x where it does give me '3/4×e' back. At FIX 6, however, exp(1) is turned into e^1 by both XQ and →Qπ |
|
Anyways, db48x is not a strict emulation. A lot of algorithms (some very complex) are around to transform a real to an algebric expression, and the QPI program used as fondation, is the closer to XQ I know, not too strong, not too weak and not too complex. But other are possible, anf maybe closer to HP50. Your experiences given above shows no real difference between ->QPi and XQ . The difference is unclear. (I have now NewRPL on my HP50g..) |
|
Hey @jcbenoist. Thanks a lot for all the work! I did a quick size comparison between your implementation and the existing one, and the new implementation uses about 4K more code. This is a lot for a single command, given how severely constrained and close to the limit we are on the DM42. Size Comparison: dev vs PR 1652
Summary
Additionally, 22 of your tests pass as is, and the tests that fail are mostly due to formatting differences: XQ Tests: Failures (dev with PR 1652 test suite)
Result: 22 passed, 8 failed (30 total) So my current approach is to take your tests, to understand how to get the |
|
The ROM size is a big concern, I agree, and sometime needs compromizes. Some test cases was chosen to be challenging, and maybe are not representative of the average command usage. sqrt(2)/789 is surprizingly difficult, and I have struggled with this very test case too. BTW : can you orient me toward some other important command implementation, without risks to collide your own work ;) ? |
Based on https://www.hpcalc.org/details/7450 QPI for HP Prime, by Han Duong (HPSolo) and Mika Heiskanen, clauded by Claude Opus 4.6 and orchestred and conducted by me.
Note : I've tried to connect the algorithm to "to_fraction" and "DFC", to save space and have global coherency, but convergence criterions are not the same than in HP Prime QPI algorithm, leading to numerical instabilities. Comments in code explains that.
@c3d By the way : DFC (and DFC2F) was merged in 0.9.16, but not advertised or documented. Do you mind if I add add DFC/DFC2F doc in this PR (in numerics.md ?), and add it to a menu (there is a space left in "NUM" menu)