Fast algorithm to find root of strictly decreasing function

AI Thread Summary
The discussion focuses on identifying the fastest algorithm to find the closest root of a strictly decreasing function, where the function value is positive within a specified error margin but never negative. Two primary methods are highlighted: Newton's tangent method, which requires the derivative of the function, and the secant method, which does not. The Newton-Raphson method is mentioned as a viable option even when the derivative is not explicitly calculated, as it can be approximated using a finite difference approach. A code snippet illustrates how to compute the derivative numerically using a small increment. The emphasis is on efficiency and accuracy in locating the root under the given constraints.
dabd
Messages
25
Reaction score
0
What is the fastest algorithm to find the closest root (such that the function value at that point is positive to an error but never negative, if not exactly zero) for a strictly decreasing function?
 
Technology news on Phys.org
If you can find the derivative of the function, Newton's tangent method, otherwise secant method.
 
dabd said:
What is the fastest algorithm to find the closest root (such that the function value at that point is positive to an error but never negative, if not exactly zero) for a strictly decreasing function?

In the Newton-Raphson Method, you do not need to find the derivative instead

Code:
private static double df(double x) {
		double del=0.000001;
		double x0=f(x+del)-f(x);
		x0=x0/del;
		return x0;
	}
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top