What algorithm do scientific calculators use to calculate Logarithms

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












I have been introduced to numerical analysis and have been researching quite a bit on its applications recently. One specific application would be the scientific calculator.



From the information that I found, computers typically use the Taylor Series to compute trigonometric problems and calculators would usually take a different approach and use the CORDIC algorithm to compute such problems, including hyperbolic, inverse trigo, square roots etc.



However, how would they calculate logarithmic problems? I couldn't really find any information about this and was hoping someone would point me in the right direction or provide any insights on what kind of algorithms are used is such calculations.



Thanks in advance.







share|cite|improve this question























    up vote
    2
    down vote

    favorite
    1












    I have been introduced to numerical analysis and have been researching quite a bit on its applications recently. One specific application would be the scientific calculator.



    From the information that I found, computers typically use the Taylor Series to compute trigonometric problems and calculators would usually take a different approach and use the CORDIC algorithm to compute such problems, including hyperbolic, inverse trigo, square roots etc.



    However, how would they calculate logarithmic problems? I couldn't really find any information about this and was hoping someone would point me in the right direction or provide any insights on what kind of algorithms are used is such calculations.



    Thanks in advance.







    share|cite|improve this question





















      up vote
      2
      down vote

      favorite
      1









      up vote
      2
      down vote

      favorite
      1






      1





      I have been introduced to numerical analysis and have been researching quite a bit on its applications recently. One specific application would be the scientific calculator.



      From the information that I found, computers typically use the Taylor Series to compute trigonometric problems and calculators would usually take a different approach and use the CORDIC algorithm to compute such problems, including hyperbolic, inverse trigo, square roots etc.



      However, how would they calculate logarithmic problems? I couldn't really find any information about this and was hoping someone would point me in the right direction or provide any insights on what kind of algorithms are used is such calculations.



      Thanks in advance.







      share|cite|improve this question











      I have been introduced to numerical analysis and have been researching quite a bit on its applications recently. One specific application would be the scientific calculator.



      From the information that I found, computers typically use the Taylor Series to compute trigonometric problems and calculators would usually take a different approach and use the CORDIC algorithm to compute such problems, including hyperbolic, inverse trigo, square roots etc.



      However, how would they calculate logarithmic problems? I couldn't really find any information about this and was hoping someone would point me in the right direction or provide any insights on what kind of algorithms are used is such calculations.



      Thanks in advance.









      share|cite|improve this question










      share|cite|improve this question




      share|cite|improve this question









      asked Aug 6 at 5:06









      Wei Xiong Yeo

      987




      987




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          Modern Computer Arithmetic suggests using an arithmetic-geometric mean algorithm. I'm not sure if this approach is meant for the low amount of precision one typically works with or if its meant for calculation in very high precision.




          Another approach is to observe that the Taylor series for $ln(x)$ is efficient if $x$ is very close to $1$. We can use algebraic identities to reduce the general case to this special case.



          One method is to use the identity



          $$ ln(x) = 2 ln(sqrtx)$$



          to reduce the calculation of $ln(x)$ to that of an argument closer to 1. We could use a similar identity for more general radicals if we can compute those efficiently.



          By iteratively taking roots until we get an argument very close to $1$, we can reduce to



          $$ ln(x) = m ln(sqrt[m]x)$$



          which can be computed by the Taylor series.




          If you store numbers in mantissa-exponent form in base 10, an easy identity to exploit is



          $$ ln(m cdot 10^e) = e ln(10) + ln(m)$$



          so the plan is to precompute the value of $ln(10)$, and then use another method to obtain $ln(m)$, where $m$ is not large or small.



          A similar identity holds in base 2, which a computer is likely to use.




          A way to use lookup tables to accelerate the calculation of $ln(x)$ when $x$ is not large or small is to observe that



          $$ ln(x) = ln(k) + ln(x/k) $$



          The idea here is that you store a table of $ln(k)$ for enough values of $k$ so that you can choose the $k$ nearest $x$ to make $x/k$ very near $1$, and then all that's left is to compute $ln(x/k)$.






          share|cite|improve this answer






























            up vote
            3
            down vote













            The Handbook of Mathematical Functions by Abramowitz and Stegun, National Bureau of Standards Applied Mathematics Series 55 (which is available for free on-line), lists several polynomial approximations to the natural logarithm function in formulas 4.1.41 through 4.1.44. The Handbook says these approximations are from C. Hastings Jr., Approximations for digital computers. The most accurate of the formulas, 4.1.44, reads



            $$ln(1+x)=a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8 + epsilon(x)$$
            for $0 le x le 1$ with $| epsilon(x) | le 3 times 10 ^-8$, where
            $$beginalign
            a_1 &= .99999 ;64239 \
            a_2 &= -.49987 ;41238 \
            a_3 &= .33179 ;90258 \
            a_4 &= -.24073 ;38084 \
            a_5 &= .16765 ;40711 \
            a_6 &= -.09532 ;93897 \
            a_7 &= .03608 ;84937 \
            a_8 &= -.00645 ;35422
            endalign$$






            share|cite|improve this answer





















              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',
              convertImagesToLinks: true,
              noModals: false,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              noCode: true, onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              );



              );








               

              draft saved


              draft discarded


















              StackExchange.ready(
              function ()
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2873604%2fwhat-algorithm-do-scientific-calculators-use-to-calculate-logarithms%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              4
              down vote



              accepted










              Modern Computer Arithmetic suggests using an arithmetic-geometric mean algorithm. I'm not sure if this approach is meant for the low amount of precision one typically works with or if its meant for calculation in very high precision.




              Another approach is to observe that the Taylor series for $ln(x)$ is efficient if $x$ is very close to $1$. We can use algebraic identities to reduce the general case to this special case.



              One method is to use the identity



              $$ ln(x) = 2 ln(sqrtx)$$



              to reduce the calculation of $ln(x)$ to that of an argument closer to 1. We could use a similar identity for more general radicals if we can compute those efficiently.



              By iteratively taking roots until we get an argument very close to $1$, we can reduce to



              $$ ln(x) = m ln(sqrt[m]x)$$



              which can be computed by the Taylor series.




              If you store numbers in mantissa-exponent form in base 10, an easy identity to exploit is



              $$ ln(m cdot 10^e) = e ln(10) + ln(m)$$



              so the plan is to precompute the value of $ln(10)$, and then use another method to obtain $ln(m)$, where $m$ is not large or small.



              A similar identity holds in base 2, which a computer is likely to use.




              A way to use lookup tables to accelerate the calculation of $ln(x)$ when $x$ is not large or small is to observe that



              $$ ln(x) = ln(k) + ln(x/k) $$



              The idea here is that you store a table of $ln(k)$ for enough values of $k$ so that you can choose the $k$ nearest $x$ to make $x/k$ very near $1$, and then all that's left is to compute $ln(x/k)$.






              share|cite|improve this answer



























                up vote
                4
                down vote



                accepted










                Modern Computer Arithmetic suggests using an arithmetic-geometric mean algorithm. I'm not sure if this approach is meant for the low amount of precision one typically works with or if its meant for calculation in very high precision.




                Another approach is to observe that the Taylor series for $ln(x)$ is efficient if $x$ is very close to $1$. We can use algebraic identities to reduce the general case to this special case.



                One method is to use the identity



                $$ ln(x) = 2 ln(sqrtx)$$



                to reduce the calculation of $ln(x)$ to that of an argument closer to 1. We could use a similar identity for more general radicals if we can compute those efficiently.



                By iteratively taking roots until we get an argument very close to $1$, we can reduce to



                $$ ln(x) = m ln(sqrt[m]x)$$



                which can be computed by the Taylor series.




                If you store numbers in mantissa-exponent form in base 10, an easy identity to exploit is



                $$ ln(m cdot 10^e) = e ln(10) + ln(m)$$



                so the plan is to precompute the value of $ln(10)$, and then use another method to obtain $ln(m)$, where $m$ is not large or small.



                A similar identity holds in base 2, which a computer is likely to use.




                A way to use lookup tables to accelerate the calculation of $ln(x)$ when $x$ is not large or small is to observe that



                $$ ln(x) = ln(k) + ln(x/k) $$



                The idea here is that you store a table of $ln(k)$ for enough values of $k$ so that you can choose the $k$ nearest $x$ to make $x/k$ very near $1$, and then all that's left is to compute $ln(x/k)$.






                share|cite|improve this answer

























                  up vote
                  4
                  down vote



                  accepted







                  up vote
                  4
                  down vote



                  accepted






                  Modern Computer Arithmetic suggests using an arithmetic-geometric mean algorithm. I'm not sure if this approach is meant for the low amount of precision one typically works with or if its meant for calculation in very high precision.




                  Another approach is to observe that the Taylor series for $ln(x)$ is efficient if $x$ is very close to $1$. We can use algebraic identities to reduce the general case to this special case.



                  One method is to use the identity



                  $$ ln(x) = 2 ln(sqrtx)$$



                  to reduce the calculation of $ln(x)$ to that of an argument closer to 1. We could use a similar identity for more general radicals if we can compute those efficiently.



                  By iteratively taking roots until we get an argument very close to $1$, we can reduce to



                  $$ ln(x) = m ln(sqrt[m]x)$$



                  which can be computed by the Taylor series.




                  If you store numbers in mantissa-exponent form in base 10, an easy identity to exploit is



                  $$ ln(m cdot 10^e) = e ln(10) + ln(m)$$



                  so the plan is to precompute the value of $ln(10)$, and then use another method to obtain $ln(m)$, where $m$ is not large or small.



                  A similar identity holds in base 2, which a computer is likely to use.




                  A way to use lookup tables to accelerate the calculation of $ln(x)$ when $x$ is not large or small is to observe that



                  $$ ln(x) = ln(k) + ln(x/k) $$



                  The idea here is that you store a table of $ln(k)$ for enough values of $k$ so that you can choose the $k$ nearest $x$ to make $x/k$ very near $1$, and then all that's left is to compute $ln(x/k)$.






                  share|cite|improve this answer















                  Modern Computer Arithmetic suggests using an arithmetic-geometric mean algorithm. I'm not sure if this approach is meant for the low amount of precision one typically works with or if its meant for calculation in very high precision.




                  Another approach is to observe that the Taylor series for $ln(x)$ is efficient if $x$ is very close to $1$. We can use algebraic identities to reduce the general case to this special case.



                  One method is to use the identity



                  $$ ln(x) = 2 ln(sqrtx)$$



                  to reduce the calculation of $ln(x)$ to that of an argument closer to 1. We could use a similar identity for more general radicals if we can compute those efficiently.



                  By iteratively taking roots until we get an argument very close to $1$, we can reduce to



                  $$ ln(x) = m ln(sqrt[m]x)$$



                  which can be computed by the Taylor series.




                  If you store numbers in mantissa-exponent form in base 10, an easy identity to exploit is



                  $$ ln(m cdot 10^e) = e ln(10) + ln(m)$$



                  so the plan is to precompute the value of $ln(10)$, and then use another method to obtain $ln(m)$, where $m$ is not large or small.



                  A similar identity holds in base 2, which a computer is likely to use.




                  A way to use lookup tables to accelerate the calculation of $ln(x)$ when $x$ is not large or small is to observe that



                  $$ ln(x) = ln(k) + ln(x/k) $$



                  The idea here is that you store a table of $ln(k)$ for enough values of $k$ so that you can choose the $k$ nearest $x$ to make $x/k$ very near $1$, and then all that's left is to compute $ln(x/k)$.







                  share|cite|improve this answer















                  share|cite|improve this answer



                  share|cite|improve this answer








                  edited Aug 6 at 6:12


























                  answered Aug 6 at 5:47









                  Hurkyl

                  108k9112253




                  108k9112253




















                      up vote
                      3
                      down vote













                      The Handbook of Mathematical Functions by Abramowitz and Stegun, National Bureau of Standards Applied Mathematics Series 55 (which is available for free on-line), lists several polynomial approximations to the natural logarithm function in formulas 4.1.41 through 4.1.44. The Handbook says these approximations are from C. Hastings Jr., Approximations for digital computers. The most accurate of the formulas, 4.1.44, reads



                      $$ln(1+x)=a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8 + epsilon(x)$$
                      for $0 le x le 1$ with $| epsilon(x) | le 3 times 10 ^-8$, where
                      $$beginalign
                      a_1 &= .99999 ;64239 \
                      a_2 &= -.49987 ;41238 \
                      a_3 &= .33179 ;90258 \
                      a_4 &= -.24073 ;38084 \
                      a_5 &= .16765 ;40711 \
                      a_6 &= -.09532 ;93897 \
                      a_7 &= .03608 ;84937 \
                      a_8 &= -.00645 ;35422
                      endalign$$






                      share|cite|improve this answer

























                        up vote
                        3
                        down vote













                        The Handbook of Mathematical Functions by Abramowitz and Stegun, National Bureau of Standards Applied Mathematics Series 55 (which is available for free on-line), lists several polynomial approximations to the natural logarithm function in formulas 4.1.41 through 4.1.44. The Handbook says these approximations are from C. Hastings Jr., Approximations for digital computers. The most accurate of the formulas, 4.1.44, reads



                        $$ln(1+x)=a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8 + epsilon(x)$$
                        for $0 le x le 1$ with $| epsilon(x) | le 3 times 10 ^-8$, where
                        $$beginalign
                        a_1 &= .99999 ;64239 \
                        a_2 &= -.49987 ;41238 \
                        a_3 &= .33179 ;90258 \
                        a_4 &= -.24073 ;38084 \
                        a_5 &= .16765 ;40711 \
                        a_6 &= -.09532 ;93897 \
                        a_7 &= .03608 ;84937 \
                        a_8 &= -.00645 ;35422
                        endalign$$






                        share|cite|improve this answer























                          up vote
                          3
                          down vote










                          up vote
                          3
                          down vote









                          The Handbook of Mathematical Functions by Abramowitz and Stegun, National Bureau of Standards Applied Mathematics Series 55 (which is available for free on-line), lists several polynomial approximations to the natural logarithm function in formulas 4.1.41 through 4.1.44. The Handbook says these approximations are from C. Hastings Jr., Approximations for digital computers. The most accurate of the formulas, 4.1.44, reads



                          $$ln(1+x)=a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8 + epsilon(x)$$
                          for $0 le x le 1$ with $| epsilon(x) | le 3 times 10 ^-8$, where
                          $$beginalign
                          a_1 &= .99999 ;64239 \
                          a_2 &= -.49987 ;41238 \
                          a_3 &= .33179 ;90258 \
                          a_4 &= -.24073 ;38084 \
                          a_5 &= .16765 ;40711 \
                          a_6 &= -.09532 ;93897 \
                          a_7 &= .03608 ;84937 \
                          a_8 &= -.00645 ;35422
                          endalign$$






                          share|cite|improve this answer













                          The Handbook of Mathematical Functions by Abramowitz and Stegun, National Bureau of Standards Applied Mathematics Series 55 (which is available for free on-line), lists several polynomial approximations to the natural logarithm function in formulas 4.1.41 through 4.1.44. The Handbook says these approximations are from C. Hastings Jr., Approximations for digital computers. The most accurate of the formulas, 4.1.44, reads



                          $$ln(1+x)=a_1 x + a_2 x^2 + a_3 x^3 + a_4 x^4 + a_5 x^5 + a_6 x^6 + a_7 x^7 + a_8 x^8 + epsilon(x)$$
                          for $0 le x le 1$ with $| epsilon(x) | le 3 times 10 ^-8$, where
                          $$beginalign
                          a_1 &= .99999 ;64239 \
                          a_2 &= -.49987 ;41238 \
                          a_3 &= .33179 ;90258 \
                          a_4 &= -.24073 ;38084 \
                          a_5 &= .16765 ;40711 \
                          a_6 &= -.09532 ;93897 \
                          a_7 &= .03608 ;84937 \
                          a_8 &= -.00645 ;35422
                          endalign$$







                          share|cite|improve this answer













                          share|cite|improve this answer



                          share|cite|improve this answer











                          answered Aug 6 at 14:30









                          awkward

                          5,14111021




                          5,14111021






















                               

                              draft saved


                              draft discarded


























                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2873604%2fwhat-algorithm-do-scientific-calculators-use-to-calculate-logarithms%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Comments

                              Popular posts from this blog

                              What is the equation of a 3D cone with generalised tilt?

                              Color the edges and diagonals of a regular polygon

                              Relationship between determinant of matrix and determinant of adjoint?