The MASM Forum

Miscellaneous => Miscellaneous Projects => Windows Projects => Topic started by: RuiLoureiro on May 31, 2012, 10:59:09 PM

Title: The calculator
Post by: RuiLoureiro on May 31, 2012, 10:59:09 PM
 :biggrin:
Hi all
        This version is the result of what i learned
        till now. Some procedures are now lighter.
        Some strategies was corrected.
        Now, we have not "division by 0" but infinity.
        In this way, 1/(log(10)-1)* 0 gives "Indeterminate form"
        and not "division by 0".
       
        Now, it is time for corrections and improvements.
        Meanwhile, the calculator should solve any expression. ;)

        **** Here is calcula48 v1.08 ****

        Calculation rules

            1. terms inside parentheses or brackets
            2. functions
            3. exponents or powers
            4. multiplication and division
            5. addition and subtraction
           
    note 1: if we end a pair of brackets with !
            we must have a positive integer inside:      (12-3)!

    note 2: the exponents are treated as

            a)  real:       it is the general case
            b)  integer:    enclosed by brackets       (1-log(3))^(-2)   
            c)  rational:   enclosed by brackets       (1-log(3))^(-2/3)         

    note 3: roots are calculated following this rule:

            1. put the expression inside brackets:      (log(3)-log(2)*2)
            2. put the rational exponent inside brackets:   (n/k)
            3. use "^"
                        (log(3)-log(2)*2)^(n/k)

            square root: sqr(2*log(2)-log(3))=(2*log(2)-log(3))^(1/2)
                         = 0.353466740455591 = 0.353466740455591
                         
    note 4: exponents or powers are calculated starting at the end

            4^3^2:  first: 3^2 = 9  second: 4^9     4^3^2 = 262144.0

            (4^3)^2 = 64.0 ^2 = 4096.0

           
        We can define:
                        1. a set of 10 constants: type  t=10; s=2.25;u=-2.5e-3;

                        2. a function:      type    f(x)=x^2/(1-x)

                        3. a derivative:    type   df(x)=2*x-1
                       
                        4. up to 20 matrices, up to a 20*20 matrix:
                       
                        a=[1,2,2];          vector column       3 columns
                        b=[1;2;3];             "   line         3 lines
                        c=[1,2;2,3];        squared matrix

        We can solve:
                        1. Any expression
                        2. Mean(x1,...,xn):                  mean(12,13,12,13,14)
                        3. Factorial and k-combination of n: 12!, comb(12,3)
                        4. Logarithms of any base:           logb(15.2, 5)
                        5. Quadratic equations: aX^2+bX+c=c0
                        6. Systems of 2 equations: type aX+bY=c;fX+gY=h;
                        7. Systems of 3 equations: type aX+bY+cZ=d;fX+gY+hZ=i;                                                        jX+kY+mZ=l;
                        8. Systems of 4 equations: type aX+bY+cZ+dT=f;   
                                                                            gX+hY+iZ+jT=k;
                                                        lX+mY+nZ+oT=p;qX+rY+sZ+tT=u;

                        (note: a,b,c, ... are real numbers)

                        9. Conversion decimal-binary-hexadecimal - any 64-bit number

                           conv(11000) = 00002AF8H
                           conv(11000b)= 24
                           conv(11000h)= 69632

                       10. Linear interpolation:     type: point(1,2; 3,5) and g(x=2)
                                                                           or g(y=2)

                       11. The equation f(x)=0

                           a) root(x=-20, x=20; n=200)

                           b) root(x=-20, x=20; d=0.01)

                           c) root(x=-20, x=20; x=1.2)

                        note: in root(x=a, x=b; x=X0 ) a, b, X0 can be
                              -9pi,...,-1pi, -pi, pi, 2pi, 3pi,...,9pi,
                              -9e,...,-1e, -e, e, 2e, 3e,...,9e.

        Matrix operations

                . Copy

                    a=[1, 2; 3, 4];                     [press ENTER/COMPUTE]
                   
                    b=a;                                [press ENTER/COMPUTE]

                  Now we have a, b and a equal b

                . Addiction

                    a1=[1, 2; 3, 4];                    [press ENTER/COMPUTE]
                    a2=[5, 6; 7, 8];                    [press ENTER/COMPUTE]

                    a=a1+a2;                            [press ENTER/COMPUTE]

                . Subtraction

                    a1=[1, 2; 3, 4];                    [press ENTER/COMPUTE]
                    a2=[5, 6; 7, 8];                    [press ENTER/COMPUTE]

                    b=a1-a2;                            [press ENTER/COMPUTE]

                . Multiplication

                    a1=[1, 2; 3, 4];                    [press ENTER/COMPUTE]
                    a2=[5, 6; 7, 8];                    [press ENTER/COMPUTE]

                    c=a1*a2;                            [press ENTER/COMPUTE]

                . Scalar multiplication

                    a1=[1, 2; 3, 4];                    [press ENTER/COMPUTE]
                               
                    d=10 * a1;                          [press ENTER/COMPUTE]
                   
                    f=+ a1;                             [press ENTER/COMPUTE]
                   
                    g=- a1;                             [press ENTER/COMPUTE]

                . Transpose matrix

                    a1=[1, 2; 3, 4];                    [press ENTER/COMPUTE]

                    b=a1^t;                             [press ENTER/COMPUTE]
                  or
                    b=a1^T;                             [press ENTER/COMPUTE]

                    we get b=[ 1.0, 3.0; 2.0, 4.0];

                . Inverse matrix

                    a1=[1, 2; 3, 4];                    [press ENTER/COMPUTE]

                    b=a1^-1;                            [press ENTER/COMPUTE]
                    b=inv(a1)
                   
                    we get b=[-2.0, 1.0; 1.5,-0.5];

                . Determinant of a square matrix

                    . type
                            delta(a)                    [press ENTER/COMPUTE]
                            det(a)
                           
                            where a is a matrix name

        INFINITY and Indeterminate forms

            Use 1/0 or (1/0) for generate the infinity
           
            arcsec(1/0)= 1.570796326794897  arctan(1/0)= 1.570796326794897
            arctan(1/0)= 1.570796326794897  arccot(1/0)= 0
           
            1.570796326794897 = pi/2

            0/0 = Indeterminate form   
            0^0 = Indeterminate form
            (1/0)/(1/0) = Indeterminate form
            (1/0)* 0    = Indeterminate form
                                                                                     
        Detailed questions about pi

            Now, when we use pi we dont need to use *

            In this way, we can type any expression with pi like 

                        n pi  OR  +n pi  OR  -n pi       ( n integer )

                        r pi  OR  +r pi  OR  -r pi       ( r real, scientific notation)

            It is the same as
           
                        n*pi,     +n*pi,     -n*pi       ( we dont need to type * )

                        r*pi,     +r*pi,     -r*pi       ( we dont need to type * )

        Symbols

                    Type list and press ENTER/COMPUTE
                   
        Length of an expression or matrix

                    The calculator supports any expression or
                    matrix up to 3800 characters.

        Memories

                    The calculator has 6 memories to save any
                    expression or matrix in the input box.

        error function

                    Some functions use the system error = 1e-3
               
                    To set it to 1e-5, type error(1e-5)
                    and press ENTER/COMPUTE

        printing on the paper

                    . print()   prints the last results
                    . print(a)  prints the matrix a

        Constant name or Matrix name

            . It must start with a letter and it can have
              up to 8 characters;       
   
            . Type the constant name or the matrix name
              and press ENTER/COMPUTE to see its definition or value.


        Constants

              Any integer or real number, scientific notation
                    e, +e, -e, pi, +pi, -pi


        Keys

              . ENTER to compute
              . DELETE to clean the input box

              . Use Home, End, Ctrl+Home, Ctrl+End etc.
                when we have the focus in the input box.

        Big expressions... or not

              We can use a text editor to type it.
              Then we copy and paste it into the edit box.

        Some numbers

              1700!   =  2.99835320555842E+4755
              e^10000 =  8.806818225662921E+4342

        Try it and say something.
        Good luck !
        Thanks       
        Rui Loureiro

EDIT: i decided to replace calcula50 by the new calcula51
         See the last post
        I made some corrections in Calcula50

        calcula51 has a new look

        Good luck
        Rui Loureiro

EDIT:   now we have Calcula55 the version 3.00.1 with new functions and the file of rules RulesV2_20.txt
Please, see the last post

EDIT: I replaced Calcula58 by the new powerful Calcula59
      It works with complex numbers. Please see the last post

EDIT: I replaced Calcula59 by the new powerful Calcula60
      It works with complex numbers and complex functions.
      Please see the last post

        note:   RulesV3_10_2I   - rules in English
                    RulesV3_10_2P   - regras em Português

EDIT: I replaced Calcula62 by the new powerful Calcula63
      Please see the last post to get the examples

       EDIT: I replaced calcula66 by calcula67
                       to correct some problems

         DERIVATIVES : compute a derivative of any function
                                  See the link in the last post
                               
Title: Re: The calculator
Post by: RuiLoureiro on June 07, 2012, 04:11:25 AM
Hi all
        News

            The previous calcula48 doesnt work with
            -INFINITY and +INFINITY.

            Now i never test for overflow or division by 0
            or other case than "invalid operation".
            After getting "invalid operation" we examine
            the case (we have 25 for powers).
            To have no problems, we should use fclex before.           


        **** Here is calcula49 v1.09 ****

            Now the calculator gives results from
            -INFINITY  to +INFINITY  or "indeterminate form"
            or ERROR.
           
            It seems also that i solved all cases of
            "indeterminate forms":

            0/0     00/00   00-00   0*00   

            0^0     1^+00   1^-00   +00^0   -00^0

            It gave me a lot of work to put it to work correctly
            and to test each case.

            Some cases:

            1/0^3 = +INFINITY       -(ln(e)-1)^-(1/0) = -INFINITY

            -(-2/0)^(1/(2+1))= -(-INFINITY)^0.333333333333333 = ERROR
            but
            -(-2/0)^(1/3) = +INFINITY

            (4*3-11)^-(3/(log(10)-1)) = Indeterminate form


        Try it and say something.
        Good luck !

        Thanks       
        Rui Loureiro
Title: Re: The calculator
Post by: RuiLoureiro on June 10, 2012, 02:46:59 AM
raymond,
         i added hyperbolic functions to calcula49
         and now i want to test it.
         I used your Ztest but i get this values
         (it seems that something is wrong)

                         Ztest                             calcula50
arcsinh(1)= 0.881373587019543          0.881373587019543
arccosh(1)=0.000000000931323           0
arctanh(1)=21.48756259735830           +INFINITY
arccoth(1)=21.48756259735830           +INFINITY
arccsch(1)= 0.881373587019543          0.881373587019543
arcsech(1)=0-i0.000000000931323        0

arcsinh(-1234566677889e2345) = 0       -5428.096931407931
arcsinh(-1234566677889e3345) = 0       -INFINITY

arcsinh(+1234566677889e2345) = 0       5428.096931407931
arcsinh(+1234566677889e3345) = 0       +INFINITY
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2012, 12:13:28 AM
Hi all

Hyperbolic functions:

Can anyone confirm this values ?
Thanks  ;)

sinh(x), tanh(x), coth(x), csch(x) are odd functions: sinh(-x)=-sinh(x)...
cosh(x), sech(x) are even functions: cosh(-x)=cosh(x)

sinh(-1/0) = -INFINITY
sinh(-1.234566677889e2375) = -INFINITY
sinh(-7200) = 4.161402346759365E+3126
sinh(-5) = -74.20321057778876

sinh(-1.0E-6) = -0.000001
sinh(0) = 0
sinh(+1.0E-6) =  0.000001

sinh(5) = 74.20321057778876
sinh(7200) =-4.161402346759365E+3126
sinh(1.234566677889e2375) = +INFINITY
sinh(1/0)= +INFINITY

cosh(-1/0) = +INFINITY
cosh(-1.234566677889e2375)= +INFINITY
cosh(-7200) = 4.161402346759365E+3126
cosh(-5) =  74.20994852478784

cosh(-1.0E-6) = 1.0000000000005
cosh(0) = 1.0
cosh(+1.0E-6) = 1.0000000000005

cosh(5) =   74.20994852478784
cosh(7200) = 4.161402346759365E+3126
cosh(1.234566677889e2375) = +INFINITY
cosh(1/0)= +INFINITY

tanh(-1/0) = -1.0
tanh(-1.234566677889e2375)= -1.0
tanh(-7200) =-1.0
tanh(-5) = -0.999909204262595

tanh(-1.0E-6) = -9.999999999996327E-0007
tanh(0) = 0
tanh(+1.0E-6) =  9.999999999996327E-0007

tanh(5) =  0.999909204262595
tanh(7200) = 1.0
tanh(1.234566677889e2375) = 1.0
tanh(1/0)= 1.0

coth(-1/0) = -1.0
coth(-1.234566677889e2375)= -1.0
coth(7200) = -1.0
coth(-5) = -1.000090803982019

coth(-1.0E-6) = -1000000.000000367
coth(0) = Undefined
coth(1.0E-6) =  1000000.000000367

coth(5) =   1.000090803982019
coth(7200) = 1.0
coth(1.234566677889e2375) =1.0
coth(1/0)= 1.0

sech(-1/0) = 0
sech(-1.234566677889e2375)= 0
sech(-7200) = 0
sech(-5) = 0.013475282221305

sech(-1.0E-6) =  0.9999999999995
sech(0) = 1.0
sech(+1.0E-6) =  0.9999999999995

sech(5) =  0.013475282221305
sech(7200) = 0
sech(1.234566677889e2375)= 0
sech(1/0)= 0

csch(-1/0) = 0
csch(-1.234566677889e2375)= 0
csch(-7200) = 0
csch(-5) = -0.013476505830589
csch(-1.0E-6) = -999999.9999998673
csch(0) = Undefined
csch( 1.0E-6) =  999999.9999998673
csch(5) =   0.013476505830589
csch(7200) = 0
csch(1.234566677889e2375)= 0
csch(1/0)= 0
Title: Re: The calculator
Post by: MichaelW on June 11, 2012, 07:14:25 AM
Using the Windows calculator:

sinh(-1/0) = -INFINITY                    will not paste
sinh(-1.234566677889e2375) = -INFINITY    too slow
sinh(-7200) = 4.161402346759365E+3126     -4.1614023467593632561951834091827e+3126
sinh(-5) = -74.20321057778876             -74.203210577788758977009471996065

-1.0e-6 :e
sinh(-1.0E-6) = -0.000001                 -0.000001000000000000166666666666675
sinh(0) = 0                               0
+1.0e-6 :e
sinh(+1.0E-6) =  0.000001                 0.000001000000000000166666666666675

sinh(5) = 74.20321057778876               74.203210577788758977009471996065
sinh(7200) =-4.161402346759365E+3126      4.1614023467593632561951834091827e+3126
sinh(1.234566677889e2375) = +INFINITY     invalid input for function
sinh(1/0)= +INFINITY                      will not paste

cosh(-1/0) = +INFINITY                    will not paste
cosh(-1.234566677889e2375)= +INFINITY     invalid input for function
cosh(-7200) = 4.161402346759365E+3126     4.1614023467593632561951834091827e+3126
cosh(-5) =  74.20994852478784             74.209948524787844444106108044488

-1.0e-6 :e
cosh(-1.0E-6) = 1.0000000000005           1.0000000000005000000000000416667
cosh(0) = 1.0                             1
+1.0e-6 :e
cosh(+1.0E-6) = 1.0000000000005           1.0000000000005000000000000416667

cosh(5) =   74.20994852478784             74.209948524787844444106108044488   
cosh(7200) = 4.161402346759365E+3126      4.1614023467593632561951834091827e+3126
1.234566677889e2375 :e
cosh(1.234566677889e2375) = +INFINITY     invalid input for function
cosh(1/0)= +INFINITY                      will not paste                   

tanh(-1/0) = -1.0                         will not paste
tanh(-1.234566677889e2375)= -1.0          too slow
tanh(-7200) =-1.0                         -1
tanh(-5) = -0.999909204262595             -0.99990920426259513121099044753447 

-1.0e-6 :e
tanh(-1.0E-6) = -9.999999999996327E-0007  -0.0000009999999999996666666666668
tanh(0) = 0                               0   
+1.0e-6 :e
tanh(+1.0E-6) =  9.999999999996327E-0007  0.0000009999999999996666666666668   

tanh(5) =  0.999909204262595              0.99990920426259513121099044753447
tanh(7200) = 1.0                          1 
tanh(1.234566677889e2375) = 1.0           invalid input for function
tanh(1/0)= 1.0                            will not paste

do not know how to calc coth, trying cosh/sinh

coth(-1/0) = -1.0                         will not paste
coth(-1.234566677889e2375)= -1.0          invalid input for function
coth(7200) = -1.0                         1
coth(-5) = -1.000090803982019             -1.0000908039820193755366579205217

-1.0e-6 :e
coth(-1.0E-6) = -1000000.000000367        -1000000.0000003333333333333111111
coth(0) = +INFINITY                       0 
1.0e-6 :e
coth(1.0E-6) =  1000000.000000367         1000000.0000003333333333333111111

coth(5) =   1.000090803982019             1.0000908039820193755366579205217
coth(7200) = 1.0                          1
coth(1.234566677889e2375) =1.0            invalid input for function
coth(1/0)= 1.0                            will not paste

do not know how to calc sech, trying 1/cosh

sech(-1/0) = 0                            will not paste     
sech(-1.234566677889e2375)= 0             invalid input for functon
sech(-7200) = 0                           2.4030360841670037099489877684017e-3127 
sech(-5) = 0.013475282221305              0.013476505830589086655381881284338

-1.0e-6 :e
sech(-1.0E-6) =  0.9999999999995          0.99999999999950000000000020833333
sech(0) = 1.0                             1
+1.0e-6 :e
sech(+1.0E-6) =  0.9999999999995          0.99999999999950000000000020833333

sech(5) =  0.013475282221305              0.013475282221304557305519138244882
sech(7200) = 0                            2.4030360841670037099489877684017e-3127
sech(1.234566677889e2375)= 0              invalid input for function
sech(1/0)= 0                              will not paste

do not know how to calc csch, trying 1/sinh

csch(-1/0) = 0                            will not paste 
csch(-1.234566677889e2375)= 0             too slow
csch(-7200) = 0                           -2.4030360841670037099489877684017e-3127
csch(-5) = -0.013476505830589             -0.013476505830589086655381881284338     
-1.0e-6 :e
csch(-1.0E-6) = -999999.9999998673        -999999.99999983333333333335277778
csch(0) = +INFINITY                       cannot divide by zero
1.0e-6 :e
csch( 1.0E-6) =  999999.9999998673        999999.99999983333333333335277778
csch(5) =   0.013476505830589             0.013476505830589086655381881284338
csch(7200) = 0                            2.4030360841670037099489877684017e-3127
csch(1.234566677889e2375)= 0              invalid input for function
csch(1/0)= 0                              will not paste
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2012, 09:10:41 PM
Hi Michael,
            Thanks for reply  :t
           
I corrected this:

sinh(-7200) = -4.161402346759365E+3126      «« copy-paste problem
sinh( 7200) =  4.161402346759365E+3126      «« copy-paste problem

sech(-7200) =  2.403036084167004E-3127
sech( 7200) =  2.403036084167004E-3127

coth(0)     = Undefined         This is undefined because it can be
csch(0)     = Undefined         -INFINITY or +INFINITY

It seems all results are correct
meanwhile you gave this result

coth(0)     = +INFINITY                   0
but it seems you want to write
coth(0)     = +INFINITY              cannot divide by zero

One question: the Windows calculator uses Real10 or another code?
              Do you know, Michael ?

        Many thanks

EDIT:
sinh(-1.0E-6) = -0.000001       Windows calculator=-0.000001000000000000166666666666675It seems i need to add a randon number generator to give 18 digits
+15 generated, no one knows if it is correct or not ! :greensml:
Title: Re: The calculator
Post by: RuiLoureiro on June 12, 2012, 01:17:10 AM
Hi all

Hyperbolic inverse functions:

Anyone can confirm this values ?

arcsinh(x)=ln(x+sqrt(x^2+1))
arcsinh(-1/0) = -INFINITY
arcsinh(-1.234566677889e2375) = -5469.543463081824
arcsinh(-7200)  = -9.574983490386623
arcsinh(-5)     = -2.312438341272753
arcsinh(-1.0e-6)= -9.999999999998556E-0007
arcsinh(0)      = 0
arcsinh(1.0e-6) =  9.999999999998556E-0007
arcsinh(5)      = 2.312438341272753
arcsinh(7200)   = 9.574983490386623
arcsinh(1.234566677889e2375)  = 5469.543463081824
arcsinh(1/0)    = +INFINITY

arccosh(x)=ln(x+sqrt(x^2-1))         ; it is defined for x>=1
arccosh(-1/0) = Undefined         
arccosh(-5)   = Undefined
arccosh(0)    = Undefined
arccosh(0.99) = Undefined
arccosh(1)    = 0
arccosh(5)    = 2.292431669561178
arccosh(7200) = 9.574983480741561
arccosh(1.234566677889e2375) =  5469.543463081824
arccosh(1/0)  = +INFINITY

note1: if x is very large, arcsinh(x)=~arccosh(x)

arctanh(x)=2^-1* ln((1+x)/(1-x))     ; it is defined for |x|<1
arctanh(-1/0) = Undefined   
arctanh(-1.234566677889e2375) = Undefined
arctanh(-5)   = Undefined
arctanh(-1)   = -INFINITY

arctanh(-0.1) = -0.100335347731076
arctanh(-0.01)= -0.010000333353335
arctanh(-0.001) = -0.001000000333334
arctanh(0)      = 0
arctanh(0.001)  =  0.001000000333334
arctanh(0.01)=  0.010000333353335
arctanh(0.1) =  0.100335347731076

arctanh(1)    = +INFINITY
arctanh(1/0)  = Undefined

arccoth(x)=2^-1* ln((x+1)/(x-1))     ; it is defined for |x|>1
arccoth(-1/0) = 0         
arccoth(-5)   = -0.202732554054082
arccoth(-1.99)= -0.552661861628048
arccoth(-1)   = -INFINITY

arccoth(-0.99)= Undefined
arccoth(0)    = Undefined
arccoth(0.99) = Undefined

arccoth(1)    = +INFINITY
arccoth(1.99) = 0.552661861628048
arccoth(5)    = 0.202732554054082
arccoth(1/0)  = 0       

arcsech(-1/0) = Undefined           ; it is defined for 0 < x <= 1
arcsech(-5)   = Undefined
arcsech(0)    = Undefined       +INFINITY / -INFINITY

arcsech(1.0E-8)= 19.11382792451231
arcsech(0.001)=  7.600902209541989
arcsech(0.01) =  5.298292365610485
arcsech(0.1)  =  2.993222846126381

arcsech(0.99999)        = 0.00447215458902
arcsech(0.999999999999) = 0.000001414213445
arcsech(1)    =  0

arcsech(5)    = Undefined
arcsech(1/0)  = Undefined

arccsch(-1/0) = 0
arccsch(-1.234566677889e2375)= 0
arccsch(-7200)= -0.000138888888442
arccsch(-5)   = -0.198690110349241
arccsch(-1)   = -0.881373587019543

arccsch(-1.0E-8)= -19.11382792451231
arccsch(0)    = Undefined               +INFINITY / -INFINITY
arccsch(1.0E-8)= 19.11382792451231

arccsch(1)    = 0.881373587019543
arccsch(5)    = 0.198690110349241
arccsch(7200) = 0.000138888888442

arccsch(1.234566677889e2375)= 0
arccsch(1/0)  = 0
Title: Re: The calculator
Post by: MichaelW on June 12, 2012, 09:04:36 AM
Hi Rui,

The Windows calculator uses some sort of extended precision that can be very slow for some operations.

QuoteExtended Precision, a feature of Calculator, means that all operations are accurate to at least 32 digits. Calculator also stores rational numbers as fractions to retain accuracy. For example, 1/3 is stored as 1/3, rather than .333. However, errors accumulate during repeated operations on irrational numbers. For example, Calculator will truncate pi to 32 digits, so repeated operations on pi will lose accuracy as the number of operations increases.
Title: Re: The calculator
Post by: RuiLoureiro on June 13, 2012, 03:07:41 AM
Ok, Michael,
thank you  :t
Title: Re: The calculator
Post by: RuiLoureiro on June 14, 2012, 01:26:42 AM
Hi all

        **** Here is calcula50 v1.10 ****

            Now, we have 57 functions
           
            Now, the calculator gives results from
                -INFINITY  to +INFINITY             
            or
                undefined               e.g. ln(-1), arccos(-2), SIN(1/0)
            or
                "indeterminate form"    e.g. 0/0           
            or
                Operand too long e.g. 4444444444444444445
            or
                ERROR.
           
            Now, the calculator solves all trigonometric functions,
            all inverse trigonometric functions
            all hyperbolic functions
            and all inverse hyperbolic functions.

            functions: atan2(y,x) and atan2d(y,x)

            e.g.    atan2d(24,sqr(3+1)) = 85.23635830927382
                    1+atan2d(24,sqr(-3+1)) = Undefined because sqr(-3+1) is Undefined

        If you want to give any suggestion
        please, answer this post
       
        Try it and say something.
        Good luck !

        Thanks       
        Rui Loureiro
Title: Re: The calculator
Post by: RuiLoureiro on June 30, 2012, 05:42:44 AM
        **** Here is calcula51 v1.11 ****

        I made some corrections in Calcula50

        calcula51 has a new look

        Good luck
        Rui Loureiro
Title: Re: The calculator
Post by: Farabi on June 30, 2012, 02:05:29 PM
Whoa, cool man, can I use it on my project?  :t
Title: Re: The calculator
Post by: RuiLoureiro on June 30, 2012, 07:42:20 PM
Quote from: Farabi on June 30, 2012, 02:05:29 PM
Whoa, cool man, can I use it on my project?  :t
Yes, Farabi, where you want no problems  :t
               If you know some erros, please tell me
               i correct it
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2013, 07:26:02 AM
Hi all

***** Here is The calculator v2.20 *****

In this version we have:

1. conversions decimal-hexadecimal-binary

    note:  -  => two's complement

    type: -12d      (decimal end with "d" or "D")

    we get:     unsigned: 18446744073709551604 / signed: -12
                         
                FFFFFFFFFFFFFFF4H
                11111111111111111111111111111111
                11111111111111111111111111110100B

    type: 18446744073709551604d

    we get:     18446744073709551604d
   
                FFFFFFFFFFFFFFF4H
                11111111111111111111111111111111   
                11111111111111111111111111110100B


    type:   FFFFFFFFFFFFFFF4H

    we get:     unsigned: 18446744073709551604 / signed: -12
                         
                FFFFFFFFFFFFFFF4H
                11111111111111111111111111111111
                11111111111111111111111111110100B


    type:   FFFFFFFFFFFFFFFFH

    we get:     unsigned: 18446744073709551615 / signed: -1
                FFFFFFFFFFFFFFFFH
                11111111111111111111111111111111
                11111111111111111111111111111111B               


    type:   7FFF FFFF FFFF FFFFh

    we get:     9223372036854775807

                7FFFFFFFFFFFFFFFh
                01111111111111111111111111111111
                11111111111111111111111111111111B
               
    type:   9223372036854775807d   
       
    we get:     9223372036854775807d       
                7FFFFFFFFFFFFFFFH
                01111111111111111111111111111111
                11111111111111111111111111111111B


2. logic expressions

    first: shl and shr
    next:  or, and, xor (or = +)
   
    -   :  invert
   
    type:   21h shl 2d + 34h and -56h shl 3d and 99h xor 12h

    we get:     18
                00000012H
                00000000000000000000000000010010B
   
    type:   -(21h shl 2d) + 34h and -56h shl 3d and 99h xor 12h

    we get:     26
                0000001AH
                00000000000000000000000000011010B

    type:   -(21h shl 2d + (34h and -56h) shl 3d and 99h xor 12h)

    we get:     unsigned: 18446744073709551469 / signed: -147
                FFFFFFFFFFFFFF6DH
                11111111111111111111111111111111
                11111111111111111111111101101101B

Now i need to do some more tests
but it seems it works correctly
Rui Loureiro
Title: Re: The calculator
Post by: dedndave on June 11, 2013, 09:49:21 AM
nice, Rui   :t
Title: Re: The calculator
Post by: qWord on June 11, 2013, 10:35:08 AM
hello,
what must be inputted to get the derivate of (e.g.) f(x)=x2?
For: df(x)=x^2 [ENTER] -> df(x=1) [ENTER] we get the output: X=1 and df(X)= 1.0, which is wrong.

regards, qWord
Title: Re: The calculator
Post by: MichaelW on June 11, 2013, 11:06:21 AM
Rui,

I tested one of your expressions in test apps compiled with FreeBASIC and C (MSVC and GCC), and your expression evaluator produces a different result. Sorry, I didn't have time to test the other expressions.

dim as longint i
i = -(&h21 shl 2 + (&h34 and -&h56) shl 3 and &h99 xor &h12)
print i
print hex(i)
sleep

/'
Relevant parts of operator precedence table:

Operator  Description           Associativity

  ^       Exponentiate          Left-to-Right
  -       Negate                Right-to-Left
  *       Multiply              Left-to-Right
  /       Divide                Left-to-Right
  MOD     Modulus               Left-to-Right
  SHL     Shift left            Left-to-Right
  SHR     Shift right           Left-to-Right
  +       Add                   Left-to-Right
  -       Subtract              Left-to-Right
  =       Equal                 Left-to-Right
  <>      Not equal             Left-to-Right
  <       Less than             Left-to-Right
  <=      Less than or equal    Left-to-Right
  >=      Greater than or equal Left-to-Right
  >       Greater than          Left-to-Right
  NOT     Complement            Right-to-Left
  AND     Conjunction           Left-to-Right
  OR      Inclusive Disjunction Left-to-Right
  EQV     Equivalence           Left-to-Right
  IMP     Implication           Left-to-Right
  XOR     Exclusive Disjunction  Left-to-Right
'/


-146
FFFFFFFFFFFFFF6E


#include <conio.h>
#include <stdio.h>
void main( void )
{
    long long i;
    i = -((0x21 << 2) + ((0x34 & -0x56) << 3) & 0x99 ^ 0x12);
    printf("%I64d\n%I64X\n",i,i);
    getch();
}

/*
Relevant parts of operator precedence table:

Operator  Description                 Associativity

  +       Unary plus                  Right-to-left
  -       Unary minus                 Right-to-left
  ~       Bitwise NOT                 Right-to-left
  *       Multiplication              Left-to-right
  /       Division                    Left-to-right
  %       Modulo (remainder)          Left-to-right
  +       Addition                    Left-to-right
  -       Subtraction                 Left-to-right
  <<      Bitwise left shift          Left-to-right
  >>      Bitwise right shift         Left-to-right
  <       Less than                   Left-to-right
  <=      Less than or equal to       Left-to-right
  >       Greater than                Left-to-right
  >=      Greater than or equal to    Left-to-right
  ==      Equal to                    Left-to-right
  !=      Not equal to                Left-to-right
  &       Bitwise AND                 Left-to-right
  ^       Bitwise XOR (exclusive or)  Left-to-right
  |       Bitwise OR (inclusive or)   Left-to-right
  =       Direct assignment           Right-to-left
*/


-146
FFFFFFFFFFFFFF6E

Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2013, 08:09:28 PM
Dave,
            :t
       
hello qWord,

        We have not any way to get a derivative from f(x).
        We should write f(x) and we should write
        df(x) also.
        In this way for f(x)=x^2 we should write
        df(x)=2*x. For instance, for
        f(x)=x^2+sin(x) we have df(x)=2*x+cos(x).
        df(x) is used in one case in the root function.

        Rules: If we define f(x)=x^2 it is wrong to
               define the derivative of f(x) as
               the function df(x)=x^2.
               When we are typing df(x)= ...
               we are defining it.

        note: if f(x)=x^3/3 then df(x)= x^2.

best regards  :t
Rui
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2013, 08:11:30 PM
MichaelW,

        Thanks for your tests

        When i thought to include logic expressions
        the question was this: what operators to use.
        May be someone should help me

        In any way, i defined the next set of operators

        operators          what to do
        -------------     -----------------------
           - (minus)    invert the operand    => -1100b => 0011b
                        (the same as NOT)

           + (plus)     the same as OR

           OR           the same as "or"      => 11 0101b or  00 1101b => 11 1101b
                          instruction   

          AND        the same as "and"    => 11 0101b and 00 1101b => 00 0101b
                          instruction   

          XOR         the same as "xor"     => 11 0101b xor 00 1101b => 11 1000b
                          instruction   

          SHL           the same as "shl"     => 11 0101b shl 2d       => 1101 0100b
                          instruction   

          SHR           the same as "shr"     => 11 0101b shr 2d       => 0000 1101b
                          instruction   


        We may use or, and, xor, shl, shr also.
        The calculator doesnt use "not" or "NOT".

        -------------------------------
        How the calculator works
        --------------------------------

            First: any number with minus sign is inverted
                   before starting the operation.
                   
                   In this way writing -1100b is the same
                   as writing 0011b (it should be).

            Next:  first operate SHL / SHR from left to right
                   and next all others. We may change this
                   rule using brackets.

            If we want to change this rules we need to use
            brackets. We may use as many as we want.
           
