All Questions
24 questions
3
votes
0
answers
462
views
Making a fast Mandelbrot Fractal viewer
I'm making a Mandelbrot set viewer in JavaFX. It takes a while, like maybe 5 seconds to finish. Here's my code:
...
1
vote
2
answers
286
views
"Disease Spread" challenge
Right now I'm solving this problem on codewars.com. I'm not sure about how to optimise the code further. Or is my algorithm inefficient? If it's an algorithmic issue, could someone help me how to go ...
1
vote
5
answers
559
views
Optimizing program to output all numbers summing to 100
I just finished my program which calculates the solutions to this problem:
Outputs all possibilities to put + or - or nothing between the numbers 1,2,…,9 (in this order) such that the result is 100.
...
5
votes
1
answer
2k
views
Rational Polynomial Factoring method
I have written a class containing methods to factor a polynomial equation using the p over q method. The method returns a string that is the factored equation.
Here is the class (can also be found ...
0
votes
1
answer
2k
views
Eigenvalue calculation for a Java matrix library [closed]
After an interview didn't go smoothly, I decided to write my own library so that I would be better prepared if I'm ever asked about matrix multiplication again.
I know that doing it in Java is going ...
4
votes
1
answer
2k
views
Pollard p - 1 implementation
I'm trying to implement the Pollard p - 1 algorithm seen here, in Java.
It has a C implementation here. I am using it for numbers without any smaller factors so trial factorisation isn't needed. My ...
3
votes
2
answers
365
views
BigRational based on BigIntegers
For Project Euler I've implemented a BigRational. The functionality is rather limited, just things I needed or will probably need soon. The style departs a bit from ...
15
votes
1
answer
2k
views
Multiplication 128 x 64 bits
I was fooling around with the Collatz sequence a bit and found out that long is only sufficient for starting values below ...
11
votes
3
answers
2k
views
Algorithm to calculate semi perfect integers, lack of efficiency
I'm working on an algorithm to calculate weird numbers, and to do so there are several properties that needs to be calculated, one of them being, if it is NOT a semi-perfect/pseudoperfect number.
My ...
4
votes
1
answer
1k
views
Followup: How do I optimize this Java cube root function for BigInteger?
Followup to How do I optimize this Java cube root function for BigInteger?
So I've tried several implementations of this algorithm. The version using only BigInteger sometimes results in a never-...
7
votes
1
answer
3k
views
How do I optimize this Java cube root function for BigInteger?
I find that this function is one of the biggest causes of slow program execution. I can write a square root version with BigInteger only, but with the cube root, the algorithm sometimes gets caught in ...
6
votes
4
answers
125
views
Calculation of e performance issue
Can you give me some idea how to optimize the switch statements, maybe a for or do while ...
0
votes
2
answers
1k
views
Pythagorean triplets
This code is about finding Pythagorean triplets. I take a number as input, and find from 1 to that number, how many Pythagorean triplets exist.
Are there ways this can be optimized? It takes a lot ...
5
votes
3
answers
1k
views
Better performance in calculating E
Can you give me some performance advice on how to optimize the time of execution of the following calculation of E?
...
8
votes
2
answers
2k
views
Finding the nearest Rational to a double - is there a more efficient mechanism?
I use the following code to find the lowest denominator Rational that is within a certain delta from a double.
The rationale is that the I am pulling float numbers ...