Commit Graph

50 Commits

Author SHA1 Message Date
Hugo Saint-Vignes
73b5b0775a [poincare] Avoid nullptr context on non-Numbers sign and nullStatus methods
Change-Id: I3361344c1e0b50cdbe999d6ea50025022a51f603
2020-11-16 17:12:42 +01:00
Léa Saviot
5df60e946a [poincare] shallowBeautify can modify the reduction context
UnitConvert must set UnitConversion to None, otherwise the unit asked
for in the conversion might get changed after being properly set in
UnitConvert::shallowBeautify.
2020-11-09 15:50:27 +01:00
Émilie Feral
7142f9545e [poincare] Finish replacing approximateContext 2020-11-04 15:58:41 +01:00
Hugo Saint-Vignes
61d33be2a7 [poincare] Add NullStatus and sign for more expressions
Change-Id: I4443a28532f5b728afe169a3d2a70d9026bc1909
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
4a3f749cc6 [poincare] Add NullStatus for expressions
Change-Id: Ibaba72e3e3589ba259c7b22d402e2b27937f27c1
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
98499f6c9f [poincare] Rename isRationalZero to isNumberZero
Change-Id: I554dd5e9b9ab3af4364ca23cde590f9e0a458ef8
2020-11-04 15:58:33 +01:00
Neven Sajko
c92b770112 Performance fixes relating to floating point constants
This replaces unnecessary double-precision soft-float operations with
single-precision floating-point operations, mainly by casting.

In a couple places I also replace a function call with a constant.
2020-04-09 13:58:56 +02:00
Ruben Dashyan
4a6b633c74 [poincare] Fix commit "Reducing an Expression which hasUnit in its children returns Undefined in general" 2020-02-12 15:13:25 +01:00
Ruben Dashyan
cc280373d0 [poincare] Reducing an Expression which hasUnit in its children returns Undefined in general 2020-02-12 15:13:25 +01:00
Ruben Dashyan
f465637c86 [poincare/complex_cartesian] Add defaultShallowReduce 2020-02-12 15:13:25 +01:00
Émilie Feral
0736a3f55a [poincare] In Polar complex format, avoid displaying real expression as
sqrt of square when possible
2019-11-05 16:46:21 +01:00
Romain Goyet
a34ecd2769 [poincare] Use std::move when needed
When returning a subclass of an Expression as an Expression, make sure
to use std::move, otherwise the compiler cannot proceeed to copy
ellision.
2019-10-16 10:01:14 +02:00
Léa Saviot
fbec61db47 Merge branch 'feature/Gradians' of https://github.com/boricj/epsilon 2019-08-22 11:25:25 +02:00
Émilie Feral
9fbec16db4 [poincare] Merge MultiplicationImplicit and MultiplicationExplicit (they
were required if we wanted to parse into two distincts expression 2π and
2*π but don't)
2019-08-08 17:22:05 +02:00
Émilie Feral
c1cd0302b8 [poincare] Fix typo: explicite --> explicit, implicite --> implicit 2019-08-08 17:22:04 +02:00
Émilie Feral
fd25b678ce [poincare] Split Multiplication into MultiplicationExplicite and
MultiplicationImplicite
2019-08-08 17:22:02 +02:00
Léa Saviot
9c9e292974 [poincare] ComplexCartesian::norm, special case for pure imaginary 2019-08-08 16:29:37 +02:00
Léa Saviot
61cf762eef [poincare] Expression::ReductionContext 2019-08-08 16:29:37 +02:00
Léa Saviot
de2d9f7c57 [poincare] SerializationHelper::Map -> Expression::mapOnMatrixChild 2019-08-08 16:24:51 +02:00
Léa Saviot
51ee5d8e21 [poincare] More matrix simplification when map/undefined 2019-08-08 16:24:51 +02:00
Jean-Baptiste Boric
2d06110822 [poincare] Add support for gradians 2019-06-24 22:15:05 +02:00
Ruben Dashyan
19356c4a4e [poincare] Fix trigonometric inverse functions' names in comments 2019-06-06 10:00:32 +02:00
Ruben Dashyan
1c09f49ec0 [poincare] Fix trigonometric inverse functions' names in comments 2019-05-27 15:51:47 +02:00
Léa Saviot
267d27f114 [poincare] Remove symbolic computation 2019-05-03 15:53:21 +02:00
Léa Saviot
bbb10f1993 [ion/kandinsky] Move unicode to ion 2019-05-03 15:53:19 +02:00
Léa Saviot
65e5adafac Remove Ion::Charset 2019-05-03 15:53:19 +02:00
Émilie Feral
24c9617a89 [poincare] Templatize TreeHandle Builders 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
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
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
Émilie Feral
f6026254be [poincare] Add an argument ReductionTarget to shallowBeautify 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
e5f0959239 [poincare] Static Expression methods start with uppercase 2019-01-10 11:42:05 +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
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
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
6df1e3aee7 [poincare] Fix ComplexCartesian approximation 2019-01-10 11:42:03 +01:00
Émilie Feral
c4758873d2 [poincare] ComplexCartesian: when computing the squareNorm, simplify
cos^2+sin^2
2019-01-10 11:42:03 +01:00
Émilie Feral
8f45cae358 [poincare] ComplexCartesian: fix bug due to clone missing 2019-01-10 11:42:03 +01:00
Émilie Feral
c6039423a9 [poincare] When simplifying an expression, also compute the approximation from the reduced
expression to avoid loss of precision.

If an expression is reduced to a ComplexCartesian(a, b), we compute the
approximation from ComplexCartesian(a,b) instead of going through the
potentially complicated expression resulting from beautifying
(sqrt(a^2+b^2)*exp(i*(arctan(b/a) -Pi/2*sign(b)) for example)
2019-01-10 11:42:03 +01:00
Émilie Feral
38de794642 [poincare] Change signature setSign(Context, AngleUnit, ReductionTarget) 2019-01-10 11:42:03 +01:00
Émilie Feral
4a7a95fddf [poincare] ComplexCartesian: improve norm on real numbers 2019-01-10 11:42:03 +01:00
Émilie Feral
cbd4f44539 [poincare] SignFunction: improve shallowReduce: sign(-x) = -sign(x) 2019-01-10 11:42:03 +01:00
Émilie Feral
383ac004cf [poincare] Take into account complex format in simplify 2019-01-10 11:42:03 +01:00
Émilie Feral
a6ac075442 [poincare] Fix Expression::CreateComplexExpression 2019-01-10 11:42:03 +01:00
Émilie Feral
ced136f843 [poincare] Fix ComplexCartesian::powerInteger to handle pure imaginary
complex
2019-01-10 11:42:03 +01:00
Émilie Feral
76ec7d3a58 [poincare] Implement ComplexCartesian::powerInteger 2019-01-10 11:42:03 +01:00
Émilie Feral
3292bdfd44 [poincare] Sketch of complex reduction as part of the reduce routine 2019-01-10 11:42:03 +01:00