65001 / abmath Goto Github PK
View Code? Open in Web Editor NEWMath Library
License: MIT License
Math Library
License: MIT License
Describe the bug
The derivative( (x^2 - x)/e^(1/(2x)), x)
may be producing an incorrect function as an output.
Expected behavior
(e^(-1/(2x))(4x^2 - x - 1))/(2x)
Describe the bug
If a user inputs arccos(1/A)
the system will create an optimization chain that cannot end.
We should implement a generic solution that states that if an optimization results in the same state changes (10x) times in a row or something similar then the optimization should break out and return a message to the user that an optimization chain loop may have been detected.
Describe the bug
Implicit multiplication interferes with the arity of variadic functions.
Current behavior
# | Token | Arity |
---|---|---|
0 | 1 | 0 |
1 | 2 | 0 |
2 | 3 | 0 |
3 | sum | 1 |
4 | 2 | 0 |
5 | * | 2 |
Expected behavior
# | Token | Arity |
---|---|---|
0 | 1 | 0 |
1 | 2 | 0 |
2 | 3 | 0 |
3 | sum | 3 |
4 | 2 | 0 |
5 | * | 2 |
Does RPN set equation remove custom added functions when a reset()
if performed?
I want to be able to support matrices and matrix operations in AbMath. To do this we have to use one of several conventional ways to represent matrices on calculators.
To do this we need to make a breaking change on what constitutes left and right brackets and use aliasing to map them to lists and end parenthesis as appropriate.
In this context we will alias {
to a new function named list
and will alias }
to )
. This should allow us to use a the traditional matrix form of {{a,b},{c,d}}
with this expanding out to list( list(a,b), list(c,d))
.
A list is another name for a vector in this context. A vector of length n
shall be treated as a matrix of size n x 1
We would need several rules in order for this to make sense when displayed to the user.
A list with a single element shall just return that element. IE 3{3}
will always return 9
A list of lists shall be a matrix
and for appropriate operators the matrix variants shall take precedence. We shall also need to include scalar and matrix variants of operators and all other functions and operators as logical shall be applied on all the elements of the data.
A list, vector, or matrix inside in all general math functions shall be treated as a list.
In certain functions such as total
, avg
, max
, and min
the list shall decompose and allow access to the underlying data contained therein. IE total({4,3,2}) - > total(4,3,2)
.
For all other functions the list shall cause the function to be applied on all the elements of the data. ln({e,pi,2}) -> {ln(e),ln(pi),ln(2)}
or ln( {{a,b},{c,d}}) -> { {ln(a), ln(b)}, {ln(c),ln(d)} }
All functions and operators shall be classified as requiring decomposition, distribution, or having special variants for matrix support.
Is your feature request related to a problem? Please describe.
Is there a way we can do simple algebraic simplifications on an AST?
Describe the solution you'd like
Research required.
Describe alternatives you've considered
None.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
We should change rename the current sum
function to be called total
and create a new sum function that takes four parameters such as start index, end index, index variable, function
.
This new sum function could have optimizations such as the sum of [0,n]
or [1,n]
is known to be n * (n - 1)/2
.
Disable Decimal to Fraction rule since it causes more precision loss than it saves.
Describe the bug
An invalid node exception is thrown when you enter (2/2)^1
.
Ideally an equation like (x^4) + (x^6) + (x^2) + (x^5) + x + (x^3)
should be automatically
reordered so that it looks like x^6 + x^5 + x^4 + x^3 + x^2 + x
.
Is your feature request related to a problem? Please describe.
Functions such as rad
,deg
,max
,min
,gcd
,lcm
,bounded
, gamma
, and !
do not have derivatives.
Describe the solution you'd like
Explore adding derivatives for these functions and operators.
Describe the bug
sum(2x - 1,x,1,n)
-> sum(1,x,1,n)+sum(2*x,x,1,n)
Expected behavior
sum(-1,x,1,n)+sum(2*x,x,1,n)
or sum(2*x,x,1,n) - sum(1,x,1,n)
The expression 1/2x
currently evaluates to 1 / 2 x *
but this is invalid postfix notation.
There are two ways of expressing this expression.
1 2 / x *
ie (1 / 2) * x
1 2 x * /
ie 1 /(2x)
Is your feature request related to a problem? Please describe.
Currently the simplification code is spread across Post Simplify
, Pre Simplify
, and AST Simplify
.
AST Simplify
is the most powerful of the the simplification tools due to the fact that manipulating graphs is inherently easier than manipulating a list in postfix.
Describe the solution you'd like
Document all the functionality in Post Simplify
and Pre Simplify
and add that functionality into AST Simplify
.
Additional context
derivative(cos(x)sin(x),x)
Type | Time (ms) | Ticks | % Milliseconds | % Ticks |
---|---|---|---|---|
Tokenize | 4 | 45,187 | 1.87 | 2 |
PreSimplify | 0 | 8,959 | 0 | 0 |
Shunting | 51 | 519,387 | 23.83 | 24 |
PostSimplify | 71 | 714,023 | 33.18 | 33 |
AST Generate | 0 | 15 | 0 | 0 |
AST Simplify | 17 | 175,355 | 7.94 | 8 |
AST Generate | 0 | 21 | 0 | 0 |
AST MetaFunctions | 36 | 363,379 | 16.82 | 17 |
AST Simplify | 35 | 353,184 | 16.36 | 16 |
Evaluation | 0 | 348 | 0 | 0 |
Total | 214 | 2,179,858 |
Describe the bug
The derivatives of arcsec
and arccsc
will produce incorrect values for negative numbers.
https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Calculus
Describe the bug
When a user enters a number such as -.5
implicit multiplication is performed.
Current behavior
RPN: -. 5 *
Expected behavior
RPN: -.5
Describe the bug
A constant such as pi
or e
multiplied by a number like this pi(3)
results in incorrect RPN.
Current behavior
RPN: 3 pi
Expected behavior
RPN: 3 pi *
Is your feature request related to a problem? Please describe.
There should be a way to create symbolic integration for a subset of integrations.
The integration(x^2,x,0,100)
takes one second to calculate even though its integration is a very simple.
Describe the solution you'd like
When a user types in integration for a subset of integrations the program should return the derivative and then analyze it at the start and end points.
integration(f(x),x) -> F(x) + c
integration(f(x),x,a,b) -> F(b) - F(a)
The integrate
command should take two arguments and be internal only. It should denote that an item has yet to be integrated by the program. If there is no applicable integration is available then the library should fall back to approximating a function.
The at
command should take three arguments and be internal only.
at(f(x),x,c)
Describe alternatives you've considered
Currently the program does mathematical integration by using the Simpson's rules alongside the Midpoint approximation methods. The program attempts to calculate the integral in this method but it can take a very long time for very simple integrations. This implementation should be fall back in the event no applicable integration rule is found.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.