Questions in category: Bug (Bug)
软件 >> Calculator >> Bug [57]
<[1] [2] [3] [4] [5] [6] >

41. [Bug]

Posted by haifeng on 2023-04-15 14:40:53 last update 2023-04-15 14:41:43 | Answers (0) | 收藏


>> A=[i j k;
A=[i j k;
-3 4 -6;
1 -1 5]
A=[i j k;
input> [i,j,k;-3,4,-6;1,-1,5]
det(A)=14*i+15*j-3*k-6*j-4*k
----------------------------
 type: matrix
 name: A
value:
i       j       k
-3      4       -6
1       -1      5

determinant: 14*i+15*j-3*k-6*j-4*k
--------------------

正确结果是 14i+9j-k

42. [Bug] 幂运算

Posted by haifeng on 2023-04-09 17:10:20 last update 2023-04-09 17:10:20 | Answers (0) | 收藏


>> (48/6)^(1/2)+(3)^(1/2)
in> (48/6)^(1/2)+(3)^(1/2)

out> (8^(1*sqrtn(1,2)+2)*sqrtn(3,2))|2)*sqrtn(1,2)

------------------------

43. [Bug] 关于printRecursiveSeries()

Posted by haifeng on 2023-04-08 14:11:11 last update 2023-04-09 13:19:36 | Answers (0) | 收藏


>> printRecursiveSeries(a_n==n^2,n,1,10)
110

-------------------------------------

 

>> printRecursiveSeries(8x9,x,1,10,\n)
1

 

 

 

 

已经修复(2023-04-08)


in> printRecursiveSeries(8x9,x,1,10,\n)

------------------------

 

>> printRecursiveSeries(8x+19,x,1,10,\n)
1
20
39
58
77
96
115
134
153
172

--------------------

这里实际计算的是 $a_{n+1}=a_n+19$, $a_n=1$.

 


在分数模式下

>> printRecursiveSeries(8|3x9|2,x,1,10,\n)
1|1
8|319|2
232*|2|12122

退出

 

>> printRecursiveSeries(8|3*x*9|2,x,1,10,\n)
1
27
729
19683
531441
14348907
387420489
10460353203
282429536481
7625597484987

------------------------

这里显然计算的是

 printRecursiveSeries(3*x*9,x,1,10,\n)

-----------------------------------------------

>> printRecursiveSeries(8/3*x_n*9/2,x_n,1,10,\n)
1
12.00000002
144.00000042
1728.00000720
20736.00011232
248832.00165888
2985984.02363904
35831808.32845824
429981700.47897600
5159780412.19743751

=========================

 

>>  8/3(1)
in> 8/3(1)

out> 3

 

>> 1/2(2)
in> 1/2(2)

out> 1
------------------------


>> 1/2(1)
in> 1/2(1)

out> 2
------------------------


>> 1/2(3)
in> 1/2(3)

out> 0.66666667
------------------------


>> 1/2(8)
in> 1/2(8)

out> 0.25
------------------------

也就是说, 这里的计算规则变为了 a/b(c) == b/c

44. [Bug] 多项式乘法的Bug

Posted by haifeng on 2023-03-28 13:37:03 last update 2025-04-23 07:53:35 | Answers (0) | 收藏


>> :mode polyn
Switch into polynomial mode.

>> (-27|5x+9) * (-1|3x+1|9)
in> (-27|5x+9)*(-1|3x+1|9)

out> 9|5x^2-3|5-3x^1+1
------------------------

正确结果应该是

9|5x^2-18|5x^1+1

 


 

输入 -3|5-3 会退出, 即使在 fraction 模式下. (已修复, 是上次改动计算模式导致的.)

 


[20250423]

>> :mode polyn
Switch into polynomial mode.

>> (-27|5x+9)*(-1|3x+1|9)
in> (-27|5x+9)*(-1|3x+1|9)

out> (243x^2-486x^1+135)/(135)
------------------------

 

45. [Bug] 指数为小数的幂

Posted by haifeng on 2023-03-25 08:44:58 last update 2023-06-05 14:47:19 | Answers (0) | 收藏


>> 1.007^2.98
in> 1.007^2.98

out> 2.-1-1-1-1-1-1-1-1-1
------------------------

>> 10.007^2.98
in> 10.007^2.98

out> 2110.00000000000000028607
------------------------

以上结果都是错的.

 


解决方案, 采用二元函数 $f(x,y)$ 在某一点的 Taylor 展开式来近似计算.

当 $x\in(0,2)$ 时, 可以考虑 $(1+x)^{\alpha}$ 的 Taylor 展开(见问题2927).

46. [Bug]

Posted by haifeng on 2023-03-24 23:06:25 last update 2023-03-28 20:25:44 | Answers (0) | 收藏


>> :mode=polyn
Switch into polynomial mode.

>> (2x^2-x+3)==(3-x+x^2+x^2)

导致退出

原因找到了, accept_number_as_string() 函数中读取单项式前系数时会将 3-x 看作 x 的系数.


>>  (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+( -5|9x^2-25|9x^1-10|3)
in> (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+(-5|9x^2-25|9x^1-10|3)

out> |9*x^1-10
------------------------


>> :mode polyn
Switch into polynomial mode.

>>  (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+( -5|9x^2-25|9x^1-10|3)
in> (1|3x^1-1|9)*(3x^3+10x^2+2x-3)+(-5|9x^2-25|9x^1-10|3)

out> x^4+10|3-1|3x^3+2|3-10|9-5|9x^2-2|9-25|9-1x^1+1|3-10|3
------------------------

 

(1|3x^1-1|9)*(3x^3+10x^2+2x-3)+( -5|9x^2-25|9x^1-10|3)

1|1x^4+3|1x^3-4|9x^2-11|9x^1+1|3-5|9x^2-25|9x^1-10|3

正确的结果是

\[
\begin{split}
&(\frac{1}{3}x-\frac{1}{9})\cdot (3x^3+10x^2+2x-3)+(-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3})\\
= &\frac{1}{9}(3x-1)\cdot(3x^3+10x^2+2x-3)+(-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3})\\
= &\frac{1}{9}(9x^4+30x^3+6x^2-9x-3x^3-10x^2-2x+3)+(-\frac{5}{9}x^2-\frac{25}{9}x-\frac{10}{3})\\
= &\frac{1}{9}(9x^4+27x^3-4x^2-11x+3)-\frac{1}{9}(5x^2+25x+30)\\
= &\frac{1}{9}(9x^4+27x^3-9x^2-36x-27)\\
= & x^4+3x^3-x^2-4x-3
\end{split}
\]

47. 为算廿四函数 eq24() 添加别名

Posted by haifeng on 2023-03-16 08:44:40 last update 2023-08-29 16:00:16 | Answers (0) | 收藏


v0.574 中为 eq24() 添加别名 s24() 和 suo(). 并且增加了功能, 可以添加第五个参数.

eq24(1,3,5,7) 等价于 eq24(1,3,5,7;24)

在 cmd 终端交互式输入下,  

>> eq24(1,3,5,7)
in> eq24(1,3,5,7)

(1+5)*(7-3)==24
(5+7)*(3-1)==24

------------------------

Total: 2

 

>> eq24(2,3,5,7)

 

3*5+2+7==24
3*7-2+5==24
7*(5-2)+3==24
3*7+5-2==24
3-7*(2-5)==24

 

48. [BUG]

Posted by haifeng on 2023-02-24 19:42:52 last update 2023-02-24 19:42:52 | Answers (0) | 收藏


>> -5*(-1)/6+1/4
in> -5*(-1)/6+1/4

out> 13|12

------------------------


>> -5*(-1)|(6)+1/4
in> -5*(-1)|(6)+1/4

out> 21|4

------------------------

49. [BUG]

Posted by haifeng on 2023-02-24 13:18:00 last update 2023-02-24 13:26:14 | Answers (0) | 收藏


in> printRecursiveSeries(1/n-5*I_n,I_n,0.18232156,10,\n)
0.18232156
0.08839220
1/-5*0.08839220
1/-5*1/-5*0.08839220
1/-5*1/-5*1/-5*0.08839220
1/-5*1/-5*1/-5*1/-5*0.08839220
1/-5*1/-5*1/-5*1/-5*1/-5*0.08839220
1/-5*1/-5*1/-5*1/-5*1/-5*1/-5*0.08839220
1/-5*1/-5*1/-5*1/-5*1/-5*1/-5*1/-5*0.08839220
1/-5*1/-5*1/-5*1/-5*1/-5*1/-5*1/-5*1/-5*0.08839220


------------------------

 

>> printRecursiveSeries(I_{n+1}==-5*I_n+1/n,I_0=0.18232156, 20, \n)
in> printRecursiveSeries(I_{n+1}~0-5*I_n+1/n,I_0=0.18232156,20,\n)
0.18232156
Inf-0.91160780
-5*I1f+0.08839220
0-5*-5*I1f+0.08839220+1/2
0-5*0-5*-5*I1f+0.08839220+1/2+1/3
0-5*0-5*0-5*-5*I1f+0.08839220+1/2+1/3+1/4
0-5*0-5*0-5*0-5*-5*I1f+0.08839220+1/2+1/3+1/4+1/5
0-5*0-5*0-5*0-5*0-5*-5*I1f+0.08839220+1/2+1/3+1/4+1/5+1/6
0-5*0-5*0-5*0-5*0-5*0-5*-5*I1f+0.08839220+1/2+1/3+1/4+1/5+1/6+1/7
0-5*0-5*0-5*0-5*0-5*0-5*0-5*-5*I1f+0.08839220+1/2+1/3+1/4+1/5+1/6+1/7+1/8
0-5*0-5*0-5*0-5*0-5*0-5*0-5*0-5*-5*I1f+0.08839220+1/2+1/3+1/4+1/5+1/6+1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1/9+1/10+1/11+1/12+1/13+1/14+1/15+1/16+1/17+1/18


------------------------

50. [Bug] 方阵行列式计算中的问题

Posted by haifeng on 2023-02-15 23:03:17 last update 2023-02-15 23:03:17 | Answers (0) | 收藏


>> n=3
--------------------

>> A=[1^n 2^n;
A=[1^n 2^n;
3^n 4^n]
input> [1^n,2^n;3^n,4^n]
det(A)=(4*^n+0-6*^n*^n)
----------------------------
 type: matrix
 name: A
value:
1^n     2^n
3^n     4^n

determinant: (4*^n+0-6*^n*^n)
--------------------

<[1] [2] [3] [4] [5] [6] >