Result of asind changed between R2016b and R2019b

1 次查看(过去 30 天)
I noticed that the result of the 'asind' function changed slightly for some input values when I upgraded from R2016b to R2019b.
For example, in R2016b:
>> format long
>> asind(0.7)
ans =
44.427004000805702
In R2019b:
>> format long
>> asind(0.7)
ans =
44.427004000805695
I realize this is a tiny difference, but I didn't expect it. I searched the release notes for everything between these versions and didn't find anything relevant. Did I overlook something, or does behavior like this change from version to version without mention?

采纳的回答

Steven Lord
Steven Lord 2020-5-19
I'm not 100% certain offhand but I suspect this is related to the change in sind and cosd in release R2019a described in bug report 1839169.
  1 个评论
Michael
Michael 2020-5-19
That does look like a plausible cause for this change. Thank you for pointing that out.

请先登录,再进行评论。

更多回答(1 个)

James Tursa
James Tursa 2020-5-19
编辑:James Tursa 2020-5-19
This is a bit strange. I would have expected the later version to be better, but it appears to be worse:
>> version -release
ans =
'2017b'
>> double(asind(vpa(0.7)))
ans =
44.427004000805702 % Symbolic Toolbox answer converted to double
>> asind(0.7)
ans =
44.427004000805702 % Double function agrees
>> sind(ans)-0.7
ans =
0 % Matches desired result to last bit
But for the later version:
>> version -release
ans =
'2019b'
>> double(asind(vpa(0.7)))
ans =
44.427004000805702 % Symbolic Toolbox answer converted to double
>> asind(0.7)
ans =
44.427004000805695 % Double function does not agree
>> sind(ans)-0.7
ans =
-1.110223024625157e-16 % Does not match desired result to last bit
That bug report indicates the "fix" for the exact degree cases is to use R2019a or later, but these results seem to indicate that the later version is not the better one for this isolated example. Maybe in a wide range of testing the later version is better overall. Maybe to get the "exact" degree cases to come out as desired there were side effects for other cases. I don't know what the story is here as I haven't looked into it in any depth.
Maybe drop another note to the technical team ...
  2 个评论
Michael
Michael 2020-5-19
I noticed that there are values which will invert back to their original value exactly in R2016b but not in R2019b, and there are others which invert in R2019b but not in R2016b.
R2019b:
>> y = 0.743148279360506;
>> sind(asind(y)) - y
ans =
0
R2016b:
>> y = 0.743148279360506;
>> sind(asind(y)) - y
ans =
1.110223024625157e-16
And as you pointed out, 0.7 is an example in the other direction.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Trigonometry 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by