Commit Graph

7625 Commits

Author SHA1 Message Date
Émilie Feral
64d6450728 [solver] Handle unreal equations and equations whose solutions are
unreal
2019-01-10 11:42:04 +01:00
Émilie Feral
fc6793233f [solver] I18n: add message 'unreal equation' 2019-01-10 11:42:04 +01:00
Émilie Feral
61d58b5dfa [shared] SimplifyAndApproximate is used with already updated
ComplexFormat
2019-01-10 11:42:04 +01:00
Émilie Feral
786cefc3d4 [calculation] No special case for unreal calculation, it is handled in
simplication and approximation routines.
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
05ef7008dc [solver] Fix bug: when the number of solutions is infinite, do not try
to find the solution layouts
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
aa80710f4d [solver] Take into account the complexFormat Real 2019-01-10 11:42:04 +01:00
Émilie Feral
6fd3a155df [calculation] Take into account the complex format 'real' 2019-01-10 11:42:04 +01:00
Émilie Feral
b6ec84f6a9 [calculation] Clean and add tests on CalculationStore 2019-01-10 11:42:04 +01:00
Émilie Feral
ab13d137fd [settings] Update PreferencesController with new ComplexFormat::Real 2019-01-10 11:42:04 +01:00
Émilie Feral
b83ee26636 [settings] Add a message I18n: Real 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
Émilie Feral
6df1e3aee7 [poincare] Fix ComplexCartesian approximation 2019-01-10 11:42:03 +01:00
Émilie Feral
1671ee8ec8 [poincare] Fix Undefined:: isReal is false 2019-01-10 11:42:03 +01:00
Émilie Feral
0d8306aa7b [poincare] Fix pow: do not bubble ComplexCartesian if the parent of the
pow is a Logarithm of the same base
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
42aad48ec4 [solver] Fix EquationStore::oneDimensialPolynomialSolve 2019-01-10 11:42:03 +01:00
Émilie Feral
9401edfd3f [poincare] Clean outdated comment 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
ff77b46276 [poincare] Power::shallowReduce. Fix bug: I complex should always be
shallowReduced as it turns into ComplexCartesian(0,1) if the reduction
target is the User and stays Constant(I) otherwise.
2019-01-10 11:42:03 +01:00
Émilie Feral
e4b59ddf69 [poincare] Fix Expression::simplifyAndApproximate to display polar form
of negative real expression. -5 --> 5*e^(i*Pi)
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
dae5c4d2d4 [poincare] Constant: i->ComplexCartesian(0,1) only if the reduction
target is the user
2019-01-10 11:42:03 +01:00
Émilie Feral
5463486d59 [poincare] Fix Power::setSign 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
6794f8c802 [poincare] Add comments 2019-01-10 11:42:03 +01:00
Émilie Feral
8a00aa16cc [poincare] Clean: remove complexCartesian and complexPolar methods 2019-01-10 11:42:03 +01:00