Léa Saviot
4788495d62
[poincare/parser] -1/2 gives - 1/2 and not -(1) / 2
2019-01-10 11:42:05 +01:00
Émilie Feral
9709fb66b1
[poincare] When approximating, make a special case for x^(p/q) when the
...
complex format is real.
In this case, x^(p/q) might have a real result which is not the
principale angle returned by the standard library
2019-01-10 11:42:05 +01:00
Émilie Feral
1251821d3e
[poincare] Change name: ReductionTarget::TopDownComputation -->
...
ReductionTarget::System
2019-01-10 11:42:05 +01:00
Émilie Feral
c6cf0eb000
[poincare] Discard BottomUpComputation of ReductionTarget because it is
...
never used
2019-01-10 11:42:05 +01:00
Émilie Feral
4841542750
[poincare] Add ComplexFormat argument to the approximation routine
2019-01-10 11:42:05 +01:00
Léa Saviot
b30c197d36
[test/poincare] Tests on expression order
2019-01-10 11:42:05 +01:00
Émilie Feral
4283eb7e32
[poincare] Power: fix approximation
...
0^0 should be equal to undef
2019-01-10 11:42:05 +01:00
Léa Saviot
e5f0959239
[poincare] Static Expression methods start with uppercase
2019-01-10 11:42:05 +01:00
Léa Saviot
8a2bdb4c42
[poincare] When reducing store, handle non reductible left side
2019-01-10 11:42:04 +01:00
Léa Saviot
4bfd77b093
[test] Replace assert by quiz_assert
2019-01-10 11:42:04 +01:00
Léa Saviot
b25c8f4df2
[poincare] Fix store tests
2019-01-10 11:42:04 +01:00
Léa Saviot
892dd2de4f
[apps/poincare] Clean some comments
2019-01-10 11:42:04 +01:00
Léa Saviot
300e797324
[poincare/store] Store shallow reduces into the reduced left operand
2019-01-10 11:42:04 +01:00
Léa Saviot
101db272c8
[test/calculation] 1+1->a shoud display 2, not 1+1=2
2019-01-10 11:42:04 +01:00
Émilie Feral
95248edde0
[poincare] Fix tests with new beautify order
2019-01-10 11:42:04 +01:00
Émilie Feral
284a020de3
[poincare] Constant: order constant e, i and pi correctly
2019-01-10 11:42:04 +01:00
Émilie Feral
83bb2f1221
[poincare] Fix Expression::CreateComplexExpression: should not check the sApproximationEncounteredComplex here as this method is also used int the reduction routine
2019-01-10 11:42:04 +01:00
Émilie Feral
65527f22b2
[poincare] Remove duplicate calls to SetEncounterComplex
2019-01-10 11:42:04 +01:00
Émilie Feral
97b13bae5d
[poincare] Fix SimplificationOrder:
...
Sorting cos(2)*pi should return pi*cos(2)
Sorting pi+cos(2) should return cos(2)+pi
2019-01-10 11:42:04 +01:00
Émilie Feral
ad8f0a73d9
[poincare] Fix Addition::shallowBeautify
...
B+A should be beautified in A+B
1+x should be beautified in x+1
2019-01-10 11:42:04 +01:00
Émilie Feral
2ea39fcaa4
[poincare] Addition: shallowBeautify sorts its children in decreasing
...
order: 1+x+x^2 --> x^2+x+1
2019-01-10 11:42:04 +01:00
Émilie Feral
fe8825df35
[shared] PoincareHelpers: update the complexFormat (force it to
...
Cartesian with complex input).
2019-01-10 11:42:04 +01:00
Émilie Feral
3fd737ab72
[poincare] Change name: sApproximationEncounterComplex -->
...
sApproximationEncounteredComplex
2019-01-10 11:42:04 +01:00
Émilie Feral
b8826b1cf4
[poincare] (-1)^(p/q) is not reduced the same way according to the
...
complex format
2019-01-10 11:42:04 +01:00
Émilie Feral
6506588244
[poincare] Complex: do not set the SetEncounterComplex flag when
...
building an undefined complex
2019-01-10 11:42:04 +01:00
Émilie Feral
ae2de436c2
[poincare] Add tests on ComplexFormat == Real
2019-01-10 11:42:04 +01:00
Émilie Feral
c6177a8edc
[poincare] Power: fix bug: if a unreal node appears, it needs to be
...
bubbled up
2019-01-10 11:42:04 +01:00
Émilie Feral
e265b0319c
[poincare] Power: avoid infinite loop of reduction
...
2^(1/2+a) --> 2^(1/2)*2^a --> 2^(1/2+a)-->...
2019-01-10 11:42:04 +01:00
Émilie Feral
2268817738
[poincare] The reduction routine is unterrupted if one of the expression
...
leaves is unreal or undefined. If any leaf is unreal the result is
unreal (unreal > undefined)
2019-01-10 11:42:04 +01:00
Émilie Feral
2052ee43ae
[apps][poincare] An expression is undefined if it is of type 'unreal' or
...
'undefined'
2019-01-10 11:42:04 +01:00
Émilie Feral
4e345b7050
[poincare] Unreal: approximating unreal set the sApproximationEncounterComplex to true
2019-01-10 11:42:04 +01:00
Émilie Feral
87391d65ee
[poincare] Missing header in sign_function
2019-01-10 11:42:04 +01:00
Émilie Feral
cbd3eeb3f6
[poincare] Turn i into unreal when complexFormat is Real
2019-01-10 11:42:04 +01:00
É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
c3ad0e027c
[poincare] Create class Unreal
2019-01-10 11:42:04 +01:00
Émilie Feral
5e434a4c33
[poincare] Get rid of useless arguments in shallowReduce
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
3de8901c22
[poincare] Use reduce instead of setting the
...
sSimplificationHasBeenInterrupted flag and deepReducing
2019-01-10 11:42:04 +01:00
Émilie Feral
8bc1a7be05
[poincare] Preferences: add a ComplexFormat::Real
2019-01-10 11:42:04 +01:00
Émilie Feral
6d32c1866e
[poincare] Division: force division by 0 to be equal to NAN
...
Before x/0 = (Inf, NAN) which leads to arctan(1/0) = Pi/2.
2019-01-10 11:42:03 +01:00
Émilie Feral
5c98ff15cd
[poincare] Clean AbsoluteValue and ComplexArgument
2019-01-10 11:42:03 +01:00
Émilie Feral
9f42d5c7ec
[poincare] Trigonometry: arctan(1/x) = sign(x)Pi/2-arctan(x) only when x
...
!= 0
2019-01-10 11:42:03 +01:00
Émilie Feral
c0424089f7
[poincare] Clean Power
2019-01-10 11:42:03 +01:00
Émilie Feral
5e79949ba7
[poincare] Clean Trigonometry
2019-01-10 11:42:03 +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
c89fec872c
[poincare] Constant: missing template declaration
2019-01-10 11:42:03 +01:00