# Questions tagged [refactoring]

The tag has no usage guidance.

9 questions
Filter by
Sorted by
Tagged with
1 vote
51 views

### Can one collect with respect to two groups of variables?

Here is a toy example of what I want: given ...
1 vote
50 views

### Is there any way to refactor this equation?

I have a function produce this equation: (-4*dt^2*(c3 + a3*t)^2*t0^4 + dxC^2*(t0^2 + t1^2)^2 + dxM^2*(t0^2 + t1^2)^2 + dxY^2*(t0^2 + t1^2)^2)/(4*t0^4) Is there any ...
1 vote
22 views

### Rewriting GroupBy[{elem1,elem2,…},spec,red] into GroupBy[spec] , how to apply reduction?

I'm currently using this version of GroupBy: GroupBy[{elem1,elem2,…},spec,red] applies the function red to reduce lists of values that are generated. I want to rewrite my function with this one: ...
100 views

### What is a more expedient way to assign variable names to individual elements in a list?

There is a set of one-dimensional descriptive statistics that I need so often that instead of copying and pasting calculations each time I created a function (...
45 views

### How to refactor solution verification function for solving simple ordinary differential equations with Dsolve? [closed]

I have tried different approaches but none would work for me as I am new to both functional programming and Mathematica. At bottom is the code I have. How ...
1 vote
48 views

### Variable refactoring and multi-selection

In IDEs like PyCharm for Python, I can select a variable name or method name and it will highlight to show where all I have used it. Also its easy to refactor the names under a given text selection. ...
61 views

### Numerical output using Select and FactorInteger

I have concocted a function from other peoples examples to find the powers of two in a prime decompostion, in the example below its $2^2=4$ gives {2,2}. ...