### Author Topic: The calculator  (Read 85507 times)

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #180 on: February 04, 2017, 10:17:35 AM » 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)
« Last Edit: February 05, 2017, 09:39:48 AM by RuiLoureiro »

#### HSE

• Member
•     • • Posts: 1315
• <AMD>< 7-32> ##### Re: The calculator
« Reply #181 on: February 05, 2017, 02:37:54 AM »
Fantastic Rui  :t

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #182 on: February 05, 2017, 09:27:14 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)

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #183 on: February 06, 2017, 11:21:56 AM »  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

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #184 on: February 07, 2017, 05:02:48 AM »  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)

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #185 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)))

#### HSE

• Member
•     • • Posts: 1315
• <AMD>< 7-32> ##### Re: The calculator
« Reply #186 on: February 07, 2017, 09:17:14 PM » 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?

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #187 on: February 08, 2017, 02:32:01 AM » 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
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

#### HSE

• Member
•     • • Posts: 1315
• <AMD>< 7-32> ##### Re: The calculator
« Reply #188 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

#### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #189 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)

#### hutch--

• Member
•      • • Posts: 7308
• Mnemonic Driven API Grinder ##### Re: The calculator
« Reply #190 on: February 09, 2017, 11:09:37 AM »
I have moved this topic because its a long term project, not a Campus style question.
hutch at movsd dot com
http://www.masm32.com  #### RuiLoureiro

• Member
•    • Posts: 819 ##### Re: The calculator
« Reply #191 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   <<<<<<

Good luck