Calculating Hyperbolic Sin faster than using a standard power series












3












$begingroup$


Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.



Thank you very much.










share|cite|improve this question









New contributor




Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$

















    3












    $begingroup$


    Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.



    Thank you very much.










    share|cite|improve this question









    New contributor




    Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.







    $endgroup$















      3












      3








      3





      $begingroup$


      Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.



      Thank you very much.










      share|cite|improve this question









      New contributor




      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.







      $endgroup$




      Using $$ sinh x = x + tfrac{x^3}{3!}+ tfrac{x^5}{5!} + tfrac{x^7}{7!}+ cdots$$ as the Standard Power Series. This series takes a very long time to run. Can it be written without using the exponentials divided by a huge factorial. The example functions in Is there a way to get trig functions without a calculator? using the "Tailored Taylor" series representation for sin and cosine are very fast and give the same answers. I want to use it within my calculator program.



      Thank you very much.







      sequences-and-series trigonometry






      share|cite|improve this question









      New contributor




      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|cite|improve this question









      New contributor




      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|cite|improve this question




      share|cite|improve this question








      edited 3 hours ago









      MPW

      30.5k12157




      30.5k12157






      New contributor




      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 hours ago









      Bill BollingerBill Bollinger

      312




      312




      New contributor




      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Bill Bollinger is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          6












          $begingroup$

          Note that $$sinh x=frac{e^x-e^{-x}}2$$
          So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
          For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.






          share|cite|improve this answer









          $endgroup$





















            0












            $begingroup$

            Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.



            The infinite series is
            $$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.



            But suppose that you write instead
            $$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
            $$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.



            You could use the same trick for most functions expressed as infinite series.






            share|cite|improve this answer









            $endgroup$













              Your Answer





              StackExchange.ifUsing("editor", function () {
              return StackExchange.using("mathjaxEditing", function () {
              StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
              StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
              });
              });
              }, "mathjax-editing");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "69"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });






              Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.










              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3137004%2fcalculating-hyperbolic-sin-faster-than-using-a-standard-power-series%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              6












              $begingroup$

              Note that $$sinh x=frac{e^x-e^{-x}}2$$
              So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
              For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.






              share|cite|improve this answer









              $endgroup$


















                6












                $begingroup$

                Note that $$sinh x=frac{e^x-e^{-x}}2$$
                So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
                For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.






                share|cite|improve this answer









                $endgroup$
















                  6












                  6








                  6





                  $begingroup$

                  Note that $$sinh x=frac{e^x-e^{-x}}2$$
                  So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
                  For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.






                  share|cite|improve this answer









                  $endgroup$



                  Note that $$sinh x=frac{e^x-e^{-x}}2$$
                  So all you need is a fast way to calculate the exponential $e^x$. You can use the regular Taylor series, but that's slow. So you can use the definition $$e^x=lim_{ntoinfty}left(1+frac xnright)^n$$
                  For calculation purposes, use $n$ as a power of $2$, $n=2^k$. You calculate first $y=1+frac x{2^k}$, then you repeat the $y=ycdot y$ operation $k$ times. I've got the idea about calculating the fast exponential from this article.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered 2 hours ago









                  AndreiAndrei

                  12.7k21128




                  12.7k21128























                      0












                      $begingroup$

                      Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.



                      The infinite series is
                      $$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.



                      But suppose that you write instead
                      $$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
                      $$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.



                      You could use the same trick for most functions expressed as infinite series.






                      share|cite|improve this answer









                      $endgroup$


















                        0












                        $begingroup$

                        Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.



                        The infinite series is
                        $$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.



                        But suppose that you write instead
                        $$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
                        $$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.



                        You could use the same trick for most functions expressed as infinite series.






                        share|cite|improve this answer









                        $endgroup$
















                          0












                          0








                          0





                          $begingroup$

                          Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.



                          The infinite series is
                          $$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.



                          But suppose that you write instead
                          $$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
                          $$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.



                          You could use the same trick for most functions expressed as infinite series.






                          share|cite|improve this answer









                          $endgroup$



                          Let me consider the problem from a computing point of view assumin that you do not know how to compute $e^x$.



                          The infinite series is
                          $$sinh(x)=sum_{n=0}^infty frac{x^{2n+1}}{(2n+1)!}$$ If you compute each term independently of the other, for sure, it is expensive since you have to compute each power of $x$ as well as each factorial.



                          But suppose that you write instead
                          $$sinh(x)=sum_{n=0}^infty T_n qquad text{where} qquad T_n=frac{x^{2n+1}}{(2n+1)!}qquad text{and} qquad T_0=x$$ then
                          $$T_{n+1}= frac {t,, T_n}{(2n+2)(2n+3)}qquad text{where} qquad t=x^2$$ This would be much less expensive in terms of basic operations.



                          You could use the same trick for most functions expressed as infinite series.







                          share|cite|improve this answer












                          share|cite|improve this answer



                          share|cite|improve this answer










                          answered 26 mins ago









                          Claude LeiboviciClaude Leibovici

                          123k1157135




                          123k1157135






















                              Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.










                              draft saved

                              draft discarded


















                              Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.













                              Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.












                              Bill Bollinger is a new contributor. Be nice, and check out our Code of Conduct.
















                              Thanks for contributing an answer to Mathematics Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              Use MathJax to format equations. MathJax reference.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3137004%2fcalculating-hyperbolic-sin-faster-than-using-a-standard-power-series%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              SQL Server 17 - Attemping to backup to remote NAS but Access is denied

                              Always On Availability groups resolving state after failover - Remote harden of transaction...

                              Restoring from pg_dump with foreign key constraints