Post Reply 
[VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier"
04-09-2019, 11:37 PM
Post: #32
RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier"
.
Hi again, all

(04-05-2019 07:40 PM)Albert Chan Wrote:  Below Lua code scale cin argument to [sin(0.5), 0.5], do cin, then undo asin/sin's [...] Result *very* accurate. Example:
x = 2.019
cin(x) = 1.02692 331869 35764
cin(cin(x)) = 0.956628 929996 1186
cin(cin(cin(x))) = 0.90122 698939 98129
math.sin(x)      = 0.90122 698939 98126

Indeed, impressive accuracy ! Thanks a lot for your Lua code, Albert Chan, I hope you'll adapt it to some HP calc's native programming language when you eventually get your hands on one (apart from the HP-12C, that is). Smile

(04-07-2019 04:58 PM)John Keith Wrote:  Though I did not participate in this challenge, I have taken the liberty of adapting Valantin's Albert's programs into RPL with a twist- unlimited precision.[...] The result:
[...]
34070691656272561422194582628271806535540344380151.E-49
[...]
-- Rate of converge increases, only about 56 iterations required to confirm 49 digits.

Yes, it does converge very fast and I love multiprecision computations and results. In fact, I don't understand why HP didn't ever include it in some of its advanced models right from the box (at least double precision as in some SHARP models which would do 20 digits without batting an eyelid.)

Thanks a lot for your interest and your RPL high-precision results, much appreciated.

(04-08-2019 03:36 PM)Albert Chan Wrote:  I posted cin(x) puzzle to the Lua mailing list, and got an elegant solution from Egor Skriptunoff. Taylor coefficients built on the fly, without any need for CAS. Smile
http://lua-users.org/lists/lua-l/2019-04/msg00063.html
[...]
Below code modified a bit for speed, accuracy, and extended cin(x) for tin(x):
[...]
lua> function nest(f,x,n) for i=1,n do x=f(x);print(i, x) end end
lua> nest(egor, 2.019, 2) -- egor = tin
1      0.9894569770589354
2      0.9012269893998129

lua> maclaurin_coefs = maclaurin_of_cin()
lua> nest(egor, 2.019, 3) -- egor = cin
1      1.0269233186935764
2      0.9566289299961186
3      0.9012269893998129

lua> math.sin(2.019)
0.9012269893998126

As I said before, truly excellent accuracy. Also thank you very much for posting my challenge to the Lua forums, for giving me credit for it, and for your outstandingly clear code which also includes an implementation and high-precision results fot the tin(x) function I mentioned in the challenge. Again, really appreciated.

(04-09-2019 06:53 PM)Gerson W. Barbosa Wrote:  
(04-07-2019 04:58 PM)John Keith Wrote:  It can be observed that: [...] LongFloat numbers are not very user-friendly. Smile

They needn't be so.

34070691656272561422194582628271806535540344380151.E-49
[...]
3.4070691656272561422194582628271806535540344380151

Very good effort to increase usability. As you know RPL is not my thing but I can appreciate your ingenuity. Thanks, Gerson.

Best regards to all of you.
V.
.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] Short & Sweet Math Challenge #24: "2019 Spring Special 5-tier" - Valentin Albillo - 04-09-2019 11:37 PM



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