How to display very small numbers in Mathematica?












2












$begingroup$


I am trying to evaluate the function:
$$f(x) = cos(x) - mathrm{e}^{-2.7 x}$$
at $x = 1.7 times 10^{-25}$



and Mathematica keeps returning '0.'



How do I evaluate the expression in a better way?










share|improve this question









New contributor




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







$endgroup$

















    2












    $begingroup$


    I am trying to evaluate the function:
    $$f(x) = cos(x) - mathrm{e}^{-2.7 x}$$
    at $x = 1.7 times 10^{-25}$



    and Mathematica keeps returning '0.'



    How do I evaluate the expression in a better way?










    share|improve this question









    New contributor




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







    $endgroup$















      2












      2








      2





      $begingroup$


      I am trying to evaluate the function:
      $$f(x) = cos(x) - mathrm{e}^{-2.7 x}$$
      at $x = 1.7 times 10^{-25}$



      and Mathematica keeps returning '0.'



      How do I evaluate the expression in a better way?










      share|improve this question









      New contributor




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







      $endgroup$




      I am trying to evaluate the function:
      $$f(x) = cos(x) - mathrm{e}^{-2.7 x}$$
      at $x = 1.7 times 10^{-25}$



      and Mathematica keeps returning '0.'



      How do I evaluate the expression in a better way?







      precision-and-accuracy






      share|improve this question









      New contributor




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











      share|improve this question









      New contributor




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









      share|improve this question




      share|improve this question








      edited 20 mins ago









      Henrik Schumacher

      50.8k469145




      50.8k469145






      New contributor




      Ray_56 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









      Ray_56Ray_56

      111




      111




      New contributor




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





      New contributor





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






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






















          4 Answers
          4






          active

          oldest

          votes


















          1












          $begingroup$

          Can also use exact numbers.



          f[x_] = Cos[x] - E^(-27 x/10);

          f[17 10^-26]//N[#,50]&
          (*4.5899999999999999999999988020950000000000000000002*10^-25*)





          share|improve this answer









          $endgroup$





















            1












            $begingroup$

            The simplest methods are usually the best. Try this code



            N[Cos[x] - Exp[-x 27/10] /. x -> 17*^-26, 15] // InputForm


            or a minor variation



            With[{x = 17*^-26}, N[Cos[x] - Exp[-x 27/10], 15]] // InputForm


            or define a function first



            f = Cos[#] - Exp[-# 27/10] &; N[f[17*^-26], 15] // InputForm


            All of these return the result



            4.589999999999999999999998802094999`15.*^-25


            You can get more digits by increasing the 15 digits precision.



            For example, with 34 digits precision the result returned is



            4.5899999999999999999999988020950000000000000000001613`34.*^-25





            share|improve this answer











            $endgroup$





















              1












              $begingroup$

              First convert the expression to trigonometric form:



              y = Cos[x] - Exp[-2.7*x] // ExpToTrig



              Cos[x] - Cosh[2.7 x] + Sinh[2.7 x]




              y /. x -> 1.7*10^-25



              4.59*10^-25




              This is the exact solution.






              share|improve this answer











              $endgroup$





















                0












                $begingroup$

                Do a series expansion:



                Series[Cos[x] - Exp[-2.7 x], {x, 0, 1}]


                (*



                SeriesData[x, 0, {2.7}, 1, 2, 1]



                *)



                Then plug in $x = 1.7 times 10^{-25}$ to get:



                $$4.59 times 10^{-25}$$






                share|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: "387"
                  };
                  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: false,
                  noModals: true,
                  showLowRepImageUploadWarning: true,
                  reputationToPostImages: null,
                  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
                  },
                  onDemand: true,
                  discardSelector: ".discard-answer"
                  ,immediatelyShowMarkdownHelp:true
                  });


                  }
                  });






                  Ray_56 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%2fmathematica.stackexchange.com%2fquestions%2f189857%2fhow-to-display-very-small-numbers-in-mathematica%23new-answer', 'question_page');
                  }
                  );

                  Post as a guest















                  Required, but never shown

























                  4 Answers
                  4






                  active

                  oldest

                  votes








                  4 Answers
                  4






                  active

                  oldest

                  votes









                  active

                  oldest

                  votes






                  active

                  oldest

                  votes









                  1












                  $begingroup$

                  Can also use exact numbers.



                  f[x_] = Cos[x] - E^(-27 x/10);

                  f[17 10^-26]//N[#,50]&
                  (*4.5899999999999999999999988020950000000000000000002*10^-25*)





                  share|improve this answer









                  $endgroup$


















                    1












                    $begingroup$

                    Can also use exact numbers.



                    f[x_] = Cos[x] - E^(-27 x/10);

                    f[17 10^-26]//N[#,50]&
                    (*4.5899999999999999999999988020950000000000000000002*10^-25*)





                    share|improve this answer









                    $endgroup$
















                      1












                      1








                      1





                      $begingroup$

                      Can also use exact numbers.



                      f[x_] = Cos[x] - E^(-27 x/10);

                      f[17 10^-26]//N[#,50]&
                      (*4.5899999999999999999999988020950000000000000000002*10^-25*)





                      share|improve this answer









                      $endgroup$



                      Can also use exact numbers.



                      f[x_] = Cos[x] - E^(-27 x/10);

                      f[17 10^-26]//N[#,50]&
                      (*4.5899999999999999999999988020950000000000000000002*10^-25*)






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered 1 hour ago









                      Bill WattsBill Watts

                      3,0811518




                      3,0811518























                          1












                          $begingroup$

                          The simplest methods are usually the best. Try this code



                          N[Cos[x] - Exp[-x 27/10] /. x -> 17*^-26, 15] // InputForm


                          or a minor variation



                          With[{x = 17*^-26}, N[Cos[x] - Exp[-x 27/10], 15]] // InputForm


                          or define a function first



                          f = Cos[#] - Exp[-# 27/10] &; N[f[17*^-26], 15] // InputForm


                          All of these return the result



                          4.589999999999999999999998802094999`15.*^-25


                          You can get more digits by increasing the 15 digits precision.



                          For example, with 34 digits precision the result returned is



                          4.5899999999999999999999988020950000000000000000001613`34.*^-25





                          share|improve this answer











                          $endgroup$


















                            1












                            $begingroup$

                            The simplest methods are usually the best. Try this code



                            N[Cos[x] - Exp[-x 27/10] /. x -> 17*^-26, 15] // InputForm


                            or a minor variation



                            With[{x = 17*^-26}, N[Cos[x] - Exp[-x 27/10], 15]] // InputForm


                            or define a function first



                            f = Cos[#] - Exp[-# 27/10] &; N[f[17*^-26], 15] // InputForm


                            All of these return the result



                            4.589999999999999999999998802094999`15.*^-25


                            You can get more digits by increasing the 15 digits precision.



                            For example, with 34 digits precision the result returned is



                            4.5899999999999999999999988020950000000000000000001613`34.*^-25





                            share|improve this answer











                            $endgroup$
















                              1












                              1








                              1





                              $begingroup$

                              The simplest methods are usually the best. Try this code



                              N[Cos[x] - Exp[-x 27/10] /. x -> 17*^-26, 15] // InputForm


                              or a minor variation



                              With[{x = 17*^-26}, N[Cos[x] - Exp[-x 27/10], 15]] // InputForm


                              or define a function first



                              f = Cos[#] - Exp[-# 27/10] &; N[f[17*^-26], 15] // InputForm


                              All of these return the result



                              4.589999999999999999999998802094999`15.*^-25


                              You can get more digits by increasing the 15 digits precision.



                              For example, with 34 digits precision the result returned is



                              4.5899999999999999999999988020950000000000000000001613`34.*^-25





                              share|improve this answer











                              $endgroup$



                              The simplest methods are usually the best. Try this code



                              N[Cos[x] - Exp[-x 27/10] /. x -> 17*^-26, 15] // InputForm


                              or a minor variation



                              With[{x = 17*^-26}, N[Cos[x] - Exp[-x 27/10], 15]] // InputForm


                              or define a function first



                              f = Cos[#] - Exp[-# 27/10] &; N[f[17*^-26], 15] // InputForm


                              All of these return the result



                              4.589999999999999999999998802094999`15.*^-25


                              You can get more digits by increasing the 15 digits precision.



                              For example, with 34 digits precision the result returned is



                              4.5899999999999999999999988020950000000000000000001613`34.*^-25






                              share|improve this answer














                              share|improve this answer



                              share|improve this answer








                              edited 36 mins ago

























                              answered 51 mins ago









                              SomosSomos

                              4778




                              4778























                                  1












                                  $begingroup$

                                  First convert the expression to trigonometric form:



                                  y = Cos[x] - Exp[-2.7*x] // ExpToTrig



                                  Cos[x] - Cosh[2.7 x] + Sinh[2.7 x]




                                  y /. x -> 1.7*10^-25



                                  4.59*10^-25




                                  This is the exact solution.






                                  share|improve this answer











                                  $endgroup$


















                                    1












                                    $begingroup$

                                    First convert the expression to trigonometric form:



                                    y = Cos[x] - Exp[-2.7*x] // ExpToTrig



                                    Cos[x] - Cosh[2.7 x] + Sinh[2.7 x]




                                    y /. x -> 1.7*10^-25



                                    4.59*10^-25




                                    This is the exact solution.






                                    share|improve this answer











                                    $endgroup$
















                                      1












                                      1








                                      1





                                      $begingroup$

                                      First convert the expression to trigonometric form:



                                      y = Cos[x] - Exp[-2.7*x] // ExpToTrig



                                      Cos[x] - Cosh[2.7 x] + Sinh[2.7 x]




                                      y /. x -> 1.7*10^-25



                                      4.59*10^-25




                                      This is the exact solution.






                                      share|improve this answer











                                      $endgroup$



                                      First convert the expression to trigonometric form:



                                      y = Cos[x] - Exp[-2.7*x] // ExpToTrig



                                      Cos[x] - Cosh[2.7 x] + Sinh[2.7 x]




                                      y /. x -> 1.7*10^-25



                                      4.59*10^-25




                                      This is the exact solution.







                                      share|improve this answer














                                      share|improve this answer



                                      share|improve this answer








                                      edited 18 mins ago









                                      Henrik Schumacher

                                      50.8k469145




                                      50.8k469145










                                      answered 1 hour ago









                                      VixillatorVixillator

                                      4497




                                      4497























                                          0












                                          $begingroup$

                                          Do a series expansion:



                                          Series[Cos[x] - Exp[-2.7 x], {x, 0, 1}]


                                          (*



                                          SeriesData[x, 0, {2.7}, 1, 2, 1]



                                          *)



                                          Then plug in $x = 1.7 times 10^{-25}$ to get:



                                          $$4.59 times 10^{-25}$$






                                          share|improve this answer









                                          $endgroup$


















                                            0












                                            $begingroup$

                                            Do a series expansion:



                                            Series[Cos[x] - Exp[-2.7 x], {x, 0, 1}]


                                            (*



                                            SeriesData[x, 0, {2.7}, 1, 2, 1]



                                            *)



                                            Then plug in $x = 1.7 times 10^{-25}$ to get:



                                            $$4.59 times 10^{-25}$$






                                            share|improve this answer









                                            $endgroup$
















                                              0












                                              0








                                              0





                                              $begingroup$

                                              Do a series expansion:



                                              Series[Cos[x] - Exp[-2.7 x], {x, 0, 1}]


                                              (*



                                              SeriesData[x, 0, {2.7}, 1, 2, 1]



                                              *)



                                              Then plug in $x = 1.7 times 10^{-25}$ to get:



                                              $$4.59 times 10^{-25}$$






                                              share|improve this answer









                                              $endgroup$



                                              Do a series expansion:



                                              Series[Cos[x] - Exp[-2.7 x], {x, 0, 1}]


                                              (*



                                              SeriesData[x, 0, {2.7}, 1, 2, 1]



                                              *)



                                              Then plug in $x = 1.7 times 10^{-25}$ to get:



                                              $$4.59 times 10^{-25}$$







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered 2 hours ago









                                              David G. StorkDavid G. Stork

                                              23.9k22153




                                              23.9k22153






















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










                                                  draft saved

                                                  draft discarded


















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













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












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
















                                                  Thanks for contributing an answer to Mathematica 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%2fmathematica.stackexchange.com%2fquestions%2f189857%2fhow-to-display-very-small-numbers-in-mathematica%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

                                                  Сан-Квентин

                                                  Алькесар

                                                  Josef Freinademetz