example:
        This:
                                             
           -(&h21 shl 2 + (&h34 and -&h56) shl 3 and &h99 xor &h12)

        is this:
       
    type:   -(21h shl 2d + (34h and -56h) shl 3d and 99h xor 12h)

    we get:     unsigned: 18446744073709551469 / signed: -147
                FFFFFFFFFFFFFF6DH
                11111111111111111111111111111111
                11111111111111111111111101101101B


        So
            1. We solve this: (34h and -56h)   
       
                32
                00000020H
                00000000000000000000000000100000B

            Now the expression is:

                -(21h shl 2d + 20h shl 3d and 99h xor 12h)

            2. From left to right we need to solve 21h shl 2d

               21h shl 2d = 132
                            00000084H
                            00000000000000000000000010000100B

            Now the expression is:

                -(84h + 20h shl 3d and 99h xor 12h)


            3. From left to right we need to solve 20h shl 3d

                20h shl 3d = 256
                             00000100H
                             00000000000000000000000100000000B

            Now the expression is:

                -(84h + 100h and 99h xor 12h) = -(84h or 100h and 99h xor 12h) =


            Now we solve it from left to right:

                    84h or 100h = 388
                                  00000184H
                                  00000000000000000000000110000100B

                = -(184h and 99h xor 12h)


                    184h and 99h = 128
                                   00000080H
                                   00000000000000000000000010000000B

                = -(80h xor 12h)

                    80h xor 12h = 146
                                  00000092H
                                  00000000000000000000000010010010B

                = -92h

            Now we should invert it               

                = -00000000000000000000000010010010B
               
                =   111111111111111111111111 1111 1111
                    111111111111111111111111 0110 1101b

            To use the calculator we should use this: -92h or 0h
            (because -92h gives the two's complement not the inverse)

            The result is this:
                               
            unsigned: 18446744073709551469 / signed: -147
            FFFFFFFFFFFFFF6DH
            111111111111111111111111 1111 1111
            111111111111111111111111 0110 1101B

               
            I think that the problem is (or seems to be) the calculation rules
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2013, 08:47:07 PM
MichaelW,
            From your data we have

Relevant parts of operator precedence table I:

Operator  Description           Associativity

  ^       Exponentiate          Left-to-Right
  -       Negate                Right-to-Left
  *       Multiply              Left-to-Right
  /       Divide                Left-to-Right
  MOD     Modulus               Left-to-Right
  SHL     Shift left            Left-to-Right
  SHR     Shift right           Left-to-Right
  +       Add                   Left-to-Right
  -       Subtract              Left-to-Right
  =       Equal                 Left-to-Right
  <>      Not equal             Left-to-Right
  <       Less than             Left-to-Right
  <=      Less than or equal    Left-to-Right
  >=      Greater than or equal Left-to-Right
  >       Greater than          Left-to-Right
  NOT     Complement            Right-to-Left
  AND     Conjunction           Left-to-Right
  OR      Inclusive Disjunction Left-to-Right
  EQV     Equivalence           Left-to-Right
  IMP     Implication           Left-to-Right
  XOR     Exclusive Disjunction  Left-to-Right



Relevant parts of operator precedence table II:

Operator  Description                 Associativity

  +       Unary plus                  Right-to-left
  -       Unary minus                 Right-to-left
  ~       Bitwise NOT                 Right-to-left
  *       Multiplication              Left-to-right
  /       Division                    Left-to-right
  %       Modulo (remainder)          Left-to-right
  +       Addition                    Left-to-right
  -       Subtraction                 Left-to-right
  <<      Bitwise left shift          Left-to-right
  >>      Bitwise right shift         Left-to-right
  <       Less than                   Left-to-right
  <=      Less than or equal to       Left-to-right
  >       Greater than                Left-to-right
  >=      Greater than or equal to    Left-to-right
  ==      Equal to                    Left-to-right
  !=      Not equal to                Left-to-right
  &       Bitwise AND                 Left-to-right
  ^       Bitwise XOR (exclusive or)  Left-to-right
  |       Bitwise OR (inclusive or)   Left-to-right
  =       Direct assignment           Right-to-left


--------------------------------------------------------
The calculator operator precedence table III
--------------------------------------------------------

Operator  Description           Associativity  Priority

  SHL     Shift left            Left-to-Right     1
  shl
 
  SHR     Shift right           Left-to-Right     1
  shr
 
  -       Complement            Left-to-Right     0
 
  AND     Conjunction           Left-to-Right     2
  and
 
  OR      Inclusive Disjunction Left-to-Right     2
  or 
  +       Inclusive Disjunction Left-to-Right     2

  XOR     Exclusive Disjunction Left-to-Right     2
  xor

1. First are executed expressions inside brackets

2. All expressions are executed from left to right

3. Priority 0 means that it is executed before any other

4. All expressions with priority 1 are executed before
   that with priority 2

NOTE: for decimal values we must end with "d" or "D"
           For instance, 12345 should be 12345d or 12345D with spaces
           or not
Title: Re: The calculator
Post by: dedndave on June 11, 2013, 09:01:01 PM
you could also add a few logic operations that CPU's don't generally support

NAND = NOT AND
NOR  = NOT OR
XNOR = NOT XOR


when i design circuits, i find that NAND and NOR gates are more versatile than AND and OR gates   :P
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2013, 09:04:07 PM
Quote from: dedndave on June 11, 2013, 09:01:01 PM
you could also add a few logic operations that CPU's don't generally support

NAND = NOT AND
NOR  = NOT OR
XNOR = NOT XOR


when i design circuits, i find that NAND and NOR gates are more versatile than AND and OR gates   :P
Yes it is true,
Ok, i will do it Dave  :t
Title: Re: The calculator
Post by: dedndave on June 11, 2013, 09:05:24 PM
if f(x) = x2, then f'(x) = 2x, and f''(x) = 2   :biggrin:
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2013, 09:10:09 PM
Quote from: dedndave on June 11, 2013, 09:05:24 PM
if f(x) = x2, then f'(x) = 2x, and f''(x) = 2   :biggrin:
:biggrin:
Hey, Dave i wrote this:
Quote
In this way for f(x)=x^2 we should write
        df(x)=2*x.
and you should know that 2X is equal to 2*X.
         Dave about this i know what i am doing !
Title: Re: The calculator
Post by: daydreamer on June 12, 2013, 10:20:03 PM
Quote from: dedndave on June 11, 2013, 09:01:01 PM
you could also add a few logic operations that CPU's don't generally support

NAND = NOT AND
NOR  = NOT OR
XNOR = NOT XOR


when i design circuits, i find that NAND and NOR gates are more versatile than AND and OR gates   :P
whats wrong with PANDN instruction?
Title: Re: The calculator
Post by: qWord on June 13, 2013, 12:11:11 AM
Quote from: daydreamer2 on June 12, 2013, 10:20:03 PM
Quote from: dedndave on June 11, 2013, 09:01:01 PM
you could also add a few logic operations that CPU's don't generally support

NAND = NOT AND
NOR  = NOT OR
XNOR = NOT XOR


when i design circuits, i find that NAND and NOR gates are more versatile than AND and OR gates   :P
whats wrong with PANDN instruction?
NAND is: C = NOT (A AND B);
PANDN does: C = (NOT A) AND B
Title: Re: The calculator
Post by: dedndave on June 13, 2013, 12:30:04 AM
the PORN operation would be nice, also   :badgrin:

i can't buy those gates in TTL or CMOS DIP packages
but, i can use them in ASIC designs   :P
Title: Re: The calculator
Post by: RuiLoureiro on June 13, 2013, 01:46:24 AM
                        *** The Calculator v2.20 ***

The previous Calculator v2.10 doesnt solve
logic expressions correctly because i didnt write
the basic algorithm correctly - problems with brackets.

Now we have also the text file RulesV2_20.txt where i
say something about the calculator and not only.

You are there,
Read it and then ... say something
Sorry if i am not good in writing words, words, words ...

Good Luck
Thanks      :t
RuiLoureiro

Files: Calcula54.zip & RulesV2_20.zip


        Logic Expressions
        --------------------------

                    The calculator operator precedence table
                    ----------------------------------------------------
                   
                  Operator  Description           Associativity  Priority

                    SHL     Shift left            Left-to-Right     1
                    shl
 
                    SHR     Shift right           Left-to-Right     1
                    shr
 
                    -       Complement (=NOT)     Left-to-Right     0
 
                    AND     Conjunction           Left-to-Right     2
                    and
 
                    OR      Inclusive Disjunction Left-to-Right     2
                    or 
                    +       Inclusive Disjunction Left-to-Right     2

                    XOR     Exclusive Disjunction Left-to-Right     2
                    xor

                    NAND    not AND =-(x.y)       Left-to-Right     2
                    nand

                    NOR     not OR  =-(x+y)       Left-to-Right     2
                    nor

                    NXOR    not XOR               Left-to-Right     2
                    nxor


                    1. Expressions inside brackets are executed first

                    2. All expressions are executed from left to right

                    3. Priority 0 means that it is executed before any other

                    4. All expressions with priority 1 are executed before
                       that with priority 2

                    NOTE: for decimal values we must end with "d" or "D"
                          if it is the last value.
                    For instance, 12345 should be 12345d or 12345D with spaces
                    or not

        ------------
        Examples
        ------------
   
    type:   21h shl 2d + 34h and -56h shl 3d and 99h xor 12h

    we get:     18
                00000012H
                00000000000000000000000000010010B
   
    type:   -(21h shl 2d) + 34h and -56h shl 3d and 99h xor 12h

    we get:     26
                0000001AH
                00000000000000000000000000011010B

    type:   -(21h shl 2d + (34h and -56h) shl 3d and 99h xor 12h)

    we get:     unsigned: 18446744073709551469 / signed: -147
                FFFFFFFFFFFFFF6DH
                11111111111111111111111111111111
                11111111111111111111111101101101B

               
    type:   34h and 56h shl 3d + 24h nand 56 shr 2d nor 33 nxor 20h xor 11111b

    we get:     unsigned: 18446744073709551556 / signed: -60
                FFFFFFFFFFFFFFC4H
                11111111111111111111111111111111
                11111111111111111111111111000100B


    type:   -(34h and (56h shl 3d) or (24h nand 56) shr 2d nor 33+22 nxor 20h) xor 11111b

    we get:     unsigned: 13835058055282163745 / signed: -4611686018427
                C000000000000021H
                11000000000000000000000000000000
                00000000000000000000000000100001B

               
    type:  -(34h and (56h shl 3d) or (24h nand 56) shr 2d nor 33 or 22 nxor 20h) xor 11111b

                unsigned: 13835058055282163745 / signed: -4611686018427
                C000000000000021H
                11000000000000000000000000000000
                00000000000000000000000000100001B


    type:   -(34h and -(56h shl 3d) or -(24h nand 56) shr 2d nor 33+22 nxor 20h) xor 11111b

    we get:     unsigned: 18446744073709551593 / signed: -23
                FFFFFFFFFFFFFFE9H
                11111111111111111111111111111111
                11111111111111111111111111101001B


    type:   -(1101b AND -(56h SHL 11b) OR -(24h nand 56) shr 2d nor 33+01100111b nxor 20h) xor 11111b

    we get:     unsigned: 18446744073709551560 / signed: -56
                FFFFFFFFFFFFFFC8H
                11111111111111111111111111111111
                11111111111111111111111111001000B


    type:   -(000000000000000000000000000001101h AND -(56h SHL 11b) OR -(24h nand 56) shr 2d nor 33+01100111b nxor 20h) xor 11111b

    we get:     unsigned: 18446744073709547208 / signed: -4408
                FFFFFFFFFFFFEEC8H
                11111111111111111111111111111111
                11111111111111111110111011001000B


    type:   (-(1101b AND -(56h SHL 11b) OR -(24h nand 56) shr 2d nor 33+01100111b nxor 20h) xor 11111b)
            or
            (34h and 56h shl 3d + 24h nand 56 shr 2d nor 33 nxor 20h xor 11111b)
            and
            -(21h shl 2d + 34h and -56h shl 3d and 99h xor 12h)

   
    we get:     unsigned: 18446744073709551564 / signed: -52
                FFFFFFFFFFFFFFCCH
                11111111111111111111111111111111
                11111111111111111111111111001100B
   

    -------------------------------------------------------
    conversions decimal-hexadecimal-binary (64 bits)
    -------------------------------------------------------

    type: -12d      (decimal end with "d" or "D")

    we get:     unsigned: 18446744073709551604 / signed: -12
                         
                FFFFFFFFFFFFFFF4H
                11111111111111111111111111111111
                11111111111111111111111111110100B

    type: 18446744073709551604d

    we get:     18446744073709551604d
   
                FFFFFFFFFFFFFFF4H
                11111111111111111111111111111111   
                11111111111111111111111111110100B


    type:   FFFFFFFFFFFFFFF4H

    we get:     unsigned: 18446744073709551604 / signed: -12
                          18446744073709551604
                         
                FFFFFFFFFFFFFFF4H
                11111111111111111111111111111111
                11111111111111111111111111110100B


    type:   FFFFFFFFFFFFFFFFH

    we get:     unsigned: 18446744073709551615 / signed: -1
                FFFFFFFFFFFFFFFFH
                11111111111111111111111111111111
                11111111111111111111111111111111B               


    type:   7FFF FFFF FFFF FFFFh

    we get:     9223372036854775807

                7FFFFFFFFFFFFFFFh
                01111111111111111111111111111111
                11111111111111111111111111111111B
               
    type:   9223372036854775807d   
       
    we get:     9223372036854775807d       
                7FFFFFFFFFFFFFFFH
                01111111111111111111111111111111
                11111111111111111111111111111111B
   
Title: Re: The calculator
Post by: dedndave on June 13, 2013, 03:46:02 AM
nice, as always, Rui   :t

did you add the PORN operator ?   :biggrin:

you could leave the "P" out
i think that indicates bitwise, which - all our operations are bitwise
so, it would be
NOT   C = NOT(A)
AND   C = A AND B
OR    C = A OR B
XOR   C = A XOR B
NAND  C = NOT (A AND B)
NOR   C = NOT (A OR B)
XNOR  C = NOT (A XOR B) = A XOR (NOT B) = (NOT A) XOR B
ANDN  C = A AND (NOT B)
ORN   C = A OR (NOT B)


XORN is not needed - logically the same as XNOR
Title: Re: The calculator
Post by: RuiLoureiro on June 17, 2013, 07:30:03 AM
Quote from: dedndave on June 13, 2013, 03:46:02 AM
nice, as always, Rui   :t

did you add the PORN operator ?   :biggrin:

you could leave the "P" out
i think that indicates bitwise, which - all our operations are bitwise
so, it would be
NOT   C = NOT(A)
AND   C = A AND B
OR    C = A OR B
XOR   C = A XOR B
NAND  C = NOT (A AND B)
NOR   C = NOT (A OR B)
XNOR  C = NOT (A XOR B) = A XOR (NOT B) = (NOT A) XOR B
ANDN  C = A AND (NOT B)
ORN   C = A OR (NOT B)


XORN is not needed - logically the same as XNOR
Hi Dave,
              i will reply soon, i hope!
              i want to post the new powerful calculator with
              new interesting functions. But we need to wait
              because i need to test it.
              Yes it does ORN and ANDN also.
              Replacing constants is now a very simple
              and fast procedure.
              We compute expressions to save as a new or old constant/variable
              The same for matrices.
               We have up to 20 real/logic/matrix names for constants/variables.
               The Inverse matrix is all inside the edit box in any case 2x2 to 20x20.
               Error messages are now better
Title: Re: The calculator
Post by: Mikl__ on June 19, 2013, 10:55:57 AM
Ola, RuiLoureiro!
ORN = (Not A) OR (Not B) = Not (A AND B) ?
Title: Re: The calculator
Post by: dedndave on June 19, 2013, 11:46:16 AM
NAND = NOT (A AND B)
NOR = NOT (A OR B)
ORN = A OR (NOT B)
Title: Re: The calculator
Post by: RuiLoureiro on June 26, 2013, 01:53:48 AM
Olá Mikl,
          It's not right.
          I use A ORN B = A or (not B) = A or -B as Dave wrote
         
Hi
        In the next Calcula55, The powerfull Calculator v2.30,

        we may solve any quadratic or any system of 2,3,4 equations

        where any coeficient may be a real expression as large as

        a train (11 300 characters)!

        Well, we may solve any system of 5,6, ..,19,20 equations

        using matrices;

        We may define or redefine any one of 20 constants: real, logic

        or matrix.

        Each matrix element is a real constant or any real expression

        as large as a train!
         
        When we want to compute a real/logic expression, we may define or

        redefine a constant:

                        (log(2)+56.38)/12.5        (=4.5344823996531185)
                or
                        this = (log(2)+56.38)/12.5 (=4.5344823996531185)

       (the expression may contain real constants)

        Using 'list r' we may edit the real constants and we may redefine them.

        Using 'list l' we may edit the logic constants and we may redefine them.

        Any 20x20 matrix fits in th edit box, so we may copy it from or to

        the edit box.

        What do you think about this version ?

        Thanks
         Rui
-------------------------------------------------------------------------
TYPE:   this = (log(2)+56.38)/12.5      ENTER/COMPUTE

TYPE:   a=12.3;b=-1.5;c=15;d=3.24;      ENTER/COMPUTE


Quadratic equation:

TYPE:   ax^2+bx+c=d                     ENTER/COMPUTE

Root X0=  0.0609756097560975+ i  0.9758993472640925
Root X1=  0.0609756097560975- i  0.9758993472640925

--------------------------------------------------------------------------
Quadratic equation:

TYPE:   this x^2 + bx + c=d             ENTER/COMPUTE

Root X0=  0.1653992526373845+ i  1.6019061672211593
Root X1=  0.1653992526373845- i  1.6019061672211593
--------------------------------------------------------------------------
System of 2 equations:

TYPE:   this x + by= c ; x - d y= 12;

X=  2.3196363400200491
Y= -2.9877665617222071
Determinant: -13.1917229748761039
Title: Re: The calculator
Post by: RuiLoureiro on July 04, 2013, 02:17:31 AM
    ****-- Here it is The Calculator v3.00.1 --****

       This is the new calculator with new functions
       and new better and faster procedures.

       A. What it does ?
       ---------------------

        1. Conversions

        2. Real constants definitions

        3. Logic constants definitions     

        4. Function definition

        5. Derivative definition

        6. Matrices definitions

        7. Logic operations

        8. Matrices operations

        9. Systems of 2 linear equations x,y
                       
       10. Systems of 3 linear equations x,y,z

       11. Systems of 4 linear equations x,y,z,t

       12. Quadratic equation ax^2+bx+c=d

       13. Solves any real expression


       B. Special functions
       ------------------------

        B.1. list     shows the symbols defined

             list r   edit the r eal constans defined

             list l   edit the l ogic constants defined

             list f   edit the f unction defined

             list d   edit the d erivative defined


        B.2. scan     shows the values of a defined function f(x)     
                      from x=x0 to x=x1 where x0,x1 are integers.
                      It shows also the zeros

        B.3. root     try to find the value x=x0 where the function f(x)=0


       C. General rule about constants and matices
       --------------------------------------------------------

            1. Any constant or matrix is redefinable
           
            2. The tables have space for 20 names


       C. General rule about real constants
       ----------------------------------------------

            1. The name cannot be any symbol already defined
               like 'e' 'pi', 'log', 'sin', etc.

            2. The name cannot be x, y, z, t

            3. The name cannot be a matrix name

            4. The matrix name cannot be any symbol already defined
               and cannot be any real constant name

            5. Any real constant is redefinable

            6. We may define a real constant like this

                            name = real expression


       D. General rule about logic constants
       ----------------------------------------------

            1. The name cannot be any symbol already defined

            2. The name cannot be 'd', 'h', 'b'

            3. We may use real constant names or matrix names
               because logic expressions doesnt use real values
               or matrix names and real expressions doesnt use
               logic constants
       

       E. General rule about expressions
       -------------------------------------------

            We may use any constant already defined
                       

       F. Defining a matrix
       -------------------------

            F.1
                    matA =[1,2,3; 3,4,5; 2,5,9]         (without semicolon)


            F.2
                    a=2; b=3;
                    matB =[3*2, a, b; 1.2, 4.5,-5.23];  (with semicolon)


            F.3
                    matC =[2, a, b; 1, 5,-5; 0,1,-1];
                    matC =matC^-1;
           

       G. Defining a real constant
       ----------------------------------

            G.1
                    a=2;b=-5;c=3;

            G.2
                    a=2;b=3;
                    f=round(e^-(-3+sin(3*a+12)),6)+34*5-sin(pi/b)


       H. Defining a logic constant
       ----------------------------------
     

            H.1
                    l1=2d; l2=53h; l3=11100011b;

            H.2
                    l1=2d; l2=53h; l3=11100011b;

                    l4= l1 + l2 shl 1d + 45h and l3                   


       I. System of equations
       -----------------------------

            1.      a=2;b=-3;c=4;d=-1;f=5;g=-2;h=-6;i=0;j=4;k=1;l=-3;

            2.      aX-bY=c; dY+fX=-a;
                   
                    aX-bY+cZ=d; Z-dY+fX=-a; X+Y+Z=h;
                   
                    kT+aX-bY+cZ=d; Z-dY+fX=-a; X+Y+Z-T=h; Y+lZ+fT=l;

       J. Quadratic equation
       ---------------------------

                    a=2;b=-3;c=4;d=-1;
                    aX^2 -bX +c=d                   

       K. root function
       --------------------

            1. f(x)=2*x^5+3*x^4-x^3+5*x^2+x+120
                           

            2. root(x=-2,x=2)

               root(x=-2,x=2; n=1000)

               root(x=-2,x=2; d=0.01)


               df(x)=10*x^4+12*x^3-3*x^2+10*x+1
               root(x=-2,x=2; x=-2)


       L. scan function
       --------------------

            1. f(x)=x^5-5*x^3+4*x
                           

            2. scan(x=-10,x=10)


            Now type 'list' and we can see all constants defined till now.


       M. conversions
       -------------------

                Type 112233d or 112233h or 111000111b and press COMPUTE
               
        note 1: type/copy and paste the examples and press compute
        note 2: to get the polynomials zeros use scan() function

        Try it and say something.
        Good luck !
        Thanks       
        Rui Loureiro
Title: Re: The calculator
Post by: RuiLoureiro on July 10, 2013, 05:43:42 AM
    ****-- The Calculator v3.00.2 --****
    ****--     The new version    --****

    --------------------------------   
    Three things  A.1  A.2  A.3
    --------------------------------

            --------------------------------------------------------------------
       A.1. Define a matrix as a direct operation of 2 matrices
            ---------------------------------------------------------------------

            matA= -1.2*[1,2,3; 4,5,6; 7,8,9]

            matB= [1,2,3; 4,5,6; 7,8,9]*[3; 6; 9]

            matC= [1,2,3; 4,5,6; 7,8,9]-[-9,8,7; -4,0,6; 1,3,2]

    Example 1
   
        Solving a system of 5 linear equations:

            1 X1 -2 X2 +3 X3 -1 X4 + 0 X5 = 123

            0 X1 +3 X2 -2 X3 +5 X4 + 7 X5 = 15

            3 X1 -4 X2 +0 X3 -2 X4 + 3 X5 = 9

           -2 X1 -2 X2 +5 X3 +0 X4 + 0 X5 = -12

            1 X1 +0 X2 -1 X3 +3 X4 + 9 X5 = 35


        matC=[123; 15; 9; -12; 35]
        matA=[1,-2,3,-1,0; 0,3,-2,5,7; 3,-4,0,-2,3; -2,-2,5,0,0; 1,0,-1,3,9]

        matA1=matA^-1;
             =[ 0.5230125523012552, 0.2761506276150627, 0.0711297071129707,
             -0.2510460251046025,-0.2384937238493723; 0.6903765690376569,
             -0.7154811715481171,-0.8661087866108786,-0.5313807531380753,
             0.8451882845188284; 0.4853556485355648,-0.1757322175732217,
             -0.3179916317991631,-0.11297071129707113, 0.2426778242677824;
             -0.401673640167364, 1.1799163179916318, 0.8493723849372384,
             0.4728033472803347,-1.200836820083682; 0.1297071129707113,
             -0.4435146443514644,-0.3263598326359832,-0.1422594142259414,
             0.5648535564853556];

        multiplying by [123; 15; 9; -12; 35]
               
            = [ 63.778242677824266; 102.347280334728032; 64.050209205020915;
              -71.765690376569036; 27.841004184100418];

            X1=  63.778242677824266
            X2= 102.347280334728032
            X3=  64.050209205020915
            X4= -71.765690376569036
            X5=  27.841004184100418


        first equation:
       
            63.778242677824266 -2* 102.347280334728032 + 3* 64.050209205020915
              +71.765690376569036 = 122.999999999999983


             --------------------
        A.2 find function
             --------------------

             Now we have the scan function and the find function
             to study one function.
             
             The scan function uses integer points and is useful to
             study any polynomial.
             
             The find function try to get an interval (x0,x1) where
             the function changes the sign. So it may be a discontinuity
             or it may be a zero (it shows the f(x) values)

    Example 2

f(x)=(x+1)/(x^2-x-1)

find(x=-10, x=10)
One zero was found
x= -1.0
f(x)=  0


    Example 3

f(x)=(log(x-1)-x)/(x-5)

find(x=1, x=20)
The function change the sign in this interval
(x0,x1)=[  4.9999 ,  5.0 ]
f(x0)=  43978.50866169812
f(x1)= -INFINITY


    Example 4

f(x)=x-log(1/(x-1))

find(x=1, x=5)
The function change the sign in this interval
(x0,x1)=[  1.0826 ,  1.0827 ]
f(x0)= -0.0004199526796177
f(x1)=  0.0002055095525466


    Example 5

f(x)=(x-log(1/(x-1)))/(x^2-1)

find(x=1, x=10)
The function change the sign in this interval
(x0,x1)=[  1.0826 ,  1.0827 ]
f(x0)= -0.0004199526796177
f(x1)=  0.0002055095525466



    Example 6

f(x)=x^3-log(x^2+x)+x-1

find(x=0,x=1)
The function change the sign in this interval
(x0,x1)=[  0.1177 ,  0.1178 ]
f(x0)=  0.0002288184583431
f(x1)= -0.000074703978969

scan(x=-2,x=2)
x= -2 , f(x)=-11.3010299956639812 ; x= -1 , f(x)=+INFINITY ;
x= 0 , f(x)=+INFINITY ; x= 1 , f(x)= 0.6989700043360188 ;
x= 2 , f(x)= 8.2218487496163564 ;



             ---------------------------------------------------------------------------
        A.3  The limits of the root/find function may be real expressions
             ---------------------------------------------------------------------------

             f(x)=x^3-x

             root(x=log(2), x=log(3))
             find(x=-log(3), x=log(3))

        Good luck !
        Rui Loureiro
Title: Re: The calculator
Post by: RuiLoureiro on July 24, 2013, 02:15:31 AM
    ****-- The Calculator v3.01.0 --****

            ---------------------------
            COMPLEX NUMBERS
            ---------------------------

        Now, we may solve any complex expression in the same way we do for
        real expressions.

        Any complex number is a number with a real part
        and an imaginary part. For instance, z1=-2+i3 or z1=i3-2.

        We may define it typing z1=(-2,3); or z1=-2+i3 for example.

        To build a complex expression
        we may define a set of real/complex constants z1, z2, z3, z4, ...
        and then we write the expression

        For instance,

                (1-i2)*(2-i3)  or (a-ib)*(c-id) where a=12;b=-4;c=1;d=-3;
                                                are real constants

                z1+z2*z3-z4   or  z5=z1+z2*z3-z4  or z1=z1+z2*(z3/z4)+3-i2


        Type:   d=7;c=1;b=-3;a=2;    press ENTER/COMPUTE
        and     (a-ib)*(c-id)                 press ENTER/COMPUTE
        and     Z1=(a-ib)*(c-id)           press ENTER/COMPUTE

        We get:      23.0-i11.0
                     | Z |=  25.495097567963924
                     Angle= -25.559965171823808 degrees
                     Complex Constant defined


        If you have any suggestion, please tell me

        Jul. 2013
       
        Good luck !
        Thanks       
        Rui Loureiro
                            EDIT: In the next version the calculator will do all
                                      complex functions (e.g.: ln(2-i3), etc.  )
Title: Re: The calculator
Post by: RuiLoureiro on July 30, 2013, 04:19:25 AM
Hi all
        ****-- The Calculator v3.10.1 --****

        This is the last version and this is the powerful calculator
        v3.10.1.

            --------------------------------------------------------------
            COMPLEX NUMBERS and COMPLEX FUNCTIONS
            --------------------------------------------------------------

        Now, we may solve any complex expression in the same way we do for
        real expressions.

        We may use any function:

                conj(a+ib)      = a-ib
                inv(a+ib)       = 1/(a+ib)

                abs(a+ib)       = sqr(a^2+b^2)+i0
                sqr(a+ib)       = (a+ib)^(1/2)
                rnd(a+ib)       = rnd(a)+i rnd(b)
                rndi(a+ib)      = rndi(a)+i rndi(b)
       
                e^(a+ib)        = e^a * e^ib = e^a * ( cos(b)+i sin(b))

                (a+ib)^(c+id)   = e^( (c+id)*ln(a+ib) )
               
                ln(a+ib)        = ln (|a+ib|* e^i angleR )
                log(a+ib)       = (ln (|a+ib|* e^i angleR )) / ln(10)
               
                sin(a+ib)
                cos(a+ib)
                tan(a+ib)
                sec(a+ib)
                csc(a+ib)
                cot(a+ib)

                arcsin(a+ib)
                arccos(a+ib)
                arctan(a+ib)
                arcsec(a+ib)
                arccsc(a+ib)
                arccot(a+ib)

                sinh(a+ib)
                cosh(a+ib)
                tanh(a+ib)
                sech(a+ib)
                csch(a+ib)
                coth(a+ib)

                arcsinh(a+ib)
                arccosh(a+ib)
                arctanh(a+ib)
                arcsech(a+ib)
                arccsch(a+ib)
                arccoth(a+ib)
               
                round(a+ib, n)  - round 'a' and 'b' to n decimal places

        The operation rules are the same for real numbers

        The result may be a complex number, INFINITY or indeterminate form.
        We may use the division by 0 to generate the infinity.

        We need to use brackets when we have powers of powers

        (1-i2)^(1-i)^(i2) gives "Complex power too complex- use brackets"

        We need to do ((1-i2)^(1-i))^(i2) or (1-i2)^((1-i)^(i2)).

        Any complex number is a number with a real part 'a'
        and an imaginary part 'b'. For instance, z1=-2+i3 or z1=i3-2.

        We may define it typing z1=(-2,3); or z1=-2+i3 for example.

        To build a complex expression
        we may define a set of real/complex constants z1, z2, z3, z4, ...
        and then we write the expression

        For instance,

                (1-i2)*(2-i3)  or (a-ib)*(c-id) where a=12;b=-4;c=1;d=-3;
                                                are real constants

                z1+z2*z3-z4   or  z5=z1+z2*z3-z4  or z1=z1+z2*(z3/z4)+3-i2

        After defining any constant/matrix we may type the constant name
        to see its value. We may use also list c or list r or list l or
        list.

        Example 1
       
        Type:   d=7;c=1;b=-3;a=2;    press ENTER/COMPUTE
        and     (a-ib)*(c-id)        press ENTER/COMPUTE
        and     Z1=(a-ib)*(c-id)     press ENTER/COMPUTE

        We get:      23.0-i11.0
                     | Z |=  25.495097567963924
                     Angle= -25.559965171823808 degrees
                     Angle= -0.4461055489434036 radians
                     Complex Constant defined

        Example 2

            conj(-1-i2)+inv(1-i3)

            -0.9+i2.3
            | Z |=  2.4698178070456938
            Angle=  111.370622269343183 degrees
            Angle=  1.9437840485949576 radians


        Example 3

            zx=arctan(-1-i3.3)+sin(1.2+i3e-2)*(i*cos(1-i))^(2-i)
           
            -1.2156119789977935-i18.15086513723519
            | Z |=  18.191525986392202
            Angle= -93.831529845398134 degrees
            Angle= -1.6376691379855234 radians
            Complex Constant defined

        Example 4

            zy=(ln(zx)+1-i)* (ln(zx-1)+1+i)+e^(9.1-i2.3e-1)  ; edit: ')' was not here
           
            8732.8791809611277-i2054.6089708474515
            | Z |=  8971.3207953094131
            Angle= -13.2393627831433264 degrees
            Angle= -0.231070471431851 radians
            Complex Constant defined

        Example 5

            zz=zx*zy-zy/zx
            -47989.335119512577-i156498.23124802209
            | Z |=  163690.78370199185
            Angle= -107.0478745161774 degrees
            Angle= -1.8683378675690276 radians
            Complex Constant defined

        Example 6

            zw=(e+i pi)*(pi-ie)/((ipi)* ie)

            -2.0-i0.2904713703586566
            | Z |=  2.0209833292231868
            Angle= -171.73638751817216 degrees
            Angle= -2.9973654076729973 radians
            Complex Constant defined

        Example 7

            zr=round( (e+i pi)*(pi-ie)/((ipi)* ie), 3)
                       
            -2.0-i0.29
            | Z |=  2.0209156340629363
            Angle= -171.7496127710945 degrees
            Angle= -2.9975962318809012 radians
            Complex Constant defined

        If you know any bug or something else, please post it
       
        If you have any suggestion, please tell me

        Jul. 2013
       
        Good luck !  ;)
        Thanks       
        Rui Loureiro
Title: Re: The calculator
Post by: guga on October 27, 2013, 10:43:25 AM
Trabalho excelente, rui.

Me ajudou muito há pouco quando estava testando uma função de atan2.
Title: Re: The calculator
Post by: RuiLoureiro on November 09, 2013, 05:06:21 AM
Olá guga,
          obrigado !
Hi all,

        (1) The previous The Calculator v3.10.1 (calcula59.exe)
            dosn't solve trigonometric functions,
            when we are working with angles in DEGREES:

                sind(a+ib)
                cosd(a+ib)
                tand(a+ib)
                secd(a+ib)
                cscd(a+ib)
                cotd(a+ib)

                arcsind(a+ib)
                arccosd(a+ib)
                arctand(a+ib)
                arcsecd(a+ib)
                arccscd(a+ib)
                arccotd(a+ib)

           If we try, we get "Complex expression error"

        (2) The results of some complex trigonometric functions
            are not correct
            because there is a bug in one internal procedure
            (i wanted «fstp OperandZ» but i did «fstp OperandI» !!!)

        (3) there is a problem when we try to define variables x1, x2, x3, etc

            All these problems are solved in
            the NEXT version v3.10.2 (calcula60.exe)
            that i will post soon.

--------------------------------------------------------------------
These are some values that we get, when we use the
next version v3.10.2 (calcula60.exe)
--------------------------------------------------------------------
--------------------------------------
about trigonometric functions
inverse trigonometric functions
RADIANS
--------------------------------------

TYPE:   z1=pi/4+i3
WE GET:

0.7853981633974483+i3.0
| Z |=  3.101104686247803
Angle=  75.329256947468645 degrees
Angle=  1.314743556814141 radians
Complex Constant defined

TYPE:   z2=sin(z1)
WE GET:
7.1189120679085489+i7.0837072942502342
| Z |=  10.0427993139974647
Angle=  44.857978252688267 degrees
Angle=  0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arcsin(z2)
WE GET:
0.7853981633974483+i3.0                 ->>>> is = z1 (correct)
| Z |=  3.101104686247803
Angle=  75.329256947468645 degrees
Angle=  1.314743556814141 radians
Complex Constant defined

TYPE:   z2=cos(z1)
WE GET:
7.1189120679085491-i7.0837072942502341
| Z |=  10.0427993139974647
Angle= -44.857978252688266 degrees
Angle= -0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arccos(z2)
WE GET:
0.7853981633974483+i3.0                 ->>>> is = z1 (correct)
| Z |=  3.101104686247803
Angle=  75.329256947468645 degrees
Angle=  1.314743556814141 radians
Complex Constant defined

TYPE:   z2=tan(z1)
WE GET:
0.0049574738935603+i0.9999877116507955
| Z |=  1.0
Angle=  89.715956505376533 degrees
Angle=  1.5658388325948463 radians
Complex Constant defined

TYPE:   w1=arctan(z2)
WE GET:
0.7853981633974411+i3.0000000000000079  ->>>> is = z1 (correct)
| Z |=  3.1011046862478089
Angle=  75.32925694746881 degrees
Angle=  1.3147435568141439 radians
Complex Constant defined

TYPE:   z2=csc(z1)
WE GET:
0.0705836414544171-i0.0702345879617375
| Z |=  0.099573830834817
Angle= -44.857978252688267 degrees
Angle= -0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arccsc(z2)
WE GET:
0.7853981633974483+i3.0000000000000004  ->>>> is = z1 (correct)
| Z |=  3.1011046862478034
Angle=  75.329256947468646 degrees
Angle=  1.3147435568141411 radians
Complex Constant defined

TYPE:   z2=sec(z1)
WE GET:
0.0705836414544171+i0.0702345879617375
| Z |=  0.099573830834817
Angle=  44.857978252688266 degrees
Angle=  0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arcsec(z2)
WE GET:
0.7853981633974482+i3.0000000000000004  ->>>> is = z1 (correct)
| Z |=  3.1011046862478034
Angle=  75.329256947468647 degrees
Angle=  1.3147435568141411 radians
Complex Constant defined

TYPE:   z2=cot(z1)
WE GET:
0.0049574738935603-i0.9999877116507955
| Z |=  1.0
Angle= -89.715956505376533 degrees
Angle= -1.5658388325948463 radians
Complex Constant defined

TYPE:   w1=arccot(z2)
WE GET:
0.7853981633974554+i3.0000000000000079  ->>>> is = z1 (correct)
| Z |=  3.1011046862478125
Angle=  75.329256947468554 degrees
Angle=  1.3147435568141395 radians
Complex Constant defined


--------------------------------------
about trigonometric functions
inverse trigonometric functions
RADIANS
--------------------------------------

--------------
First quadrant
--------------
z1=pi/4+i3    = 0.7853981633974483+i3.0

y1=sin(z1)    = 7.1189120679085489+i7.0837072942502342
w1=arcsin(y1) = 0.7853981633974483+i3.0 = z1

y1=cos(z1)    = 7.1189120679085491-i7.0837072942502341
w1=arccos(y1) = 0.7853981633974483+i3.0 = z1

y1=tan(z1)    = 0.0049574738935603+i0.9999877116507955
w1=arctan(y1) = 0.78539816339744 11+i3.00000000000000 79 = z1

---------------
Second quadrant
---------------
z2=-pi/4+i3   = -0.7853981633974483+i3.0

y2=sin(z2)    = -7.1189120679085489+i7.0837072942502342
w2=arcsin(y2) = -0.7853981633974483+i3.0 = z2

y2=cos(z2)    = 7.1189120679085491+i7.0837072942502341
w2=arccos(y2) = -0.7853981633974483+i3.0 = z2

y2=tan(z2)    = -0.0049574738935603+i0.9999877116507955
w2=arctan(y2) = -0.78539816339744 11+i3.00000000000000 79 = z2

--------------
Third quadrant
--------------
z3=-pi/4-i3 = -z1

y3=sin(z3)    = -7.1189120679085489-i7.0837072942502342
w3=arcsin(y3) = -0.7853981633974483-i3.0 = z3

y3=cos(z3)    = 7.1189120679085491-i7.0837072942502341
w3=arccos(y3) =  0.7853981633974483+i3.0 = z1

y3=tan(z3)    = -0.0049574738935603-i0.9999877116507955
w3=arctan(y3) = -0.78539816339744 11-i3.00000000000000 79 = z3

---------------
Fourth quadrant
---------------
z4=pi/4-i3  = -z2

y4=sin(z4)    = 7.1189120679085489-i7.0837072942502342
w4=arcsin(y4) = 0.7853981633974483-i3.0 = z4

y4=cos(z4)    = 7.1189120679085491+i7.0837072942502341
w4=arccos(y4) = -0.7853981633974483+i3.0 = z2

y4=tan(z4)    = 0.0049574738935603-i0.9999877116507955
w4=arctan(y4) = 0.78539816339744 11-i3.00000000000000 79 = z4


--------------------------------------
about trigonometric functions
inverse trigonometric functions
DEGREES
--------------------------------------

TYPE:   z1=45+i3
WE GET:
| Z |=  45.099889135118725
Angle=  3.8140748342903542 degrees
Angle=  0.0665681637758238 radians
Complex Constant defined

TYPE:   z2=sind(z1)
WE GET:
7.118912067908549+i7.0837072942502342
| Z |=  10.0427993139974647
Angle=  44.857978252688266 degrees
Angle=  0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arcsind(z2)
WE GET:
45.0+i3.0                           ->>>> is = z1 (correct)
| Z |=  45.099889135118724
Angle=  3.8140748342903542 degrees
Angle=  0.0665681637758238 radians
Complex Constant defined

