Why the both results are different
Ältere Kommentare anzeigen
I compute the little program in matlab
clear; clf;
syms a b
f1 = 96*pi - 16*pi * (log(a)-log(b)+1)
f1_ = subs(f1,[a b],[12 2])
f1_ = vpa(f1_)
f2 = 96*pi - 16*pi*(log(12)-log(2)+1)
with the output
f1 =
f1_ =
f1_ =
f2 = 161.2638
Why the results are different?
2 Kommentare
Walter Roberson
am 8 Jun. 2020
Ah, sorry, somehow when I formatted your code, the special characters disappeared!! If you could repost that part, that would be good.
Walter Roberson
am 8 Jun. 2020
When I test, I get
f1_ =
161.26375811875458240605931894947
f2 =
161.263758118755
The first of those has been computed to higher precision.
The first has also been computed in a mode that recognized pi as being the indefinitely precise transcendental number, whereas the second one that was calculated purely numeric was calculated with the 16-digit numeric approximation of pi.
Akzeptierte Antwort
Weitere Antworten (1)
Christian Muth
am 10 Jun. 2020
0 Stimmen
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


