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?
0 个评论
采纳的回答
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 个)
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Trigonometry 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!