TYPE:   z2=cosd(z1)
WE GET:
7.118912067908549-i7.0837072942502342
| Z |=  10.0427993139974647
Angle= -44.857978252688266 degrees
Angle= -0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arccosd(z2)
WE GET:
45.0+i3.0                           ->>>> is = z1 (correct)
| Z |=  45.099889135118725
Angle=  3.8140748342903542 degrees
Angle=  0.0665681637758238 radians
Complex Constant defined

TYPE:   z2=tand(z1)
WE GET:
0.0049574738935603+i0.9999877116507955
| Z |=  1.0
Angle=  89.715956505376533 degrees
Angle=  1.5658388325948463 radians
Complex Constant defined

TYPE:   w1=arctand(z2)
WE GET:
44.99999999999959+i3.0000000000000079   ->>>> is = z1 (correct)
| Z |=  45.099889135118316
Angle=  3.8140748342903989 degrees
Angle=  0.0665681637758245 radians
Complex Constant defined

TYPE:   z2=cscd(z1)
WE GET:
0.0705836414544171-i0.0702345879617375
| Z |=  0.099573830834817
Angle= -44.857978252688266 degrees
Angle= -0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arccscd(z2)
WE GET:
45.000000000000002+i3.0000000000000004  ->>>> is = z1 (correct)
| Z |=  45.099889135118727
Angle=  3.8140748342903545 degrees
Angle=  0.0665681637758238 radians
Complex Constant defined

TYPE:   z2=secd(z1)
WE GET:
0.0705836414544171+i0.0702345879617375
| Z |=  0.099573830834817
Angle=  44.857978252688266 degrees
Angle=  0.7829194162974231 radians
Complex Constant defined

TYPE:   w1=arcsecd(z2)
WE GET:
44.999999999999998+i3.0000000000000004  ->>>> is = z1 (correct)
| Z |=  45.099889135118723
Angle=  3.8140748342903549 degrees
Angle=  0.0665681637758238 radians
Complex Constant defined

TYPE:   z2=cotd(z1)
WE GET:
0.0049574738935603-i0.9999877116507955
| Z |=  1.0
Angle= -89.715956505376533 degrees
Angle= -1.5658388325948463 radians
Complex Constant defined

TYPE:   w1=arccotd(z2)
WE GET:
45.00000000000041+i3.0000000000000079   ->>>> is = z1 (correct)
| Z |=  45.099889135119134
Angle=  3.8140748342903296 degrees
Angle=  0.0665681637758233 radians
Complex Constant defined


---------------------------------
about hyperbolic functions
inverse hyperbolic functions
---------------------------------

TYPE:   z1=2.3+i0.25
WE GET:
2.3+i0.25
| Z |=  2.3135470602518549
Angle=  6.2034479016918352 degrees
Angle=  0.10827059086045604 radians
Complex Constant defined

TYPE:   z2=sinh(z1)
WE GET:
4.783483618904492+i1.2462283322677304
| Z |=  4.9431569455636773
Angle=  14.6025145321957282 degrees
Angle=  0.2548619576571349 radians
Complex Constant defined

TYPE:   w1=arcsinh(z2)
WE GET:
2.3+i0.25                               ->>>> is = z1 (correct)
| Z |=  2.3135470602518549
Angle=  6.2034479016918353 degrees
Angle=  0.10827059086045604 radians
Complex Constant defined

TYPE:   z2=cosh(z1)
WE GET:
4.8806256579738629+i1.2214238973804283
| Z |=  5.0311413367510157
Angle=  14.0502468762936514 degrees
Angle=  0.2452230687093726 radians
Complex Constant defined

TYPE:   w1=arccosh(z2)
WE GET:
2.3+i0.25                               ->>>> is = z1 (correct)
| Z |=  2.3135470602518549
Angle=  6.2034479016918353 degrees
Angle=  0.10827059086045604 radians
Complex Constant defined

TYPE:   z2=tanh(z1)
WE GET:
0.9824664000943306+i0.0094701778128957
| Z |=  0.9825120414438294
Angle=  0.5522676559020767 degrees
Angle=  0.0096388889477623 radians
Complex Constant defined

TYPE:   w1=arctanh(z2)
WE GET:
2.3000000000000002+i0.249999999999998   ->>>> is = z1 (correct)
| Z |=  2.3135470602518549
Angle=  6.2034479016917859 degrees
Angle=  0.10827059086045518 radians
Complex Constant defined

TYPE:   z2=csch(z1)
WE GET:
0.1957651997848019-i0.0510021895924765
| Z |=  0.2022998684873777
Angle= -14.6025145321957282 degrees
Angle= -0.2548619576571349 radians
Complex Constant defined

TYPE:   w1=arccsch(z2)
WE GET:
2.3000000000000003+i0.2499999999999997  ->>>> is = z1 (correct)
| Z |=  2.3135470602518552
Angle=  6.2034479016918292 degrees
Angle=  0.10827059086045593 radians
Complex Constant defined

TYPE:   z2=sech(z1)
WE GET:
0.1928157309006095-i0.0482540063543098
| Z |=  0.1987620567713517
Angle= -14.0502468762936514 degrees
Angle= -0.2452230687093726 radians
Complex Constant defined

TYPE:   w1=arcsech(z2)
WE GET:
2.3000000000000005+i0.2499999999999998  ->>>> is = z1 (correct)
| Z |=  2.3135470602518554
Angle=  6.2034479016918313 degrees
Angle=  0.10827059086045597 radians
Complex Constant defined

TYPE:   z2=coth(z1)
WE GET:
1.017751950195062-i0.0098103018452776
| Z |=  1.0177992307661405
Angle= -0.5522676559020767 degrees
Angle= -0.0096388889477623 radians
Complex Constant defined

TYPE:   w1=arccoth(z2)
WE GET:
2.3000000000000003+i0.2499999999999993  ->>>> is = z1 (correct)
| Z |=  2.3135470602518551
Angle=  6.2034479016918193 degrees
Angle=  0.10827059086045576 radians
Complex Constant defined


---------------------------------
hyperbolic functions
inverse hyperbolic functions
---------------------------------

TYPE:   z1=2.3+i1.58 = Z + iI  ( I > pi/2)
WE GET:
2.3+i1.58
| Z |=  2.790412155936825
Angle=  34.487372830078654 degrees
Angle=  0.6019182062477074 radians
Complex Constant defined

TYPE:   y1=sinh(z1)
WE GET:
-0.045437541593796+i5.0370073053376468
| Z |=  5.0372122413306062
Angle=  90.516836405985953 degrees
Angle=  1.5798168237735256 radians
Complex Constant defined

TYPE:   w1=arcsinh(y1)
WE GET:
-2.3+i1.5615926535897932     -> is not = z1
| Z |=  2.7800308659699467
Angle=  145.82532569791053 degrees
Angle=  2.5451320662216368 radians
Complex Constant defined


---------------------------------
about hyperbolic functions
inverse hyperbolic functions
---------------------------------


--------------
First quadrant
--------------
z1=2.3+i0.25

y1=sinh(z1)    = 4.783483618904492+i1.2462283322677304
w1=arcsinh(y1) =  2.3+i0.25 = z1

y1=cosh(z1)    = 4.8806256579738629+i1.2214238973804283
w1=arccosh(y1) = 2.3+i0.25 = z1

y1=tanh(z1)    = 0.9824664000943306+i0.0094701778128957
w1=arctanh(y1) = 2.3000000000000002+i0.249999999999998 = z1

---------------
Second quadrant
---------------
z2=-2.3+i0.25  = -z4

y2=sinh(z2)    = -4.783483618904492+i1.2462283322677304
w2=arcsinh(y2) = -2.3+i0.25 = z2

y2=cosh(z2)    = 4.8806256579738629-i1.2214238973804283
w2=arccosh(y2) = 2.3-i0.25 = z4

y2=tanh(z2)    = -0.9824664000943306+i0.0094701778128957
w2=arctanh(y2) = -2.3000000000000002+i0.249999999999998 = z2

--------------
Third quadrant
--------------
z3=-2.3-i0.25 = -z1

y3=sinh(z3)    = -4.783483618904492-i1.2462283322677304
w3=arcsinh(y3) = -2.3-i0.25 = z3

y3=cosh(z3)    = 4.8806256579738629+i1.2214238973804283
w3=arccosh(y3) = 2.3+i0.25 = z1

y3=tanh(z3)    = -0.9824664000943306-i0.0094701778128957
w3=arctanh(y3) = -2.3000000000000002-i0.249999999999998 = z3

---------------
Fourth quadrant
---------------
z4=2.3-i0.25  = -z2

y4=sinh(z4)    = 4.783483618904492-i1.2462283322677304
w4=arcsinh(y4) = 2.3-i0.25 = z4

y4=cosh(z4)    = 4.8806256579738629-i1.2214238973804283
w4=arccosh(y4) = 2.3-i0.25 = z4

y4=tanh(z4)    = 0.9824664000943306-i0.0094701778128957
w4=arctanh(y4) = 2.3000000000000002-i0.249999999999998 = z4

Title: Re: The calculator
Post by: RuiLoureiro on November 10, 2013, 05:34:30 AM
-------------------------------------------------------------------
about cos(w)=z and the inverse function w=arccos(z)
-------------------------------------------------------------------

By definition
                cos(w)= (e^iw+e^-iw)/2 = z   => w=arccos(z)

    From
                     e^iw+e^-iw
                 z=--------------   doing t=e^iw
                           2
    we get
                         1
                2z= t + ---  <=>   2z t = t^2 + 1  ( t<>0 )
                         t

                <=> t^2 -2z t + 1 = 0

                <=>   t= z + SQRT(z^2-1)        - positive solution I
                   or
                      t= z - SQRT(z^2-1)         - negative solution I

    From
            SQRT(z^2-1)= SQRT[(-1).(1-z^2)]= i SQRT(1-z^2)

    we have
                      t= z + i SQRT(1-z^2)      - positive solution II
                   or
                      t= z - i SQRT(1-z^2)      - negative solution II

    From
            t=e^iw  we get w=-i ln(t)

    Solutions:
   
            w=arccos(z)= -i ln(z +  SQRT(z^2-1))       - positive solution I
            w=arccos(z)= -i ln(z -  SQRT(z^2-1))       - negative solution I
            w=arccos(z)= -i ln(z +i SQRT(1-z^2))       - positive solution II
            w=arccos(z)= -i ln(z -i SQRT(1-z^2))       - negative solution II

    Because cos(w)=z and cos(-w)=z

            arccos(z)= w or -w


Here are some results

