Émilie Feral
ecf3f2ea0f
[poincare] Create a a flag on Expression that is set when the
...
approximation encouters a complex value
All approximation methods take the complex format into account.
2019-01-10 11:42:04 +01:00
Émilie Feral
26e2e9be0d
[poincare] Add complex format as an argument of simplification
2019-01-10 11:42:04 +01:00
Émilie Feral
1f247b731d
[poincare] Discard useless parameters of sign and isReal methods
2019-01-10 11:42:04 +01:00
Émilie Feral
f00f639bed
[poincare] Interrupt simplification of when too many nodes where
...
generated while bubbling up ComplexCartesian. Retry with another
ReductionTarget
2019-01-10 11:42:03 +01:00
Émilie Feral
759aee2345
[poincare] Discard wrong optimization. NAryExpression children are
...
sorted but Power(ComplexCartesian) is after ComplexCartesian in the
simplification order. ComplexCartesian are not ensure to be last ones if
some children are not real.
2019-01-10 11:42:03 +01:00
Émilie Feral
df2f6e3b6e
[poincare] Fix tests with complex cas
2019-01-10 11:42:03 +01:00
Émilie Feral
a02fd614ab
[poincare] Trigonometry: add rule arctan(1/x) = sign(x)*pi/2-arctan(x)
2019-01-10 11:42:03 +01:00
Émilie Feral
5b782c3ff7
[poincare] Power: fix sqrt(-1*i) != i*sqrt(i)
2019-01-10 11:42:03 +01:00
Émilie Feral
2fe8b386c3
[poincare] Add tests on Complex
2019-01-10 11:42:03 +01:00
Émilie Feral
7d9c49919c
[poincare] simplifyForComplexFormat: before extracting
...
ComplexCartesian/ComplexPolar, deepReduce instead of simplify to avoid
generating uselessly big trees. To make it work, implement shortcuts for
Power::complexCartesian and Power::complexPolar to return nice cartesian
expression when the power index is -1, 1/2 or -1/2
2019-01-10 11:42:03 +01:00
Émilie Feral
c62922ec5c
[poincare] Change complex getters design: extract real and imaginary
...
parts at the same time in complexCartesian and norm and arg in
complexPolar
2019-01-10 11:42:03 +01:00
Émilie Feral
64aebcf16d
[poincare] Implement shallowReduce of ComplexArgument, AbsoluteValue,
...
RealPart and ImaginaryPart
2019-01-10 11:42:03 +01:00
Émilie Feral
2f8ede54f2
[poincare] The sign function was used to decide wether an expression was
...
of form -x. However, ln(0.3) has a negative sign but is not of form -x.
This commit fixes the misuse of ExpressionNode::Sign::negative.
For example, we do not turn sin(tan(9)) in -sin(-tan(9)) or
arcsin(sin(12)) in -arcsin(-sin(12) because tan(9)<0 and sin(12)<0
2019-01-10 11:42:03 +01:00
Émilie Feral
9e2b709fcb
[poincare] Change sign() signature to sign(context, angleUnit)
2019-01-10 11:42:03 +01:00
Émilie Feral
68367343ed
[poincare] Add tests on complex extractors
2019-01-10 11:42:03 +01:00
Émilie Feral
d72b906919
[poincare] SquareRoot: implement realPart & imaginaryPart
2019-01-10 11:42:03 +01:00
Émilie Feral
ee0d158bd9
[poincare] Add rules on cos(arcsin), cos(arctan), sin(arccos),
...
sin(arctan), tan(arccos), tan(arcsin)
2019-01-10 11:42:03 +01:00
Émilie Feral
3c3f68c6c4
[poincare] Multiplication and Division implement realPart,
...
imaginaryPart and complexNorm
2019-01-10 11:42:03 +01:00
Émilie Feral
d95585956c
[poincare] Implement Expression::realPart, Expression::imaginaryPart,
...
Expression::complexNorm, Expression::complexArgument
2019-01-10 11:42:03 +01:00
Émilie Feral
0e1825817b
[poincare] Test: clean helper
...
Create a method expressions_are_equal
2019-01-10 11:42:02 +01:00
Émilie Feral
88a2751e6b
[poincare] Add SignFunction class
2019-01-10 11:42:02 +01:00
Émilie Feral
bc1a1c25d2
[poincare] Fix precision of approximation of arc trigonomtry when the
...
result is in real numbers
2018-12-17 09:47:25 +01:00
Émilie Feral
06264b2ea8
[poincare] Fix sqrt(-1) reduces to i
2018-12-17 09:43:06 +01:00
Léa Saviot
2772e0397f
[poincare] Add tests on power serailization
2018-11-26 14:07:42 +01:00
Léa Saviot
0ecaea0695
[poincare] Fix power serialization
2018-11-26 14:07:42 +01:00
Léa Saviot
13e8f71150
[poincare] Add parsing tests on layouts
2018-11-23 12:04:10 +01:00
Léa Saviot
69fc876231
[poincare/tests] Add layout serialization+parsing tests
2018-11-23 12:04:10 +01:00
Léa Saviot
3e12f83bb1
[tests] Fix with new serializations
2018-11-23 12:04:10 +01:00
Émilie Feral
123f974bff
[poincare] Power: implement (±inf)^x
2018-11-23 12:04:09 +01:00
Émilie Feral
0e3d8514c5
[poincare] Fix tests: first operand of addition does not require
...
parentheses anymore
2018-11-23 12:04:09 +01:00
Léa Saviot
53e4a290f7
[poincare] Rename Expression:parse in Parse
2018-11-23 12:04:09 +01:00
Émilie Feral
2bdce9dd82
[poincare] Power: approximation of power of positive real and real is
...
real. Fix 10^1000 = inf instead of undef
2018-11-23 12:04:09 +01:00
Léa Saviot
584f6d6f6b
[poincare] Add parsing test on 1E2E3
2018-11-23 12:04:09 +01:00
Léa Saviot
70707a9985
[poincare] Infinity::Name() gives "inf"
2018-11-23 12:04:08 +01:00
Léa Saviot
63e83c246b
[poincare] Undefined::Name() gives "undef"
2018-11-23 12:04:08 +01:00
Émilie Feral
721cd59227
[poincare] Add tests on User Variable
...
- test isApproximate on Symbols and Functions
- test IsMatrix on Symbols and Functions
2018-11-23 12:04:08 +01:00
Émilie Feral
fb57ac73d7
[poincare] add tests on Function properties
2018-11-23 12:04:08 +01:00
Émilie Feral
6530d87805
[poincare] Test: divide store tests in store and user variable tests
2018-11-23 12:04:08 +01:00
Émilie Feral
dd4a83fc59
[poincare] Store: add tests on composed functions
2018-11-23 12:04:08 +01:00
Émilie Feral
bd09638b68
[poincare] Add tests to Store: f(x+1)+f(x-1)
2018-11-23 12:04:08 +01:00
Émilie Feral
e516c9d544
[poincare] Helper: add a function to check approximateWithValueForSymbol
2018-11-23 12:04:08 +01:00
Émilie Feral
140ccbfa77
[poincare] Add tests on composed functions
2018-11-23 12:04:08 +01:00
Émilie Feral
b78f25f9bd
[poincare] Store: add tests with 1 circular function and 2 defined
...
functions
2018-11-23 12:04:07 +01:00
Émilie Feral
b4098fb5e2
[poincare] Store: fix tests
...
In storage, we record the expression without any simplification.
2018-11-23 12:04:07 +01:00
Léa Saviot
36e19f3122
[poincare/test] Add store test
2018-11-23 12:04:07 +01:00
Léa Saviot
07d1aabb56
[apps/solver] Remove max variable name size redefinition
2018-11-23 12:04:07 +01:00
Léa Saviot
d411ff292e
[poincare] Do not parse 1>ans
2018-11-23 12:04:07 +01:00
Léa Saviot
44963179c7
[poincare] Store and Equal must be topmost expressions
2018-11-23 12:04:07 +01:00
Léa Saviot
9dc5794d22
[poincare] Fix tests
2018-11-23 12:04:06 +01:00
Léa Saviot
755af81d65
[poincare] Fix tests
2018-11-23 12:04:06 +01:00