CAS Maxima:函数定义中关系运算符的问题

问题描述 投票:0回答:0

在CAS Maxima中,我定义的Tent Map如下:

TMm2(x):=2*if x>1/2 then 1-x else x


开始
TM:1/%pi

然后根据
迭代
for i:0 thru 60 do
(
TMC1oPI:coeff(TM,1/%pi,1), TMCconst:coeff(TM,1/%pi,0),
TMstr:sconcat(i,";",TMC1oPI,";",TMCconst),
print(TMstr),
TM:(expand(TMm2(TM))),
if TM = 0 then return("Iterating the Tent Map ended at its fixed point zero!")
)

输出在以 56
开头的行中开始失败
55;-36028797018963968;11468322278445318
56;-72057594037927936;22936644556890636
57;-144115188075855872;45873289113781272
58;-288230376151711744;91746578227562544
59;-576460752303423488;183493156455125088
60;-1152921504606846976;366986312910250176

问题是关系运算符在应用于以 55 开头的行中的结果时评估为 false,尽管该行的准确结果是

-36028797018963968/%pi+11468322278445318
,也就是0.71左右,这样接下来的结果应该是0.58左右,但是
-72057594037927936/%pi+22936644556890636
的计算结果约为 1.42,这是一个错误。

我在这里错过了什么?

maxima
© www.soinside.com 2019 - 2024. All rights reserved.