-----------------------------------
The calculator negative solution I
arccos(z) = -i * ln(z - sqrt(z^2-1)
-----------------------------------
z1=pi/4+i3 = 0.7853981633974483+i3 = -z3
y1=cos(z1)=  7.1189120679085491-i7.0837072942502341
w1=arccos(y1)= pi/4+i3 = z1

z2=-pi/4+i3 = -z4
y2=cos(z2)= 7.1189120679085491+i7.0837072942502341
w2=arccos(y2)= -pi/4+i3 = z2

z3=-pi/4-i3 = -z1
y3=cos(z3)= 7.1189120679085491-i7.0837072942502341
w3=arccos(y3)= pi/4+i3 = z1

z4=pi/4-i3 = -z2
y4=cos(z4)= 7.1189120679085491+i7.0837072942502341
w4=arccos(y4)= -pi/4+i3 = z2

------------------------------------
The calculator positive solution I
arccos(z) = -i * ln(z + sqrt(z^2-1))
------------------------------------
z1=pi/4+i3 = 0.7853981633974483+i3 = -z3
y1=cos(z1)=  7.1189120679085491-i7.0837072942502341
w1=arccos(y1)= -pi/4-i3 = z3

z2=-pi/4+i3 = -z4
y2=cos(z2)= 7.1189120679085491+i7.0837072942502341
w2=arccos(y2)= pi/4-i3 = z4

z3=-pi/4-i3 = -z1
y3=cos(z3)= 7.1189120679085491-i7.0837072942502341
w3=arccos(y3)= -pi/4-i3 = z3

z4=pi/4-i3 = -z2
y4=cos(z4)= 7.1189120679085491+i7.0837072942502341
w4=arccos(y4)= pi/4-i3 = z4

-------------------------------------
The calculator positive solution II
arccos(z) = -i * ln(z +i sqrt(1-z^2))
-------------------------------------
z1=pi/4+i3 = 0.7853981633974483+i3 = -z3
y1=cos(z1)=  7.1189120679085491-i7.0837072942502341
w1=arccos(y1)= pi/4+i3 = z1

z2=-pi/4+i3 = -z4
y2=cos(z2)= 7.1189120679085491+i7.0837072942502341
w2=arccos(y2)= pi/4-i3 = z4

z3=-pi/4-i3 = -z1
y3=cos(z3)= 7.1189120679085491-i7.0837072942502341
w3=arccos(y3)= pi/4+i3 = z1

z4=pi/4-i3 = -z2
y4=cos(z4)= 7.1189120679085491+i7.0837072942502341
w4=arccos(y4)= pi/4-i3 = z4

-------------------------------------
The calculator negative solution II
arccos(z) = -i * ln(z - i sqrt(1-z^2)
-------------------------------------
z1=pi/4+i3 = 0.7853981633974483+i3 = -z3
y1=cos(z1)=  7.1189120679085491-i7.0837072942502341
w1=arccos(y1)=-pi/4-i3 = z3

z2=-pi/4+i3 = -z4
y2=cos(z2)= 7.1189120679085491+i7.0837072942502341
w2=arccos(y2)= -pi/4+i3 = z2

z3=-pi/4-i3 = -z1
y3=cos(z3)= 7.1189120679085491-i7.0837072942502341
w3=arccos(y3)=-pi/4-i3 = z3

z4=pi/4-i3 = -z2
y4=cos(z4)= 7.1189120679085491+i7.0837072942502341
w4=arccos(y4)= -pi/4+i3 = z2

arccos(z) = +w or -w    because cos(w)=z and cos(-w)=z


From these results,
the calculator uses the positive solution II.

            w=arccos(z)= -i ln(z +i SQRT(1-z^2))    - positive solution II


Here some more results

--------------------------------------
The calculator negative solution
arccos(z) = -i * ln(z - sqrt(z^2-1))
--------------------------------------
x1=pi/4
x2=3 pi/4

z1=x1+ix1    = 0.7853981633974483+i0.7853981633974483
y1=cos(z1)   = 0.9366400694314301-i0.6142431274865956
w1=arccos(y1)= 0.7853981633974482+i0.7853981633974482  = z1

z2=-x1+ix1   = -0.7853981633974483+i0.7853981633974483
y2=cos(z2)   = 0.9366400694314301+i0.6142431274865956
w2=arccos(y2)= -0.7853981633974482+i0.7853981633974482 = z2

z3=-x1-ix1   = -0.7853981633974483-i0.7853981633974483
y3=cos(z3)   = 0.9366400694314301-i0.6142431274865956
w3=arccos(y3)=  0.7853981633974482+i0.7853981633974482 = z1

z4=x1-ix1    = 0.7853981633974483-i0.7853981633974483
y4=cos(z4)   = 0.9366400694314301+i0.6142431274865956
w4=arccos(y4)=-0.7853981633974482+i0.7853981633974482  = z2
------------------------------------------------------------
z1=x2+ix1    = 2.3561944901923449+i0.7853981633974483
y1=cos(z1)   = -0.93664006943143-i0.6142431274865956
w1=arccos(y1)= -2.3561944901923449-i0.7853981633974482 = z3

z2=-x2+ix1   = -2.3561944901923449+i0.7853981633974483
y2=cos(z2)   = -0.93664006943143+i0.6142431274865956
w2=arccos(y2)= 2.3561944901923449-i0.7853981633974482  = z4

z3=-x2-ix1   = -2.3561944901923449-i0.7853981633974483
y3=cos(z3)   = -0.93664006943143-i0.6142431274865956
w3=arccos(y3)= -2.3561944901923449-i0.7853981633974482 = z3

z4=x2-ix1    = 2.3561944901923449-i0.7853981633974483
y4=cos(z4)   = -0.93664006943143+i0.6142431274865956
w4=arccos(y4)= 2.3561944901923449-i0.7853981633974482  = z4

--------------------------------------
The calculator positive solution II
arccos(z) = -i * ln(z +i sqrt(1-z^2))
--------------------------------------
x1=  pi/4 = 0.7853981633974483
x2=3 pi/4 = 2.3561944901923449
x3=5 pi/4 = 3.9269908169872415
x4=7 pi/4 = 5.4977871437821381

z1=x1+ix1    = 0.7853981633974483+i0.7853981633974483
y1=cos(z1)   = 0.9366400694314301-i0.6142431274865956
w1=arccos(y1)= 0.7853981633974482+i0.7853981633974482 = z1

z2=-x1+ix1   = -0.7853981633974483+i0.7853981633974483
y2=cos(z2)   = 0.9366400694314301+i0.6142431274865956
w2=arccos(y2)= 0.7853981633974482-i0.7853981633974482 = z4

z3=-x1-ix1   = -0.7853981633974483-i0.7853981633974483
y3=cos(z3)   = 0.9366400694314301-i0.6142431274865956
w3=arccos(y3)= 0.7853981633974482+i0.7853981633974482 = z1

z4=x1-ix1    = 0.7853981633974483-i0.7853981633974483
y4=cos(z4)   = 0.9366400694314301+i0.6142431274865956
w4=arccos(y4)= 0.7853981633974482-i0.7853981633974482 = z4
------------------------------------------------------------
z1=x2+ix1    = 2.3561944901923449+i0.7853981633974483
y1=cos(z1)   = -0.93664006943143-i0.6142431274865956
w1=arccos(y1)=  2.3561944901923449+i0.7853981633974482  =z1

z2=-x2+ix1   = -2.3561944901923449+i0.7853981633974483
y2=cos(z2)   = -0.93664006943143+i0.6142431274865956
w2=arccos(y2)= 2.3561944901923449-i0.7853981633974482   =z4

z3=-x2-ix1   = -2.3561944901923449-i0.7853981633974483
y3=cos(z3)   = -0.93664006943143-i0.6142431274865956
w3=arccos(y3)= 2.3561944901923449+i0.7853981633974482  = z1

z4=x2-ix1    = 2.3561944901923449-i0.7853981633974483
y4=cos(z4)   = -0.93664006943143+i0.6142431274865956
w4=arccos(y4)= 2.3561944901923449-i0.7853981633974482  = z4
------------------------------------------------------------
z1=x1+ix2    = 0.7853981633974483+i2.3561944901923449
y1=cos(z1)   = 3.7637541395008347-i3.6967343997925613
w1=arccos(y1)= 0.7853981633974483+i2.3561944901923449   = z1

z2=-x1+ix2   = -0.7853981633974483+i2.3561944901923449
y2=cos(z2)   = 3.7637541395008347+i3.6967343997925613
w2=arccos(y2)= 0.7853981633974483-i2.3561944901923449   = z4

z3=-x1-ix2   = -0.7853981633974483-i2.3561944901923449
y3=cos(z3)   = 3.7637541395008347-i3.6967343997925613
w3=arccos(y3)= 0.7853981633974483+i2.3561944901923449   = z1

z4=x1-ix2    =  0.7853981633974483-i2.3561944901923449
y4=cos(z4)   =  3.7637541395008347+i3.6967343997925613
w4=arccos(y4)= 0.7853981633974483-i2.3561944901923449   = z4
------------------------------------------------------------
z1=x2+ix2    = 2.3561944901923449+i2.3561944901923449
y1=cos(z1)   = -3.7637541395008346-i3.6967343997925614
w1=arccos(y1)= 2.3561944901923449+i2.3561944901923449   = z1

z2=-x2+ix2   = -2.3561944901923449+i2.3561944901923449
y2=cos(z2)   = -3.7637541395008346+i3.6967343997925614
w2=arccos(y2)=  2.3561944901923449-i2.3561944901923449  = z4

z3=-x2-ix2   = -2.3561944901923449-i2.3561944901923449
y3=cos(z3)   = -3.7637541395008346-i3.6967343997925614
w3=arccos(y3)= 2.3561944901923449+i2.3561944901923449   = z1

z4=x2-ix2    = 2.3561944901923449-i2.3561944901923449
y4=cos(z4)   = -3.7637541395008346+i3.6967343997925614
w4=arccos(y4)= 2.3561944901923449-i2.3561944901923449   = z4
-------------------------------------------------------------
x1=  pi/4 = 0.7853981633974483
x2=3 pi/4 = 2.3561944901923449
x3=5 pi/4 = 3.9269908169872415
x4=7 pi/4 = 5.4977871437821381

z1=x3+ix1    =  3.9269908169872415+i0.7853981633974483
y1=cos(z1)   = -0.9366400694314301+i0.6142431274865956
w1=arccos(y1)=  2.356194490192345-i0.7853981633974482   = x2-ix1

z2=-x3+ix1   = -3.9269908169872415+i0.7853981633974483
y2=cos(z2)   = -0.9366400694314301-i0.6142431274865956
w2=arccos(y2)=  2.356194490192345+i0.7853981633974482   = x2+ix1

z3=-x3-ix1   = -3.9269908169872415-i0.7853981633974483
y3=cos(z3)   = -0.9366400694314301+i0.6142431274865956
w3=arccos(y3)=  2.356194490192345-i0.7853981633974482   = x2-ix1

z4=x3-ix1    =  3.9269908169872415-i0.7853981633974483
y4=cos(z4)   = -0.9366400694314301-i0.6142431274865956
w4=arccos(y4)=  2.356194490192345+i0.7853981633974482   = x2+ix1
------------------------------------------------------------------
z1=x3+ix2    =  3.9269908169872415+i2.3561944901923449
y1=cos(z1)   = -3.7637541395008349+i3.6967343997925611
w1=arccos(y1)=  2.356194490192345-i2.3561944901923449   = x2-ix2

z2=-x3+ix2   = -3.9269908169872415+i2.3561944901923449
y2=cos(z2)   = -3.7637541395008349-i3.6967343997925611
w2=arccos(y2)=  2.356194490192345+i2.3561944901923449   = x2+ix2

z3=-x3-ix2   = -3.9269908169872415-i2.3561944901923449
y3=cos(z3)   = -3.7637541395008349+i3.6967343997925611
w3=arccos(y3)=  2.356194490192345-i2.3561944901923449   = x2-ix2

z4=x3-ix2    =  3.9269908169872415-i2.3561944901923449
y4=cos(z4)   = -3.7637541395008349-i3.6967343997925611
w4=arccos(y4)=  2.356194490192345+i2.3561944901923449   = x2+ix2
; -------------------------------------------------------------------
x1=  pi/4 = 0.7853981633974483
x2=3 pi/4 = 2.3561944901923449
x3=5 pi/4 = 3.9269908169872415
x4=7 pi/4 = 5.4977871437821381

z1=x4+ix1    = 5.4977871437821381+i0.7853981633974483 = -z3
y1=cos(z1)   = 0.93664006943143+i0.6142431274865956
w1=arccos(y1)= 0.7853981633974483-i0.7853981633974482 = x1-ix1

z2=-x4+ix1   = -5.4977871437821381+i0.7853981633974483 = -z4
y2=cos(z2)   =  0.93664006943143-i0.6142431274865956
w2=arccos(y2)=  0.7853981633974483+i0.7853981633974482 = x1+ix1

z3=-x4-ix1   = -5.4977871437821381-i0.7853981633974483 = -z1
y3=cos(z3)   =  0.93664006943143+i0.6142431274865956
w3=arccos(y3)=  0.7853981633974483-i0.7853981633974482  = x1-ix1

z4=x4-ix1    = 5.4977871437821381-i0.7853981633974483  = -z2
y4=cos(z4)   = 0.93664006943143-i0.6142431274865956
w4=arccos(y4)= 0.7853981633974483+i0.7853981633974482  = x1+ix1
----------------------------------------------------------------
z1=x4+ix2    = 5.4977871437821381+i2.3561944901923449
y1=cos(z1)   = 3.7637541395008344+i3.6967343997925616
w1=arccos(y1)= 0.7853981633974483-i2.3561944901923449   =x1-ix2

z2=-x4+ix2   = -5.4977871437821381+i2.3561944901923449
y2=cos(z2)   = 3.7637541395008344-i3.6967343997925616
w2=arccos(y2)= 0.7853981633974483+i2.3561944901923449   =x1+ix2

z3=-x4-ix2   = -5.4977871437821381-i2.3561944901923449
y3=cos(z3)   = 3.7637541395008344+i3.6967343997925616
w3=arccos(y3)= 0.7853981633974483-i2.3561944901923449   =x1-ix2

z4=x4-ix2    = 5.4977871437821381-i2.3561944901923449
y4=cos(z4)   = 3.7637541395008344-i3.6967343997925616
w4=arccos(y4)= 0.7853981633974483+i2.3561944901923449   =x1+ix2
------------------------------
z1=x4+ix3    = 5.4977871437821381+i3.9269908169872415
y1=cos(z1)   = 17.951221702159904+i17.937289667062213
w1=arccos(y1)= 0.7853981633974484-i3.9269908169872415   =x1-ix3

z2=-x4+ix3   = -5.4977871437821381+i3.9269908169872415
y2=cos(z2)   = 17.951221702159904-i17.937289667062213
w2=arccos(y2)= 0.7853981633974484+i3.9269908169872415   =x1+ix3

z3=-x4-ix3   = -5.4977871437821381-i3.9269908169872415
y3=cos(z3)   =  17.951221702159904+i17.937289667062213
w3=arccos(y3)= 0.7853981633974484-i3.9269908169872415   =x1-ix3

z4=x4-ix3    = 5.4977871437821381-i3.9269908169872415
y4=cos(z4)   = 17.951221702159904-i17.937289667062213
w4=arccos(y4)= 0.7853981633974484+i3.9269908169872415   =x1+ix3
----------------------------------------------------------------
x1=  pi/4 = 0.7853981633974483
x2=3 pi/4 = 2.3561944901923449
x3=5 pi/4 = 3.9269908169872415
x4=7 pi/4 = 5.4977871437821381

z1=x4+ix4    = 5.4977871437821381+i5.4977871437821381
y1=cos(z1)   = 86.321884181857327+i86.318987996303526
w1=arccos(y1)=  0.7853981633974483-i5.4977871437821381  =x1-ix4

z2=-x4+ix4   = -5.4977871437821381+i5.4977871437821381
y2=cos(z2)   = 86.321884181857327-i86.318987996303526
w2=arccos(y2)= 0.7853981633974483+i5.4977871437821383   =x1+ix4

z3=-x4-ix4   = -5.4977871437821381-i5.4977871437821381
y3=cos(z3)   = 86.321884181857327+i86.318987996303526
w3=arccos(y3)= 0.7853981633974483-i5.4977871437821381   =x1-ix4

z4=x4-ix4    = 5.4977871437821381-i5.4977871437821381
y4=cos(z4)   = 86.321884181857327-i86.318987996303526
w4=arccos(y4)= 0.7853981633974483+i5.4977871437821383   =x1+ix4

Title: Re: The calculator
Post by: Gunther on November 10, 2013, 05:38:29 AM
Hi Rui,

only one question: What algorithm do you use by solving a linear equation system?

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 10, 2013, 05:46:50 AM
Quote from: Gunther on November 10, 2013, 05:38:29 AM
Hi Rui,
only one question: What algorithm do you use by solving a linear equation system?
Gunther

Hi Gunther

Where is the linear equation system ?

Do you want to say, for example:
                      a X+ bY=c and dX+eY=f  ? etc.
I use matrices.
               
Title: Re: The calculator
Post by: dedndave on November 10, 2013, 06:20:54 AM
Hi Rui,

the standard form for a linear equation is called the "slope-intercept" form:

Y=mX+b

m is the slope (=rise/run=(Y2-Y1)/(X2-X1))
b is the y-intercept (the value of Y when X=0)

many calculators let you enter 2 (X,Y) points (some allow m and b)
then, you can enter an X or Y value, and it will spit out the opposite

nearly any straight line can be described using the slope-intercept form
however, it gets a little tricky as the slope approaches infinity   :P
those are lines that graph stright up and down, like the line: X=0
Title: Re: The calculator
Post by: RuiLoureiro on November 10, 2013, 07:49:32 AM
Quote from: dedndave on November 10, 2013, 06:20:54 AM
Hi Rui,

the standard form for a linear equation is called the "slope-intercept" form:

Y=mX+b

m is the slope (=rise/run=(Y2-Y1)/(X2-X1))
b is the y-intercept (the value of Y when X=0)

many calculators let you enter 2 (X,Y) points (some allow m and b)
then, you can enter an X or Y value, and it will spit out the opposite

nearly any straight line can be described using the slope-intercept form
however, it gets a little tricky as the slope approaches infinity   :P
those are lines that graph stright up and down, like the line: X=0
Hi Dave,  :t

              i know all about that
              Gunther asked for linear equation system
Title: Re: The calculator
Post by: Gunther on November 10, 2013, 07:57:45 AM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 05:46:50 AM
Do you want to say, for example:
                      a X+ bY=c and dX+eY=f  ? etc.
I use matrices.

that's clear. The direction of my question was: Do you use the Gaussian elimination (https://en.wikipedia.org/wiki/Gaussian_elimination)?

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 10, 2013, 08:15:50 AM
Gunther,
               yes, the calculator uses that method.
Title: Re: The calculator
Post by: dedndave on November 10, 2013, 11:45:47 AM
sorry Rui   :t
Title: Re: The calculator
Post by: Gunther on November 10, 2013, 09:15:37 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 08:15:50 AM
yes, the calculator uses that method.

okay. Did you test some ill conditioned equation systems?

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 10, 2013, 11:01:57 PM
Quote from: Gunther on November 10, 2013, 09:15:37 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 08:15:50 AM
yes, the calculator uses that method.

okay. Did you test some ill conditioned equation systems?

Gunther
Hi Gunther,
                 use the calculator and see yourself the answers  :t
Title: Re: The calculator
Post by: Gunther on November 10, 2013, 11:06:33 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 11:01:57 PM
use the calculator and see yourself the answers  :t

okay, I'll give you a report.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 11, 2013, 12:38:57 AM
Quote from: Gunther on November 10, 2013, 11:06:33 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 11:01:57 PM
use the calculator and see yourself the answers  :t

okay, I'll give you a report.

Gunther
Gunther,
                ok, thank you ! :t
Title: Re: The calculator
Post by: RuiLoureiro on November 11, 2013, 01:33:49 AM
Quote from: dedndave on November 10, 2013, 11:45:47 AM
sorry Rui   :t
i like you give me answers,
               no problems with you, Dave  :t :t
Title: Re: The calculator
Post by: RuiLoureiro on November 11, 2013, 11:35:29 PM
Hi all,

In Reply #39 on: November 10, 2013, 05:34:30 AM
i showed how to get the function arccos(z).
Now i show all other because i rarely use formulas
without knowing from where they come from.
The calculator uses them.
---------------------------------------------------------------------------------
about
      trigonometric sin(w)=z and the inverse function w=arcsin(z)
      trigonometric tan(w)=z and the inverse function w=arctan(z)

      hyperbolic sinh(w)=z and the inverse function w=arcsinh(z)
      hyperbolic cosh(w)=z and the inverse function w=arccosh(z)
      hyperbolic tanh(w)=z and the inverse function w=arctanh(z)
---------------------------------------------------------------------------------

                  -----------------------------
                  Trigonometric functions
                  -----------------------------
By definition
                sin(w)= (e^iw-e^-iw)/2i = z   => w=arcsin(z)

    From
                   e^iw-e^-iw
                 z=----------   doing t=e^iw
                       2i
    we get
                          1
                2iz= t - ---  <=> 2iz t = t^2 - 1  ( t<>0 )
                          t

                <=> t^2 -2iz t - 1 = 0

                <=>   t= iz + SQRT(1-z^2)        - positive solution I
                   or
                      t= iz - SQRT(1-z^2)        - negative solution I

    From
            SQRT(1-z^2)= SQRT[(-1).(z^2-1)]= i SQRT(z^2-1)

    we have
                      t= iz + i SQRT(z^2-1)      - positive solution II
                   or
                      t= iz - i SQRT(z^2-1)      - negative solution II

    From
            t=e^iw  we get w=-i ln(t)

    Solutions:
   
            w=arcsin(z)= -i ln(iz +  SQRT(1-z^2))       - positive solution I
            w=arcsin(z)= -i ln(iz -  SQRT(1-z^2))       - negative solution I
            w=arcsin(z)= -i ln(iz +i SQRT(z^2-1))       - positive solution II
            w=arcsin(z)= -i ln(iz -i SQRT(z^2-1))       - negative solution II

    note1:  sin(w)=z and sin(-w)=-z
    note2:  the calculator uses positive solution I
----------------------------------------------------------------------------------
By definition

                       sin(w)      e^iw - e^-iw       e^2iw - 1
                tan(w)=------- = --------------- = --------------= z
                       cos(w)    i(e^iw + e^-iw)    i(e^2iw + 1)

                w= arctan(z)
                                       
         Doing
                (1)     t=e^2iw    we have   

                        2iw= ln(t)  => w = -i/2 ln(t) = i/2 ln(t^-1)

                              t - 1
                (2)     iz = -------    <=>   iz (t+1) = t - 1    ( t<>-1 )
                              t + 1

                                               
                        izt + iz -t = -1  <=> (iz-1)t = - (iz + 1)

                        <=>  (1-iz) t = (1 + iz)
                                             
                             (1 + iz)   i (1 + iz)    i - z
                        t= -----------= -----------=---------
                             (1 - iz)   i (1 - iz)    i + z

                        t^-1 = (i+z)/ (i-z)


               =>       w = arctan(z) =  i/2 ln( (i+z)/(i-z) )     
------------------------------------------------------------------------
                    -------------------------
                    Hyperbolic functions
                    -------------------------
               
By definition
                sinh(w)= (e^w-e^-w)/2 = z   => w=arcsinh(z)

    From
                   e^w-e^-w
                 z=----------   doing t=e^w
                       2
    we get
                         1
                2z= t - ---  <=> 2z t = t^2 - 1  ( t<>0 )
                         t

                <=> t^2 -2z t - 1 = 0

                <=>   t= z + SQRT(z^2+1)        - positive solution I
                   or
                      t= z - SQRT(z^2+1)        - negative solution I

    From
            t=e^w  we get w=ln(t)

    Solutions:
       
            w=arcsinh(z)= ln(z +  SQRT(z^2+1))       - positive solution I
            w=arcsinh(z)= ln(z -  SQRT(z^2+1))       - negative solution I

    note1:  sinh(w)=z and sinh(-w)=-z
    note2:  the calculator uses positive solution I
-------------------------------------------------------------------------
By definition
                cosh(w)= (e^w+e^-w)/2 = z   => w=arccosh(z)

    From
                   e^w+e^-w
                 z=----------   doing t=e^w
                       2
    we get
                         1
                2z= t + ---  <=> 2z t = t^2 + 1  ( t<>0 )
                         t

                <=> t^2 -2z t + 1 = 0

                <=>   t= z + SQRT(z^2-1)        - positive solution I
                   or
                      t= z - SQRT(z^2-1)        - negative solution I

    From
            SQRT(z^2-1)= SQRT[(-1).(1-z^2)]= i SQRT(1-z^2)

    we have
                      t= z + i SQRT(1-z^2)      - positive solution II
                   or
                      t= z - i SQRT(1-z^2)      - negative solution II


    From
            t=e^w  we get w=ln(t)

    Solutions:
       
            w=arccosh(z)= ln(z +  SQRT(z^2-1))       - positive solution I
            w=arccosh(z)= ln(z -  SQRT(z^2-1))       - negative solution I
            w=arccosh(z)= ln(z +i SQRT(1-z^2))       - positive solution II
            w=arccosh(z)= ln(z -i SQRT(1-z^2))       - negative solution II

    note1:  Because cosh(w)=z and cosh(-w)=z

            arccosh(z)= w or -w
   
    note2:  The calculator uses positive solution I
-----------------------------------------------------------------------------
By definition

                        sinh(w)     e^w - e^-w       e^2w - 1
                tanh(w)=------- = --------------- = ---------- = z
                        cosh(w)    (e^w + e^-w)     (e^2w + 1)

                w= arctanh(z)
                                       
         Doing
                (1)     t=e^2w    we have   

                        2w= ln(t)  => w = 1/2 ln(t)

                              t - 1
                (2)      z = -------    <=>    z (t+1) = t - 1    ( t<>-1 )
                              t + 1

                                               
                         zt + z -t = -1  <=> (z-1)t = - (z + 1)

                        <=>  (1 - z) t = (1 + z)
                                             

                        t = (1+z)/ (1-z)


               =>       w = arctanh(z) =  1/2 ln( (1+z)/(1-z) )

Title: Re: The calculator
Post by: RuiLoureiro on November 12, 2013, 06:05:15 AM
Quote from: Gunther on November 10, 2013, 11:06:33 PM
Rui,

Quote from: RuiLoureiro on November 10, 2013, 11:01:57 PM
use the calculator and see yourself the answers  :t

okay, I'll give you a report.

Gunther

Hi Gunther,

            I think you are talking about some cases like
           
                0x+0y+0z=1; x+y+z=2;x+y+z=3;
            or
                0x+0y+0z=0; x+y+z=2;x+y+z=3;
            or
                0x+0y+0z=0; x+y+z=3;x+y+z=3;
            or
                x+y+z=1; x+y+z=2;x+y+z=3;

            The calculator doesnt give a clear message because
            i didnt test that cases. I will do in the next version.

            Thanks  Gunther :t
Title: Re: The calculator
Post by: RuiLoureiro on November 12, 2013, 10:41:37 PM
Hi,
        In the NEXT version v3.10.2 (calcula60.exe)
        that i will post soon,

        When the calculator gives the message

        «The System of linear equations has no solution»
        it means that «there isn't any solution»

        When the calculator gives the message

        «The System of linear equations has no unique solution»
        it means that «there is infinite solutions»

        The problem is completely solved now.

Gunther,
              I don't know if you have any other question.
              If you have, please give me the report.
              Thanks  :t
              Rui
                       
Here are some results
----------------------------

x+y+z=1; x+y+z=2; x+y+z=3;
The System of linear equations has no solution
Determinant:  0

x+y+z=1; x+y+z=3; x+y+z=2;
The System of linear equations has no solution
Determinant:  0

x+y+z=3; x+y+z=2; x+y+z=1;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=1; x+y+z=2; x+y+z=3;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=0; x+y+z=2; x+y+z=3;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=0; x+y+z=3; x+y+z=3;
The System of linear equations has no unique solution
Determinant:  0

0x+0y+0z=0; 0x+0y+0z=0; x+y+z=3;
The System of linear equations has no unique solution
Determinant:  0

0x+0y+0z=0; 0x+0y+0z=0; 0x+0y+0z=3;
The System of linear equations has no solution
Determinant:  0

0x+0y+0z=0; 0x+0y+0z=0; 0x+0y+0z=0;
The System of linear equations has no unique solution
Determinant:  0

x+y=1; x+y+z=2; y+x=3;
The System of linear equations has no solution
Determinant:  0

x+y=1; x+y+z=2; y+x=1;
The System of linear equations has no unique solution
Determinant:  0
; ----------------------------------------------------
x+y+z+t=1; x+y+z+t=2; x+y+z+t=1; x+y+z+t=2;
The System of linear equations has no solution
Determinant:  0

x+y+z+t=1; x+y+z+t=2; x+y+z+t=3; x+y+z+t=4;
The System of linear equations has no solution
Determinant:  0

x+y+z+t=4; x+y+z+t=4; x+y+z+t=4; x+y+z+t=4;
The System of linear equations has no unique solution
Determinant:  0

Title: Re: The calculator
Post by: Gunther on November 12, 2013, 11:15:58 PM
Rui,

sorry for the delay, but I'm sick and I'm confined to bed.

My question has that background:
Given is the following linear equation system A:

x - 2y = 1
x +  y = 4

The solution is: x = 3 and y = 1

If we change the coefficients a bit, we've the system A':

x - 2y    = 1
x +  1.2y = 4

The solution is now: x = 2.875 and y = 0.9375

But the relationship between the two solutions is still recognizable.

Lets have a look at the following system B:

x   +  2y  = 3
2x +  4.1y = 4

The solution is: x = 43 and y = -20

Again, we're changing only 1 coefficient by 0.2. That leads to system B':

x   +  2y  = 3
2x +  3.9y = 4

The solution is now: x =-37 and y = 20

There's no relationship between the two solutions; even the sign has been reversed. That's a simple example of an ill conditioned linear equation system.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 13, 2013, 06:08:44 AM
Hi Gunther,
Quote
sorry for the delay, but I'm sick and I'm confined to bed.

        Oh, i hope you get better soon as possible  :t
       
Quote
Lets have a look at the following system B:
x   +  2y    = 3
2x +  4.1y = 4

        The solution is: x = 43 and y = -20

Again, we're changing only 1 coefficient by 0.2. That leads to system B':
x   +  2y  = 3
2x +  3.9y = 4

        The solution is now: x =-37 and y = 20

        (1) Ok, i think i understood the question
       
        (2) If we multiply both systems by 10 we have this

Quote
10 x + 20 y= 30
20 x + 41 y= 40     solution B  => vector (x,y)=(43,-20)

Quote
10 x + 20 y= 30
20 x + 39 y= 40     solution B' => vector (x,y)=(-37,20)

        It seems that there are something "wrong" when
        we change from 41 to 39
        But  from 41 to 39 we have "40"
       
Quote
this:
     10 x + 20 y= 30
     20 x + 40 y= 40

is equivalent to

    20 x + 40 y = 60
    20 x + 40 y = 40     solution C => has no solution

        It behaves like a function that passes through
        a discontinuity point: (its only an image)

Quote
10 x + 20 y= 30
20 x + 39 y= 40     solution B' => vector (x,y)=(-37,20)

10 x + 20 y= 30
20 x + 40 y= 40     solution C  => has no solution

10 x + 20 y= 30
20 x + 41 y= 40     solution B  => vector (x,y)=(43,-20)

        Many years ago, i wrote hundreds of sheets of
        exercises about this type of problems
as examples
        to my son when he was at the university studying
        mathematics.
        For instance: study the system
        x+y+z=3
        x-y+z=1
        2x-2y+az=2

        In this case, we have:

            1. If a =2  the system has no unique solution
            2. If a<>2  the system has a  unique solution 
       
        I took this example from a book that i have here
        about linear algebra and not from what i did because
        i have no room to all my library in my house.

        I think this is what you call
        an ill conditioned linear equation system:
        a linear equation system that depends on one or more
        parameters.

        I hope you recover soon as possible.
        By the way, i have had some headaches
        these days. Not too fine.
Title: Re: The calculator
Post by: dedndave on November 13, 2013, 06:13:28 AM
hope you're feeling better, Gunther   :t

for those simple equations, i usually solve them by substitution   :P
but, i'm sure Gunther is just using it as an example of a possibly more complex system
Title: Re: The calculator
Post by: RuiLoureiro on November 13, 2013, 06:20:22 AM
 :biggrin:
Quote
those simple equations, i usually solve them by substitution   :P
it is when we are on the first class, Dave :greensml:
Title: Re: The calculator
Post by: RuiLoureiro on November 13, 2013, 06:22:06 AM
I am playing with you Dave  :t
playing ? kidding.
Title: Re: The calculator
Post by: dedndave on November 13, 2013, 06:23:03 AM
i sometimes "add" equations, which is what you are essentially doing with the matricies
Title: Re: The calculator
Post by: RuiLoureiro on November 13, 2013, 06:31:24 AM
Quote from: dedndave on November 13, 2013, 06:23:03 AM
i sometimes "add" equations, which is what you are essentially doing with the matricies
or multiply by c and add.
               But the calculator cannot solve 2 systems
               only 1 system at a time. All parameters in one system
               are real constants not variables.
Title: Re: The calculator
Post by: Gunther on November 13, 2013, 06:37:46 AM
Hi Rui,

Quote from: RuiLoureiro on November 13, 2013, 06:08:44 AM
        I think this is what you call
        an ill conditioned linear equation system:
        a linear equation system that depends on one or more
        parameters.

no, not really. If you would draw both equations of system A into a coordinate system, you would see a clear intersection of both lines. That's our solution. The situation is total different with system B. You would see that both lines are smeared. That's the bad condition. Both equations are linear independent, but both are almost parallel.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 13, 2013, 07:14:45 AM
Gunther,
        I don't know what you want the calculator should do.
       
When we type the following system B:
(a)   x +    2y = 3
(b)  2x +  4.1y = 4

the calculator should give a pair of values for which
(a) and (b) are true. And this is exactly what i want.
The calculator doesn't study each coefficient or any relationship
between each equation. The calculator will never do this.
If we want to study the relationship between (a) and (b)
its another question you should solve.
The calculator doesn't do any geometric interpretation also
and will never do it.
If the angle between (a) and (b) are too small or too too small or not, the calculator does not compute it. It computes only the solution of the system.

So, the calculator will give only the solution: x = 43 and y = -20.
and the answer to your question
Quote
Did you test some ill conditioned equation systems?
seems to be this: no and never (if i understood whats behind it).
Title: Re: The calculator
Post by: Gunther on November 13, 2013, 07:56:30 AM
Rui,

Quote from: RuiLoureiro on November 13, 2013, 07:14:45 AM
So, the calculator will give only the solution: x = 43 and y = -20.

no offense, my posts wasn't meant as criticism. The Calculator brings the right result and that shows that it is numerically stable. :t The point with the coordinate system was only included to illustrate what's behind the term "ill conditioned". It's clear that the Calculator won't draw the system; that wouldn't be necessary and is in the most cases impossible. I apologize for the misunderstanding.

Gunther   
Title: Re: The calculator
Post by: RuiLoureiro on November 13, 2013, 08:10:57 AM
Gunther,

         «no offense, my posts wasn't meant as criticism.»

         I didnt get it in that way.  No problems :t

         About the calculator, i wrote what i wrote
         and i know what i want to do or if i want to
         do something more
! In this particular case
         of solving linear equation systems of 2,3,4
         unknowns i don't want to know if the angle
         between (a) and (b), (b) and (c) etc.
         are so small or so so small or not. To me
         it is irrelevant when the calculator
         wants to solve linear equation systems of 2,3,4
         unknowns. Only this.
Title: Re: The calculator
Post by: RuiLoureiro on November 14, 2013, 04:02:27 AM
Gunther,
        I was working about complex functions
        to be used in my "the calculator",
        when you asked me for something that has
        something to do with
        "an ill conditioned linear equation system".
        I used the calculator to see if there was
        any problem when we try to solve a system.
        And there was and i corrected the problem.
        Meanwhile, my problem was to know
        what you call a "an ill conditioned...",
        thing that i never heard. But it is also
        true that i don't follow this kind of
        things there are many years
. It could be
        seen as a concept, but i don't give
        importance to be included in the calculator.
        Now, it seems we know what is the question
        and, for me, it is solved. You give importance
        and i think that it is out of context for
        what i want the calculator should do.
        I want to say that it seems that you have
        a good background about this things...

        The way you set the question, the way you
        wrote about it, ... Nothing more to say.
        I hope you give the best interpretation
        to my replies.
        I hope you recover soon as possible.  :t
Title: Re: The calculator
Post by: Gunther on November 14, 2013, 04:16:35 AM
Hi Rui,

Quote from: RuiLoureiro on November 14, 2013, 04:02:27 AM
        I hope you recover soon as possible.  :t

thank you for the good wishes. The cold is very persistent.

Quote from: RuiLoureiro on November 14, 2013, 04:02:27 AM
        I hope you give the best interpretation
        to my replies.

Yes of course. I think you've made a good job with the Calculator.  :t

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 14, 2013, 04:24:36 AM
Hi Gunther,
                  take the correct tablets and wait ! :t
Title: Re: The calculator
Post by: RuiLoureiro on November 14, 2013, 05:25:29 AM
Dave,
        What do you call "a possibly more complex system" ?
       
        Don't forget that we are talking about "linear equation systems".
        And to be solved by a computer procedure.       

        It seems that there are "linear equation systems" and
           "linear complex equation systems"
        or "complex linear equation systems"
        or "linear equation complex systems" (don't know)
        Where did you see it, Dave?  :bgrin:
Title: Re: The calculator
Post by: dedndave on November 14, 2013, 05:34:00 AM
you can always make a line formula more complex
for example, one of the constants may be the sin(angle) - something like that
at a specific angle, the function is linear, but changes as the angle changes

you could also introduce time into the equation
at any given moment, the function is linear - and may be evaluated as such
but, the constants change with time
Title: Re: The calculator
Post by: dedndave on November 14, 2013, 05:37:53 AM
the reason i bring it up is....

let's say i evaluate a linear equation in a loop
at each pass - constants
but - the constants are different for different passes

the evaluation process should be able to handle any set of input values
Title: Re: The calculator
Post by: Gunther on November 14, 2013, 06:13:44 AM
Dave,

Rui's question is justified.

Quote from: dedndave on November 14, 2013, 05:34:00 AM
you can always make a line formula more complex
for example, one of the constants may be the sin(angle) - something like that

No, that wouldn't be a linear equation system, because the sine is bent. You're talking about a non-linear equation system. That's not so easy to solve and most of these systems can only be solved approximately. That's another point.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 14, 2013, 06:29:26 AM
Quote from: dedndave on November 14, 2013, 05:34:00 AM
you can always make a line formula more complex
for example, one of the constants may be the sin(angle) - something like that
at a specific angle, the function is linear, but changes as the angle changes

you could also introduce time into the equation
at any given moment, the function is linear - and may be evaluated as such
but, the constants change with time

Ok Dave,
        now, i understood the idea.
        Yes, if the constants are real
        the system is a linear equation system.

        The system is non-linear in x if we use sin(x) instead of x
         or x^2, e^x, ...

        For instance:  2 sin(3t) x+  y=5
                               2 x- 3y=10       for t={...}
--------------------------------------------------------------------
        For each t, we get a real number A=2*sin(3t),
        we have a linear equation system,
        we may solve it, we may have or not a solution,
        etc. etc.
---------------------------------------------------------------------
        But this:     2 sin(3x)+  y=5
                            2 x- 3y=10

        is a non-linear equation system.       
   
Title: Re: The calculator
Post by: dedndave on November 14, 2013, 07:44:55 AM
Gunther....
sin(45) is a constant   :P
Title: Re: The calculator
Post by: Gunther on November 14, 2013, 07:55:14 AM
Dave,

Quote from: dedndave on November 14, 2013, 07:44:55 AM
Gunther....
sin(45) is a constant   :P

yes, that's true. But the value is sqrt(2)/2 which is irrational.  :greensml:

Gunther
Title: Re: The calculator
Post by: dedndave on November 14, 2013, 11:46:36 AM
constants can be irrational - take my wife, for example   :lol:
Title: Re: The calculator
Post by: Gunther on November 14, 2013, 08:46:07 PM
Dave,

Quote from: dedndave on November 14, 2013, 11:46:36 AM
constants can be irrational - take my wife, for example   :lol:

I hope she didn't read your posts, otherwise ...  :lol:

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 14, 2013, 10:57:34 PM
Quote from: Gunther on November 14, 2013, 06:13:44 AM
No, that wouldn't be a linear equation system, because the sine is bent. You're talking about a non-linear equation system. That's not so easy to solve and most of these systems can only be solved approximately. That's another point.
Gunther

Gunther,

        If the constants are real (like, 1, 1.2, pi, sqrt(5),...)
        the system is a linear equation system.

        The system is non-linear in x if we use sin(x) instead of x
        or x^2, e^x, ...

        For instance:  2 sin(3t) x+  y=5
                               2 x           - 3y=10       for instance: t={1,2,...}
--------------------------------------------------------------------
        For each t, we get a real number A=2*sin(3t),
        we have a linear equation system,
        we may solve it, we may have or not a solution,
        etc. etc.
---------------------------------------------------------------------
        But this:     2 sin(3x)+  y =5
                            2 x        - 3y=10
        is a non-linear equation system
        and what you said is correct.
Title: Re: The calculator
Post by: RuiLoureiro on November 14, 2013, 11:00:03 PM
Quote from: dedndave on November 14, 2013, 11:46:36 AM
constants can be irrational - take my wife, for example   :lol:
(...) :greensml:
Title: Re: The calculator
Post by: RuiLoureiro on November 15, 2013, 02:50:26 AM
 :biggrin:
Gunther,
          you tried to show us an example of
          a linear equation system A
          that you say "it has one property"
          and another linear equation system B
          that you say "it has another property".
          Now, i show that they have the same:
          the question is the starting point.

This is what you wrote
-----------------------------
Quote
My question has that background:
Given is the following linear equation system A:
x -  2y = 1
x + 1y = 4

The solution is: x = 3 and y = 1
If we change the coefficients a bit, we've the system A':
x -     2y = 1
x + 1.2y = 4

The solution is now: x = 2.875 and y = 0.9375
But the relationship between the two solutions is still recognizable.

    Well,
    Do this:
                (1) replace +1y  by +ay where "a" is a real number
    we get:
                    x - 2y = 1
                    x + ay = 4
           
                (2) study this system
                    (if you know how to do that.
                    (explanations: $150 per hour. very cheap!).
    we get:
                    if a = -2 the system has no solution
                    if a<>-2 the system has a unique solution

                Using "The calculator", we get:
Quote
                x-2y=1; x-   2y=4; The System of linear equations has no solution                 
                x-2y=1; x-1.9y=4; X=  61.0   Y=  30.0   Determinant:  0.1
                x-2y=1; x-2.1y=4; X= -59.0   Y= -30.0   Determinant: -0.1               
Well, if we want to be far from a=-2, we may choose a=1 or a=200

          x-2y=1; x+200y=4; X=1.0297029702970297  Y=0.01485148514851485
          x-2y=1; x+201y=4; X=1.0295566502463054  Y=0.0147783251231527
          ...

Following what you call "an ill conditioned linear equation system",
i would say: that's a simple example of "an ill conditioned linear equation system",and this is your linear equation system A.

Well, you may say: the starting point is the first equation system.
And my question is: why to change "1" and no "-2" or "4" or other ?
-----------------------------------------------------------------------------------
This is what you wrote
----------------------------
Quote
Lets have a look at the following system B:
x   +     2y  = 3
2x +  4.1y = 4
Doing the same
           
    we get:
                    x +  2y = 3
                   2x + ay = 4

    studying the system:
   
                    if a = 4  the system has no solution
                    if a<>4  the system has a unique solution

                Using "The calculator", we get:

Quote
                    x+2y=3; 2x+   4y=4;  The System of linear equations has no solution
                    x+2y=3; 2x+3.9y=4;  X= -37.0   Y=  20.0   Determinant: -0.1
                    x+2y=3; 2x+4.1y=4;  X=  43.0   Y= -20.0   Determinant:  0.1
---------------------------------------------------------------------------
my conclusion is this: 

          The calculator should solve the linear equation system with
          real constant coefficients;
          We may study the system, if and when we want;
          You can call the name you want, for me, no problems.
---------------------------------------------------------------------------
I want to remember that many of us are here
doing this things to do something useful or
to pass the time, no to get more problems
for our lives

I will post the NEXT version v3.10.2 (calcula60.exe)
soon as possible
Title: Re: The calculator
Post by: Gunther on November 15, 2013, 05:00:38 AM
Hi Rui,

Quote from: RuiLoureiro on November 14, 2013, 10:57:34 PM
        But this:     2 sin(3x)+  y =5
                            2 x        - 3y=10
        is a non-linear equation system
        and what you said is correct.

no doubt about that.

Quote from: RuiLoureiro on November 15, 2013, 02:50:26 AM
I want to remember that many of us are here
doing this things to do something useful or
to pass the time, no to get more problems
for our lives

That's clear. It wasn't my matter of concern to make you problems.

Quote from: RuiLoureiro on November 15, 2013, 02:50:26 AM
          Now, i show that they have the same:

That's not my point of view. I want you cause no further problems; therefore I won't answer in detail. Only that: The condition of a linear equation system is a measure for the behavior of the system. If we call M the matrix of the coefficients, it's defined as:
Quote
cond (M) = ||M|| ||M-1||
or formulated in a sentence: The condition of a linear equation system is the norm of the matrix M multiplied by the norm of the inverse matrix of M. The system A has a much better condition than system B. That's the difference.

But again, I don't want that you've further problems in your spare time. You may ignore this point. Anyway, your Calculator is a solid work. Thank you for that.

Gunther 
Title: Re: The calculator
Post by: RuiLoureiro on November 15, 2013, 05:29:09 AM
Hi Gunther,
Quote
That's clear. It wasn't my matter of concern to make you problems.
I wanted to say the same to you

Quote
That's not my point of view.
...
The system A has a much better condition than system B.
That's the difference.
It's clear: now, i understand your point of view.
         Well, nothing to say: i showed my point of view.         
         Thank you for that, also.  :icon14:
         RuiLoureiro
Quote
Anyway, your Calculator is a solid work.
:t
Title: Re: The calculator
Post by: RuiLoureiro on November 19, 2013, 10:19:13 PM
Hi all,                               
-----------------------------------------------------------------------
                              LASTEST VERSION
-----------------------------------------------------------------------
        ****-- The (powerful) Calculator v3.10.2 --****
                                 (calcula60.exe)
                       
        This is the lastest version and this is the powerful calculator
        v3.10.2

            ---------------------------------------------------------------
            COMPLEX NUMBERS and COMPLEX FUNCTIONS
            ---------------------------------------------------------------

        Now, we may solve any complex expression in the same way we do for
        real expressions.

        We may use any function:

                                z= a + i b          (a,b are reals, i^2=-1)
                                  = |z| e^(i.angleR)

                conj(a+ib)      = a-ib
                inv(z)             = 1/z

                abs(a+ib)       = sqr(a^2+b^2)+i0
                sqr(a+ib)       = (a+ib)^(1/2)
                rnd(a+ib)       = rnd(a)+i rnd(b)
                rndi(a+ib)      = rndi(a)+i rndi(b)
       
                e^(a+ib)        = e^a * e^ib = e^a * ( cos(b)+i sin(b))

                (a+ib)^(c+id)   = e^( (c+id)*ln(a+ib) )
               
                ln(a+ib)        = ln (|a+ib|* e^i angleR )
                log(a+ib)       = (ln (|a+ib|* e^i angleR )) / ln(10)
               
                sin(z)          = (e^iz - e^-iz)/2i
                cos(z)          = (e^iz + e^-iz)/2
                tan(z)          = (e^2iz - 1) / i (e^2iz + 1)
                sec(z)          = 1 / cos(z)
                csc(z)          = 1 / sin(z)
                cot(z)          = 1 / tan(z)
               
                arcsin(z)       = -i  * ln(i*z + sqrt(1-z^2))   
                arccos(z)       = -i  * ln(z +i sqrt(1-z^2))
                arctan(z)       = i/2 * ln((i+z) / (i-z))
                arcsec(z)       = arccos(1/z)
                arccsc(z)       = arcsin(1/z)
                arccot(z)       = arctan(1/z)

                sind(z)
                cosd(z)
                tand(z)
                secd(z)
                cscd(z)
                cotd(z)

                arcsind(z)
                arccosd(z)
                arctand(z)
                arcsecd(z)
                arccscd(z)
                arccotd(z)

                sinh(z)         = (e^z - e^-z) / 2
                cosh(z)         = (e^z + e^-z) / 2
                tanh(z)         = (e^2z - 1) / (e^2z + 1)
                sech(z)         = 1 / cosh(z)
                csch(z)         = 1 / sinh(z)
                coth(z)         = 1 / tanh(z)

                arcsinh(z)      = ln(z + sqrt(z^2+1))
                arccosh(z)      = ln(z + sqrt(z^2-1))
                arctanh(z)      = 1/2 * ln((1+z) / (1-z))
                arcsech(z)      = arccosh(1/z)
                arccsch(z)      = arcsinh(1/z)
                arccoth(z)      = arctanh(1/z)
               
                round(a+ib, n)  - round 'a' and 'b' to n decimal places

        The operation rules are the same for real numbers

        The result may be a complex number, INFINITY or indeterminate form.
        We may use the division by 0 to generate th infinity.

        We need to use brackets when we have powers of powers

        (1-i2)^(1-i)^(i2) gives "Complex power too complex- use brackets"

        We need to do ((1-i2)^(1-i))^(i2) or (1-i2)^((1-i)^(i2)).

        Any complex number is a number with a real part 'a'
        and an imaginary part 'b'. For instance, z1=-2+i3 or z1=i3-2.

        We may define it typing z1=(-2,3); or z1=-2+i3 for example.

        To build a complex expression
        we may define a set of real/complex constants z1, z2, z3, z4, ...
        and then we write the expression

        For instance,

                (1-i2)*(2-i3)  or (a-ib)*(c-id) where a=12;b=-4;c=1;d=-3;
                                                are real constants

                z1+z2*z3-z4   or  z5=z1+z2*z3-z4  or z1=z1+z2*(z3/z4)+3-i2

        If the expression uses '^', we may use brackets or constants
        previously defined. See the following example:

            z1=(e^i*(2-i3)+ e^-i*(2-i3) ) /2 =  1.0806046117362794-i1.6209069176044192

        is not equal to
       
            z2=(e^(i*(2-i3))+ e^(-i*(2-i3)) ) /2 = -4.1896256909688072+i9.1092278937553366

            cos(2-i3)=-4.1896256909688072+i9.1092278937553366

        but is equal to

            x1=i*(2-i3)
            x2=-x1

            z3=(e^x1+e^x2)/2 = -4.1896256909688072+i9.1092278937553366

        After defining any constant/matrix we may type the constant name
        to see its value. We may use also list c or list r or list l or
        list.

        To delete all defined variables, type: del a (delete all)

        If you know any bug or something else, please post it       
        If you have any suggestion, please send me a personal message or ...

        I hope i have not did many mistakes!

        What will coming next ?
       
        Maybe the function norm(a), where a=matrix
        and something about complex numbers.
        ---------------------------------------------------------
        Nov. 2013

        Good luck !
        Rui Loureiro

        note:   RulesV3_10_2I   - rules in English
                   RulesV3_10_2P   - regras em Português
Title: Re: The calculator
Post by: Gunther on November 20, 2013, 06:22:03 AM
Rui,

impressive. You are a hard working man.  :t Thank you for providing.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on November 28, 2013, 10:43:48 PM
Quote from: Gunther on November 20, 2013, 06:22:03 AM
Rui,
impressive. You are a hard working man.  :t Thank you for providing.
Gunther
Thank you, Gunther   :t

Hi all,                               
-----------------------------------------------------------------------
                              LASTEST VERSION
-----------------------------------------------------------------------
        ****-- The (powerful) Calculator v3.11.1 --****
                               (calcula61.exe)
                       
        This is the lastest version and this is the powerful calculator
        v3.11.1

            ---------------------------------------------------------------------
            LINEAR EQUATION SYSTEMS WITH COMPLEX VARIABLES
                                  NORM of a MATRIX           
            ---------------------------------------------------------------------
        Now, we may solve linear equation systems with complex variables,
        and we may compute the norm of a matrix.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                           Systems of 2 complex variables x,y
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-------------
example 1
-------------
type the following lines (for each one, press COMPUTE)
or copy and paste:

z1=1-i2
z2=2+i3

x1=3;x2=5;x3=-7;

x1 X+ x2 Y=z1; x2 X- x3 Y=z2;

X=  0.75+i7.25
Y= -0.25-i4.75
Determinant: -4.0+i0
----------------------------------------
PROOF:

    type the following lines ( press COMPUTE):

X1=  0.75+i7.25
Y1= -0.25-i4.75

w1= x1*X1+ x2*Y1
  = 1.0-i2.0     = z1
 
w2= x2*X1- x3*Y1
  = 2.0+i3.0     = z2
---------------------------------------
------------
example 2
------------
    type the following lines ( press COMPUTE):

z1 X+ x2 Y=x1; x2 X- z2 Y=x2;
X=  0.9302752293577981+i0.3009174311926605 
Y=  0.2935779816513761+i0.3119266055045871
Determinant: -33.0+i1.0


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                       Systems of 3 complex variables x,y,z
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

------------
example 3
------------
type the following lines (for each one, press COMPUTE):

z1=1-i2
z2=2+i3

x1=3;x2=5;x3=-7;
x+y-x3 z=z1; x2 x-iy+2z=20; (x1+ix2)x+2y-z=8;

result:
X=  5.4763271162123386-i2.6248206599713056
Y= -10.3565279770444763-i9.0616929698708752
Z=  0.8400286944045911+i1.3837876614060258
Determinant:  42.0+i32.0
-------------------------------------------------
------------   
example 4
------------
type the following line ( press COMPUTE):

x+y-x3 z=z1; x2 x-iy+2z=20; z2 x+2y-z=x1+ix2;

result:
X=  4.5773011617515639-i1.0393208221626452
Y= -4.5656836461126005-i3.1689008042895442
Z=  0.1411974977658623+i0.3154602323503127
Determinant:  54.0+i21.0

PROOF:

    type the following lines ( press COMPUTE):

    X1=  4.5773011617515639-i1.0393208221626452
    Y1= -4.5656836461126005-i3.1689008042895442
    Z1=  0.1411974977658623+i0.3154602323503127


w1=   X1+   Y1-x3* Z1
  =0.9999999999999995-i2.0000000000000005 = z1=1-i2

w2=x2*X1-i* Y1+2*  Z1
  =20.0-i9.9746599868666408e-17 = 20

w3=z2*X1+2* Y1-    Z1
  =3.0000000000000001+i5.0000000000000002 = x1+ix2 = 3+i5

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                      Systems of 4 complex variables x,y,z,t
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

--------------------------------
example 5: real variables
--------------------------------
    type the following line ( press COMPUTE):

x+y+z+t=10; -x-y+2z+2t=20; 3x+2y-z-3t=8; -2x+y+z-5t=18;

X=  7.6666666666666667
Y= -7.6666666666666667
Z=  15.1666666666666667
T= -5.1666666666666667
Determinant: -36.0

    type the following line ( press COMPUTE):

matA=[1,1,1,1;  -1,-1,2,2;  3,2,-1,-3; -2,1,1,-5];
det(matA)=-36.0
The triangular matrix is correct
--------------------------------------------------------
------------
example 6- same as example 5
------------
    type the following line ( press COMPUTE):

x+y+z+t=10; -x-y+2z+2t=20; 3x+2y-z-3t=8; -2x+y+z-5t=18+i0;

X=  7.6666666666666667+i0
Y= -7.6666666666666667+i0
Z=  15.1666666666666667+i0
T= -5.1666666666666667+i0
Determinant: -36.0+i0
----------------------------------------------------------
------------
example 7
------------
    type the following line ( press COMPUTE):

x+iy+z+t=10; -x-y+2z+2t=20; 3x+2y-z-3t=8; -2x+y+z-5t=18+i0;

X=  5.1111111111111111-i2.5555555555555556
Y=  0+i7.6666666666666667
Z=  15.1666666666666667+i0
T= -2.6111111111111111+i2.5555555555555556
Determinant:  0-i36.0
----------------------------------------------
PROOF:

    type the following lines ( press COMPUTE):

X1=5.1111111111111111-i2.5555555555555556
Y1=0+i7.6666666666666667
Z1=15.1666666666666667+i0
T1=-2.6111111111111111+i2.5555555555555556

W1=X1+i*Y1+Z1+T1
  =10.0+i0

W2=-X1-Y1+2*Z1+2*T1
  =20.0+i0.0000000000000001

W3=3*X1+2*Y1-Z1-3*T1
  =7.9999999999999999-i1.9949319973733282e-16

W4=-2*X1+Y1+Z1-5*T1
  =18.0-i0.0000000000000001
----------------------------------------------
------------
example 8
------------
    type the following lines ( press COMPUTE):

z1=1-i2
z2=2+i3

x1=3;x2=5;x3=-7;

z1 x+iy+z+t=x1-ix2; -x-z2 y+2z+2t=20; 3x+2y-z1 z-3t=8; -2x+y+z-5t=18+i2;

X=  5.2599406528189911-i7.4712166172106825
Y=  5.7750741839762611+i2.2890207715133531
Z=  16.267062314540059+i3.4747774480712166
T= -1.2955489614243323+i3.7412462908011869

Determinant: -46.0-i68.0
----------------------------------------------
PROOF:

    type the following lines ( press COMPUTE):

X1=  5.2599406528189911-i7.4712166172106825
Y1=  5.7750741839762611+i2.2890207715133531
Z1=  16.267062314540059+i3.4747774480712166
T1= -1.2955489614243323+i3.7412462908011869

w1= z1*X1+ i* Y1+   Z1+  T1
  = 2.9999999999999997-i5.0000000000000001 = x1-ix2 =3-i5
 
w2=   -X1-z2 *Y1+2* Z1+2*T1
  = 19.999999999999999+i0 = 20
 
w3= 3* X1+2*  Y1-z1*Z1-3*T1
  = 8.0000000000000002-i6.0108168442596366e-16 = 8
 
w4=-2* X1+    Y1+   Z1-5*T1
  = 17.999999999999999+i2.0000000000000002 = 18+i2
;«««««««««««««««««««««««««««««««««««««««««««««««««««
                             NORM of a MATRIX
;«««««««««««««««««««««««««««««««««««««««««««««««««««
    type the following lines ( press COMPUTE):
matA=[1,-2; -3, 4];
norm(matA) 

we get:
norm -max. of the sum of each line (matA)= 7.0
norm -max. of the sum of each column (matA)= 6.0
Title: Re: The calculator
Post by: Gunther on November 29, 2013, 06:26:17 AM
Hi Rui,

only one thing: Wow!  :t

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on December 12, 2013, 06:35:33 AM
 :biggrin: :biggrin:
Hi Gunther
                       :t

Hi all,
        This is only to say that "The powerful calculator" (calcula62)
        is near to use matrices with COMPLEX NUMBERS.
        I need only to do some tests.       
        RuiLoureiro

Hi qWord,
        When i post calcula62, could you test it with matlab ?
        Ok, thank you  :t
       
See this:

Do:
        matX=[1+i2,9-i3; 3-i5.4, 4+i1.2];
We get:
        The complex matrix is defined

Do:
        matY=matX^-1;
We get:       
        matY=[0.0095362094447181-i0.061193609684003, 0.0622844675909634+i0.1261524385952565;
              0.0854036174255753+i0.0331480047856992,0.027359420085861 -i0.0187381237244];
        The complex matrix is defined
        Errors in the identity matrix are below 1e-18
        The inverted matrix is correct
-------------------------------------------------
Do:

matA=[1, 2, 3, 2, 0, 2,1,-2, 3, 2,0,1  ; 1, 4,5, 6, 0, 3,-5, 0, 1, 2, 7,0 ; -3, 0, 7,-2,-3,5,1 ,-1, 2,9,-2,0;
      9, 1, 1, 3, 4, 6,2, 5, 6, 8,2,3  ; 1,-1,1,-1, 8, 0, 4, 1,-1, 0, 5,1 ;  2,-1,-5, 2, 0,5,7 ,-9, 3,5,-3,1;
      2, 3, 1, 3, 5, 6,4, 5,-6,-8,7,0  ;-1,-3,1,-7,-8, 0, 0, 2,-5, 3, 4,1 ; 12,-4, 5, 7, 1,0,2 , 0,-3,0,-4,-1;
      1,-1, 1,-1,-9,-3,5,-7, 2, 2,1,-1 ; 0,-5,3,-2,-1,-7, 6,-1,-2,-5,-2,8 ;  0, 0, 1,-3, 0,1,-5,-2, 0,1, 5,1+i0];   


We get:
The complex matrix is defined

Do:
    matB=matA^-1;

We get:

matB=[0.3489475139105589+i0,-0.077717764135831+i0,-0.1305663289999746+i0,
-0.01189321415923582+i0, 0.030658417448943+i0,-0.01544063546736273+i0,
-0.032359956048502+i0, 0.12026503888873099+i0, 0.0563587763184989+i0,
-0.0469873206919989+i0,-0.0552819588513436+i0, 0.0028764341340867+i0;
1.2038253746424853+i0,-0.0737862490216782+i0,-0.3707567189349224+i0,
-0.1747472582414871+i0, 0.1591538921209745+i0,-0.0028790830112823+i0,
-0.1494282660592322+i0, 0.4412261789225444+i0, 0.01548276728050134+i0,
-0.2686901806756077+i0,-0.1567441075089298+i0,-0.2763391412739283+i0;
0.0187343364849522+i0,-0.0207830852282367+i0, 0.0772439172493358+i0,
-0.01210186072460702+i0, 0.0069412698217746+i0,-0.055170392364791+i0,
0.0258755788715113+i0,-0.0499767559328416+i0, 0.0257864718665081+i0,
0.0349311858466001+i0, 0.0159887049951585+i0, 0.0485851419165665+i0;
-0.3314381496330013+i0, 0.149112029548901+i0, 0.0633701813335249+i0,
0.0279434023893145+i0,-0.043087392918502+i0, 0.0414049652003719+i0,
0.01215734823711377+i0,-0.0944356492076842+i0,-0.0062092805019976+i0,
0.036984525440662+i0, 0.0541658475877536+i0,-0.058825516372493+i0;
0.1306324231186913+i0,-0.0212040294890572+i0,-0.0315844618695761+i0,
-0.0359397656450297+i0, 0.0930859455477016+i0, 0.006451085834335+i0,
-0.0357521157353953+i0, 0.0202766124971702+i0, 0.01438058210203112+i0,
-0.0674981469058792+i0,-0.0234276869891709+i0,-0.0083228389532894+i0;
-0.3692504255738974+i0,-0.021892117367119+i0, 0.1657167584891193+i0,
0.0705876315716985+i0,-0.1292871530040815+i0, 0.026429924473778+i0,
0.1266082036440829+i0,-0.164592953418614+i0,-0.01335398125911003+i0,
0.0718698527221532+i0, 0.0405050165976217+i0, 0.1594134514897885+i0;
0.0490849707981281+i0,-0.0171928398021129+i0,-0.00158264398711094+i0,
0.0022457425854745+i0, 0.0498990230369092+i0, 0.0029350115469339+i0,
0.0180160649764132+i0, 0.0216114527675041+i0,-0.01354256886325167+i0,
0.0354693568163014+i0,-0.0026549908694263+i0,-0.087100970997439+i0;
-0.2044568349995381+i0, 0.01297154108852978+i0, 0.0532421387390865+i0,
0.0737142372186105+i0,-0.0384820735367924+i0,-0.047213045317213+i0,
0.0295741565155512+i0,-0.0456359070616521+i0,-0.026393327801645+i0,
0.0326274528589774+i0, 0.0201915799013743+i0,-0.0406533648942984+i0;
-0.5932972720613709+i0,-0.0209918266600847+i0, 0.2026367180091205+i0,
0.1572055516251538+i0,-0.1259187657287346+i0,-0.0612563733893335+i0,
0.10269198782892028+i0,-0.3301642954853802+i0,-0.0588064472272272+i0,
0.2259098962133411+i0, 0.0763407165237221+i0, 0.1953977685856945+i0;
0.3182471547714092+i0, 0.0517233171449673+i0,-0.10861579851959029+i0,
-0.055216064571107+i0, 0.11886820932720037+i0, 0.0414594815056652+i0,
-0.1230670565368351+i0, 0.2047330641547552+i0, 0.01459943016238838+i0,
-0.12498644339395018+i0,-0.0577935633223318+i0,-0.1656982226986158+i0;
-0.2799018148394809+i0, 0.068480479218752+i0, 0.0509548448741404+i0,
0.0509176474488098+i0, 0.01172613482006036+i0,-0.0045568810249207+i0,
0.0402069822428226+i0,-0.0780196840570518+i0,-0.0297156907710767+i0,
0.10156931114386624+i0, 0.0259680263379561+i0, 0.062108712424104+i0;
0.2739747436075013+i0, 0.0358644611698261+i0,-0.10043750004637351+i0,
-0.01537054898749617+i0,-0.01188421088973993+i0, 0.0545292542113109+i0,
-0.0447509545683625+i0, 0.1334135675731232+i0,-0.0175808083399441+i0,
-0.1361058847726861+i0, 0.0610654582586491+i0,-0.0461320667215304+i0];


The complex matrix is defined
Errors in the identity matrix are below 1e-18
The inverted matrix is correct
-----------------------------------------------------------------
Do:
matR=[1, 2, 3, 2, 0, 2,1,-2, 3, 2,0,1  ; 1, 4,5, 6, 0, 3,-5, 0, 1, 2, 7,0 ; -3, 0, 7,-2,-3,5,1 ,-1, 2,9,-2,0;
      9, 1, 1, 3, 4, 6,2, 5, 6, 8,2,3  ; 1,-1,1,-1, 8, 0, 4, 1,-1, 0, 5,1 ;  2,-1,-5, 2, 0,5,7 ,-9, 3,5,-3,1;
      2, 3, 1, 3, 5, 6,4, 5,-6,-8,7,0  ;-1,-3,1,-7,-8, 0, 0, 2,-5, 3, 4,1 ; 12,-4, 5, 7, 1,0,2 , 0,-3,0,-4,-1;
      1,-1, 1,-1,-9,-3,5,-7, 2, 2,1,-1 ; 0,-5,3,-2,-1,-7, 6,-1,-2,-5,-2,8 ;  0, 0, 1,-3, 0,1,-5,-2, 0,1, 5,1];   

The real matrix is defined

NOTE: this matR is equal matA
      ***********************
Do:
   matS=matR^-1;
The real matrix is defined
The identity matrix is correct

matS=[0.3489475139105589,-0.077717764135831,-0.1305663289999746,-0.01189321415923582,
0.030658417448943,-0.01544063546736273,-0.032359956048502, 0.12026503888873098,
0.0563587763184989,-0.0469873206919989,-0.0552819588513436, 0.0028764341340867;
1.2038253746424853,-0.0737862490216782,-0.3707567189349224,-0.1747472582414871,
0.1591538921209745,-0.0028790830112823,-0.1494282660592322, 0.4412261789225444,
0.01548276728050134,-0.2686901806756077,-0.1567441075089298,-0.2763391412739283;
0.0187343364849522,-0.0207830852282367, 0.0772439172493358,-0.01210186072460701,
0.0069412698217746,-0.055170392364791, 0.0258755788715113,-0.0499767559328416,
0.0257864718665081, 0.0349311858466001, 0.0159887049951585, 0.0485851419165665;
-0.3314381496330014, 0.149112029548901, 0.0633701813335249, 0.0279434023893145,
-0.043087392918502, 0.0414049652003719, 0.01215734823711377,-0.0944356492076842,
-0.0062092805019976, 0.036984525440662, 0.0541658475877536,-0.058825516372493;
0.1306324231186913,-0.0212040294890573,-0.0315844618695761,-0.0359397656450297,
0.0930859455477016, 0.006451085834335,-0.0357521157353953, 0.0202766124971702,
0.01438058210203112,-0.0674981469058792,-0.0234276869891709,-0.0083228389532894;
-0.3692504255738975,-0.021892117367119, 0.1657167584891193, 0.0705876315716985,
-0.1292871530040815, 0.026429924473778, 0.1266082036440829,-0.164592953418614,
-0.01335398125911003, 0.0718698527221532, 0.0405050165976217, 0.1594134514897885;
0.0490849707981281,-0.0171928398021129,-0.00158264398711094, 0.0022457425854745,
0.0498990230369092, 0.0029350115469339, 0.0180160649764132, 0.0216114527675041,
-0.01354256886325167, 0.0354693568163014,-0.0026549908694263,-0.087100970997439;
-0.2044568349995381, 0.01297154108852978, 0.0532421387390865, 0.0737142372186105,
-0.0384820735367924,-0.047213045317213, 0.0295741565155512,-0.0456359070616521,
-0.026393327801645, 0.0326274528589774, 0.0201915799013743,-0.0406533648942984;
-0.5932972720613709,-0.0209918266600847, 0.2026367180091205, 0.1572055516251538,
-0.1259187657287346,-0.0612563733893335, 0.10269198782892028,-0.3301642954853802,
-0.0588064472272272, 0.2259098962133411, 0.0763407165237221, 0.1953977685856945;
0.3182471547714092, 0.0517233171449673,-0.1086157985195903,-0.055216064571107,
0.11886820932720038, 0.0414594815056652,-0.1230670565368351, 0.2047330641547552,
0.01459943016238838,-0.12498644339395018,-0.0577935633223318,-0.1656982226986158;
-0.2799018148394809, 0.068480479218752, 0.0509548448741404, 0.0509176474488098,
0.01172613482006036,-0.0045568810249207, 0.0402069822428226,-0.0780196840570518,
-0.0297156907710767, 0.10156931114386624, 0.0259680263379561, 0.062108712424104;
0.2739747436075013, 0.0358644611698261,-0.10043750004637351,-0.01537054898749618,
-0.01188421088973993, 0.0545292542113109,-0.0447509545683625, 0.1334135675731232,
-0.0175808083399441,-0.1361058847726861, 0.0610654582586491,-0.0461320667215304];

Title: Re: The calculator
Post by: RuiLoureiro on December 19, 2013, 02:51:55 AM
 :biggrin: :biggrin: :biggrin:
Hi
        --**** The calculator v3.12.1 ****--
                              calcula62

    This is the latest version.

    Now, we may do almost all operations with complex numbers,
    the same way we do for real numbers.

    In the next version, the calculator will do more
    matrix operations with real and complex numbers,
    i hope. And, i hope to do a general revision too.

    Dez. 2013

    Good luck !   
    RuiLoureiro

   
1. matrix definition:

a11=2.453 ;a12=-5.236 ;a21=9.123  ;a22=-3.154;
z11=(2,3) ; z12=(3,-2); z21=(8,-3); z22=(0,-5);

matA=[a11+ia12, a12-ia21; 0, 2+ia22];
matB=[z11, z12; z21, z22];

2. Operations:

    2.1  - ROUND

            round(matA, 1) or
           
            matC=round(matB, 1)

    2.2  - CONJUGATE

            conj(matA) or

            matC=conj(matB)

    2.3  - CHANGE

            - lines:         change l(matA;1,2) or
                        matX=change l(matA;1,2)

            - columns:       change c(matA;1,2) or
                        matY=change c(matA;1,2)

    2.4  - ADD,SUB,MUL (x=+,-,*)
                matX=matA x matB;

    2.5  - SCALAR:
   
                matX=-matB;

                matX=-2.3*matB;

                matX=(-2.3+i3.4)*matB;
               
    2.6  - TRANSPOSE:
   
                matX=matA^t;

    2.7  - INVERSE:
   
                matX=matA^-1;

    2.8  - DETERMINANT:
   
                det(matA)        - Gauss

                delta(matA)     - Laplace (note: more than 12x12 use Gauss)

---------------------
Inverse example
20x20 matrix
---------------------

g=[1.23+i3,2,3,-4.45,5,6,7,-1.24,0,10,11,1.12,-13,14.11,15,-1.16,7,8,19,-4;
1,2.24,3,-4,5.23,6,7,8,9,-1.08,11,12,-13.23,14,15,16,-17,18.45,1,20;
1,0,3,4,5.23,-6,7,8,9,10,-2.11,0,-13.34,14,0,-16,17,18.58,19,-20;
1,2,1,0,0,6,7.25,8,9,10.12,0,12,13.45,14,15,16,17.21,18.29,-19.23,2;
-1,2.45,0,4,5,6,7.45,8,9,0,11,12,13,4,15,0,17.22,18.21,19,1;
1,2,3,4,5.24,6,0.27,8,9.89,10,11,2,-13,14,15,16,17,3,19,20;
20,9,18,17,16,5,14,13,12,11.38,10,9,8,7,6.34,5,4,3.25,2,-1;
1,2.23,-3,4,5,6,7,-1,9,10,11.45,12,13,14.89,15,-16,17,18,19,20;
1,0,3,-4,5,6,7.34,8.34,9,1,1,12.29,-13.59,14,5,16,17,18.34,19,20;
1,2,0,4,5,0,1,8,9,10,-11,12.24,13,14.22,15,16,17.45,18,19,20;
20,19.34,1.84,17,16,15,14.35,13,12.68,11,10,9,8.34,7,6.34,5,4,3,2,1;
1,2,3,4,5.24,6,7,8.24,9,10,11.23,12,13.34,14,15,-1,-17.23,1,19,1;
1,-2.81,1,4.23,5,6.21,7,8.89,9,10,11,0,13,14,15,16,17,18,19.23,20;
-1,2,3,4,5,-6.23,-7,8,9,10,1,12,13,-14,15.33,6,17,18,19,20;
1,0,0,4,5,6.34,7,8,9,10,-11.89,1.23,13,14.34,15.21,16.34,0,18,19,20;
1.34,2,3,4,5,6.23,7,0,9,0,11,0,1.35,14,15,16.62,17,18,1.92,0;
1,-2,3,4,5.45,6,1,-8,9,10,1.12,12,13,14,15,-16,17.43,2,19,0;
1,2,1,0,-1,6,7,8,9,10,11,-12.23,13,14,15,16,17,18,0,20.23;
-1.45,1,3,4.56,0,6,7,0,9,10,11,0,13.34,14,-15,16,7,18,9.34,20;
1,2,3,-4,5,6,7,8,9.45,10,0,12.48,13,14,-1.54,16.21,-17,0,19,-2];

det(g)=-7.4473766747107554e+24+i4.3514436660822637e+23

f=g^-1;

f=[-0.0194101390259696-i0.00113411916989698,-0.1370614197121183-i0.0080083910445378,
0.0066192461046662+i0.000386757348184,-0.0465182165804565-i0.0027180228386169,
-0.386511062558009-i0.0225835376468868,-0.368461737789722-i0.0215289297846751,
-0.1614524182309398-i0.009433537920411,-0.2385493532116904-i0.01393825124497746,
0.4595938754918398+i0.0268537089747356, 0.0388561956287034+i0.0022703369755786,
0.1837886974705918+i0.01073862916349639, 0.5117449650708355+i0.0299008561560835,
0.1620417483438316+i0.0094679720157843, 0.1277470356882338+i0.0074641589056987,
-0.1869878416007705-i0.01092555264098641, 0.1301116930261207+i0.0076023239756936,
0.1197250236072046+i0.0069954390438745, 0.0993442813080926+i0.005804608287473,
-0.0020717516763048-i0.00012105082236762,-0.2827179734166223-i0.0165189890137946;
0.0337604928916169+i0.0019725990690909, 0.0299769462062127+i0.01392917529187581,
-0.01306560097164575-i0.0006726957847483,-0.0192320231024803+i0.0047275184685492,
0.12136210891085013+i0.0392800567360801, 0.0866611744166858+i0.0374457534790036,
0.0386556888522107+i0.0164079654184201, 0.055693308951244+i0.0242431149745011,
-0.11648218123635306-i0.0467072621036945, 0.0604679439001707-i0.0039488483427679,
-0.0280615129773847-i0.01867794007322,-0.11348444865514418-i0.0520072339698397,
-0.1499236106659666-i0.0164678574176749,-0.0331475772238254-i0.01298258004956008,
0.0202305291773326+i0.0190030602964516,-0.0270031861935396-i0.01322289367416595,
-0.0440565862158477-i0.01216732501495661, 0.0358409776223077-i0.0100960862034869,
0.0154972153526858+i0.0002105464274417, 0.0667522074753097+i0.0287318504226455;
0.0406117941812262+i0.0023729152193714, 0.0818252740755585+i0.0167559402015824,
-0.01085170799121976-i0.0008092116085059,-0.01108316472790187+i0.0056869136256106,
0.1517248804988679+i0.0472514896246874, 0.0585950532450137+i0.0450449357517479,
0.0715022541055779+i0.0197377720948801,-0.0520828615153939+i0.0291629745696253,
-0.10913404205833358-i0.0561859603594483, 0.0430512462722827-i0.0047502214101024,
-0.0543945245926987-i0.0224684118332657,-0.12046089994367322-i0.0625615001741418,
-0.0724493563580234-i0.0198098184821957,-0.0432071231790731-i0.01561724441069838,
0.0189264569889868+i0.0228595114428722,-0.10750152552027906-i0.0159063269040366,
0.0513258689097457-i0.01463654280255493, 0.0355983503043648-i0.0121449700467418,
0.043286961062462+i0.0002532743880342, 0.0170873264137525+i0.0345626469245062;
-0.0159470029981016-i0.000931770853282,-0.0579278258913802-i0.0065795425692905,
-0.0002637164077883+i0.0003177525201018, 0.01317218340486517-i0.0022330761412033,
-0.0542926443389835-i0.0185542072666661,-0.0126062849965109-i0.0176877613994824,
-0.017181424227656-i0.0077504162797713,-0.0209795548031127-i0.01145140352135348,
0.0591087304758857+i0.022062499241108,-0.0074086132114467+i0.00186526590602018,
0.0163702885251149+i0.0088226545537184, 0.1342346535807686+i0.0245659777155073,
0.0000232256387358+i0.0077787066810621, 0.01368776224649405+i0.0061324117404943,
0.0219876624186343-i0.0089762273463687, 0.0539338060356428+i0.0062459255480201,
-0.0231183686896271+i0.0057473203698566,-0.0451954066975247+i0.0047689563500441,
0.029589433178144-i0.0000994530654642,-0.0979559737147994-i0.01357168884654252;
0.0270098173828801+i0.00157816240411039, 0.2822294053188393+i0.01114392737497949,
0.0135642886383116-i0.0005381849832173, 0.0039312280452027+i0.0037822140488184,
0.4288829609106601+i0.0314257011186627, 0.3581887821357926+i0.0299581811935978,
0.1830606920666091+i0.01312706396197744, 0.2244567837334123+i0.0193955138734373,
-0.6048031004824733-i0.0373677784837187, 0.0180793287694184-i0.0031592451257527,
-0.1548464757746993-i0.0149431393696068,-0.7404162256078907-i0.0416079793806236,
-0.00007960509715-i0.01317498008594397,-0.1638551599103601-i0.01038661128032024,
0.128850098868514+i0.01520324925263357,-0.2125982673139815-i0.01057887230968555,
-0.0449222722876399-i0.0097343728880726,-0.11590363813509191-i0.0080772945322047,
-0.0367118167199483+i0.0001684460168895, 0.3807303570510562+i0.0229866914407692;
0.0405289318993353+i0.0023680736413576, 0.11148214611394603+i0.0167217522158427,
-0.00129221501739713-i0.0008075605334483, 0.0019705997187974+i0.0056753103303257,
0.1254488014001815+i0.0471550800389505,-0.0034092780624095+i0.0449530283086203,
-0.0303372563008461+i0.0196975001278765,-0.1648226353587958+i0.0291034718889808,
-0.0618045619113692-i0.0560713213246684, 0.0192129713643234-i0.0047405292949555,
0.0484247009571903-i0.0224225684049586,-0.0763036052803377-i0.0624338528055026,
0.0500677141133544-i0.0197693995153322,-0.037371848055371-i0.01558537976312966,
0.0000199038379996+i0.0228128700344031,-0.1589038574370042-i0.0158738724269483,
0.1411181108148658-i0.01460667912969671, 0.0204365488505158-i0.01212019005482421,
0.0610045485222371+i0.000252757619589,-0.0517062399548468+i0.0344921270213575;
-0.0352221441445672-i0.0020580022031672,-0.2033129989221616-i0.01453223510451822,
-0.0291679975757334+i0.0007018199637047, 0.0474400439994978-i0.0049321950802055,
-0.12018171605391551-i0.0409806759873619, 0.0370009471101926-i0.0390669570753481,
0.0516429278153983-i0.0171183437677289, 0.2467030664092351-i0.0252927139685577,
0.1295205241152076+i0.0487294401683013,-0.1591280629174403+i0.004119812645524,
-0.0710703227173497+i0.0194865963507867, 0.0969597598894756+i0.0542588728584819,
-0.11046223479751792+i0.0171808287746164, 0.0406517006168604+i0.01354465728157462,
0.12341720850775279-i0.0198257925646494, 0.199315428173636+i0.01379537521845265,
-0.2055876840688113+i0.01269410600450729,-0.0599417938584268+i0.01053319347844866,
-0.0711746548999218-i0.000219661977101, 0.0624404120414577-i0.0299757879831741;
0.0081821082410326+i0.0004780741546421, 0.102675244302531+i0.0033758399295984,
0.0198194052144595-i0.000163032860384, 0.0004582798404677+i0.00114574949913589,
0.1515148995684158+i0.0095198158676266, 0.060127170119415+i0.0090752587385449,
0.0237902158205569+i0.0039765932772258,-0.0535693260866477+i0.0058755004394625,
-0.1269786180193445-i0.01131985470122105, 0.0560906730305373-i0.0009570329636974,
-0.01004175635606827-i0.0045267386317264,-0.1324901331847655-i0.01260434256762883,
0.0351354779174615-i0.003991108551699,-0.0604964952618838-i0.0031464254847934,
-0.0164770597133613+i0.0046055339522322,-0.1517478501646902-i0.0032046672911151,
0.0337269698867066-i0.0029488423227647, 0.0181214240660289-i0.0024468620879714,
0.01020547141042502+i0.0000510275032009, 0.0289199897365273+i0.0069633790856655;
-0.0855434614452994-i0.0049982372282164,-0.0876699811315491-i0.0352942083331155,
0.0171838885388476+i0.00170449898678236,-0.0013575635030036-i0.01197874376848046,
-0.1443737898739694-i0.0995291161701729,-0.0379226738097229-i0.0948812974770497,
-0.039423574272766-i0.0415750493238491, 0.0343289525511508-i0.0614280122566028,
0.1519604273907546+i0.11834841652963564,-0.10261154979135434+i0.01000572346640078,
0.0232597906075389+i0.0473267867166671, 0.1381659923690335+i0.1317776617852742,
-0.0403896939358725+i0.0417268056665535, 0.0722280711352362+i0.0328956937772025,
0.012981757502854-i0.0481505871679929, 0.134654076778117+i0.0335046084440366,
-0.004615171744153+i0.0308299734145118, 0.0301539335505019+i0.0255817995213824,
-0.0361964298334951-i0.0005334895511192,-0.00177590366985481-i0.0728017196541579;
0.0218453568013083+i0.00127640703080258,-0.0360687764178845+i0.0090131327518192,
0.0045033886416937-i0.0004352803581316, 0.036121924954747+i0.0030590290272651,
-0.0600614082205919+i0.0254168935663961, 0.0039853559555188+i0.0242299734209682,
-0.0094350279881629+i0.01061708015044768, 0.020246079162043+i0.0156869598525506,
0.01463167809985502-i0.0302228053702613,-0.043572986696341-i0.0025551759945851,
0.0060957258463732-i0.01208590960217478, 0.0295053933264537-i0.0336522510488103,
0.009592203958364-i0.01065583438598161, 0.0340152894450295-i0.0084006206394755,
0.0214516524167138+i0.01229628470844514, 0.0087630613671468-i0.0085561200538527,
-0.0201178115133616-i0.0078730946589707,-0.024229047535509-i0.006532860942522,
0.0061163698112344+i0.00013623799408,-0.00122346407094997+i0.0185914798714436;
0.0023717548784452+i0.0001385797737122, 0.00127000820674749+i0.0009785576756027,
-0.0004651536338222-i0.0000472584779584,-0.0059787913672044+i0.0003321194103035,
-0.0199869109976612+i0.0027595173591952,-0.017417003321501+i0.002630653195023,
-0.01114788616837892+i0.00115269857437899,-0.0076362675002467+i0.00170313645579978,
0.01147052620860822-i0.0032812961916431, 0.0035884156375167-i0.0002774159829735,
0.01018550301142924-i0.00131216968988529, 0.0327141889714081-i0.0036536318139193,
0.0338533248498052-i0.00115690612969722, 0.0087544684830588-i0.0009120571096577,
-0.0443652618458861+i0.00133501015841773,0.01190391112150391-i0.0009289397130411,
-0.00116041352008804-i0.0008547835055162, 0.0030220362544637-i0.0007092740554232,
0.0051412022124669+i0.00001479138702232,-0.01187840518949871+i0.0020184807913035;
-0.0021773302246684-i0.0001272196939799,-0.0413996878030306-i0.0008983403904993,
-0.01022822662108148+i0.000043384463279, 0.0200731016564679-i0.0003048939149761,
-0.059829128139176-i0.002533305868274,-0.0427014479813116-i0.002415005346547,
-0.0194138840209737-i0.00105820608560225,-0.0080547729396944-i0.00156352181064276,
0.0855139254474379+i0.0030123118704566, 0.0021761912802275+i0.0002546748021998,
0.01537435822730602+i0.00120460455321332, 0.10034410912545845+i0.0033541252726216,
0.0061856561978348+i0.0010620687264888, 0.0240180114421728+i0.0008372912097827,
-0.0262380491838674-i0.00122557267387925, 0.0322499883210472+i0.0008527898614148,
-0.007793487012067+i0.0007847126104905,-0.0241592049734958+i0.0006511313004902,
0.0041348793570754-i0.00001357886277421,-0.0436616602045676-i0.00185301578791263;
0.00163093934628789+i0.0000952945043355, 0.0302530708970439+i0.000672906053765,
-0.0051672510640367-i0.0000324973342939,-0.0087897397246035+i0.0002283822071381,
0.0545519731256677+i0.0018975845601828, 0.0099335672909108+i0.00180897100336672,
0.0168173698306746+i0.0007926541972992, 0.0024116035820543+i0.0011711632947845,
-0.061889431957065-i0.0022563862372166, 0.0289729843517122-i0.000190765346804,
-0.01241661193219478-i0.0009023146513535,-0.063305462952149-i0.002512423158196,
0.0065498520652884-i0.0007955475264466,-0.0211767672346124-i0.0006271768805963,
-0.0078361711389552+i0.0009180209198029,-0.0330167947307559-i0.0006387862177904,
0.01203699951247948-i0.0005877926358975, 0.01237595588738707-i0.000487732933451,
0.00167711993385647+i0.00001017131040822, 0.0347682281317692+i0.00138801010685441;
0.0088216085486977+i0.0005154396550699, 0.0699799884812732+i0.0036396901024402,
0.01042231309956863-i0.000175775244291,-0.0163939124460478+i0.00123529942143221,
0.0648410525042197+i0.01026386923344891, 0.0245169509364199+i0.0097845662402882,
0.01212154464984239+i0.0042873973572173,-0.0250403304837035+i0.0063347200229777,
-0.0847635771635731-i0.01220459618237775, 0.0830344016548766-i0.00103183310770688,
-0.0086389649556449-i0.0048805411802176,-0.0709062996003324-i0.01358947753681597,
0.01233728467259267-i0.0043030471219977,-0.0577372300533136-i0.0033923449967696,
-0.0363107561220523+i0.0049654950151578,-0.0603695286263248-i0.0034551388881975,
0.0330834006796475-i0.0031793190553025, 0.01541772964384465-i0.0026381048596356,
0.01511361734985653+i0.0000550157300777, 0.01558068918132165+i0.0075076254994859;
-0.00010647519188074-i0.0000062212617884,-0.0398796154392724-i0.0000439303897814,
-0.0095374480770532+i0.0000021215748534, 0.0047233939370626-i0.00001490983670394,
-0.0490527259583104-i0.0001238830129491,-0.0215208315545052-i0.00011809791402026,
-0.008928255502146-i0.0000517480971592, 0.0081910407792857-i0.0000764589049983,
0.0527150573359137+i0.0001473072301011,-0.01482946131806337+i0.00001245403573798,
0.00175733652455657+i0.0000589072339559, 0.0764247908005089+i0.0001640224932112,
-0.01441465334412763+i0.0000519369869403, 0.0224513470089867+i0.000040944979871,
0.0095327141628947-i0.0000599326111109, 0.0505573225600725+i0.0000417028905856,
-0.01545491389652381+i0.0000383737959573, 0.0073030040545381+i0.0000318414402068,
-0.0245305385048686-i0.0000006640297383,-0.0296398692001017-i0.0000906156582684;
-0.0030059108442561-i0.0001756330084452,-0.0507753907650083-i0.00124020283696128,
-0.01035452831279432+i0.0000598943730102, 0.0052508409786246-i0.0004209209586084,
-0.0675825098326581-i0.003497352627079,-0.0272727074960238-i0.0033340329720668,
-0.0167509459726376-i0.00146090524631103,-0.0017056013050055-i0.0021585183141238,
0.0636853406801707+i0.0041586438359693,-0.01013932855255368+i0.0003515910177601,
0.01051793928311291+i0.0016630154895754, 0.0729531249765221+i0.0046305339519651,
0.0085855906382627+i0.00146623781093389, 0.0263497321300003+i0.00115592145774289,
-0.0055583658766593-i0.00169196300547323, 0.0670641158440147+i0.00117731810418832,
-0.0266263975370759+i0.00108333413038318,-0.0129276616179764+i0.0008989185999456,
-0.0047298475908088-i0.0000187462840515,-0.01524138264719996-i0.0025581789056883;
-0.0000014128898892-i0.0000000825540459,-0.0077705202097542-i0.0000005829414575,
-0.0027687903174659+i0.0000000281525828, 0.0069182874879205-i0.0000001978485049,
0.0276527070967543-i0.00000164388580427, 0.0287600300905307-i0.00000156711949242,
0.01477139232511271-i0.000000686679798, 0.0239238381078118-i0.00000101458388478,
-0.0178177051142643+i0.0000019547172664, 0.0012810880714072+i0.0000001652608543,
-0.01367992113534759+i0.000000781679129,-0.0445041351219465+i0.0000021765231709,
-0.0081580467652459+i0.0000006891863017,-0.01101528465677902+i0.0000005433260748,
0.00139192678644616-i0.0000007952855381,-0.0055612534868285+i0.0000005533832944,
-0.0098689712537824+i0.0000005092073314,-0.0022620865749333+i0.0000004225251735,
-0.0072389765816235-i0.0000000088114506, 0.0226401372793714-i0.00000120243922654;
0.0234133161595634+i0.00136802166393001, 0.0470593492766544+i0.0096600540163217,
0.01515590328711374-i0.0004665227826525,-0.01095847810732329+i0.0032785920783106,
-0.0001388320378292+i0.0272412014267657,-0.0694657873375164+i0.0259690896057587,
-0.032625955539782+i0.01137912539102907,-0.092955386465975+i0.0168128977681953,
0.01398618141222478-i0.0323920595025713, 0.0372086071131991-i0.002738574789539,
0.037354674136369-i0.0129533806733097, 0.0286026430819526-i0.0360676550377794,
0.042654833742052-i0.01142066122756087, 0.01042256212525127-i0.009003578598305,
-0.0324649112247081+i0.01317885553828946,-0.0364495167960244-i0.0091702390463147,
0.0582902229292784-i0.0084381892262622, 0.0174612148754783-i0.0070017596903966,
0.0355941815503645+i0.0001460165314465,-0.0631054325565208+i0.0199258908912945;
0.0040047719980562+i0.0002339956807102,-0.0473624348634574+i0.00165232099377236,
-0.001969428243213-i0.0000797972129915,-0.0217534039207987+i0.0005607925702957,
-0.0616025485119036+i0.0046595193916074,-0.0624283196648258+i0.004441928779306,
-0.0317901688766614+i0.00194636259203078,-0.0414601687778709+i0.0028757917814537,
0.0983774509889199-i0.005540557004877, 0.0068442021826542-i0.0004684243597526,
0.0275640390312306-i0.0022156338660914, 0.11566639645662481-i0.006169255732356,
0.0081571421819226-i0.0019534671625207, 0.0276218679963847-i0.001540032996909,
-0.0222478497039098+i0.0022542006124413, 0.0358145601712081-i0.00156853972747311,
0.0096475510590416-i0.00144332497358908, 0.0173213828634444-i0.00119762834765146,
0.0049905203726582+i0.0000249756554093,-0.0532297427699772+i0.003408259186095;
-0.0069944360220029-i0.0004086794002123, 0.008030569558455-i0.0028858205871301,
-0.01078112655241977+i0.0001393678594621,-0.0008282345333327-i0.0009794384690193,
0.0206669562294324-i0.0081379689764357, 0.0392599799234215-i0.0077579414449135,
0.0252112335649803-i0.0033993717075995, 0.0523217271062519-i0.0050226433958645,
-0.0298505153673624+i0.009676723547728,-0.0066479178887888+i0.0008181150430105,
-0.0240859175265769+i0.0038696608276528,-0.0490925571630928+i0.01077476184518943,
-0.0215200176500464+i0.0034117800204272,-0.01118715686671396+i0.0026897067483196,
0.023572457544089-i0.0039370186298079,-0.01242750526869648+i0.0027394944773648,
-0.0241403756810982+i0.0025208037290581,...];


det(f)=-1.3381861640951734e-25-i7.8189165959126229e-27
Title: Re: The calculator
Post by: RuiLoureiro on January 08, 2014, 05:39:46 AM
Hi
        --**** The calculator v2014.01 ****--
                            (calcula63)
   
        This is the latest powerful version.

        In this new version, we may define up to
        30 constants or matrices and matrices
        20x21. Each matrix may be real or complex.

        We may compute the determinant of any
        defined matrix N by (N+1) - the same
        as N by N.

        We may do linear transformations also:
        add lines, sub lines, etc.

        See the examples in the files:
       
            .  Examples_real_matrix.txt
            .  Examples_complex_matrix.txt
            .  Examples_equations.txt

        Finally, we may transfer all work done
        to the file TheCalculator.txt. To do
        this, press ToFile.
        To start a new page, press Del File.
       

        To transfer to the file ThisWork.txt
        use
                file(ThisWork)
       
        Last note: now the calculator has a
        unique table of erros with 190 messages.

           
    Jan. 2014

    Good luck !   
    RuiLoureiro
Title: Re: The calculator
Post by: Gunther on January 08, 2014, 07:05:02 AM
Rui,

awesome.  :t

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on January 14, 2014, 04:58:54 AM
Quote from: Gunther on January 08, 2014, 07:05:02 AM
Rui,

awesome.  :t

Gunther

Hi Gunther
                        Thanks for your words  :t

Hi
        --**** The calculator v2014.02 ****--
                          (calcula64)
   
        This is the latest powerful version.

        ---------------------------------------------
        Polynomials with integer coefficients
        ---------------------------------------------

        General:   

                  p(x)=I7 x^7 + I6 x^6 + ...+ I1 x + I0

        where I7, I6, ..., I0 are integers.

        The calculator tries to find integer roots only.
   
        ------------------------------------------------
        Type:           
                p(x)=x^2+x-2

        We get:
                p(x)= (x+2 ) * (x-1 )

        ------------------------------------------------
        Type:           
                p(x)=x^5 +2x^4 -x^3 -2x^2

        We get:
                p(x)= (x+2 ) * (x+1 ) * (x-0 ) * (x-0 ) * (x-1 )
        ------------------------------------------------
        Type:           
                p(x)=x^2-2x+2

        We get:
                There is no integer roots in the table from -30 to 30
                 x^2-2 x+2= (x-1+i ) * (x-1-i )
        ------------------------------------------------
        Type:           
                p(x)=x^6 -1

        We get:
                p(x)= (x+1 ) * (x-1 ) * ( x^4+ x^2+1 )

        ------------------------------------------------
        Type:           
                p(x)=-5x^4 +5

        We get:
                p(x)= -5 * (x+1 ) * (x-1 ) * ( x^2+1 )
                x^2+1= (x+i ) * (x-i )

        ------------------------------------------------
        Type:           
                p(x)=-6x^6

        We get:
       
                p(x)= -6 * (x-0 ) * (x-0 ) * (x-0 ) * (x-0 ) * (x-0 ) * (x-0 )
           
    Jan. 2014

    Good luck !   
    RuiLoureiro
Title: Re: The calculator
Post by: RuiLoureiro on March 19, 2014, 04:56:04 AM
Hi all,

****--The Calculator v2014.03 by RuiLoureiro--****
                              (calcula65)
                 
        ------------------------------------
                  DERIVATIVES
                     first version
        ------------------------------------

        In this version, we may compute the derivative
        of one given function.

       
        1. Write an expression:   x^2-x*sin(x-x^2)

        2. Put the expression between brackets

           (x^2-x*sin(x-x^2)) or [x^2-x*sin(x-x^2)]

        3. end it

           (x^2-x*sin(x-x^2))' or [x^-x*sin(x-x^2)]'

        4. compute (we get)

            2*x-[sin(x-x^2)+(1-2*x)*cos(x-x^2)*x]


        In the same way, we have:

            [-(x)*sin(x-x^2)]' = -[sin(x-x^2)+(1-2*x)*cos(x-x^2)*x]

        ------------
        basic rule
        ------------

           the calculator doesn't know how to solve
           expressions with brackets inside brackets
       
        --------------------
        some messages
        --------------------
       
        1. «The expression is too complex»

            means that the calculator doesnt solve that case
            (it will solve later but not now)

        2. «Expression error»

            In many cases, it means that the calculator
            doesnt solve that case
            (it will solve later but not now)

            [x^2 + 2 * sin(x) ]' = Expression error

            but
           
            [x^2 + (2) * sin(x) ]' = 2*x+cos(x)*(2)

        -----------------------------------
        how to read the expression
        -----------------------------------

        We must read the expression from left to right.

        Example:
       
        [arctan(x^2-1)^(-1/2)]' = (-1/2)*2*x/(1+(x^2-1)^2)*arctan(x^2-1)^(-3/2)

        means this:

                                                 (-1/2)*2*x
        [arctan(x^2-1)^(-1/2)]' = --------------- * arctan(x^2-1)^(-3/2)
                                               (1+(x^2-1)^2)


                                           -x
                                = --------------- * arctan(x^2-1)^(-3/2)
                                   (1+(x^2-1)^2)

                                                          -x
                                = -----------------------------------------------
                                   (1+(x^2-1)^2) * arctan(x^2-1)^(3/2)

        ------------
        examples
        ------------
       
[sin(x^2-x)^(1/3) / (x^2-1)]'=[(1/3)*(2*x-1)*cos(x^2-x)*sin(x^2-x)^(-2/3)*(x^2-1) -
                                 2*x*sin(x^2-x)^(1/3)]/(x^2-1)^2

[(x^2-1) * sin(x^2-x)^(1/3)]' = 2*x*sin(x^2-x)^(1/3) +
                                (1/3)*(2*x-1)*cos(x^2-x)*sin(x^2-x)^(-2/3)*(x^2-1)

[(x^2-1) / sin(x^2-x)^(1/3)]' = [2*x*sin(x^2-x)^(1/3) -
                                (1/3)*(2*x-1)*cos(x^2-x)*sin(x^2-x)^(-2/3)*(x^2-1)] /
                                sin(x^2-x)^(2/3)


        This is the first version and this may contain some
        bugs. I am sure you will call my attention to that
        if you want to help me.
        Thank you.

        Good luck  :t
        Mar. 2014
        RuiLoureiro
Title: Re: The calculator
Post by: Gunther on March 19, 2014, 08:35:23 AM
Hi Rui,

seems to be a great step forward. I'll test the new version next weekend. Thank you.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on March 22, 2014, 03:14:56 AM
Hi Gunther,
            Thank you.  :t
            I also think it will be a great step forward:
            we write a function, we have the derivative!
            Only to us: i hope that Hutch will do some
                differential calculus, now and quickly.
  ;)

:biggrin:
Hi all,

****--The Calculator v2014.03.01 by RuiLoureiro--****
                                  (calcula65)
                 
        ------------------------------------
           DIFFERENTIAL CALCULUS
        ------------------------------------       
    I found a bug in the previous version v2014.03.

    First, i want to say that i did a lot of tests before posting
    the last version. For instance, i got
   
    [cos(x^2-1)^(1/2) * sin(x-x^2)^(1/3)]'  =

        -(1/2)*2*x*sin(x^2-1)*cos(x^2-1)^(-1/2)*sin(x-x^2)^(1/3) +
        (1/3)*(1-2*x)*cos(x-x^2)*sin(x-x^2)^(-2/3)*cos(x^2-1)^(1/2)

    and it is correct. But probably i did some modifications in the model
    and using the version i posted, we get

    -(1/2)*2*x*sin(x^2-1)*cos(x^2-1)^(-1/2)*sin(x-x^2) +
     (1/3)*(1-2*x)*cos(x-x^2)*sin(x-x^2)^(-2/3)*cos(x^2-1)

    Here, we have sin(x-x^2) NOT sin(x-x^2)^(1/3)
    and cos(x^2-1) NOT cos(x^2-1)^(1/2)

    This is the bug.

    In this new version we get

    -x*sin(x^2-1)*cos(x^2-1)^(-1/2)*sin(x-x^2)^(1/3) +
    (1/3)*(1-2*x)*cos(x-x^2)*sin(x-x^2)^(-2/3)*cos(x^2-1)^(1/2)

    See this:   -(1/2)*2*x ...   in the previous
             IS:    -x ...                 now

    This is the new model.
   
    Another example I:

    [sin(3.1*x^2-x)^(1/3) / cos(2.5*x^2-1)^(1/2)]'=

    [(1/3)*(6.2*x-1)*cos(3.1*x^2-x)*sin(3.1*x^2-x)^(-2/3)*cos(2.5*x^2-1)^(1/2) -
    (-5/2)*x*sin(2.5*x^2-1)*cos(2.5*x^2-1)^(-1/2)*sin(3.1*x^2-x)^(1/3)] / cos(2.5*x^2-1)

    Another example II:

    [sin(3.1*x^2-x)^(1/3) * cos(2.5*x^2-1)^(1/2)
    +(x^2-x)^(3) * (x^2-1)
    +exp(x^2-x) * ln(x^2-1)]'=

    (1/3)*(6.2*x-1)*cos(3.1*x^2-x)*sin(3.1*x^2-x)^(-2/3)*cos(2.5*x^2-1)^(1/2) +
    (-5/2)*x*sin(2.5*x^2-1)*cos(2.5*x^2-1)^(-1/2)*sin(3.1*x^2-x)^(1/3) +
    3*(2*x-1)*(x^2-x)^2*(x^2-1) +
     2*x*(x^2-x)^3 +
     (2*x-1)*exp(x^2-x)*ln(x^2-1)+(2*x/(x^2-1))*exp(x^2-x)

        Good luck !
        Mar. 2014
        RuiLoureiro

        EDIT: we may use list or show to see the defined constants.
Title: Re: The calculator
Post by: Gunther on March 22, 2014, 04:45:33 AM
Rui,

thank you for the new archives.  :t

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on June 23, 2014, 09:25:35 PM
****--The Calculator v2014.04 by RuiLoureiro--****
                              ( calcula66 )                 
        --------------------------------------------
              SOME DETECTED PROBLEMS
                in the previous versions
        --------------------------------------------
    ----------------------------
    1.  REAL EXPRESSIONS
    ----------------------------
        If we try:   
                       jr   = 10.6;
                       tj   = jr/1200
                       tj1  =(1200+jr)/1200
                       tj72 =tj1^72
        we get:

               pm=(10500.0 * ( jr / 1200) * (1+ jr / 1200)^72  ) / ( (1+tj)^72-1 )
                 =197.71325597595037

               pm=(10500.0 * ( jr / 1200) * (1+ jr / 1200)^72  ) / ( tj72-1 )
                 =197.71325597595036

        In the previous we GET: ERROR

              HERE: +tj)^  <--- brackets not tested after variable name

        Now it is solved.
       
    ----------------------------
    2. COMPLEX NUMBERS
    ----------------------------
        Try:
                10^1+i0

        It should be: 10+i0
        (first power 10^1 and second ADD i0)

        But we get: 1.0+i0
                            | Z |=  1.0
                            Angle=  0 degrees
                            Angle=  0 radians

        Now we get: 10.0+i0         
                              | Z |=  10.0
                              Angle=  0 degrees
                              Angle=  0 radians

        Now it is solved.
                   
    ------------------------------
     3.  LOGIC EXPRESSIONS
    ------------------------------
        Try:        xz=92h and 20h
        we get:  ERROR (doesnt detect 'and' operator)

        I redid all procedures to compute
        logic expressions and now
        it is, better and faster.
         
        We get: 0
                      00000000H
                      00000000000000000000000000000000B
       
        Now it is solved.

    --------------------------
    5.    CONVERSIONS
    --------------------------
        Now,    '-'    means 'negative number'
        and    NOT  means  'complement'

        Example 11
        --------------

            type:   not -42d

            we get: 41
                          00000029H
                          00000000000000000000000000101001B
    --------------------------
    4.    DERIVATIVES
    --------------------------
        I did a lot of work about this, but it is
        not completed yet.

        NOTE: in many cases, when the calculator gives ERROR, it
                   means that it cannot solve the problem (it fails).


        Good luck !  :t
        Jun. 2014
        RuiLoureiro
