Sponsored links: Algebra eBooks
 

Related

sign-sqrt

sign(sqrt(-x^2-x^4));

Calculate

sign

sign(43);

Calculate

sign

sign(-23)*3;

Calculate

sign

sign(-10) * 16;

Calculate

sign

eq1:sign(-5)+1;

Calculate

sign

sign(10);

Calculate

sign

sign(-1);

Calculate

sign

sign(-2);

Calculate

sign

Run Example
(%i1)assume(2*x*y>
0);
(%o1)                             [2 x y > 0]
(%i2) sign(x*y);
(%o2)                                 pnz
(%i3) 
Run Example
f:x^4+x^3-x-1;
                                 4    3
(%o1)                           x  + x  - x - 1
(%i2) g:diff(f,x);
                                   3      2
(%o2)                           4 x  + 3 x  - 1
(%i3) p0:f;
                                 4    3
(%o3)                           x  + x  - x - 1
(%i4) p1:g;
                                   3      2
(%o4)                           4 x  + 3 x  - 1
(%i5) a:divide(p0,p1,x);
                                        2
                          4 x + 1    3 x  + 12 x + 15
(%o5)                    [-------, - ----------------]
                            16              16
(%i6) p2:-a[2];
                                  2
                               3 x  + 12 x + 15
(%o6)                          ----------------
                                      16
(%i7) a:divide(p1,p2,x);
                             64 x - 208
(%o7)                       [----------, 32 x + 64]
                                 3
(%i8) p3:-a[2];
(%o8)                             - 32 x - 64
(%i9) a:divide(p2,p3,x);
                                   3 x + 6  3
(%o9)                           [- -------, --]
                                     512    16
(%i10) p4:-a[2];
                                       3
(%o10)                               - --
                                       16
(%i11) p:[p0,p1,p2,p3,p4];
                                             2
         4    3             3      2      3 x  + 12 x + 15                 3
(%o11) [x  + x  - x - 1, 4 x  + 3 x  - 1, ----------------, - 32 x - 64, - --]
                                                 16                        16
(%i12) sign(p[1]),x=0;
(%o12)                                neg
(%i13) 
Run Example
transformed: matrix([961,-41,15,-48],[-34,72,-30,-104],[-15,3,15,24],[13,81,-5,8]);
                          [ 961   - 41   15   - 48  ]
                          [                         ]
                          [ - 34   72   - 30  - 104 ]
(%o1)                     [                         ]
                          [ - 15   3     15    24   ]
                          [                         ]
                          [  13    81   - 5     8   ]
(%i2) m: matrix([13107, 5243, 8066],[11916,4660,7490],[10082,4194,6554],[9362,3647,5825],[8192,3355,5243],[7282,2893,4559]);
                             [ 13107  5243  8066 ]
                             [                   ]
                             [ 11916  4660  7490 ]
                             [                   ]
                             [ 10082  4194  6554 ]
(%o2)                        [                   ]
                             [ 9362   3647  5825 ]
                             [                   ]
                             [ 8192   3355  5243 ]
                             [                   ]
                             [ 7282   2893  4559 ]
(%i3) QP: 6;
(%o3)                                  6
(%i4) i: mod(QP, 6) + 1;
(%o4)                                  1
(%i5) m0: matrix([m[i,1],m[i,3],m[i,1],m[i,3]],[m[i,3],m[i,2],m[i,3],m[i,2]],[m[i,1],m[i,3],m[i,1],m[i,3]],[m[i,3],m[i,2],m[i,3],m[i,2]]);
                         [ 13107  8066  13107  8066 ]
                         [                          ]
                         [ 8066   5243  8066   5243 ]
(%o5)                    [                          ]
                         [ 13107  8066  13107  8066 ]
                         [                          ]
                         [ 8066   5243  8066   5243 ]
(%i6) roundingconst: floor((2^(floor(QP/6) + 15)) / 6);
(%o6)                                10922
(%i7) quantshift: (2^(floor(QP/6) + 15));
(%o7)                                65536
(%i8) transformed * m0;
                  [ 12595827  - 330706   196605   - 387168 ]
                  [                                        ]
                  [ - 274244   377496   - 241980  - 545272 ]
(%o8)             [                                        ]
                  [ - 196605   24198     196605    193584  ]
                  [                                        ]
                  [  104858    424683   - 40330    41944   ]
(%i9) sign(transformed * m0);
(%o9)                                 pnz
(%i10) (transformed * m0 + roundingconst);
                  [ 12606749  - 319784   207527   - 376246 ]
                  [                                        ]
                  [ - 263322   388418   - 231058  - 534350 ]
(%o10)            [                                        ]
                  [ - 185683   35120     207527    204506  ]
                  [                                        ]
                  [  115780    435605   - 29408    52866   ]
(%i11)  result: ((transformed * m0 + roundingconst) / quantshift), numer;
                [  192.3637237548828  ]         [ - 4.8795166015625 ]
                [                     ]         [                   ]
                [ - 4.017974853515625 ]         [ 5.926788330078125 ]
(%o11)  Col 1 = [                     ] Col 2 = [                   ]
                [ - 2.833297729492188 ]         [  0.535888671875   ]
                [                     ]         [                   ]
                [  1.76666259765625   ]         [ 6.646804809570313 ]
                        [  3.166610717773438  ]         [ - 5.741058349609375 ]
                        [                     ]         [                     ]
                        [ - 3.525665283203125 ]         [ - 8.153533935546875 ]
                Col 3 = [                     ] Col 4 = [                     ]
                        [  3.166610717773438  ]         [  3.120513916015625  ]
                        [                     ]         [                     ]
                        [   - 0.44873046875   ]         [  0.80667114257813   ]
(%i12)  truncate(result);
(%o12) truncate(matrix([192.3637237548828, - 4.8795166015625, 
3.166610717773438, - 5.741058349609375], 
[- 4.017974853515625, 5.926788330078125, - 3.525665283203125, 
- 8.153533935546875], [- 2.833297729492188, 0.535888671875, 3.166610717773438, 
3.120513916015625], [1.76666259765625, 6.646804809570313, - 0.44873046875, 
0.80667114257813]))
(%i13) floor(-15/6);
(%o13)                                - 3
(%i14) truncate(-15/6);
(%o14)                                - 2
(%i15) 

Related Help

Help for Sign