machine precision and numerical cancellation

i have a question which is : "let x and y be two machine numbers working with a certain arithmetic with machine precision (mp) then" :
1) x+em=x for all x
2) x> em for all x
3) for all x and y the operation x-y is not affected by numerical cancellation
4) x-y is a machine number for all x and y
I'm torn between the first and the second answer so can someone tell me which one and why please?
thanks

6 件のコメント

Steven Lord
Steven Lord 2019 年 7 月 9 日
What is em? Is it related to mp at all?
Since this sounds like a homework or exam question, why don't you explain the reason you think each answer is correct or incorrect and we may be able to offer some feedback.
sadek misto kirdi
sadek misto kirdi 2019 年 7 月 9 日
ah sorry mp is the same as em.
as i learned that matlab stores numbers with 16 digits of precision so in subtraction we might end up losing some digits which lead to numerical cancellation so 3) is wrong and case 4 is similar to case 3 so i was left with 1) and 2).
as i know also mp= epsilon/2 so i tried to add any machine number to eps/2 on matlab and i was getting the same number as the machine number so thats why i think 1) is true but i am not sure.
David Goodmanson
David Goodmanson 2019 年 7 月 10 日
Hi sadek,
could you explain your reasoning for why case 4 is 'similar' to case 3?
sadek misto kirdi
sadek misto kirdi 2019 年 7 月 10 日
because matlab cant recognize a difference less than eps
for example take x=1 and y=x+ eps/2
y-x will give 0 although it is not 0
David Goodmanson
David Goodmanson 2019 年 7 月 10 日
well, is case 4 asking about the accuracy of x-y?
sadek misto kirdi
sadek misto kirdi 2019 年 7 月 11 日
sorry i didnt understand your question

サインインしてコメントする。

回答 (0 件)

カテゴリ

質問済み:

2019 年 7 月 9 日

コメント済み:

2019 年 7 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by