Title: Re: The calculator
Post by: Gunther on June 24, 2014, 02:45:28 AM
Rui,

I see, it's an error update. So the calculator becomes more and more stable. That's good news.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on September 05, 2014, 12:47:36 AM
Hi all,

****--The Calculator v2014.05 by RuiLoureiro--****
                          ( calcula67 )
                 
        1.    SOME DETECTED PROBLEMS
             in the previous versions
                 were corrected;
        -------------------------------------------------

        2.  Now, the calculator use SSE
            instructions in some cases.
            It is faster;
        -------------------------------------------------

        3.  See the following files where
            we can find a lot of examples
            about matrices.
           
            . Examples_real0_matrix.txt
            . Examples_complex0_matrix.txt

            If matCMPX is complex,
            matREAL= cnvreal(matCMPX) is real.
        -------------------------------------------------

            I did these examples to show that
            The calculator works correctly.

        Good luck !  :t
        Set. 2014
        RuiLoureiro
Title: Re: The calculator
Post by: Gunther on September 05, 2014, 03:36:23 AM
Rui,

thank you for the new version.  :t SSE accelerates much.

Gunther
Title: Re: The calculator
Post by: guga on September 23, 2014, 05:51:45 AM
Excelent work rui


You could do a library version. (dll and lib) as well. It would be very handfull
Title: Re: The calculator
Post by: Gunther on September 24, 2014, 07:36:55 AM
Quote from: guga on September 23, 2014, 05:51:45 AM
You could do a library version. (dll and lib) as well. It would be very handfull

