# HP Forums

Full Version: X^Y on the Elektronika B3-19M
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The Elektronika B3-19M has a 3 level stack (x, y, z). It has an X^Y function that works as expected. The result is identical to pressing 'ln', '*', 'e^x'. What puzzles me is, that the later leves the z register intact an duplicates its contents into y (as expected), while the dedicated 'x^y' places ln10 in both z and y register. The manual says that z is lost, but I have no idea what ln10 might be used for in calculating x^y.

Any thoughts?

Cheers,
Harald
That is very strange.
Perhaps work of Moose and Squirrel?
Is meant to confuse! The result of "x^y" differs slightly from the result of "ln"+"*"+"e^x" (unlike B3-21, B3-34!). E. g., 8 | 8 x^y gives 16777188, 8 | 8 ln * e^x gives 16777173. But the same operation with DECIMAL logarithms (8 | 8 lg * | 10 ln * e^x) gives 16777188. Most probably it uses a similar algorithm, directly placing ln(10) in Z.
(08-07-2018 05:23 PM)watchmaker Wrote: [ -> ]The result of "x^y" differs slightly from the result of "ln"+"*"+"e^x" (unlike B3-21, B3-34!). E. g., 8 | 8 x^y gives 16777188, 8 | 8 ln * e^x gives 16777173. But the same operation with DECIMAL logarithms (8 | 8 lg * | 10 ln * e^x) gives 16777188. Most probably it uses a similar algorithm, directly placing ln(10) in Z.

Thanks for the hint, that is interesting!
So the result is a bit closer to the correct 16777216. I still wonder why you would make the calculation more complicated and loose a register for this minor improvement.
But I guess that is what they must have done.

Cheers,
Harald
(08-07-2018 05:23 PM)watchmaker Wrote: [ -> ]The result of "x^y" differs slightly from the result of "ln"+"*"+"e^x" (unlike B3-21, B3-34!). E. g., 8 | 8 x^y gives 16777188, 8 | 8 ln * e^x gives 16777173. But the same operation with DECIMAL logarithms (8 | 8 lg * | 10 ln * e^x) gives 16777188. Most probably it uses a similar algorithm, directly placing ln(10) in Z.

Perhaps ln(10) is needed to reduce argument for exp(x), for speed and accuracy.

ln(8 ^ 8) = 8 ln(8) = 16.63553233 = 7 ln(10) + 0.517436682

8^8 = 10^7 * exp(0.517436682) = 10^7 * 1.6777216
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :