Questions tagged [simplification]
249 questions
1
vote
1 answer
Boolean Algebra Expression Simplification
Hello I have to simplify the first expression which is from a 7 segment Display assignment.
upper case means it is a NOT so for example the first part ZYXW means NOT z AND NOT y AND NOT x AND NOT w. I hope that makes sense.
So the problem is i found…

user2839999
- 99
- 2
- 9
1
vote
4 answers
Is It Possible To Simplify This Branch-Based Vector Math Operation?
I'm trying to achieve something like the following in C++:
class MyVector; // 3 component vector class
MyVector const kA = /* ... */;
MyVector const kB = /* ... */;
MyVector const kC = /* ... */;
MyVector const kD = /* ... */;
// I'd like to…

Eddie Parker
- 4,770
- 3
- 35
- 43
1
vote
4 answers
Simplification Algorithm for Reverse Polish Notation
A couple of days ago I played around with Befunge which is an esoteric programming language. Befunge uses a LIFO stack to store data. When you write programs the digits from 0 to 9 are actually Befunge-instructions which push the corresponding…

user3022779
- 25
- 1
- 3
1
vote
1 answer
Query for two different result sets and then filter on a column that each contain
I had a large explanation (in my mind it was an explanation, in reality it was more 10 pages of rambling) and then my browser crashed. So, I'll just give a quick overview of the problem as I'm not sure exactly what information is needed.
I have the…

Predz
- 201
- 1
- 7
- 17
1
vote
2 answers
Simplify terms using SMT
I have been using Z3 to check if terms can be satisfied. But in addition I need to simplify terms for human consumption e.g. when n is an Int simplify And(n>4 , n != 5) to n > 5. Dose any one know how to do this in Z3 or via other tools?

david streader
- 589
- 2
- 7
1
vote
0 answers
d3.simplify.js simplify without projecting
Is there any way to simplify a features collection in SRID 4326 and maintain the same coordinate reference. Seems like most example project to a pixel based coordinate system.

whyvez
- 303
- 3
- 12
1
vote
1 answer
Mathematica simplify conjugate expression
Is there a way to simplify this conjugate expression:
expr=d12*Conjugate[C1]*C2 + d12*Conjugate[C2]*C1 + d13*Conjugate[C1]*C3 + d13*Conjugate[C3]*C1
into something like:
2 d12 (Re[C1*Conjugate[C2]]) + 2 d13 (Re[C1*Conjugate[C3]])
And in general,…

xslittlegrass
- 4,826
- 4
- 26
- 32
1
vote
3 answers
Simplify matrix matlab
I'm making some matrix computation in matlab. What looks strange (to me) is that I get results like
(8700286382685973*cos(q5)*sin(q4))/9007199254740992 +…

Manlio
- 10,768
- 9
- 50
- 79
1
vote
7 answers
Need help simplifying a nested if block
I have the following block of code:
if (x > 5)
{
if (!DateTime.TryParse(y, out z))
break;
if (w.CompareTo(z) == -1)
break;
}
Where x is an integer, y is a string, z and w are DateTime variables.
The reason for the break; is…

Ozzyberto
- 379
- 6
- 13
0
votes
1 answer
Simplification of Trigonometric Addition Formulas with SymPy
I was checking a trigonometric addition formula
cos(x)*cos(y) - sin(x)*sin(y) = cos(x+y)
using trigsimp() in SymPy.
from sympy import cos, sin, symbols, trigsimp
q = symbols('q')
print('trigsimp')
print(trigsimp(-sin(q)*sin(1*q) +…
0
votes
0 answers
how to find datarows with biggest value?
So given
a
b
c
1
1
3
1
2
8
1
3
6
1
3
7
I want to query the rows with biggest b, however I dont know that biggest b would be 3 in this case.
Same query should return the last two rows here…

aludebe
- 1
- 1
0
votes
1 answer
VB Script Simplification for "offset" repeating numbers?
I have a script I use to inspect parts, or "Apertures":
In the program I'm using, there's a separate script at the start where the user defines what number aperture they are inspecting in a sequence. So this number is always defined at the start of…

Josh briggs
- 1
- 1
0
votes
1 answer
Is it possible to do Equivalence logic simplification with SymPy from discrete variable domains?
I've been using SymPy to do logic simplification (using their sympy logic module and it's working well with boolean expressions.
I'm now trying to tackle a trickier problem, but I'm having troubles framing the problem in a way that is solvable from…

Federico Terzi
- 3
- 1
0
votes
0 answers
Simplify dict creation from non-defined type object
I'm trying to keep a bit of code as efficient as possible and I think the aspect of it is just messy. If anyone want's to give a suggestion for a simplification of it I would really apreciate it.
result = DotDict()
for name in dir(obj):
value =…

UsayHi
- 35
- 4
0
votes
1 answer
Tricks and tips for beginners to shorten and simplify code
I am looking for ways to shorten and simplify my python code. Here is one example of one small rock/paper/scissors game I wrote earlier. The code kinda looks too long to me and I want to try to learn how to shorten my code.
import random
user_wins =…

ayoub03
- 5
- 2