This idea isn't so bad. I think it's a question of time.

Gunther
Title: Re: The calculator
Post by: RuiLoureiro on March 29, 2016, 05:24:14 AM
Hi all
:biggrin:
Title: Re: The calculator
Post by: Mikl__ on March 29, 2016, 05:25:53 PM
Ola, Rui!
(http://www.cyberforum.ru/images/smilies/yes.gif)
Title: Re: The calculator
Post by: RuiLoureiro on March 30, 2016, 03:20:24 AM
Quote from: Mikl__ on March 29, 2016, 05:25:53 PM
Ola, Rui!
(http://www.cyberforum.ru/images/smilies/yes.gif)
Olá Mikl__, very nice to see you here !  :t :icon14:
Title: Re: The calculator
Post by: HSE on May 29, 2016, 01:10:29 AM
Hi Rui!

Have you thinked in symbolic solution of partial derivatives?

For example:     

             input box=> [a+b*x^c]'

             solution box1=> der.a =1
             solution box2=> der.b =x^c
             solution box3=> der.c = b*c*x^(c-1)  <- this, at least partially, explain Rui smile
             solution box3=> der.c = b*x^c* ln(x)      <- I think!
                                                                                    (more easy remember Rui calculator
                                                                                      that this things)

Regards, HSE


Title: Re: The calculator
Post by: RuiLoureiro on May 31, 2016, 06:20:07 AM
 :biggrin:
Hi HSE,
       Thanks for your post.
       The answer is NO. I have no time now to do it
       and my main computer is not working.
       It needs to be repaired.
       Meanwhile, we can see that the calculator
       solves [3+5.34^x]' =ln(5.34)*5.34^x
       but doesn't solve [3+2*5.34^x]'= Expression error.
       So, i need to do some more work about derivatives because
       it doesn't solve some cases yet.

      Note: The calculator uses x or X as the variable (not a,b or c)

Regards  :t
Rui
Title: Re: The calculator
Post by: RuiLoureiro on June 02, 2016, 08:11:36 AM
Hi HSE,
       First of all, thanks for your question about partial derivatives.

       Now, you need to correct your example because you made an error
       in the third solution.

       In your example, it is given a function of 3 variables a, b and c (x is a constant)

       f(a,b,c)=[a+b*x^c]. And we want the partial derivative of f(a,b,c)

       1.   with respect to the variable a ( which means that b*x^c is a constant );
       2.   with respect to the variable b ( which means that a and x^c are constants );
       3.   with respect to the variable c ( which means that a, b and x are constants ).

       This means that your two first solutions

             solution box1=> der.a =1
             solution box2=> der.b =x^c

       are correct. But the third - solution box3=> der.c =b*c*x^(c-1) -
       is not correct because x^c is not a power function
       but an exponential function g(c)=x^c (c is a variable and x is a constant).

       In this way, g'(c)=[e^(c*ln(x))]'= ln(x) * e^(c*ln(x)) = ln(x) * x^c

       Particular cases:
                         1. If x= e   then g'(c)= e^c ;
                         2. If x=10  then g'(c)=ln(10) * 10^c

       So, the third solution is, in general:

                         solution box3=> der.c = b * ln(x) * x^c
       EDIT:
                 or     solution box3=> der.c = ln(x) * x^c * b  etc


       I will post the new version calcula68 to solve functions like f'(x)=[C1+...+C2*K^x]'
       as soon as possible.

       Good luck  :t

       Regards,
       Rui Loureiro

EDIT:  you say that «...this, at least partially, explain Rui smile».
           No, it has nothing to do with it but with the question itself.
           Thanks HSE  :t
Title: Re: The calculator
Post by: HSE on June 02, 2016, 08:43:37 AM
Thanks Rui!!

I change my post when I think in your smile! (just in time)

Title: Re: The calculator
Post by: RuiLoureiro on June 02, 2016, 08:52:49 AM
Quote from: HSE on June 02, 2016, 08:43:37 AM
Thanks Rui!!

I change my post when I think in your smile! (just in time)

Thanks HSE.
As i said before i need to do some more work about derivatives. My last post was in 2014 - September 05, 2014.
Title: Re: The calculator
Post by: RuiLoureiro on June 07, 2016, 08:41:48 AM
Hi HSE,
             If we try to get [x-cos(x)]'  the calculator gives 1-[-sin(x)].
             Do you like the solution ? I dont like ! In the next version
             the solution will be 1+sin(x) and NOT -[- ... ].
:t
Title: Re: The calculator
Post by: HSE on June 07, 2016, 10:21:41 PM
Hi Rui!
           I have tried [2.5+3*sin(2*3.14*x/5+4)]', of course very complex.

           But also is too complex [3+2*sin(x)]' . You have a lot of work to do!  :biggrin:

           Regards. HSE
Title: Re: The calculator
Post by: RuiLoureiro on June 08, 2016, 08:24:03 AM
Quote from: HSE on June 07, 2016, 10:21:41 PM
Hi Rui!
           I have tried [2.5+3*sin(2*3.14*x/5+4)]', of course very complex.

           But also is too complex [3+2*sin(x)]' . You have a lot of work to do!  :biggrin:

           Regards. HSE
Hi HSE
             Thanks for your reply  :t
             I am working in a new version: calcula68 v2016.01
             If we use calcula67 we cannot get the solution of  [3+2*sin(x)]'. But
             using the new version we get  2*cos(x)
              and this (for example):

[-x-x^2-1/x-e^x -x^x -ln(x)-log(x)-sqr(x)-sin(x)-cos(x)- arcsin(x) -arccos(x) -arctan(x) -arccsc(x)  -arcsec(x) -arccot(x) ]'

=-1-2*x+1/(x^2)-e^x-(1+ln(x))*exp(x*ln(x))-1/x-1/(ln(10)*x)-1/(2*sqr(x))-cos(x)+sin(x)-1/sqr(1-x^2)-1/sqr(1-x^2)-1/(1+x^2)
-1/(abs(x)*sqr(x^2-1))-1/(abs(x)*sqr(x^2-1))-1/(1+x^2)


Yes, i have a lot of work to do. I need to test a lot of expressions. But i dont want to solve 2*3.14*x/5 but only C * x where C= 2*3.14/5
Thanks :t
Title: Re: The calculator
Post by: HSE on June 09, 2016, 12:32:59 AM
Hi Rui!

    Perhaps the equation parser that qWord developed for SmplMath is usefull for parenthesis problem.

   In practice, most of the equations are short but with parenthesis. Now I trying to write derivatives that are used in Levenberg-Marquardt method to solve non linear models:

Equation:
Quote
Y = a+b*sin(c+2*3.14159*(X/d));
First partial derivatives:
Quote
DER.a = 1;
DER.b = sin(c+(2*3.14159*X/d));
DER.c = b*cos(c+(2*3.14159*X/d));
DER.d = b*cos(c+(2*3.14159*X/d))*(2*3.14159*X*(-1)/d**2);

Second partial derivatives:
Quote
DER.a.a=0;
DER.a.b=0;
DER.a.c=0;
DER.a.d=0;
DER.b.a=0;
DER.c.a=0;
DER.d.a=0;
DER.b.b=0;
DER.b.c=cos(c+ (2*3.14159*X/d))*((2*3.14159*X/d)+1);
DER.b.d=cos(c+(2*3.14159*X/d))*2*3.14159*-1/d**2;
DER.c.b=cos(c+ (2*3.14159*X/d))*((2*3.14159*X/d)+1);
DER.d.b=cos(c+(2*3.14159*X/d))*2*3.14159*-1/d**2;
DER.c.c=b*(-1)*sin(c+(2*3.14159*X/d));
DER.c.d= b*-sin(c+(2*3.14159*X/d))*(2*3.14159*X*(-1)/d**2);
DER.d.c= b*-sin(c+(2*3.14159*X/d))*(2*3.14159*X*(-1)/d**2);
DER.d.d=b*2*3.14159*X*(-1)*( -sin(c+2*3.14159*X/d**2)*(2*3.14159*X*(-1)/d**2)+cos(c+2*3.14159*X/d**2)*-2*d**-3);

I can find the solution, but the convergence is very slow, perhaps some error. At least I'm learning a litlle of derivation (because I have my old notes, but I think another person write them  :biggrin:)   
Title: Re: The calculator
Post by: qWord on June 09, 2016, 02:32:26 AM
Quote from: HSE on June 09, 2016, 12:32:59 AM
    Perhaps the equation parser that qWord developed for SmplMath is usefull for parenthesis problem.
Please DON'T - he should use something well known, e.g. the Shunting-yard algorithm.

Whatever the case may be, seems like that his current problem is to bring the equation into a canonical form before applying  derivation rules.
Title: Re: The calculator
Post by: HSE on June 09, 2016, 05:13:37 AM
Quote from: qWord on June 09, 2016, 02:32:26 AM
Please DON'T - ... the Shunting-yard algorithm.
Just an idea. Very nice, that idea lead to other idea.

Next week I will try to find what is a canonical form. 8) 
Title: Re: The calculator
Post by: RuiLoureiro on June 09, 2016, 09:00:07 AM
Quote from: HSE on June 09, 2016, 05:13:37 AM
Quote from: qWord on June 09, 2016, 02:32:26 AM
Please DON'T - ... the Shunting-yard algorithm.
Just an idea. Very nice, that idea lead to other idea.

Next week I will try to find what is a canonical form. 8)
Hi qWord, how are you ?
Hi HSE
               I think that if we have a procedure that solves [c+K*x/d]' for any variable c OR x OR d
               we have the problem solved for f(c+K*x/d). In this way, if the argument is in this "canonical form"
               it is solved: sin(c+K*x/d)'= [c+K*x/d]' cos(c+K*x/d).
Title: Re: The calculator
Post by: Force on June 10, 2016, 08:37:07 AM
Hi Rui it's Good work :t
Title: Re: The calculator
Post by: HSE on June 11, 2016, 05:59:49 AM
I have the concept!! (I think)

Thanks.
Title: Re: The calculator
Post by: RuiLoureiro on June 11, 2016, 09:18:59 AM
Quote from: Force on June 10, 2016, 08:37:07 AM
Hi Rui it's Good work :t
Thanks  :t
          My problem now is not only to solve the derivative of but to show it.
          For example i dont want to show solutions like [...]'= 2*1/(...)  but 2/(...)
          Or 2*[-1/(...)] but -2/(...).
          And i have no problems to solve expressions like C1*C2*C3/C4/C5*X/C6*C7 etc
          where Cn are constants and X is the variable. But may be The calculator will solve it soon.
          Don't Know now.
          Thanks for your reply  :t
Title: Re: The calculator
Post by: RuiLoureiro on June 13, 2016, 08:32:51 AM
Hi HSE,
Could you post the first partial derivative of sin(a-2.0*9/2*x/b) with respect to the variable b and a ? It is just to see the solution.
Title: Re: The calculator
Post by: HSE on June 14, 2016, 01:01:27 AM
Hi Rui!

          df/da = cos(a-9*x/b)
          df/db = 9*x*b^(-2)*cos(a-9*x/b)


It`s my solution, perhaps not the solution. :biggrin: 
Title: Re: The calculator
Post by: RuiLoureiro on June 14, 2016, 08:54:56 AM
Quote from: HSE on June 14, 2016, 01:01:27 AM
Hi Rui!

          df/da = cos(a-9*x/b)
          df/db = 9*x*b^(-2)*cos(a-9*x/b)

It`s my solution, perhaps not the solution. :biggrin:
:biggrin:
Hi HSE,
     Yes it is the solution. Is it the solution shown by your
calculator ? It should be:
          DER.a = cos(a-9*x/b)
          DER.b = 9*x*b^(-2)*cos(a-9*x/b)

In any way why (-2) ? Why not 9*x*b^-2 ? After '^' the sign must belong
to the next number (or literal constant) or it is an error. No ?
Title: Re: The calculator
Post by: HSE on June 14, 2016, 10:44:12 PM
Hi Rui!

DER.a, etc is the way to charge derivatives in the package that solve Levenberg-Marquardt. I'm my calculator(OK, the table of rules is the calculator 8)).

After to read about Shunting-Yard the Saturday, on Sunday I tried to write a solver  :biggrin:. I give up at this point:

Quotepsal -> [2+4*2/(1-5)^2^3]' = 0


I put the parenthesis because is more easy to read. 1/b^2 also is nice. Not very important.

Yesterday I downloaded a couple of solvers in Java, don't work yet because they need extra libraries, perhaps take some time to see what they do.
Title: Re: The calculator
Post by: qWord on June 15, 2016, 08:57:42 AM
RuiLoureiro,

just for personal interest: how do you store the parsed expressions? As tree?

regards
Title: Re: The calculator
Post by: RuiLoureiro on June 17, 2016, 09:00:21 AM
Quote from: qWord on June 15, 2016, 08:57:42 AM
RuiLoureiro,

just for personal interest: how do you store the parsed expressions? As tree?

regards

Hi qWord,
         i store parsed expressions in tables one after another. The length of
         each line is a constante (2^N). It is saved from top to bottom
         and removed from bottom to top (it is like push, push, push and pop, pop, pop).
         In some cases i store the function itself to be solved later. So
         i have one table for derivatives and another for functions.
         
         I have one table of basic functions (Fnc1, Fnc2,...,FncN) and tables
         of basic derivatives (Drv1,Drv2,...,DrvN): for argument X, for -X, 1/X, ...
         The first step is to solve functions. The last is to solve something
         like 1+x-x^2+x^-5+e^x, etc. (expressions without brackets).

         Could you post an expression to be solved ?
         Thanks
regards  :t
Title: Re: The calculator
Post by: qWord on June 19, 2016, 02:57:16 AM
Hi,
not so easy to find some expression, because nested functions (e.g. sin(cos(x))) are currently not implemented.
One thing I found is that
(-2^x)'
fails with
(-2^x)' = -2  ↯

Alos to note that editing expression is very unintuitive, because the DEL key clears the control rather than removing just one character (definitively breaks usability).

regards
Title: Re: The calculator
Post by: RuiLoureiro on June 19, 2016, 09:06:02 AM
Quote from: qWord on June 19, 2016, 02:57:16 AM
Hi,
not so easy to find some expression, because nested functions (e.g. sin(cos(x))) are currently not implemented.
One thing I found is that
(-2^x)'
fails with
(-2^x)' = -2  ↯

Alos to note that editing expression is very unintuitive, because the DEL key clears the control rather than removing just one character (definitively breaks usability).

regards
Hi qWord,
             many thanks for your reply
             Tomorrow i will see what about that expression.
             I replaced my copy procedure but the last has a bug !
Thank you so much  :t
Title: Re: The calculator
Post by: RuiLoureiro on June 20, 2016, 03:35:41 AM
Hi qWord,
           First of all, many thanks for your reply.
           Five things:
           
           1.   I got calcula67 from the first post in this forum.
                It is «The Calculator v2014.05 by RuiLoureiro»
                Using it i get this:               

                                   (a)      (2^x)' = ln(2)*2^x   
                AND THIS 
                                   (b)     (-2^x)' = ln(2)*2^x 

                       NOTE: the correct solution for (b) would be -ln(2)*2^x
                                  because (-2^x)'= -1*(2^x)'
                                  and [2^x]'=[e^(x*ln(2))]' = [x*ln(2)]' * 2^x = ln(2) * 2^x

                It means that the case (b) is wrong but it gives a solution and does't fail.
                I don't know why you don't get a solution!

            2. I know that the copy procedure used by calcula67 has a bug. I'm working now
               in calcula68, «The Calculator v2016.01» and some bugs was corrected.

            3. About nested functions, like sin( cos(x) ) or  sin( cos(x)+x^2-1 ),
               it is not implemented in the calcula67. I will try to implement it
               in the next calcula68 if i have time to do it. At least some cases.

            4. About the DEL key, i will correct it, thank you for the suggestion.
               
            5. About the new version
           
               In the previous calcula67, we get things like this:
               
               (-ln(x))' = -[1/x]   OR     (-arcsin(x))'=-[1/sqr(1-x^2)]

               I don't like these solutions. In the new version, it will be:
               
               (-ln(x))' = -1/x    and     (-arcsin(x))'=-1/sqr(1-x^2) and ...

Thank you so much.  :t

EDIT:
qWord,
Your suggestions are always good.
I don't forget that i developed some things with your suggestions - see the old forum.
Title: Re: The calculator
Post by: RuiLoureiro on June 20, 2016, 08:42:08 AM
qWord,
       I want to write a general procedure to identify a general power function
(or exponential).

           The PowerFuncX must be:  _BaseArgumentX ^ _ExpoArgumentY
           where
           _BaseArgumentX and _ExpoArgumentY are strings;
           K, N are integers; X,Y are real10
           and   
           _BaseArgumentX  - must be INTEGER K  constant
                                                        REAL        X       "
                                                        10      - particular case K=10
                                                         x
                                                         e
                                                        FncX(x)
                                                        expressionX

           _ExpoArgumentY  - must be INTEGER    N    constant
                                                        RATIONAL (K/N)     "
                                                        REAL           Y           "
                                                         x
                                                         e
                                                        FncY(x)
                                                        expressionY

      Note: In general, the left side is X, the right side is Y, so we have
               X operation Y, where operation is a code for: +, -, *, /, ^.

      Example 1: we may type [-x ^ (x-1)]'           => [ - x ^ expressionY ]'
      Example 2: we may type [10.54 ^ sin(x-1)]' => [ REAL X ^ FncY ]'

Do you want to give me any suggestion ?
Thanks  :t
Title: Re: The calculator
Post by: dedndave on June 20, 2016, 10:54:50 AM
you might see if this code works for you...

http://masm32.com/board/index.php?topic=222.0 (http://masm32.com/board/index.php?topic=222.0)

the IntExp_1 download
Title: Re: The calculator
Post by: qWord on June 21, 2016, 09:40:27 AM
Quote from: RuiLoureiro on June 20, 2016, 08:42:08 AM
I want to write a general procedure to identify a general power function
[...]
Do you want to give me any suggestion ?
I would, but I'm not sure about your question. And without knowing the exact data structure it hard to give any help.

