## Calculator using variable names

I’ve recently been assigned an assignment to create a word calculator, and given my knowledge in python is still quite lacking, I want to ask if anybody has any better ideas for any possible solutions. The question is here: Jimmy has invented a new kind of calculator that works with words rather than numbers. Input … Read more

## Symbolic derivative in Swift

I just wrote my first Swift program! It is a little computer algebra test that computes the nth derivative of the symbolic expression xx. I chose this example because I’m keen to see how ARC will cope with the density of pointers in the heap. Seeing as I’m completely new to this language I’d appreciate … Read more

## Computer Algebra System implementation

I have got it working in a way so that there is one superclass, MathObject. In this implementation there is only a Constant subclass. I was forced to implement an abstract MathObject add(MathObject that) and an abstract MathObject add(Constant that) for reasons. I would like to get that abstract MathObject add(Constant) out of MathObject because … Read more

## Replace a^b by Pow(a,b)

The application uses NCalc to execute diverse calculations. The ‘natural’ way to write powers using a computer is using the ^ symbol. However, NCalc already uses it as bitwise or. I use the following function to parse calculations and convert it to the Pow(a,b) format. Private Function _replacePower(Str As String) As String Const PowerString As … Read more

## Polynomial implementation in Golang

I am writing a numerical analysis library in golang for which I need to implement a polynomial struct. Here is the source code: package numerical import ( “strconv” ) type Poly struct { Coeffs []float64 } func (p *Poly) Str() string { d := p.Deg() if d == -1 { return “0” } s := … Read more

## Boolean expressions from infix to postfix notation using Dijkstra’s Shunting Yard algorithm

I began working on a Java library that receives a boolean expression such as not A and (B or not C), compiles it to a circuit of logical gates C, minimizes C, and converts back to a (possibly shorter) boolean expression. Now, first things first: I need to be able to tokenize each input expression … Read more

## Evaluator for adding and subtracting algebraic expressions

I wrote a little program that adds and subtracts some algebraic expressions. In my code (2 x 3) represents 2×3. The purpose of this post is to get some feedback; moreover, I would like to know how to make it perform better and improve it. I ran this program on a Mac with SBCL + … Read more

## Math app/library that solves calculus problems (symbolic derivative, etc)

Let me start off by saying that this project is a mess, and I know it. I believe it is a mess because I threw it together in a few days just to get it working. Unfortunately, my undergraduate education hasn’t taught me design patterns (yet), so there is really no organized structure. If I … Read more

## Solve simple derivative questions

Built my first script and its function is to solve simple derivative questions. How can I improve this code? This is my first time posting. #This is Simple Derivative Solver def derivative(): print(“This program will give you the first derivative.”) input(“Press ENTER to continue…”) cf=int(input(“Enter the coefficient of the term…”)) exp=int(input(“Enter the exponent of the … Read more

## Algorithm to compute the n-th derivative of a polynomial in Python

As a personal exercise, I’m trying to write an algorithm to compute the n-th derivative of an ordered, simplified polynomial (i.e., all like terms have been combined). The polynomial is passed as an ordered list where the i-th index corresponds (though is not equivalent) to the coefficient of x to the n-th power. Example: Take … Read more