Commit Graph

2847 Commits

Author SHA1 Message Date
Émilie Feral
2658015cda [poincare] Fix mis-implementation of (a^b)^c -> a^(b*c) which is applied
if:
- a > 0
- in Real: when b and c are integers
- in other modes: when c is integer
2019-03-13 09:37:59 +01:00
Romain Goyet
4f1d74f44b [build] Use an out-of-tree build 2019-03-06 15:00:59 +01:00
Émilie Feral
a540bfa753 [poincare] Add comment TreeHandle constructor 2019-02-21 11:29:35 +01:00
Émilie Feral
d26c98e9d5 [poincare] Fix comments 2019-02-21 11:29:35 +01:00
Émilie Feral
8ca4094e13 [poincare] Un-inline Symbol and Function UntypedBuilder 2019-02-21 11:29:35 +01:00
Émilie Feral
24c9617a89 [poincare] Templatize TreeHandle Builders 2019-02-21 11:29:35 +01:00
Émilie Feral
d29885028b [poincare] Factorize Builders of SymbolAbstract classes 2019-02-21 11:29:35 +01:00
Émilie Feral
3adbca88d8 [poincare] TreeHandle: Improve BuildWithBasicChildren
When building ghost nodes to stand as temporary children, we do not need
to move them are they are built sequentially after the built node.
2019-02-21 11:29:35 +01:00
Émilie Feral
fad3ad958d [poincare] SymbolAbstract: the node alignment is handled by the TreePool
and the TreeNode classes. SymbolAbstract and its children class don't
need to watch the alignment.
2019-02-21 11:29:35 +01:00
Émilie Feral
55704b4e65 [poincare] TreeHandle: the constructor from a identifier retains the
node if it has one
2019-02-21 11:29:35 +01:00
Émilie Feral
3fc32d7c74 [poincare] Clean warning 2019-02-21 11:29:35 +01:00
Émilie Feral
359fc3a599 [poincare] Create templated methods instead of defining UntypedBuilder
on every expression
2019-02-21 11:29:35 +01:00
Émilie Feral
7b5f3c570d [poincare] Change the way Expression are built 2019-02-21 11:29:35 +01:00
Émilie Feral
902dda34d6 [poincare] Add comment 2019-02-21 11:29:35 +01:00
Émilie Feral
ac6f23684d [poincare] Clean Expression and Layout builders
Before: Opposite(Opposite(Rational(1))) misleadingly created the
expression "-1"; now, Opposite::Builder(Opposite::Builder(Rational(1)))
creates "--1"
2019-02-21 11:29:35 +01:00
Émilie Feral
13dbc3edb3 [poincare] Power: (a^b)^c -> a^(b*c) with a < 0 and c integer is not
always true when complex format is real:
R(-1)^2 is undefined
2019-02-15 16:40:38 +01:00
Émilie Feral
73bd40292a [poincare] Power: fix rule R(-x) --> i*R(x) is not true if x < 0 2019-02-15 16:40:38 +01:00
Émilie Feral
4dc513e5c5 [poincare] Power: fix (x+1)^0 reduction when the Reduction target is
System
2019-02-14 10:47:05 +01:00
Émilie Feral
dac9672729 [poincare] Power: Improve optional rule x^(p/q)->root(x,q)^p to handle
special case p = 1 or q = 1
2019-02-14 10:47:05 +01:00
Émilie Feral
3402721069 [poincare] Test: Add a parameter ReductionTarget (User or System) in
Helper::assert_parsed_expression_evaluates_to and
Helper::assert_parsed_expression_simplify_to
2019-02-14 10:47:05 +01:00
Émilie Feral
535dee8220 [poincare] Integer: add TODO 2019-02-05 16:42:36 +01:00
Émilie Feral
2b19a02b6a [poincare] Integer: avoid easy stack overflow by using static working
buffer for integer operations
2019-02-05 16:42:36 +01:00
Émilie Feral
02b27124f4 [poincare] Integer: remove duplicate method: isInfinite is equivalent to
isOverflow
2019-02-05 16:42:36 +01:00
Émilie Feral
f4d63a2160 [poincare] Integer are allocated on the TreePool instead of using their
own buffer. Short Integers are kept in the handle as an optimization.
2019-02-05 16:42:36 +01:00
Émilie Feral
79f0834f4e [poincare] Add method 'hasNode' on TreeHandle 2019-02-05 16:42:36 +01:00
Émilie Feral
4f3bd12fea [poincare] Fix bug: undef*x--> undef 2019-02-05 16:42:24 +01:00
Émilie Feral
e9b11d5bf7 [poincare] Power: fix rule x^0 and 1^x with x infinity 2019-02-01 10:40:03 +01:00
Émilie Feral
3caf165621 [poincare] Factorize code in method:
Expression::recursivelyMatchesInfinity
2019-02-01 10:40:03 +01:00
Émilie Feral
8855390f91 [poincare] Logarithm: add rule on log(inf) 2019-02-01 10:40:03 +01:00
Émilie Feral
3226426a55 [poincare] Fix Logarithm with Infinite arguments 2019-02-01 10:40:03 +01:00
Émilie Feral
b58573bad3 [poincare] Multiplication: do not apply rule 0*x --> 0 if x involves an
infinite expression
2019-02-01 10:40:03 +01:00
Émilie Feral
476c42c42e [poincare] Store: shallowReducing and approximating a store do the same
thing: storing the expression for the corresponding symbol
2019-01-22 14:57:38 +01:00
Émilie Feral
fd2eb95ae7 [poincare] Fix tests on user variables 2019-01-22 14:57:38 +01:00
Émilie Feral
5abb05e7bc [poincare] Store: implementation of deepReduceChildren should
recursively test that the children are not matrix (or enable the
interruption flag)
2019-01-22 14:57:38 +01:00
Émilie Feral
21fcc84df0 [poincare/parsing] Avoid invalid read (valgrind) 2019-01-22 14:57:17 +01:00
Léa Saviot
7558d08770 [poincarE] Fix compilation warning 2019-01-22 09:39:25 +01:00
Léa Saviot
b97873473b [poincare] Clearer variable names in Gauss-Kronrod algorithm 2019-01-21 17:56:49 +01:00
Émilie Feral
f8f4705929 [poincare] AbsoluteValue: fix shallowReduce to reduce abs(0) to 0 2019-01-21 13:40:17 +01:00
Émilie Feral
6948de2ad3 [poincare] ComplexCartesian: fix approximation
The assertions that the real and imaginary parts are real can be false
due to double lack of precision. We escape these cases by returning an
undefined approximation.
2019-01-21 13:39:36 +01:00
Léa Saviot
86f03b800d [poincare] Clean the TrigonometryCheatTable
It caused Travis compilation problems
2019-01-21 11:22:55 +01:00
Léa Saviot
0bf3e678d9 [poincare] Add tests and asserts about sign, such as sign(0)==0 2019-01-21 11:22:55 +01:00
Léa Saviot
614cfe8306 [poincare] Add tests on SignFunction 2019-01-21 11:22:55 +01:00
Léa Saviot
a28f67b3f8 [poincare/sign_function] Do not use signbit
Caused some Travis problems
2019-01-21 11:22:55 +01:00
Léa Saviot
b5c19d37da [poincare] By default, the complex mode is "Real" 2019-01-10 11:42:05 +01:00
Émilie Feral
a539b2f061 [poincare] Test: fix tests on Complex Format 2019-01-10 11:42:05 +01:00
Émilie Feral
43522d0dc9 [poincare] Power: shallowBeautify for ReductionTarget::System turn
x^(p/q) into root(x,q)^p to use the special case of root(x, p) with x
real and p integer might have a real solution in 'Real' complex format
2019-01-10 11:42:05 +01:00
Émilie Feral
2a71f2bada [poincare] NthRoot: special case for approximation of form root(x,p)
with x real and p integer in Real complex format

In this case, root(x,p) 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
f6026254be [poincare] Add an argument ReductionTarget to shallowBeautify 2019-01-10 11:42:05 +01:00
Émilie Feral
a24f65bd46 [poincare] Revert special case when approximating x^(p/q) with x real
and p, q integer

That hugely slows down the approximation routine
2019-01-10 11:42:05 +01:00
Léa Saviot
56aaea79cb [poincare/rational] Fix template declaration 2019-01-10 11:42:05 +01:00