You have parsed the expression in some table(s), respecting the operator precedence and associativity for the purpose of evaluation (not necessarily for derivation). For common evaluation (means no variables) you traverse the table from bottom to top, substituting the entries in row n-1 with results from row n.
The problem is that you must apply the rules of derivation from top to bottom in table. Furthermore the expression grows due to the rules (e.g. (f ⋅g)' = f'⋅g + f⋅g'), so you may need to  create a new table when applying derivation rules (or the table "grows into the third dimension"). If f' is some basic function like sin, cos, exp, ... you use tables to look up f' for particular arguments (does not sound practical because the set of possible arguments is infinite).
Did I get it right so far? You might show a graphic of your data structure.

regards

Title: Re: The calculator
Post by: RuiLoureiro on June 22, 2016, 08:43:05 AM
Quote from: dedndave on June 20, 2016, 10:54:50 AM
you might see if this code works for you...

http://masm32.com/board/index.php?topic=222.0 (http://masm32.com/board/index.php?topic=222.0)

the IntExp_1 download
Hi Dave
       How are you , my old friend ?
About the code, i am writing one.
I have a lot of work done.
See this:
[sin(x^2-x)^(2/3) * cos(x-x^2)^(1/2) ]'=
(2/3)*(2*x-1)*cos(x^2-x)*sin(x^2-x)^(-1/3)*cos(x-x^2)^(1/2)-(1/2)*(1-2*x)*sin(x-x^2)*cos(x-x^2)^(-1/2)*sin(x^2-x)^(2/3)
I am using The calculator - calcula67.
Thank you so much, Dave  :t
Title: Re: The calculator
Post by: RuiLoureiro on June 22, 2016, 09:17:46 AM
Quote from: qWord on June 21, 2016, 09:40:27 AM
Quote from: RuiLoureiro on June 20, 2016, 08:42:08 AM
I want to write a general procedure to identify a general power function
[...]
Do you want to give me any suggestion ?
I would, but I'm not sure about your question. And without knowing the exact data structure it hard to give any help.

You have parsed the expression in some table(s), respecting the operator precedence and associativity for the purpose of evaluation (not necessarily for derivation). For common evaluation (means no variables) you traverse the table from bottom to top, substituting the entries in row n-1 with results from row n.
The problem is that you must apply the rules of derivation from top to bottom in table. Furthermore the expression grows due to the rules (e.g. (f ⋅g)' = f'⋅g + f⋅g'), so you may need to  create a new table when applying derivation rules (or the table "grows into the third dimension"). If f' is some basic function like sin, cos, exp, ... you use tables to look up f' for particular arguments (does not sound practical because the set of possible arguments is infinite).
Did I get it right so far? You might show a graphic of your data structure.

regards

Hi qWord
        Thanks for your reply
No, i dont do what you are saying.

To solve this: [1-x^2+e^-x]' i dont use any table. The general procedure do this.
To solve this: [x-x^2 - sin(x^2-x)]' i solve [sin(x^2-x)]' and the result is saved in one table for 20
functions (i defined 20 but it can be 50 or 100 or ...). The last step is to solve [x-x^2]'
The result is added with the result that i get from the table.

To solve [sin(x^2-x)]' i get cos(Y) from a derivative table and i replace Y by x^2-x to get cos(x^2-x).
I call the general procedure that solves [x^2-x]' and then i multiply (2*x-1) by cos(x^2-x). This result
is saved in the derivative table.
The derivative table for simple functions is something like this:
Function Number      Function Name   Derivative
1                                   ln(x)                      1/x
...
5                                   cos(x)                   -sin(x)
...
N                                   arctan(x)                 ...

When we find 'cos(???)' we get the function number 5. If the function number is 5 the derivative is
-sin(???)

Thanks  :t
regards
Title: Re: The calculator
Post by: qWord on June 23, 2016, 06:32:31 AM
OK, so you do parsing on the fly and not as separate step (that was my thought).

regards
Title: Re: The calculator
Post by: RuiLoureiro on June 27, 2016, 08:31:25 AM
Quote from: qWord on June 23, 2016, 06:32:31 AM
OK, so you do parsing on the fly and not as separate step (that was my thought).

regards
Ok  :t
              Thanks
Hi all

Square Brackets or Not Brackets ?

In the last calcula67 that i post in this forum we get things like this

input box=> [-x*cos(2.6*x^2-1)
                      -2*sin(x)
                      +5*cos(x^2-x)
                      -sin(x)*cos(x)]'

solution box1=> -[cos(2.6*x^2-1)-5.2*x*sin(2.6*x^2-1)*x]
                           -2*cos(x)
                           -5*(2*x-1)*sin(x^2-x)
                           -[cos(x)*cos(x)-sin(x)*sin(x)]

In the new version calcula68 v2016.01 we get

input box=> [-x*cos(2.6*x^2-1)
                      -2*sin(x)
                      +5*cos(x^2-x)
                      -sin(x)*cos(x)]'

solution box1=> -cos(2.6*x^2-1)+5.2*x*sin(2.6*x^2-1)*x
                           -2*cos(x)
                           -5*(2*x-1)*sin(x^2-x)
                           -cos(x)*cos(x)+sin(x)*sin(x)
OR

input box=>        [-x*tan(2.6*x^2-1)]'

solution box1=> -tan(2.6*x^2-1)-5.2*x*sec(2.6*x^2-1)^2*x

Now, we have not square brackets. What do you say ?
What is better ?
Thanks  :t




Title: Re: The calculator
Post by: RuiLoureiro on July 05, 2016, 08:17:24 AM
Quote from: qWord on June 19, 2016, 02:57:16 AM
Hi,
not so easy to find some expression, because nested functions (e.g. sin(cos(x))) are currently not implemented.
One thing I found is that
(-2^x)'
fails with
(-2^x)' = -2  ↯

Alos to note that editing expression is very unintuitive, because the DEL key clears the control rather than removing just one character (definitively breaks usability).

regards
Hi qWord,
               In the new version v2016.01 - calcula68 - the calculator do derivatives of nested functions.
Today i got the first result:

                         input box=> [sin(x-cos( ln(x-1)-x )+x^2 )]'

                         solution box1=> cos(x-cos( ln(x-1)-x)+x^2 )*[1-(-sin(ln(x-1)-x)*(1/(x-1)-1))+2*x ]

Is there any problem ?
I will post the new versiom as soon as possible.
regards  :t
Title: Re: The calculator
Post by: HSE on July 05, 2016, 09:12:50 AM
Fantastic Rui!!

Perhaps you can replace in the final string "-(-sin"  by   "+(sin"
Title: Re: The calculator
Post by: RuiLoureiro on July 06, 2016, 08:20:28 AM
Quote from: HSE on July 05, 2016, 09:12:50 AM
Fantastic Rui!!

Perhaps you can replace in the final string "-(-sin"  by   "+(sin"

Many thanks HSE  :t

Here it is:

         input box=> [sin(x-cos(ln(x-1)-x)+x^2)]'

   solution box1=> cos(x-cos(ln(x-1)-x)+x^2)*[1+sin(ln(x-1)-x)*(1/(x-1)-1)+2*x]

But it gave me a lot of work but it is better, we have not brackets !
Thanks
Are you working in your calculator ? Is it running ?
:icon14:
Title: Re: The calculator
Post by: HSE on July 06, 2016, 10:02:34 AM
Perfect now  :t

My derivator sleep. Last week I open the file but close without changes, and begin to make little modifications in HJWasm to see how many macro levels I'm using, and that take me some time. The connection is: I think to obtain derivatives through object recursion, and that perhaps increase macro levels very fast.
Title: Re: The calculator
Post by: RuiLoureiro on July 07, 2016, 09:04:55 AM
Quote from: HSE on July 06, 2016, 10:02:34 AM
Perfect now  :t

My derivator sleep. Last week I open the file but close without changes, and begin to make little modifications in HJWasm to see how many macro levels I'm using, and that take me some time. The connection is: I think to obtain derivatives through object recursion, and that perhaps increase macro levels very fast.
Ok, good work
Now i have the solutions for 2 nested functions: one inside onother

       input box=> [sin(x^2-cos(x^2-x))]'

solution box1=> cos(x^2-cos(x^2-x))*[2*x+sin(x^2-x)*(2*x-1)]

It starts to work !
Thanks  :t
Title: Re: The calculator
Post by: RuiLoureiro on July 10, 2016, 03:44:35 AM
Hi all

Here we have the solutions for the sum of 6 nested functions:

Six functions and six derivatives in the format type I

input box=> [arcsin(cos(x^2-x)+x^2-x+1)
                    +arcsin(x^2-cos(x^2-x))
                    +arcsin(x^2-cos(x^2-x)+x^2-x+1)
           
                    +arccos(cos(x^2-x)+x^2-x+1)
                    +arccos(x^2-cos(x^2-x))
                    +arccos(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> 1/sqr(1-(cos(x^2-x)+x^2-x+1)^2)*[-sin(x^2-x)*(2*x-1)+2*x-1]
                        +1/sqr(1-(x^2-cos(x^2-x))^2)*[2*x+sin(x^2-x)*(2*x-1)]
                        +1/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)*[2*x+sin(x^2-x)*(2*x-1)+2*x-1]
               
                        -1/sqr(1-(cos(x^2-x)+x^2-x+1)^2)*[-sin(x^2-x)*(2*x-1)+2*x-1]
                        -1/sqr(1-(x^2-cos(x^2-x))^2)*[2*x+sin(x^2-x)*(2*x-1)]
                        -1/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)*[2*x+sin(x^2-x)*(2*x-1)+2*x-1]

The same Six functions and six derivatives in the format type II

input box=> [arcsin(cos(x^2-x)+x^2-x+1)
                    +arcsin(x^2-cos(x^2-x))
                    +arcsin(x^2-cos(x^2-x)+x^2-x+1)
           
                    +arccos(cos(x^2-x)+x^2-x+1)
                    +arccos(x^2-cos(x^2-x))
                    +arccos(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [-sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(cos(x^2-x)+x^2-x+1)^2)
                         +[2*x+sin(x^2-x)*(2*x-1)]/sqr(1-(x^2-cos(x^2-x))^2)
                         +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)
               
                         +[sin(x^2-x)*(2*x-1)-2*x+1]/sqr(1-(cos(x^2-x)+x^2-x+1)^2)
                         +[-2*x-sin(x^2-x)*(2*x-1)]/sqr(1-(x^2-cos(x^2-x))^2)
                         +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)


Do you like the solutions ?
Good luck  ;)
JUL 2016
More results:

input box=> [arctan(cos(x^2-x)+x^2-x+1)
            +arctan(x^2-cos(x^2-x))
            +arctan(x^2-cos(x^2-x)+x^2-x+1)
           
            +arccot(cos(x^2-x)+x^2-x+1)
            +arccot(x^2-cos(x^2-x))
            +arccot(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [-sin(x^2-x)*(2*x-1)+2*x-1]/(1+(cos(x^2-x)+x^2-x+1)^2)
               +[2*x+sin(x^2-x)*(2*x-1)]/(1+(x^2-cos(x^2-x))^2)
               +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(1+(x^2-cos(x^2-x)+x^2-x+1)^2)
               
               +[sin(x^2-x)*(2*x-1)-2*x+1]/(1+(cos(x^2-x)+x^2-x+1)^2)
               +[-2*x-sin(x^2-x)*(2*x-1)]/(1+(x^2-cos(x^2-x))^2)
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(1+(x^2-cos(x^2-x)+x^2-x+1)^2)

input box=> [arcsec(cos(x^2-x)+x^2-x+1)
            +arcsec(x^2-cos(x^2-x))
            +arcsec(x^2-cos(x^2-x)+x^2-x+1)
           
            +arccsc(cos(x^2-x)+x^2-x+1)
            +arccsc(x^2-cos(x^2-x))
            +arccsc(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [-sin(x^2-x)*(2*x-1)+2*x-1]/(abs(os(x^2-x)+x^2-x+1)*sqr((cos(x^2-x)+x^2-x+1)^2-1))
               +[2*x+sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr((x^2-cos(x^2-x))^2-1))
               +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr((x^2-cos(x^2-x)+x^2-x+1)^2-1))
               
               +[sin(x^2-x)*(2*x-1)-2*x+1]/(abs(os(x^2-x)+x^2-x+1)*sqr((cos(x^2-x)+x^2-x+1)^2-1))
               +[-2*x-sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr((x^2-cos(x^2-x))^2-1))
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr((x^2-cos(x^2-x)+x^2-x+1)^2-1))

input box=> [arcsinh(cos(x^2-x)+x^2-x+1)
            +arcsinh(x^2-cos(x^2-x))
            +arcsinh(x^2-cos(x^2-x)+x^2-x+1)
           
            +arccosh(cos(x^2-x)+x^2-x+1)
            +arccosh(x^2-cos(x^2-x))
            +arccosh(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [-sin(x^2-x)*(2*x-1)+2*x-1]/sqr((cos(x^2-x)+x^2-x+1)^2+1)
               +[2*x+sin(x^2-x)*(2*x-1)]/sqr((x^2-cos(x^2-x))^2+1)
               +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/sqr((x^2-cos(x^2-x)+x^2-x+1)^2+1)
               
               +[sin(x^2-x)*(2*x-1)-2*x+1]/sqr((cos(x^2-x)+x^2-x+1)^2-1)
               +[-2*x-sin(x^2-x)*(2*x-1)]/sqr((x^2-cos(x^2-x))^2-1)
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/sqr((x^2-cos(x^2-x)+x^2-x+1)^2-1)

input box=> [arcsech(cos(x^2-x)+x^2-x+1)
            +arcsech(x^2-cos(x^2-x))
            +arcsech(x^2-cos(x^2-x)+x^2-x+1)
           
            +arccsch(cos(x^2-x)+x^2-x+1)
            +arccsch(x^2-cos(x^2-x))
            +arccsch(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [sin(x^2-x)*(2*x-1)-2*x+1]/(cos(x^2-x)+x^2-x+sqr(1-(cos(x^2-x)+x^2-x+1)^2))
               +[-2*x-sin(x^2-x)*(2*x-1)]/((x^2-cos(x^2-x))*sqr(1-(x^2-cos(x^2-x))^2))
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/((x^2-cos(x^2-x)+x^2-x+1)*sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2))
               
               +[sin(x^2-x)*(2*x-1)-2*x+1]/(abs(os(x^2-x)+x^2-x+1)*sqr(1+(cos(x^2-x)+x^2-x+1)^2))
               +[-2*x-sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr(1+(x^2-cos(x^2-x))^2))
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr(1+(x^2-cos(x^2-x)+x^2-x+1)^2))

input box=> [arctanh(cos(x^2-x)+x^2-x+1)
            +arctanh(x^2-cos(x^2-x))
            +arctanh(x^2-cos(x^2-x)+x^2-x+1)
           
            +arccoth(cos(x^2-x)+x^2-x+1)
            +arccoth(x^2-cos(x^2-x))
            +arccoth(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [-sin(x^2-x)*(2*x-1)+2*x-1]/(1-(cos(x^2-x)+x^2-x+1)^2)
               +[2*x+sin(x^2-x)*(2*x-1)]/(1-(x^2-cos(x^2-x))^2)
               +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(1-(x^2-cos(x^2-x)+x^2-x+1)^2)
               
               +[sin(x^2-x)*(2*x-1)-2*x+1]/(1+(cos(x^2-x)+x^2-x+1)^2)
               +[-2*x-sin(x^2-x)*(2*x-1)]/(1+(x^2-cos(x^2-x))^2)
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(1+(x^2-cos(x^2-x)+x^2-x+1)^2)

input box=> [arcsech(cos(x^2-x)+x^2-x+1)
            +arcsech(x^2-cos(x^2-x))
            +arcsech(x^2-cos(x^2-x)+x^2-x+1)
           
            +arccsch(cos(x^2-x)+x^2-x+1)
            +arccsch(x^2-cos(x^2-x))
            +arccsch(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> [sin(x^2-x)*(2*x-1)-2*x+1]/(cos(x^2-x)+x^2-x+sqr(1-(cos(x^2-x)+x^2-x+1)^2))
               +[-2*x-sin(x^2-x)*(2*x-1)]/((x^2-cos(x^2-x))*sqr(1-(x^2-cos(x^2-x))^2))
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/((x^2-cos(x^2-x)+x^2-x+1)*sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2))
               
               +[sin(x^2-x)*(2*x-1)-2*x+1]/(abs(os(x^2-x)+x^2-x+1)*sqr(1+(cos(x^2-x)+x^2-x+1)^2))
               +[-2*x-sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr(1+(x^2-cos(x^2-x))^2))
               +[-2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr(1+(x^2-cos(x^2-x)+x^2-x+1)^2))

Title: Re: The calculator
Post by: Mikl__ on July 11, 2016, 10:48:34 AM
Olá, Rui!
Quero parabenizá-lo pela vitória de Portugal no Campeonato Europeu de Futebol!(http://arcanumclub.ru/smiles/smile136.gif)(http://www.gifki.org/data/media/764/flag-frantsii-animatsionnaya-kartinka-0024.gif)
(http://arcanumclub.ru/smiles/smile210.gif)
Title: Re: The calculator
Post by: jj2007 on July 11, 2016, 11:15:48 AM
Congrats from Italy :t
Title: Re: The calculator
Post by: RuiLoureiro on July 12, 2016, 03:52:42 AM
Quote from: Mikl__ on July 11, 2016, 10:48:34 AM
Olá, Rui!
Quero parabenizá-lo pela vitória de Portugal no Campeonato Europeu de Futebol!(http://arcanumclub.ru/smiles/smile136.gif)(http://www.gifki.org/data/media/764/flag-frantsii-animatsionnaya-kartinka-0024.gif)
(http://arcanumclub.ru/smiles/smile210.gif)
:biggrin:
Olá meu amigo Mikl__ !
Muito obrigado
Por acaso gosto de futebol e também eu joguei futebol
Obrigado  :t
:icon14:
Title: Re: The calculator
Post by: RuiLoureiro on July 12, 2016, 03:55:27 AM
Quote from: jj2007 on July 11, 2016, 11:15:48 AM
Congrats from Italy :t
Thank you so much, my old friend Jochen !
I like your Italy team too  :t
:icon14:
Title: Re: The calculator
Post by: RuiLoureiro on July 12, 2016, 07:47:26 AM
Hi
Here more interesting results:

input box=> [exp(ln(sin(x)))
                 +sin(cos(-tan(x)))
                 +sin(-cos(tan(x)))
                 +sin(-cos(-tan(x)))
                 -sin(-cos(-tan(x)))
                 +exp(-ln(sin(x)))]'

solution box1=> exp(ln(sin(x)))/(sin(x))*cos(x)
                      -cos(cos(-tan(x)))*sin(-tan(x))*(-sec(x)^2)
                      +cos(-cos(tan(x)))*sin(tan(x))*sec(x)^2
                      +cos(-cos(-tan(x)))*sin(-tan(x))*(-sec(x)^2)
                      -cos(-cos(-tan(x)))*sin(-tan(x))*(-sec(x)^2)
                      -exp(-ln(sin(x)))/(sin(x))*cos(x)

Good luck  :t
Title: Re: The calculator
Post by: RuiLoureiro on July 13, 2016, 04:20:26 AM
Hi

Functions and derivatives solutions TYPE I

input box=> [exp(ln(sin(x)))
                   +sin(cos(-tan(x)))
                   +sin(-cos(tan(x)))
                   +sin(-cos(-tan(x)))
                   -sin(-cos(-tan(x)))
                   +exp(-ln(sin(x)))]'

solution box1=> exp(ln(sin(x)))*cos(x)/sin(x)
                         -cos(cos(-tan(x)))*sin(-tan(x))*(-sec(x)^2)
                         +cos(-cos(tan(x)))*sin(tan(x))*sec(x)^2
                         +cos(-cos(-tan(x)))*sin(-tan(x))*(-sec(x)^2)
                         -cos(-cos(-tan(x)))*sin(-tan(x))*(-sec(x)^2)
                         -exp(-ln(sin(x)))*cos(x)/sin(x)

The same Functions and derivatives better solutions TYPE II

input box=> [exp(ln(sin(x)))
                   +sin(cos(-tan(x)))
                   +sin(-cos(tan(x)))
                   +sin(-cos(-tan(x)))
                   -sin(-cos(-tan(x)))
                   +exp(-ln(sin(x)))]'

solution box1=> exp(ln(sin(x)))*cos(x)/sin(x)
                         +cos(cos(-tan(x)))*sin(-tan(x))*sec(x)^2
                         +cos(-cos(tan(x)))*sin(tan(x))*sec(x)^2
                         -cos(-cos(-tan(x)))*sin(-tan(x))*sec(x)^2
                         +cos(-cos(-tan(x)))*sin(-tan(x))*sec(x)^2
                         -exp(-ln(sin(x)))*cos(x)/sin(x)

Good luck !  :t
Title: Re: The calculator
Post by: HSE on July 13, 2016, 05:51:13 AM
Impressive Rui :t

When TYPE III ?    :biggrin:

solution box1=>  cos(x)/sin(x)* ( exp(ln(sin(x)))-exp(-ln(sin(x))) )+
                             sec(x)^2*(
                                +cos(-cos(tan(x)))*sin(tan(x))
                                +sin(-tan(x))*( cos(cos(-tan(x)))-cos(-cos(-tan(x)))+cos(-cos(-tan(x))) )
                             )   
 
Title: Re: The calculator
Post by: RuiLoureiro on July 14, 2016, 08:02:46 AM
Quote from: HSE on July 13, 2016, 05:51:13 AM
Impressive Rui :t

When TYPE III ?    :biggrin:

solution box1=>  cos(x)/sin(x)* ( exp(ln(sin(x)))-exp(-ln(sin(x))) )+
                             sec(x)^2*(
                                +cos(-cos(tan(x)))*sin(tan(x))
                                +sin(-tan(x))*( cos(cos(-tan(x)))-cos(-cos(-tan(x)))+cos(-cos(-tan(x))) )
                             )   
Hi,
      Many thanks HSE !  :t

      Yes i could give the TYPE III solutions without any problems
      It will be [FncX(ArgX]' = [ArgX]' * FncX' = ...
     
      But i do
                [FncX(ArgX)]' = FncX' * [ArgX]' = ...

    Example: [exp(ln(sin(x)))]' = [ln(sin(x))]' * exp(ln(sin(x)))
                                                = [sin(x)]'/ sin(x) * exp(ln(sin(x)))
                                                = cos(x)/sin(x) * exp(ln(sin(x)))

In the following examples, when we get the cases FncZ / FncY / FncX at the end
they are modified to FncZ / (FncY * FncX ).
The example is this:

                -exp(ln(sin(1/x)))*cos(1/x) / (x^2*sin(1/x))

Here we have functions of X, -X, 1/X and -1/X       
Quote
input box=> [exp(ln(sin(x)))
           +sin(cos(-tan(x)))
           +sin(-cos(tan(x)))
           +sin(-cos(-tan(x)))
           -sin(-cos(-tan(x)))
           +exp(-ln(sin(x)))]'

solution box1=>     exp(ln(sin(x)))*cos(x)/sin(x)
                         +cos(cos(-tan(x)))*sin(-tan(x))*sec(x)^2
                         +cos(-cos(tan(x)))*sin(tan(x))*sec(x)^2
                         -cos(-cos(-tan(x)))*sin(-tan(x))*sec(x)^2
                         +cos(-cos(-tan(x)))*sin(-tan(x))*sec(x)^2
                         -exp(-ln(sin(x)))*cos(x)/sin(x)

input box=> [exp(ln(sin(-x)))
            +sin(cos(-tan(-x)))
            +sin(-cos(tan(-x)))
            +sin(-cos(-tan(-x)))
            -sin(-cos(-tan(-x)))
            +exp(-ln(sin(-x)))]'

solution box1=>     -exp(ln(sin(-x)))*cos(-x)/sin(-x)
                          -cos(cos(-tan(-x)))*sin(-tan(-x))*sec(-x)^2
                          -cos(-cos(tan(-x)))*sin(tan(-x))*sec(-x)^2
                          +cos(-cos(-tan(-x)))*sin(-tan(-x))*sec(-x)^2
                          -cos(-cos(-tan(-x)))*sin(-tan(-x))*sec(-x)^2
                          +exp(-ln(sin(-x)))*cos(-x)/sin(-x)

input box=> [exp(ln(sin(1/x)))
            +sin(cos(-tan(1/x)))
            +sin(-cos(tan(1/x)))
            +sin(-cos(-tan(1/x)))
            -sin(-cos(-tan(1/x)))
            +exp(-ln(sin(1/x)))]'

solution box1=>     -exp(ln(sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                          -cos(cos(-tan(1/x)))*sin(-tan(1/x))*sec(1/x)^2/x^2
                          -cos(-cos(tan(1/x)))*sin(tan(1/x))*sec(1/x)^2/x^2
                          +cos(-cos(-tan(1/x)))*sin(-tan(1/x))*sec(1/x)^2/x^2
                          -cos(-cos(-tan(1/x)))*sin(-tan(1/x))*sec(1/x)^2/x^2
                          +exp(-ln(sin(1/x)))*cos(1/x)/(x^2*sin(1/x))

input box=> [exp(ln(sin(-1/x)))
           +sin(cos(-tan(-1/x)))
           +sin(-cos(tan(-1/x)))
           +sin(-cos(-tan(-1/x)))
           -sin(-cos(-tan(-1/x)))
           +exp(-ln(sin(-1/x)))]'

solution box1=>     exp(ln(sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
                         +cos(cos(-tan(-1/x)))*sin(-tan(-1/x))*sec(-1/x)^2/x^2
                         +cos(-cos(tan(-1/x)))*sin(tan(-1/x))*sec(-1/x)^2/x^2
                         -cos(-cos(-tan(-1/x)))*sin(-tan(-1/x))*sec(-1/x)^2/x^2
                         +cos(-cos(-tan(-1/x)))*sin(-tan(-1/x))*sec(-1/x)^2/x^2
                         -exp(-ln(sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
Good luck !  :t
:icon14:
NOTE: In reply #146 we have other solutions because Z/Y*X is equivalent to Z*X/Y and
              Z / Y / X is equivalent to Z/ ( Y * X )
Title: Re: The calculator
Post by: RuiLoureiro on July 16, 2016, 09:03:30 AM
Hi

Here we have more solutions: all positive and all negative
Quote
input box=> [exp(ln(sin(x)))+exp(ln(sin(-x)))+exp(ln(sin(1/x)))+exp(ln(sin(-1/x)))
           +exp(ln(-sin(x)))+exp(ln(-sin(-x)))+exp(ln(-sin(1/x)))+exp(ln(-sin(-1/x)))
           +exp(-ln(sin(x)))+exp(-ln(sin(-x)))+exp(-ln(sin(1/x)))+exp(-ln(sin(-1/x)))
           +exp(-ln(-sin(x)))+exp(-ln(-sin(-x)))+exp(-ln(-sin(1/x)))+exp(-ln(-sin(-1/x)))]'

solution box1=> exp(ln(sin(x)))*cos(x)/sin(x)
                   -exp(ln(sin(-x)))*cos(-x)/sin(-x)
                   -exp(ln(sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                   +exp(ln(sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
               
                   +exp(ln(-sin(x)))*cos(x)/sin(x)
                   -exp(ln(-sin(-x)))*cos(-x)/sin(-x)
                   -exp(ln(-sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                   +exp(ln(-sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
               
                   -exp(-ln(sin(x)))*cos(x)/sin(x)
                   +exp(-ln(sin(-x)))*cos(-x)/sin(-x)
                   +exp(-ln(sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                   -exp(-ln(sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
               
                   -exp(-ln(-sin(x)))*cos(x)/sin(x)
                   +exp(-ln(-sin(-x)))*cos(-x)/sin(-x)
                   +exp(-ln(-sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                   -exp(-ln(-sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
Quote
input box=> [-exp(ln(sin(x)))-exp(ln(sin(-x)))-exp(ln(sin(1/x)))-exp(ln(sin(-1/x)))
            -exp(ln(-sin(x)))-exp(ln(-sin(-x)))-exp(ln(-sin(1/x)))-exp(ln(-sin(-1/x)))
             -exp(-ln(sin(x)))-exp(-ln(sin(-x)))-exp(-ln(sin(1/x)))-exp(-ln(sin(-1/x)))
             -exp(-ln(-sin(x)))-exp(-ln(-sin(-x)))-exp(-ln(-sin(1/x)))-exp(-ln(-sin(-1/x)))]'

solution box1=> -exp(ln(sin(x)))*cos(x)/sin(x)
                +exp(ln(sin(-x)))*cos(-x)/sin(-x)
                +exp(ln(sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                -exp(ln(sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
               
                -exp(ln(-sin(x)))*cos(x)/sin(x)
                +exp(ln(-sin(-x)))*cos(-x)/sin(-x)
                +exp(ln(-sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                -exp(ln(-sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
               
                +exp(-ln(sin(x)))*cos(x)/sin(x)
                -exp(-ln(sin(-x)))*cos(-x)/sin(-x)
                -exp(-ln(sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                +exp(-ln(sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
               
                +exp(-ln(-sin(x)))*cos(x)/sin(x)
                -exp(-ln(-sin(-x)))*cos(-x)/sin(-x)
                -exp(-ln(-sin(1/x)))*cos(1/x)/(x^2*sin(1/x))
                +exp(-ln(-sin(-1/x)))*cos(-1/x)/(x^2*sin(-1/x))
Good luck ! :t
EDIT:
Here we have the results of the last test with 12 functions

[-arcsin(cos(x^2-x)+x^2-x+1)
-arcsin(x^2-cos(x^2-x))
-arcsin(x^2-cos(x^2-x)+x^2-x+1)
-arccos(cos(x^2-x)+x^2-x+1)
-arccos(x^2-cos(x^2-x))
-arccos(x^2-cos(x^2-x)+x^2-x+1)

-arctan(cos(x^2-x)+x^2-x+1)
-arctan(x^2-cos(x^2-x))
-arctan(x^2-cos(x^2-x)+x^2-x+1)
-arccot(cos(x^2-x)+x^2-x+1)
-arccot(x^2-cos(x^2-x))
-arccot(x^2-cos(x^2-x)+x^2-x+1)

-arcsec(cos(x^2-x)+x^2-x+1)
-arcsec(x^2-cos(x^2-x))
-arcsec(x^2-cos(x^2-x)+x^2-x+1)
-arccsc(cos(x^2-x)+x^2-x+1)
-arccsc(x^2-cos(x^2-x))
-arccsc(x^2-cos(x^2-x)+x^2-x+1)
]'

Sunday, 17-07-2016  16:10:05

input box=> [-arcsin(cos(x^2-x)+x^2-x+1)-arcsin(x^2-cos(x^2-x))-arcsin(x^2-cos(x^2-x)+x^2-x+1)-arccos(cos(x^2-x)+x
^2-x+1)-arccos(x^2-cos(x^2-x))-arccos(x^2-cos(x^2-x)+x^2-x+1)-arctan(cos(x^2-x)+x^2-x+1)-arctan(x^2-cos(x^2-x))-ar
ctan(x^2-cos(x^2-x)+x^2-x+1)-arccot(cos(x^2-x)+x^2-x+1)-arccot(x^2-cos(x^2-x))-arccot(x^2-cos(x^2-x)+x^2-x+1)-arcs
ec(cos(x^2-x)+x^2-x+1)-arcsec(x^2-cos(x^2-x))-arcsec(x^2-cos(x^2-x)+x^2-x+1)-arccsc(cos(x^2-x)+x^2-x+1)-arccsc(x^2
-cos(x^2-x))-arccsc(x^2-cos(x^2-x)+x^2-x+1)]'

solution box1=> -[-sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(cos(x^2-x)+x^2-x+1)^2)-[2*x-sin(x^2-x)*(2*x-1)]/sqr(1-(x^2-cos
(x^2-x))^2)-[2*x-sin(x^2-x)*(2*x-1)-2*x+1]/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)+[-sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(co
s(x^2-x)+x^2-x+1)^2)+[2*x+sin(x^2-x)*(2*x-1)]/sqr(1-(x^2-cos(x^2-x))^2)+[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(x^2-
cos(x^2-x)+x^2-x+1)^2)-[-sin(x^2-x)*(2*x-1)+2*x-1]/(1+(cos(x^2-x)+x^2-x+1)^2)-[2*x-sin(x^2-x)*(2*x-1)]/(1+(x^2-cos
(x^2-x))^2)-[2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(1+(x^2-cos(x^2-x)+x^2-x+1)^2)+[-sin(x^2-x)*(2*x-1)+2*x-1]/(1+(cos(x^2-
x)+x^2-x+1)^2)+[2*x+sin(x^2-x)*(2*x-1)]/(1+(x^2-cos(x^2-x))^2)+[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(1+(x^2-cos(x^2-x)+x
^2-x+1)^2)-[-sin(x^2-x)*(2*x-1)+2*x-1]/(abs(os(x^2-x)+x^2-x+1)*sqr((cos(x^2-x)+x^2-x+1)^2-1))-[2*x-sin(x^2-x)*(2*x
-1)]/(abs(x^2-cos(

solution box2=> x^2-x))*sqr((x^2-cos(x^2-x))^2-1))-[2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr
((x^2-cos(x^2-x)+x^2-x+1)^2-1))+[-sin(x^2-x)*(2*x-1)+2*x-1]/(abs(os(x^2-x)+x^2-x+1)*sqr((cos(x^2-x)+x^2-x+1)^2-1))
+[2*x+sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr((x^2-cos(x^2-x))^2-1))+[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(abs(x^2-
cos(x^2-x)+x^2-x+1)*sqr((x^2-cos(x^2-x)+x^2-x+1)^2-1))

solution box1=> -[-sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(cos(x^2-x)+x^2-x+1)^2)
                -[2*x-sin(x^2-x)*(2*x-1)]/sqr(1-(x^2-cos(x^2-x))^2)
                -[2*x-sin(x^2-x)*(2*x-1)-2*x+1]/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)
                +[-sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(cos(x^2-x)+x^2-x+1)^2)
                +[2*x+sin(x^2-x)*(2*x-1)]/sqr(1-(x^2-cos(x^2-x))^2)
                +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/sqr(1-(x^2-cos(x^2-x)+x^2-x+1)^2)
                -[-sin(x^2-x)*(2*x-1)+2*x-1]/(1+(cos(x^2-x)+x^2-x+1)^2)
                -[2*x-sin(x^2-x)*(2*x-1)]/(1+(x^2-cos(x^2-x))^2)
                -[2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(1+(x^2-cos(x^2-x)+x^2-x+1)^2)
                +[-sin(x^2-x)*(2*x-1)+2*x-1]/(1+(cos(x^2-x)+x^2-x+1)^2)
                +[2*x+sin(x^2-x)*(2*x-1)]/(1+(x^2-cos(x^2-x))^2)
                +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(1+(x^2-cos(x^2-x)+x^2-x+1)^2)
                -[-sin(x^2-x)*(2*x-1)+2*x-1]/(abs(os(x^2-x)+x^2-x+1)*sqr((cos(x^2-x)+x^2-x+1)^2-1))
                -[2*x-sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr((x^2-cos(x^2-x))^2-1))
                -[2*x-sin(x^2-x)*(2*x-1)-2*x+1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr((x^2-cos(x^2-x)+x^2-x+1)^2-1))
                +[-sin(x^2-x)*(2*x-1)+2*x-1]/(abs(os(x^2-x)+x^2-x+1)*sqr((cos(x^2-x)+x^2-x+1)^2-1))
                +[2*x+sin(x^2-x)*(2*x-1)]/(abs(x^2-cos(x^2-x))*sqr((x^2-cos(x^2-x))^2-1))
                +[2*x+sin(x^2-x)*(2*x-1)+2*x-1]/(abs(x^2-cos(x^2-x)+x^2-x+1)*sqr((x^2-cos(x^2-x)+x^2-x+1)^2-1))

Title: Re: The calculator
Post by: RuiLoureiro on August 01, 2016, 08:16:48 AM
Hi
    I am working on a procedure to replace the variable x by one expression.
    I am improving it.
    And i wrote a procedure to test the expression syntax and it is working
    correctly till now.

These are 2 results to replace x by -sin(x).
Note that the result is simplified:
we have not (-sin(x))^2 but sin(x)^2
we have not abs(-sin(x)) but abs(sin(x))
arcsin(x^2-x+1) is replaced by arcsin(sin(x)^2+sin(x)+1)
Quote
input box=>       [x     +cos(x)        -x^2       -(x)^3    +1/x     -2*x       -x       +abs(x)]'

solution box1=> -sin(x)+cos(-sin(x))-sin(x)^2+sin(x)^3-1/sin(x)+2*sin(x)+sin(x)+abs(sin(x))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

input box=>    [-x    +cos(x)      +x^2     +(x)^3   -1/x     +2*x     +x     +abs(x)     -arcsin(x^2-x+1)-455.23]'

solution box1=> sin(x)+cos(-sin(x))+sin(x)^2-sin(x)^3+1/sin(x)-2*sin(x)-sin(x)+abs(sin(x))-arcsin(sin(x)^2+sin(x)+
1)-455.23
Good luck  :t

Another example:
Quote
input box=>    [(x^-25)        *(x)^(-15)       +x     +cos(x)        -x^2     -(x)^3     +1/x     -2*x       -x     +abs(x)]'
solution box1=> (-sin(x)^-25)*(-sin(x))^(-15)-sin(x)+cos(-sin(x))-sin(x)^2+sin(x)^3-1/sin(x)+2*sin(x)+sin(x)+abs(s
in(x))

Better:
Quote
input box=>     [(x^-25)      *(x)^(-15)+x       +cos(x)         -x^2    -(x)^3   +1/x  -2*x -x +abs(x)]'
solution box1=> sin(x)^-25*sin(x)^-15-sin(x)+cos(-sin(x))-sin(x)^2+sin(x)^3-1/sin(x)+2*sin(x)+sin(x)+abs(sin(x))
Title: Re: The calculator
Post by: RuiLoureiro on August 05, 2016, 08:50:38 AM
Hi
Here more results replacing x by -sin(x).
The expressions are simplified.
Quote
input box=>    [(2+x)      -(2-x)      +(2*x)    -(2/x)    -(-10^x)    +(-10^+x)   -(-10^-x)]'
solution box1=> (2-sin(x)) -(2+sin(x)) -2*sin(x) +2/sin(x) +10^-sin(x) -10^-sin(x) +10^sin(x)

input box=>    [+x      -x      +x^2      +x^3      -x^2      -x^3]'
solution box1=> -sin(x) +sin(x) +sin(x)^2 +sin(x)^3 -sin(x)^2 -sin(x)^3

input box=>   [-2/x      +cos(x)/x            -2/x^2      -2/x^3      +2/x^2      +2/x^3]'
solution box1=> 2/sin(x) -cos(-sin(x))/sin(x) -2/sin(x)^2 +2/sin(x)^3 +2/sin(x)^2 -2/sin(x)^3

input box=>   [-2*x      +cos(x)*x            -2*x^2      -2*x^3      +2*x^2      +2*x^3]'
solution box1=> 2*sin(x) -cos(-sin(x))*sin(x) -2*sin(x)^2 +2*sin(x)^3 +2*sin(x)^2 -2*sin(x)^3

input box=>    [-2^x       +cos(x)^x             -2^x^2       -2^x^3       +2^x^2       +2^x^3]'
solution box1=> -2^-sin(x) +cos(-sin(x))^-sin(x) -2^-sin(x)^2 -2^-sin(x)^3 +2^-sin(x)^2 +2^-sin(x)^3
Good luck  :t
Title: Re: The calculator
Post by: RuiLoureiro on August 19, 2016, 08:28:14 AM
Hi all
Here we have some tests on a procedure to replace x by an expression.
It doenst give any syntax error.

Replace x by x*e^x/x^2

input box=> [arcsinh(cos(x^2-x)+x^2-x+1)+arcsinh(x^2-cos(x^2-x))+arcsinh(x^2-cos(x^2-x)+x^2-x+1)+arccosh(cos(x^2-x
)+x^2-x+1)+arccosh(x^2-cos(x^2-x))+arccosh(x^2-cos(x^2-x)+x^2-x+1)+arcsech(cos(x^2-x)+x^2-x+1)+arcsech(x^2-cos(x^2
-x))+arcsech(x^2-cos(x^2-x)+x^2-x+1)+arccsch(cos(x^2-x)+x^2-x+1)+arccsch(x^2-cos(x^2-x))+arccsch(x^2-cos(x^2-x)+x^
2-x+1)+arctanh(cos(x^2-x)+x^2-x+1)+arctanh(x^2-cos(x^2-x))+arctanh(x^2-cos(x^2-x)+x^2-x+1)+arccoth(cos(x^2-x)+x^2-
x+1)+arccoth(x^2-cos(x^2-x))+arccoth(x^2-cos(x^2-x)+x^2-x+1)+arcsech(cos(x^2-x)+x^2-x+1)+arcsech(x^2-cos(x^2-x))+a
rcsech(x^2-cos(x^2-x)+x^2-x+1)+arccsch(cos(x^2-x)+x^2-x+1)+arccsch(x^2-cos(x^2-x))+arccsch(x^2-cos(x^2-x)+x^2-x+1)
]'
solution box1=> arcsinh(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arcsinh(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arcsinh(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccosh(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccosh(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arccosh(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arcsech(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arcsech(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arcsech(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccsch(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccsch(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arccsch(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arctanh(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arctanh(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arctanh(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccoth(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccoth(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arccoth(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arcsech(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arcsech(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arcsech(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccsch(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccsch(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2))
               +arccsch(x*e^x/x^2^2-cos(x*e^x/x^2^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)


Replace x by -x
Quote
input box=> [arcsinh(cos(x^2-x)+x^2-x+1)+arcsinh(x^2-cos(x^2-x))+arcsinh(x^2-cos(x^2-x)+x^2-x+1)+arccosh(cos(x^2-x
)+x^2-x+1)+arccosh(x^2-cos(x^2-x))+arccosh(x^2-cos(x^2-x)+x^2-x+1)+arcsech(cos(x^2-x)+x^2-x+1)+arcsech(x^2-cos(x^2
-x))+arcsech(x^2-cos(x^2-x)+x^2-x+1)+arccsch(cos(x^2-x)+x^2-x+1)+arccsch(x^2-cos(x^2-x))+arccsch(x^2-cos(x^2-x)+x^
2-x+1)+arctanh(cos(x^2-x)+x^2-x+1)+arctanh(x^2-cos(x^2-x))+arctanh(x^2-cos(x^2-x)+x^2-x+1)+arccoth(cos(x^2-x)+x^2-
x+1)+arccoth(x^2-cos(x^2-x))+arccoth(x^2-cos(x^2-x)+x^2-x+1)+arcsech(cos(x^2-x)+x^2-x+1)+arcsech(x^2-cos(x^2-x))+a
rcsech(x^2-cos(x^2-x)+x^2-x+1)+arccsch(cos(x^2-x)+x^2-x+1)+arccsch(x^2-cos(x^2-x))+arccsch(x^2-cos(x^2-x)+x^2-x+1)
]'
solution box1=> arcsinh(cos(x^2+x)+x^2+x+1)
               +arcsinh(x^2-cos(x^2+x))
               +arcsinh(x^2-cos(x^2+x)+x^2+x+1)
               +arccosh(cos(x^2+x)+x^2+x+1)
               +arccosh(x^2-cos(x^2+x))
               +arccosh(x^2-cos(x^2+x)+x^2+x+1)
               +arcsech(cos(x^2+x)+x^2+x+1)
               +arcsech(x^2-cos(x^2+x))
               +arcsech(x^2-cos(x^2+x)+x^2+x+1)
               +arccsch(cos(x^2+x)+x^2+x+1)
               +arccsch(x^2-cos(x^2+x))
               +arccsch(x^2-cos(x^2+x)+x^2+x+1)
               +arctanh(cos(x^2+x)+x^2+x+1)
               +arctanh(x^2-cos(x^2+x))
               +arctanh(x^2-cos(x^2+x)+x^2+x+1)
               +arccoth(cos(x^2+x)+x^2+x+1)
               +arccoth(x^2-cos(x^2+x))
               +arccoth(x^2-cos(x^2+x)+x^2+x+1)
               +arcsech(cos(x^2+x)+x^2+x+1)
               +arcsech(x^2-cos(x^2+x))
               +arcsech(x^2-cos(x^2+x)+x^2+x+1)
               +arccsch(cos(x^2+x)+x^2+x+1)
               +arccsch(x^2-cos(x^2+x))
               +arccsch(x^2-cos(x^2+x)+x^2+x+1)
Good luck  :t
Title: Re: The calculator
Post by: RuiLoureiro on August 30, 2016, 08:44:17 AM
Hi
This is a test.
The proc replace x by   sin(x), next by  x/e^x, next by  x-2
              next by  -sin(x),      by -x/e^x,      by -x+2
Quote
input box=> [   -x^3          -x^2          +x^3          +x^2]'

solution box1=> -sin(x)^3     -sin(x)^2     +sin(x)^3     +sin(x)^2
                -(x/e^x)^3    -(x/e^x)^2    +(x/e^x)^3    +(x/e^x)^2
                -(x-2)^3      -(x-2)^2      +(x-2)^3      +(x-2)^2
               
                +sin(x)^3     -sin(x)^2     -sin(x)^3     +sin(x)^2
                +(x/e^x)^3    -(x/e^x)^2    -(x/e^x)^3    +(x/e^x)^2
                -(-x+2)^3     -(-x+2)^2     +(-x+2)^3     +(-x+2)^2
This is another test
Quote
input box=> [arcsin(cos(x^2-x)+x^2-x+1)
            +arcsin(x^2-cos(x^2-x))
            +arcsin(x^2-cos(x^2-x)+x^2-x+1)

            +arccos(cos(x^2-x)+x^2-x+1)
            +arccos(x^2-cos(x^2-x))
            +arccos(x^2-cos(x^2-x)+x^2-x+1)]'

Replace x by -sin(x)

solution box1=> arcsin(cos(sin(x)^2+sin(x))+sin(x)^2+sin(x)+1)
               +arcsin(sin(x)^2-cos(sin(x)^2+sin(x)))
               +arcsin(sin(x)^2-cos(sin(x)^2+sin(x))+sin(x)^2+sin(x)+1)
               +arccos(cos(sin(x)^2+sin(x))+sin(x)^2+sin(x)+1)
               +arccos(sin(x)^2-cos(sin(x)^2+sin(x)))
               +arccos(sin(x)^2-cos(sin(x)^2+sin(x))+sin(x)^2+sin(x)+1)

Replace x by x*e^x/x^2
               
               +arcsin(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arcsin((x*e^x/x^2)^2-cos((x*e^x/x^2)^2-x*e^x/x^2))
               +arcsin((x*e^x/x^2)^2-cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccos(cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)
               +arccos((x*e^x/x^2)^2-cos((x*e^x/x^2)^2-x*e^x/x^2))
               +arccos((x*e^x/x^2)^2-cos((x*e^x/x^2)^2-x*e^x/x^2)+(x*e^x/x^2)^2-x*e^x/x^2+1)

Replace x by -x^2+1/x
               
               +arcsin(cos((-x^2+1/x)^2+x^2-1/x)+(-x^2+1/x)^2+x^2-1/x+1)
               +arcsin((-x^2+1/x)^2-cos((-x^2+1/x)^2+x^2-1/x))
               +arcsin((-x^2+1/x)^2-cos((-x^2+1/x)^2+x^2-1/x)+(-x^2+1/x)^2+x^2-1/x+1)
               +arccos(cos((-x^2+1/x)^2+x^2-1/x)+(-x^2+1/x)^2+x^2-1/x+1)
               +arccos((-x^2+1/x)^2-cos((-x^2+1/x)^2+x^2-1/x))
               +arccos((-x^2+1/x)^2-cos((-x^2+1/x)^2+x^2-1/x)+(-x^2+1/x)^2+x^2-1/x+1)
Good luck               
Title: Re: The calculator
Post by: HSE on August 30, 2016, 10:04:23 AM
 Hi Rui!
A lot of work :t, but try to upload some exe file. With that we can test our equations.   
Title: Re: The calculator
Post by: RuiLoureiro on September 04, 2016, 08:19:53 AM
Quote from: HSE on August 30, 2016, 10:04:23 AM
Hi Rui!
A lot of work :t , but try to upload some exe file. With that we can test our equations.
Hi HSE
       Thank you.
       But you cannot change the expressions to replace x because the way i am using to test it.
       The expressions are pre defined and i only write the expression to be replaced in the
       input box. More: it opens a lot of windows to show each step because i included
       the files that have procedures to debug it.
       Sorry. I will post the calculator as soon as possible.

Example about x^C, x^function, x^x
Quote
Replace by sin(x)
Replace by x/e^x
Replace by x-2

input box=>     [-x^-2.34               +x^cos(x)               -x^x]'

solution box1=>  -sin(x)^-2.34          +sin(x)^cos(sin(x))     -sin(x)^sin(x)
                       -(x/e^x)^-2.34         +(x/e^x)^cos(x/e^x)     -(x/e^x)^(x/e^x)
                       -(x-2)^-2.34           +(x-2)^cos(x-2)         -(x-2)^(x-2)
                 
Replace by -sin(x)
Replace by -x/e^x
Replace by -x+2

                       -(-sin(x))^-2.34       +(-sin(x))^cos(-sin(x)) -(-sin(x))^-sin(x)
                       -(-x/e^x)^-2.34        +(-x/e^x)^cos(-x/e^x)   -(-x/e^x)^-(x/e^x)
                       -(-x+2)^-2.34          +(-x+2)^cos(-x+2)       -(-x+2)^(-x+2)
Good luck  :t
More
Quote
                [-2*x^-2.34         +2*x^cos(x)               -3*x^x                 -3/x^x]'

solution box1=> -2*sin(x)^-2.34     +2*sin(x)^cos(sin(x))     -3*sin(x)^sin(x)       -3/(sin(x))^sin(x)
                -2*(x/e^x)^-2.34    +2*(x/e^x)^cos(x/e^x)     -3*(x/e^x)^(x/e^x)     -3/(x/e^x)^(x/e^x)
                -2*(x-2)^-2.34      +2*(x-2)^cos(x-2)         -3*(x-2)^(x-2)         -3/(x-2)^(x-2)
               
                -2*(-sin(x))^-2.34  +2*(-sin(x))^cos(-sin(x)) -3*(-sin(x))^-sin(x)   -3/(-sin(x))^-sin(x)
                -2*(-x/e^x)^-2.34   +2*(-x/e^x)^cos(-x/e^x)   -3*(-x/e^x)^-(x/e^x)   -3/(-x/e^x)^-(x/e^x)
                -2*(-x+2)^-2.34     +2*(-x+2)^cos(-x+2)       -3*(-x+2)^(-x+2)       -3/(-x+2)^(-x+2)
Title: Re: The calculator
Post by: HSE on September 06, 2016, 08:57:16 AM
Hi Rui!!
I have some doubt:

[x^n]' = n*x^(n-1)        Perfect

but  [x^u]'    where u is a function u(x)

have a short solution than [u^v]'  ???   where v is a function v(x) 

Thanks
Title: Re: The calculator
Post by: RuiLoureiro on September 06, 2016, 09:29:06 AM
Quote from: HSE on September 06, 2016, 08:57:16 AM
Hi Rui!!
I have some doubt:

[x^n]' = n*x^(n-1)        Perfect

but  [x^u]'    where u is a function u(x)

have a short solution than [u^v]'  ???   where v is a function v(x) 

Thanks
Hi HSE

Yes it has. Why ? First, when we have v(x)^u(x) we transform it in e^ln[v(x)^u(x)]
because e^ln(A) = A. Is there any other way ? Do you know any other way ?
So, we do x^u = e^ln(x^u) = e^[u * ln(x)]. Now, starting from here, we have
[x^u(x)]'=[e^ (u * ln(x) )]'= [u(x)* ln(x)]' * e^ (u * ln(x) ) =  [u(x)* ln(x)]' * x^u.
Of course, x must be a positive real to get a real solution.
Is there any other problem ?
Good luck  :t
Title: Re: The calculator
Post by: HSE on September 06, 2016, 10:12:32 AM
Fantastic!

I have [u^v]'= v*u^(v-1)*[v]'+ln(u)*u^v*[_u]'                                    [_u] (to no activate the underline)   

but in one table say something like "don't use this, instead take logaritms"

Thanks a lot!
Title: Re: The calculator
Post by: RuiLoureiro on September 07, 2016, 08:12:12 AM
Quote from: HSE on September 06, 2016, 10:12:32 AM
Fantastic!

I have [u^v]'= v*u^(v-1)*[v]'+ln(u)*u^v*[_u]'                                    [_u] (to no activate the underline)   

but in one table say something like "don't use this, instead take logaritms"

Thanks a lot!
Hi HSE
Ok, thank you.  :t

We get the general solution following these steps:

(1) First we do    v(x)^u(x) = e^ln[v(x)^u(x)]
 
(2) so  [v(x)^u(x)]' = [e^ln[v(x)^u(x)]]' = [e^[u(x)* ln(v(x))]' ( from 3.1)

(3.1)  but ln[v(x)^u(x)] = u(x) * ln(v(x))

(3.2)  and [e^y(x)]' = [y(x)]' * e^y(x)   - particular case:   [e^x]' = e^x

(3.3)  and [ln[y(x)]' = [y(x)]'/y(x)      - particular case: [ln(x)]' = 1/x

(3.4)  If u and v are functions of x, we have [u*v]'= u' * v + u * v'

(4)    From 3.2 we get  [ e^[u(x)* ln(v(x))] ]' = [u(x)* ln(v(x))]' * e^[u(x)* ln(v(x))]

       From 3.4 we get [u(x)* ln(v(x))]'= u'(x) * ln(v(x)) + u(x) * v'(x)/v(x)

(5) The solution is:

     [ e^[u(x)* ln(v(x))] ]' = [u'(x) * ln(v(x)) + u(x) * v'(x)/v(x)] * e^[u(x)* ln(v(x))]
or
     [ e^(u * ln(v)) ]' = [u' * ln(v) + u * v'/v] * e^(u* ln(v)) = [v^u]'

Note: in the solution we use e^(u* ln(v)) and not v^u because the first
          is used to calculate the last v^u.

Note that we may use the particular cases to compute the general cases.

For e^u,   we get e^x and the replace x by u and multiply by u'
For ln(u), we do the same thing: we get 1/x and replace x by u and multiply by u'.

As we are seeing, this is the general rule:

1. get the solution for the particular case;
2. replace x by the Argument ( any function of x)
3. multiply by the derivative of the Argument.

Now you are understanding why i need a replace x function
(the name of my procedure is ReplaceXbyArgument).

Another example: [-sin(-x^2+x-1)]'

The particular case is: [sin(x)]' = cos(x).

So, the starting solution is: -cos(x). Now we use ReplaceXbyArgument
( where Argument=  -x^2+x-1  )
and multiply by the derivative of the Argument.

We have: -(-x^2+x-1)' * cos(-x^2+x-1)

See you !
Good luck
:icon14:
Title: Re: The calculator
Post by: HSE on September 07, 2016, 11:17:09 PM
I see Rui!!  :t

I have a lot to code.  :icon_rolleyes:

Also I begin the interface, wich have some challenges.  :eusa_boohoo:

Regards. HSE
Title: Re: The calculator
Post by: RuiLoureiro on September 08, 2016, 09:36:44 AM
Quote from: HSE on September 07, 2016, 11:17:09 PM
I see Rui!!  :t

I have a lot to code.  :icon_rolleyes:

Also I begin the interface, wich have some challenges.  :eusa_boohoo:

Regards. HSE
Hi HSE,
              good news  :t
I don't know but you may solve the derivative of only one X expression.
If we have g(x,Y)= x*y+x-y, if we replace y by something taken as a constant we
need to solve g(x)= x* & + x -& where & is a constant and we have the parcial derivative with respect to X.
When we have the solution we replace & by y.
Then we do g(y)= &* y + & -y and replacing y by x we have g(x)= &*x+&-x and we use the same procedure
that solves for x. In the end we replace x by y again and & by x. In this way we have only one procedure to solve derivatives. If the procedure works correctly for x it works for y and the solution is correct.
What do you think about ?
Good luck  :t
Title: Re: The calculator
Post by: HSE on September 08, 2016, 11:22:31 PM
Quote from: RuiLoureiro on September 08, 2016, 09:36:44 AM
...we replace y by something taken as a constant...
   If the procedure works correctly for x it works for y and the solution is correct.
What do you think about ?
Hi Rui!!

           That it's the general idea.

           I don't replace in the equation, but in the procedure. The process begin storing the name of the variable, at present only one character variables are posible. Except "e". I think that in equations the number need to be <e> to prevent issues with scientific notation: 1.3e-4. Perhaps, I'm thinking now, the option is replace for exp(1), exp(x), etc  8)
Title: Re: The calculator
Post by: RuiLoureiro on September 10, 2016, 08:58:27 AM
Quote from: HSE on September 08, 2016, 11:22:31 PM
Quote from: RuiLoureiro on September 08, 2016, 09:36:44 AM
...we replace y by something taken as a constant...
   If the procedure works correctly for x it works for y and the solution is correct.
What do you think about ?
Hi Rui!!

           That it's the general idea.

           I don't replace in the equation, but in the procedure. The process begin storing the name of the variable, at present only one character variables are posible. Except "e". I think that in equations the number need to be <e> to prevent issues with scientific notation: 1.3e-4. Perhaps, I'm thinking now, the option is replace for exp(1), exp(x), etc  8)
Hi !
      Your variables are a,b,c,d, and so on ? Is it ? Did you write a general procedure to solve any expression with one well known variable ?  Each variable is only one letter ?
My procedure now clean some cases like this: (x)^... or 2*(x)^  or  (( ... ((...)) ...)). And cases where we put +x and we dont need the sign like x^+x ou x^(-x). It gives x^x and x^-x. So we have only 2 cases, no more. So (x)^(-x) is x^-x. Or ((x))^((-x)) gives x^-x.
Title: Re: The calculator
Post by: HSE on September 13, 2016, 10:03:12 AM
Hi Rui!!

Remember the original problem:

    [a+b*x^c]'    http://masm32.com/board/index.php?topic=175.msg57776#msg57776

The idea is: calling object.solution(x, a+b*x^c) solve der.x, calling object.solution(c, a+b*x^c) solve der.c , etc.

Regards. HSE
Title: Re: The calculator
Post by: RuiLoureiro on September 14, 2016, 09:03:30 AM
Quote from: HSE on September 13, 2016, 10:03:12 AM
Hi Rui!!

Remember the original problem:

    [a+b*x^c]'    http://masm32.com/board/index.php?topic=175.msg57776#msg57776 (http://masm32.com/board/index.php?topic=175.msg57776#msg57776)

The idea is: calling object.solution(x, a+b*x^c) solve der.x, calling object.solution(c, a+b*x^c) solve der.c , etc.

Regards. HSE
Hi HSE,
             Ok i hope you have something done as soon as possible.  :t
I want to try it .

Now iam working in some previous procedures to clean some cases.
If we write something like this:

[(-x)*2    +   (-x)/2      +(-x+2)       -x-2       +2*(-x)      *(+x)^2 ]'
the expression to solve is this (not the previous)

[ -x*2    -x/2    -x+2    -x-2    -2*x     *x^2 ]'
Now i am testing it.
:icon14:
Title: Re: The calculator
Post by: RuiLoureiro on September 15, 2016, 04:07:04 AM
Hi
        These are the results of the last test.
        The expression used has a lot of brackets.
        They are cleaned before used by the procedure
        that replace x by expression and all procedures
        used after that operation.
       
Here one sample
Quote
input box=> [x^+x-x^(-x)+x^(x)-x^(+X)+((sin(x)+2))]'


expression cleaned: [x^x              -x^-x               +x^x               -x^X               +sin(x)   +2 ]'

Replace by sin(x)
Replace by x/e^x
Replace by x-2

solution box1=>     sin(x)^sin(x)    -sin(x)^-sin(x)     +sin(x)^sin(x)     -sin(x)^sin(x)     +sin(sin(x))+2
                   +(x/e^x)^(x/e^x)    -(x/e^x)^-(x/e^x)   +(x/e^x)^(x/e^x)   -(x/e^x)^(x/e^x)   +sin(x/e^x)+2
                   +(x-2)^(x-2)      -(x-2)^-(x-2)       +(x-2)^(x-2)       -(x-2)^(x-2)       +sin(x-2)+2

Replace by -sin(x)
Replace by -x/e^x
Replace by -x+2

                   +(-sin(x))^-sin(x)  -(-sin(x))^sin(x)   +(-sin(x))^-sin(x) -(-sin(x))^-sin(x) +sin(-sin(x))+2
                   +(-x/e^x)^-(x/e^x)  -(-x/e^x)^(x/e^x)  +(-x/e^x)^-(x/e^x) -(-x/e^x)^-(x/e^x) +sin(-x/e^x)+2
                   +(-x+2)^(-x+2)     -(-x+2)^-(-x+2)    +(-x+2)^(-x+2)     -(-x+2)^(-x+2)     +sin(-x+2)+2
Good luck
Title: Re: The calculator
Post by: HSE on September 28, 2016, 08:41:13 AM
Hi Rui!!

In a couple of weeks this thing perhaps work.



input:
2*x^35e-1*arctg(sin(x+2))

output:
2*(35e-1*x^(35e-1-1)*arctg(sin(x+2))+x^35e-1*1/(1+(sin(x+2))^2)*((cos(x+2)*(+(1)+0))))

Title: Re: The calculator
Post by: RuiLoureiro on October 04, 2016, 09:36:33 AM
Quote from: HSE on September 28, 2016, 08:41:13 AM
Hi Rui!!

In a couple of weeks this thing perhaps work.



input:
2*x^35e-1*arctg(sin(x+2))

output:
2*(35e-1*x^(35e-1-1)*arctg(sin(x+2))+x^35e-1*1/(1+(sin(x+2))^2)*((cos(x+2)*(+(1)+0))))


Hi HSE

Good work! Go on !

About your output result, you may:

(1)    Simplify brackets (there are too much brackets)

(2)    Remove things like (+(1)+0)      ( is =1 )

(3)    This: x^35e-1*1 / could be x^35e-1/

Quote
input:
2*x^35e-1*arctg(sin(x+2))

output:
          2*(    35e-1*x^( 35e-1-1)   * arctg(sin(x+2))

         +x^35e-1*1 / ( 1+(sin(x+2) )^2 ) *  (  (cos(x+2)* (+(1)+0)  ) )    )
Good luck !  :t
Title: Re: The calculator
Post by: HSE on October 04, 2016, 10:11:06 AM
Thanks Rui!!

Right now I'm adding parenthesis  :biggrin:.  It's almost the last task to complete derivator.

The idea is to make an indepent process that "clean" the result, even obtain common factor or some other operation (that I not imagine now) for a nicer solution.

Regards. HSE
Title: Re: The calculator
Post by: RuiLoureiro on October 06, 2016, 07:56:04 AM
Quote from: HSE on October 04, 2016, 10:11:06 AM
Thanks Rui!!

Right now I'm adding parenthesis  :biggrin: .  It's almost the last task to complete derivator.

The idea is to make an indepent process that "clean" the result, even obtain common factor or some other operation (that I not imagine now) for a nicer solution.

Regards. HSE
Hi HSE,
        Nothing at all, HSE.

        About your last answer (to make an independent process that "clean" the result )
        «The calculator» do it also. But it starts to clenning same cases too as i
        said before.
Quote
        About the procedure to solve an expression of simple functions of X
        - without function names or polynomials-
        like « C +x +C*x - x^C + x^x - x/C + x/C - C +...»
        you may start the output string result as a null string and add each
        particular result until we get the end. But before adding, test the result
        and don't add if it is 0 - if it is 0 it is done and go to the next.
        Each result must have sign (+ or -) unless it is the first
        or any equivalent procedure ( this is only one hint! ). In
        this way we dont need to clean zeros.
See you !
Good luck, (i have a lot of work to do!).  :t
Title: Re: The calculator
Post by: HSE on October 14, 2016, 12:26:33 PM
Hi Rui!

   You can see in http://masm32.com/board/index.php?topic=5725.0 the present state of my project. Opinions are welcome (mostly nice and encouraging ones  :biggrin: )

Regards. HSE
Title: Re: The calculator
Post by: RuiLoureiro on October 20, 2016, 09:55:15 AM
Hi HSE

Correct this:
Quote
EXPRESSION:

2*sin(3*x+5)+x^-0.0

RESULT:

+2*(cos(3*x+5)*(+3*(1)+0))+((-0.0)*x^(-0.0-1))

der.x = 2*(3(cos(5+3*x)))+-0.000000*(x^-1.000000)
Good work !  :t
Title: Re: The calculator
Post by: HSE on October 20, 2016, 11:04:19 AM
Thanks Rui!!

I'm working in the interface, but next week I have another round with the cleaner  :t
Title: Re: The calculator
Post by: RuiLoureiro on November 01, 2016, 11:11:23 AM
Quote from: HSE on October 20, 2016, 11:04:19 AM
Thanks Rui!!

I'm working in the interface, but next week I have another round with the cleaner  :t

Hi HSE
         The cleaner is working well but needs
         some more work
Quote
EXPRESSION:   x^1+(5/1)*x^2
RESULT:
+((1)*x^(1-1))+(5/1)*((2)*x^(2-1))

der.x = (x^0)+5*(2*(x^1))   <<<<<------ x^0= 1  and x^1= x
Good luck  :t
:icon14:
Title: Re: The calculator
Post by: HSE on November 02, 2016, 03:24:10 AM
Thanks Rui!

The power is solved making a second pass in the cleanner. In first pass there is parenthesis ^( ).

+((1)*a^(1-1))+(5/1)*((2)*a^(2-1))

(a^0)+5*(2*(a^1))           <   result clean 1

1+5*(2*(a))                       <  result clean 2

1+5*(2*a)                          <  result clean 3

der.a = 1+5*(2*a)             <  result clean4 ( no improvement)

Note that parenthesis isn't removed, solution is 1+10*a. I also have some very absurd problems: (-1-1) is solved like (0)  :biggrin:, also (--) (+-), etc.  But now I'm a little in the dark side (J2ME) improving a Horse' data base I maked for my cell phone. 
Title: Re: The calculator
Post by: RuiLoureiro on January 21, 2017, 09:39:26 AM
Hi HSE,

correct this:
[cos(cos(x))]'

This is your result:
Quote
(cos(cos(x))*((-sin(x))))       <<<<- why a lot of brackets ?

   +0                 <---  why this ?
Do this:
cos(cos(x)) = cos( argX)   where argX= cos(x) and [cos(x)]'= -sin(x)
So,
Quote
[cos(cos(x))]' = [cos(argX)]' * [argX]'
                   = -sin(argX)   * (-sin(x))
                   =  sin(argX)   * sin(x)
                   = sin(cos(x)) * sin(x)   <<<<--- give this result (remove brackets)

Good luck  :t
Title: Re: The calculator
Post by: HSE on January 21, 2017, 12:49:03 PM
Perfect :t

I will see next week!

Theoretically the cleanning process remove parenthesis, but perhaps not. Sometimes work so bad that program crash! Because that, last version can disable cleanning from "options". When active solution say "der.x = ".

Thanks Rui!
Title: Re: The calculator
Post by: HSE on January 27, 2017, 11:56:28 AM
Solved (I think) and updated! 
Title: Re: The calculator
Post by: RuiLoureiro on February 04, 2017, 10:17:35 AM
 :biggrin:
Hi all
Hi HSE,

        This is to show the first set of tests that i did today
        about derivatives following my own (and new) algorithm that uses
        local stack variables (more than 130 000 bytes in 13 structures +
        some particular variables).
        It is not ready yet because the calculator solves each expression case by case.
        As soon as possible i will post it.

        See you
        Good luck   :t
:icon14:
         some basic tests in 3 Fev 2017

         [sqr(x)+log(x)+ln(x)+exp(x)+sin(x)+cos(x)+tan(x)+sec(x)+csc(x)+cot(x)]',

         [sinh(x)+cosh(x)+tanh(x)+sech(x)+csch(x)+coth(x)]',

         [sind(x)+cosd(x)+tand(x)+secd(x)+cscd(x)+cotd(x)]',

         [arcsin(x)+arccos(x)+arctan(x)+arcsec(x)+arccsc(x)+arccot(x)]',

         [arcsind(x)+arccosd(x)+arctand(x)+arcsecd(x)+arccscd(x)+arccotd(x)]'

         [arcsinh(x)+arccosh(x)+arctanh(x)+arcsech(x)+arccsch(x)+arccoth(x)]'
         
         [sqr(-x)+log(-x)+ln(-x)+exp(-x)+sin(-x)+cos(-x)+tan(-x)+sec(-x)+csc(-x)+cot(-x)]',

Quote
Friday, 03-02-2017  14:45:11

input box=>     [sqr(x)      +log(x)       +ln(x) +exp(x) +sin(x) +cos(x) +tan(x)   +sec(x)        +csc(x)        +cot(x)]'

solution box1=> 1/(2*sqr(x)) +1/(ln(10)*x) +1/x   +exp(x) +cos(x) -sin(x) +sec(x)^2 +sec(x)*tan(x) -csc(x)*cot(x) -csc(x)^2
; ----------------------------------------------------------------------------------------------
Friday, 03-02-2017  16:20:26

input box=>      [sqr(-x)      +log(-x)       +ln(-x) +exp(-x) +sin(-x) +cos(-x) +tan(-x)   +sec(-x)        +csc(-x)          +cot(-x)]'

solution box1=> -1/(2*sqr(-x)) -1/(-ln(10)*x) +1/x    -exp(-x) -cos(-x) +sin(-x) -sec(-x)^2 -sec(-x)*tan(-x) +csc(-x)*cot(-x) +csc(-x)^2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  14:51:53

input box=> [sinh(x)+cosh(x)+tanh(x)+sech(x)+csch(x)+coth(x)]'

solution box1=> cosh(x)+sinh(x)+sech(x)^2+sech(x)*tanh(x)-csch(x)*coth(x)-csch(x)^2

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  14:53:53

input box=> [sind(x)+cosd(x)+tand(x)+secd(x)+cscd(x)+cotd(x)]'

solution box1=> cosd(x)-sind(x)+secd(x)^2+secd(x)*tand(x)-cscd(x)*cotd(x)-cscd(x)^2

; ##########################################################
Friday, 03-02-2017  15:04:05

input box=> [arcsin(x)+arccos(x)+arctan(x)+arcsec(x)+arccsc(x)+arccot(x)]'

solution box1=> 1/sqr(1-x^2)-1/sqr(1-x^2)+1/(1+x^2)+1/(abs(x)*sqr(x^2-1))-1/(abs(x)*sqr(x^2-1))-1/(1+x^2)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  15:05:51

input box=> [arcsind(x)+arccosd(x)+arctand(x)+arcsecd(x)+arccscd(x)+arccotd(x)]'

solution box1=> 1/sqr(1-x^2)-1/sqr(1-x^2)+1/(1+x^2)+1/(abs(x)*sqr(x^2-1))-1/(abs(x)*sqr(x^2-1))-1/(1+x^2)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  15:08:02

input box=> [arcsinh(x)+arccosh(x)+arctanh(x)+arcsech(x)+arccsch(x)+arccoth(x)]'

solution box1=> 1/sqr(x^2+1)-1/sqr(x^2-1)+1/(1-x^2)
-1/(x*sqr(1-x^2))-1/(abs(x)*sqr(1+x^2))-1/(1+x^2)
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
Friday, 03-02-2017  22:31:57

input box=> [sin(x^2+x)]'

solution box1=> (2*x+1)*cos(x^2+x)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  22:37:01

input box=> [e^x+sin(x^2+x)-x^-2+arccos(x^2+x)]'

solution box1=> e^x+(2*x+1)*cos(x^2+x)+2*x^-3-(2*x+1)*1/sqr(1-(x^2+x)^2)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  22:43:28

input box=> [3*x^4-2*x^3+x^2+x-1]'

solution box1=> 12*x^3-6*x^2+2*x+1
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Friday, 03-02-2017  22:46:04

input box=> [sin(3*x^4-2*x^3+x^2+x-1)]'

solution box1=> (12*x^3-6*x^2+2*x+1)*cos(3*x^4-2*x^3+x^2+x-1)
Title: Re: The calculator
Post by: HSE on February 05, 2017, 02:37:54 AM
Fantastic Rui  :t
Title: Re: The calculator
Post by: RuiLoureiro on February 05, 2017, 09:27:14 AM
Quote from: HSE on February 05, 2017, 02:37:54 AM
Fantastic Rui  :t
Thanks HSE  :t
Hi
    3 examples of one nested function
    Good luck
Quote
Saturday, 04-02-2017  15:36:23

input box=>                        [sin(cos(x^2)+x)]'

solution box1=> (-2*x*sin(x^2)+1) * cos(cos(x^2)+x)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Saturday, 04-02-2017  15:38:11

input box=>            [sin(cos(x))]'

solution box1=> -sin(x)*cos(cos(x))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Saturday, 04-02-2017  21:54:50

input box=>                                                                     [cos(x^-2-4*x+arctan(x^2+x-1)+x)]'

solution box1=> -(-2*x^-3-4+(2*x+1)*1/(1+(-x^2-x+1)^2)+1)* sin(x^-2-4*x+arctan(x^2+x-1)+x)
Title: Re: The calculator
Post by: RuiLoureiro on February 06, 2017, 11:21:56 AM
 :biggrin: :biggrin:
Hi all
Hi HSE

        Here are examples of 3 functions: 2 nested functions and 3 nested functions
        As soon as possible, i will post it ( wait some more weeks ).
        And i  will say something about the algorithm (it is very simple ;) ).

        To HSE: then i will test your derivator (and you test mine).
       To Hutch: using a table of pointers does the work more simple  :t 


        See you
        Good luck  :t
       
Quote
Sunday, 05-02-2017  14:06:05

input box=>                                                       [sin(x^2-cos(tan(x^2-x)+x))]'

solution box1=> (2*x+((2*x-1)*sec(x^2-x)^2+1)*sin(tan(x^2-x)+x)) * cos(x^2+cos(tan(x^2-x)+x))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sunday, 05-02-2017  14:12:11

input box=> [x^2-cos(tan(x^2-x)+x)]'            <------ Derivative of the argument ABOVE

solution box1=> 2*x+((2*x-1)*sec(x^2-x)^2+1) * sin(tan(x^2-x)+x)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sunday, 05-02-2017  14:16:46

input box=> [cos(tan(x^2-x)+x)]'                <------ Derivative of the function ABOVE

solution box1=> -((2*x-1)*sec(x^2-x)^2+1)*sin(tan(x^2-x)+x)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sunday, 05-02-2017  14:19:50

input box=> [tan(x^2-x)+x]'                     <------ Derivative of the argument ABOVE

solution box1=> (2*x-1)*sec(x^2-x)^2+1
            example of 4 functions: 3 nested functions
Quote
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Sunday, 05-02-2017  14:35:17

input box=>                        [sin(x^2-cos(tan(ln(x^2-x)-x^3)+x))]'

solution box1=>  (2*x+(((2*x-1)*1/(x^2-x)-3*x^2)*sec(ln(x^2-x)-x^3)^2+1)*sin(tan(ln(x^2-x)-                                          x^3)+x)) * cos(x^2+cos(tan(ln(x^2-x)-x^3)+x))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
               Monday, 06-02-2017  00:05:22

input box=>                              [sin(x^2-cos(x^2-x)-ln(x^3))+x]'

solution box1=> (2*x+(2*x-1)*sin(x^2-x)-3*x^2*1/x^3)*cos(x^2-cos(x^2-x)+ln(x^3))+1
Title: Re: The calculator
Post by: RuiLoureiro on February 07, 2017, 05:02:48 AM
 :biggrin: :biggrin:
Hi all
        examples of 4, 5 and 6 nested functions
        (max. number of nested functions=6 -last argument x -
        or 5 nested functions with last argument g(x) ).
        This is because we have only tables ResA,ResB,ResC,ResD,ResE,ResF
        to solve each case: first function-> Table ResA, and so on.
        I think we dont need more than this and this is too much.

        See you
        Good luck  :t
         :icon14:
       
Quote
Monday, 06-02-2017  12:38:09

input box=> [cos(sin(tan(sec(csc(x)))))]'


solution box1=> csc(x)*cot(x)*sec(csc(x))*tan(csc(x))*sec(sec(csc(x)))^2*cos(tan(sec(csc(x)))) * sin(sin(tan(sec(csc(x)))))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  14:55:54

input box=>       [cos(sin(tan(sec(cot(csc(x))))))]'

solution box1=> -csc(x)*cot(x)*csc(csc(x))^2*sec(cot(csc(x)))*tan(cot(csc(x)))*sec(sec(cot(csc(x))))^2
                * cos(tan(sec(cot(csc(x)))))*sin(sin(tan(sec(cot(csc(x))))))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  15:10:01

input box=> [cos(sin(tan(sec(cot(arcsin(x^2-x))))))]'


solution box1=> (2*x-1)/sqr(1-(x^2-x)^2)*csc(arcsin(x^2-x))^2*sec(cot(arcsin(x^2-x)))*tan(cot(arcsin(x^2-x)))*sec(
sec(cot(arcsin(x^2-x))))^2*cos(tan(sec(cot(arcsin(x^2-x)))))*sin(sin(tan(sec(cot(arcsin(x^2-x))))))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  15:13:05

input box=> [cos(sin(tan(sec(cot(arcsin(csc(x)))))))]'

solution box1=> -csc(x)*cot(x)/sqr(1-csc(x)^2)*csc(arcsin(csc(x)))^2*sec(cot(arcsin(csc(x))))*tan(cot(arcsin(csc(x
))))*sec(sec(cot(arcsin(csc(x)))))^2*cos(tan(sec(cot(arcsin(csc(x))))))*sin(sin(tan(sec(cot(arcsin(csc(x)))))))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  15:27:54

input box=> [cos(sin(tan(sec(cot(arcsin(x^2-x)+x^2)-2*x)+5)-3*x^2))]'

solution box1=> -((-((2*x-1)/sqr(1-(x^2-x)^2)+2*x)*csc(arcsin(x^2-x)+x^2)^2-2)*sec(cot(arcsin(x^2-x)+x^2)-2*x)*tan
(cot(arcsin(x^2-x)+x^2)-2*x)*sec(sec(cot(arcsin(x^2-x)+x^2)-2*x)+5)^2-6*x)*cos(tan(sec(cot(arcsin(x^2-x)+x^2)-2*x)
+5)-3*x^2)*sin(sin(tan(sec(cot(arcsin(x^2-x)+x^2)-2*x)+5)-3*x^2))
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  15:36:15

input box=> [cos(sin(tan(sec(cot(arcsin(x^2-x))))))-cos(sin(tan(sec(cot(arcsin(x^2-x))))))]'

solution box1=> (2*x-1)/sqr(1-(x^2-x)^2)*csc(arcsin(x^2-x))^2*sec(cot(arcsin(x^2-x)))*tan(cot(arcsin(x^2-x)))*sec(
                sec(cot(arcsin(x^2-x))))^2*cos(tan(sec(cot(arcsin(x^2-x))))) * sin(sin(tan(sec(cot(arcsin(x^2-x))))))
               -(2*x-1)/sqr(1-(x^2-x)^2)*csc(arcsin(x^2-x))^2*sec(cot(arcsin(x^2-x)))*tan(cot(arcsin(x^2-x)))*sec(
                sec(cot(arcsin(x^2-x))))^2*cos(tan(sec(cot(arcsin(x^2-x))))) * sin(sin(tan(sec(cot(arcsin(x^2-x))))))
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  17:45:08

input box=> [sqr(x)+ten(x)+log(x)+ln(x)+exp(x)+sin(x)+cos(x)+tan(x)+sec(x)+csc(x)+cot(x)+sinh(x)+cosh(x)+
tanh(x)+sech(x)+csch(x)+coth(x)+sind(x)+cosd(x)+tand(x)+secd(x)+cscd(x)+cotd(x)+arcsin(x)
+arccos(x)+arctan(x)+arcsec(x)+arccsc(x)+arccot(x)+arcsind(x)+arccosd(x)+arctand(x)+arcsecd(x)
+arccscd(x)+arccotd(x)+arcsinh(x)+arccosh(x)+arctanh(x)+arcsech(x)+arccsch(x)+arccoth(x)]'

solution box1=> 1/(2*sqr(x))+ln(10)*ten(x)+1/(ln(10)*x)+1/x+exp(x)+cos(x)-sin(x)+sec(x)^2+sec(x)*tan(x)-csc(x)*cot
(x)-csc(x)^2+cosh(x)+sinh(x)+sech(x)^2+sech(x)*tanh(x)-csch(x)*coth(x)-csch(x)^2+cosd(x)-sind(x)+secd(x)^2+secd(x)
*tand(x)-cscd(x)*cotd(x)-cscd(x)^2+1/sqr(1-x^2)-1/sqr(1-x^2)+1/(1+x^2)+1/(abs(x)*sqr(x^2-1))-1/(abs(x)*sqr(x^2-1))
-1/(1+x^2)+1/sqr(1-x^2)-1/sqr(1-x^2)+1/(1+x^2)+1/(abs(x)*sqr(x^2-1))-1/(abs(x)*sqr(x^2-1))-1/(1+x^2)+1/sqr(x^2+1)-
1/sqr(x^2-1)+1/(1-x^2)-1/(x*sqr(1-x^2))-1/(abs(x)*sqr(1+x^2))-1/(1+x^2)
Title: Re: The calculator
Post by: RuiLoureiro on February 07, 2017, 11:06:21 AM
Hi HSE,
    see this given by the Derivator:
    (the cleaner is too much good: cleans all things  ;)
    See you  :t
   :icon14:
Quote
expression:
             cos(sin(arctan(x^2-x)))

result:
(-sin(sin(arctan(x^2-x)))*((cos(arctan(x^2-x))*(((((+0))))))))

   +0
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                           TheCalculator
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  23:45:48

input box=> [cos(sin(arctan(x^2-x)))]'

solution box1=> -(2*x-1)/(1+(x^2-x)^2)*cos(arctan(x^2-x))*sin(sin(arctan(x^2-x)))
Title: Re: The calculator
Post by: HSE on February 07, 2017, 09:17:14 PM
 :biggrin: because it's "arctg".  I will make a list of sinonimus :t .
Is posible to treat sind as sin, or that kind of functions have different properties?
Title: Re: The calculator
Post by: RuiLoureiro on February 08, 2017, 02:32:01 AM
Quote from: HSE on February 07, 2017, 09:17:14 PM
:biggrin: because it's "arctg".  I will make a list of sinonimus :t .
Is posible to treat sind as sin, or that kind of functions have different properties?
Hi HSE,

Oh sorry if it is not a function name (arctan) it should give a syntax error.
But ok, i replaced by arctg and the result seems to be correct after i cleaned the unnecessary
brackets and make some calculations and simplifications. For common people the result
is unreadable, so i think that you should do some more work to clean brackets and to replace
things like 2-1 by 1, x^1 by x, (2) by only 2, ... Think about this.
Another thing is when we use "save as" the result, it should save the expression and the result
because that result is for that particular expression and not for another.
About sind, cosd, arcsind, and so on, they are the same functions as sin, cos, etc but the argument is in degrees or the result is in degrees (arcsind, ...)- it is written in TheClaculator messages, run and read.
note: i use also the function ten(x) = 10^x ( exp(x)=e^x ).
See you  :t
Title: Re: The calculator
Post by: HSE on February 08, 2017, 10:01:06 PM
Hi Rui!

I think you have activated option "show only crude derivatives" (see in "options" menu). It's a development option.
Thanks for the ideas. :t
Title: Re: The calculator
Post by: RuiLoureiro on February 09, 2017, 10:16:45 AM
Hi
    This is to show the derivatives of a product:

                integer * function(x)

    The calculator simplify some expressions but not
    integer*integer ( 2*2 in the first example). But
    soon it will do.

    See you
    Good luck  :t
   
Quote
Wednesday, 08-02-2017  20:35:18

input box=>     [2*sin(x^2)]'

solution box1=> 2*2*x*cos(x^2)      <<---- 4*x*cos(x^2)

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Wednesday, 08-02-2017  20:36:10

input box=> [2*sin(cos(x))]'

solution box1=> -2*sin(x)*cos(cos(x))

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Wednesday, 08-02-2017  22:17:26

input box=> [2*sin(cos(tan(x^2-x+1)))]'

solution box1=> -2*(2*x-1)*sec(x^2-x+1)^2*sin(tan(x^2-x+1))*cos(cos(tan(x^2-x+1)))

++++++++++ OLD solution +++++++++++++++++++++++++++++++++++++++++++++++++
Monday, 06-02-2017  10:15:55

input box=> [x^2-cos(tan(ln(x^2-x)-ln(x^3))+x)]'     <<<<<<<<<<<- SIMPLIFY SOLUTION

solution box1=> 2*x+(((2*x-1)/(x^2-x)-3*x^2/x^3)*sec(ln(x^2-x)+ln(x^3))^2+1)*sin(tan(ln(x^2-x)+ln(x^3))+x)

++++++++++ NEW solution +++++++++++++++++++++++++++++++++++++++++++++
Wednesday, 08-02-2017  23:08:38

input box=> [x^2-cos(tan(ln(x^2-x)-ln(x^3))+x)]'

solution box1=> 2*x+(((2*x-1)-3*x^-1)*sec(ln(x^2-x)-ln(x^3))^2+1)*sin(tan(ln(x^2-x)-ln(x^3))+x)
Title: Re: The calculator
Post by: hutch-- on February 09, 2017, 11:09:37 AM
I have moved this topic because its a long term project, not a Campus style question.
Title: Re: The calculator
Post by: RuiLoureiro on May 26, 2017, 02:16:19 AM
Hi all,
        This is the link to the new version 2017:

                >>>>   http://masm32.com/board/index.php?topic=6197.0 (http://masm32.com/board/index.php?topic=6197.0)   <<<<<<

Good luck