Finding error in a an approximation












0












$begingroup$



We want to see the total error in approximating



$$ f'(x) approx frac{ f(x+h)-f(x) }{h} $$



where $f: R to R$ is differentiable. We can find $theta in [x,x+h]$
by Taylor's to that



$$ f(x+h) = f(x) + f'(x) h + f''( theta ) h^2 /2 $$



If the error in function values is bounded by $epsilon$, prove that
the rounding error is bounded by $2 epsilon /h$ and the truncation
error is bounded by $Mh/2$ where $M$ is a bound for $|f''(t)|$ for $t$
near $x$.




Try



We know truncation error is difference between true result and the result that would be produced by algorithm. By the result given above, we see that



$$ frac{ f(x+h) - f(x) }{h} = f'(x) + f''(theta)h/2 $$



So that



$$ underbrace{ frac{ f(x+h) - f(x) }{h} }_{approx} - underbrace{f'(x)}_{true ; result} = f''(theta)h/2 $$



So that trucantion error $E_T$ is absolute value of the above:



$$ E_T = |f''(theta) | h/2 leq Mh/2 $$



So we have our first result. However, for the rounding error I dont see how it is $2 epsilon / h $. Can someone explain what they really mean? Perhaps am I misunderstanding this part.










share|cite|improve this question









$endgroup$

















    0












    $begingroup$



    We want to see the total error in approximating



    $$ f'(x) approx frac{ f(x+h)-f(x) }{h} $$



    where $f: R to R$ is differentiable. We can find $theta in [x,x+h]$
    by Taylor's to that



    $$ f(x+h) = f(x) + f'(x) h + f''( theta ) h^2 /2 $$



    If the error in function values is bounded by $epsilon$, prove that
    the rounding error is bounded by $2 epsilon /h$ and the truncation
    error is bounded by $Mh/2$ where $M$ is a bound for $|f''(t)|$ for $t$
    near $x$.




    Try



    We know truncation error is difference between true result and the result that would be produced by algorithm. By the result given above, we see that



    $$ frac{ f(x+h) - f(x) }{h} = f'(x) + f''(theta)h/2 $$



    So that



    $$ underbrace{ frac{ f(x+h) - f(x) }{h} }_{approx} - underbrace{f'(x)}_{true ; result} = f''(theta)h/2 $$



    So that trucantion error $E_T$ is absolute value of the above:



    $$ E_T = |f''(theta) | h/2 leq Mh/2 $$



    So we have our first result. However, for the rounding error I dont see how it is $2 epsilon / h $. Can someone explain what they really mean? Perhaps am I misunderstanding this part.










    share|cite|improve this question









    $endgroup$















      0












      0








      0





      $begingroup$



      We want to see the total error in approximating



      $$ f'(x) approx frac{ f(x+h)-f(x) }{h} $$



      where $f: R to R$ is differentiable. We can find $theta in [x,x+h]$
      by Taylor's to that



      $$ f(x+h) = f(x) + f'(x) h + f''( theta ) h^2 /2 $$



      If the error in function values is bounded by $epsilon$, prove that
      the rounding error is bounded by $2 epsilon /h$ and the truncation
      error is bounded by $Mh/2$ where $M$ is a bound for $|f''(t)|$ for $t$
      near $x$.




      Try



      We know truncation error is difference between true result and the result that would be produced by algorithm. By the result given above, we see that



      $$ frac{ f(x+h) - f(x) }{h} = f'(x) + f''(theta)h/2 $$



      So that



      $$ underbrace{ frac{ f(x+h) - f(x) }{h} }_{approx} - underbrace{f'(x)}_{true ; result} = f''(theta)h/2 $$



      So that trucantion error $E_T$ is absolute value of the above:



      $$ E_T = |f''(theta) | h/2 leq Mh/2 $$



      So we have our first result. However, for the rounding error I dont see how it is $2 epsilon / h $. Can someone explain what they really mean? Perhaps am I misunderstanding this part.










      share|cite|improve this question









      $endgroup$





      We want to see the total error in approximating



      $$ f'(x) approx frac{ f(x+h)-f(x) }{h} $$



      where $f: R to R$ is differentiable. We can find $theta in [x,x+h]$
      by Taylor's to that



      $$ f(x+h) = f(x) + f'(x) h + f''( theta ) h^2 /2 $$



      If the error in function values is bounded by $epsilon$, prove that
      the rounding error is bounded by $2 epsilon /h$ and the truncation
      error is bounded by $Mh/2$ where $M$ is a bound for $|f''(t)|$ for $t$
      near $x$.




      Try



      We know truncation error is difference between true result and the result that would be produced by algorithm. By the result given above, we see that



      $$ frac{ f(x+h) - f(x) }{h} = f'(x) + f''(theta)h/2 $$



      So that



      $$ underbrace{ frac{ f(x+h) - f(x) }{h} }_{approx} - underbrace{f'(x)}_{true ; result} = f''(theta)h/2 $$



      So that trucantion error $E_T$ is absolute value of the above:



      $$ E_T = |f''(theta) | h/2 leq Mh/2 $$



      So we have our first result. However, for the rounding error I dont see how it is $2 epsilon / h $. Can someone explain what they really mean? Perhaps am I misunderstanding this part.







      numerical-methods rounding-error truncation-error






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Jan 2 at 7:02









      Jimmy SabaterJimmy Sabater

      2,579325




      2,579325






















          1 Answer
          1






          active

          oldest

          votes


















          3












          $begingroup$

          The rounding error? Take that upper bound $epsilon$ for the error in function values. We're subtracting two instances of it, which doubles that (at most $epsilon - (-epsilon)$). Then we divide by $h$, for $frac{2epsilon}{h}$. That's how far our calculated value of the difference quotient $frac{f(x+epsilon)-f(x)}{epsilon}$ can be from the true value.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
            $endgroup$
            – Jimmy Sabater
            Jan 2 at 7:28






          • 1




            $begingroup$
            Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
            $endgroup$
            – jmerry
            Jan 2 at 7:55












          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
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3059196%2ffinding-error-in-a-an-approximation%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3












          $begingroup$

          The rounding error? Take that upper bound $epsilon$ for the error in function values. We're subtracting two instances of it, which doubles that (at most $epsilon - (-epsilon)$). Then we divide by $h$, for $frac{2epsilon}{h}$. That's how far our calculated value of the difference quotient $frac{f(x+epsilon)-f(x)}{epsilon}$ can be from the true value.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
            $endgroup$
            – Jimmy Sabater
            Jan 2 at 7:28






          • 1




            $begingroup$
            Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
            $endgroup$
            – jmerry
            Jan 2 at 7:55
















          3












          $begingroup$

          The rounding error? Take that upper bound $epsilon$ for the error in function values. We're subtracting two instances of it, which doubles that (at most $epsilon - (-epsilon)$). Then we divide by $h$, for $frac{2epsilon}{h}$. That's how far our calculated value of the difference quotient $frac{f(x+epsilon)-f(x)}{epsilon}$ can be from the true value.






          share|cite|improve this answer









          $endgroup$













          • $begingroup$
            what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
            $endgroup$
            – Jimmy Sabater
            Jan 2 at 7:28






          • 1




            $begingroup$
            Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
            $endgroup$
            – jmerry
            Jan 2 at 7:55














          3












          3








          3





          $begingroup$

          The rounding error? Take that upper bound $epsilon$ for the error in function values. We're subtracting two instances of it, which doubles that (at most $epsilon - (-epsilon)$). Then we divide by $h$, for $frac{2epsilon}{h}$. That's how far our calculated value of the difference quotient $frac{f(x+epsilon)-f(x)}{epsilon}$ can be from the true value.






          share|cite|improve this answer









          $endgroup$



          The rounding error? Take that upper bound $epsilon$ for the error in function values. We're subtracting two instances of it, which doubles that (at most $epsilon - (-epsilon)$). Then we divide by $h$, for $frac{2epsilon}{h}$. That's how far our calculated value of the difference quotient $frac{f(x+epsilon)-f(x)}{epsilon}$ can be from the true value.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Jan 2 at 7:14









          jmerryjmerry

          16.8k11633




          16.8k11633












          • $begingroup$
            what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
            $endgroup$
            – Jimmy Sabater
            Jan 2 at 7:28






          • 1




            $begingroup$
            Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
            $endgroup$
            – jmerry
            Jan 2 at 7:55


















          • $begingroup$
            what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
            $endgroup$
            – Jimmy Sabater
            Jan 2 at 7:28






          • 1




            $begingroup$
            Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
            $endgroup$
            – jmerry
            Jan 2 at 7:55
















          $begingroup$
          what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
          $endgroup$
          – Jimmy Sabater
          Jan 2 at 7:28




          $begingroup$
          what do they mean by function values? Are we trying to estimate f(x) exact with $f(x')$ approx.? That is we are given that $|f(x) - f(x') | leq epsilon $? and we want to estimate $|f'(x) - f'(x')|$?
          $endgroup$
          – Jimmy Sabater
          Jan 2 at 7:28




          1




          1




          $begingroup$
          Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
          $endgroup$
          – jmerry
          Jan 2 at 7:55




          $begingroup$
          Say we're trying to calculate some reasonably nice function value - say, $exp(1.234)$. But this is a computer system - we're looking for an explicit number, and our numbers are represented with finite blocks of memory (likely 64 or 128 bits on a modern system). There's only so many numbers that can be represented exactly that way, and $e^{1.234}$ isn't one of them - so, to get our function value, we'll have to round it off. We'll estimate it as best we can, but we can't possibly do better than the closest number that has a floating-point representation. That's roundoff error.
          $endgroup$
          – jmerry
          Jan 2 at 7:55


















          draft saved

          draft discarded




















































          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%2f3059196%2ffinding-error-in-a-an-approximation%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

          Probability when a professor distributes a quiz and homework assignment to a class of n students.

          Aardman Animations

          Are they similar matrix