Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
trs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Taddeüs Kroes
trs
Commits
2a3e3ec6
Commit
2a3e3ec6
authored
12 years ago
by
Taddeüs Kroes
Browse files
Options
Downloads
Patches
Plain Diff
Lowered precedences of expansion and exponent extension
parent
63b9dd96
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/rules/precedences.py
+10
-7
10 additions, 7 deletions
src/rules/precedences.py
with
10 additions
and
7 deletions
src/rules/precedences.py
+
10
−
7
View file @
2a3e3ec6
...
...
@@ -24,7 +24,7 @@ from .negation import double_negation, negated_factor, negated_nominator, \
from
.fractions
import
multiply_with_fraction
,
divide_fraction_by_term
,
\
add_nominators
,
division_by_one
from
.integrals
import
factor_out_constant
,
integrate_variable_root
from
.powers
import
remove_power_of_one
from
.powers
import
remove_power_of_one
,
extend_exponent
from
.sqrt
import
quadrant_sqrt
,
extract_sqrt_mult_priority
from
.lineq
import
substitute_variable
,
swap_sides
,
divide_term
,
multiply_term
from
.groups
import
combine_groups
...
...
@@ -62,13 +62,20 @@ LOW = [
factor_in_exponent_multiplicant
,
reduce_fraction_constants
,
# These rules lead to a longer expression, and are therefore not
# preferred as a first step
# Expand 'single' before 'double' to avoid unnessecary complexity
extend_exponent
,
expand_single
,
expand_double
,
# Sorting expression terms has a low priority because it is assumed to
# be handled by the user
swap_factors
,
]
# Fu
c
ntion precedences relative to eachother. Tuple (A, B) means that A has a
# Fun
c
tion precedences relative to eachother. Tuple (A, B) means that A has a
# higher priority than B. This list ignores occurences in the HIGH or LOW lists
# above
RELATIVE
=
[
...
...
@@ -76,10 +83,6 @@ RELATIVE = [
(
chain_rule
,
raised_base
),
(
raised_base
,
factor_out_exponent
),
# Combine groups before expanding them
# Expand 'single' before 'double' to avoid unnessecary complexity
(
expand_single
,
expand_double
),
(
factor_out_exponent_important
,
raise_numerics
),
(
factor_out_constant
,
multiply_with_fraction
),
...
...
@@ -104,7 +107,7 @@ RELATIVE = [
# When solving of an equation with constants, expanding an equation has
# a lower priority
(
divide_term
,
multiply_term
,
swap_sides
,
expand_double
,
expand_single
),
(
divide_term
,
multiply_term
,
swap_sides
),
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment