Questions tagged [newtons-method]

In numerical analysis, Newton's method (also known as the Newton–Raphson method) is a method for finding successively better approximations to the roots (or zeroes) of a real-valued function.

In numerical analysis, Newton's method (also known as the Newton–Raphson method) is a method for finding successively better approximations to the roots (or zeroes) of a real-valued function.

Formula:

enter image description here

In this formula xn + 1 is the next closest approximation after xn, f(xn) is the function at xn and f'(xn) is the derivative of the function at xn.

First approximation x0 has to be in interval (a,b) where exact solution x* is situated.

418 questions
79
votes
19 answers

Writing your own square root function

How do you write your own function for finding the most accurate square root of an integer? After googling it, I found this (archived from its original link), but first, I didn't get it completely, and second, it is approximate too. Assume square…
Ravindra S
  • 6,302
  • 12
  • 70
  • 108
76
votes
5 answers

What is the difference between Gradient Descent and Newton's Gradient Descent?

I understand what Gradient Descent does. Basically it tries to move towards the local optimal solution by slowly moving down the curve. I am trying to understand what is the actual difference between the plain gradient descent and the Newton's…
28
votes
2 answers

Newton Raphson with SSE2 - can someone explain me these 3 lines

I'm reading this document: http://software.intel.com/en-us/articles/interactive-ray-tracing and I stumbled upon these three lines of code: The SIMD version is already quite a bit faster, but we can do better. Intel has added a fast 1/sqrt(x)…
Marco A.
  • 43,032
  • 26
  • 132
  • 246
17
votes
1 answer

SciPy optimisation: Newton-CG vs BFGS vs L-BFGS

I am doing an optimisation problem using Scipy, where I am taking a flat network of vertices and bonds of size NNxNN, connecting two sides of it (i.e., making it periodic), and minimising an energy function, so that it curls up to form a cylinder.…
ap21
  • 2,372
  • 3
  • 16
  • 32
16
votes
3 answers

Conversion between RGB and RYB color spaces

I am currently trying to convert colours between RGB (red, green, blue) colour space and RYB (red, yellow, blue) colour space and back again. Based on the details in the following paper, I am able to convert from RYB to RGB using trilinear…
Ben
  • 341
  • 1
  • 2
  • 9
12
votes
7 answers

How to find minimum of nonlinear, multivariate function using Newton's method (code not linear algebra)

I'm trying to do some parameter estimation and want to choose parameter estimates that minimize the square error in a predicted equation over about 30 variables. If the equation were linear, I would just compute the 30 partial derivatives, set them…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
9
votes
2 answers

Newton Raphson hybrid algorithm not reaching a solution

Brief explanation of the problem: I use Newton Raphson algorithm for root finding in polynomials and doesn't work in some cases. why? I took from "numerical recipes in c++" a Newton Raphson hybrid algorithm, which bisects in case New-Raph is not…
Ander Biguri
  • 35,140
  • 11
  • 74
  • 120
7
votes
2 answers

J: Tacit adverb of Newton's method

I've found in 'addons/math/misc/brent.ijs' implementation of Brent's method as an adverb. I would like to build a Newton's method as an adverb too but it's much harder than building tacit verbs. Here is a explicit version of Newton's iteration: …
Dan Oak
  • 704
  • 1
  • 7
  • 26
7
votes
3 answers

Inverse function for monotonically increasing function, OverflowError for log10()

For an assignment, we were asked to create a function which returns an inverse function. The basic problem was to create a square root function from a square function. I came up with a solution using binary search and another solution using Newton's…
Verbal_Kint
  • 1,366
  • 3
  • 19
  • 35
6
votes
2 answers

Is there a more elegant Go implementation of Newton's method?

I'm doing the Go tutorials and am wondering whether there is a more elegant way to compute a square root using Newton's method on Exercise: Loops and Functions than this: func Sqrt(x float64) float64 { count := 0 var old_z, z float64 = 0, 1 …
Ellen Spertus
  • 6,576
  • 9
  • 50
  • 101
6
votes
2 answers

Newton's Method in R

I have an issue when trying to implement the code for Newton's Method for finding the value of the square root (using iterations). I'm trying to get the function to stop printing the values once a certain accuracy is reached, but I can't seem to get…
user2884679
  • 129
  • 4
  • 9
5
votes
1 answer

Numerical recipes / Multidimensional root search (using newt) : How to minimize the maximum error

This question is related to the "numerical recipes in C++" book, so it will be reserved to people knowing a little about it as well as about multidimensional optimization. I am writing a program that needs to search for a multidimensional root, and…
5
votes
1 answer

Newton's method program (in C) loop running infinitely

This code(attached with the post) in C uses Newton - Raphson method to find roots of a polynomial in a particular interval. This code works perfectly fine for some polynomials like x^3 + x^2 + x + 1 but runtime gets infinite for some polynomials…
Masquerade
  • 3,580
  • 5
  • 20
  • 37
5
votes
3 answers

Simulating orbits using laws of physics

Over the past couple of weeks I've been trying to simulate orbits in a solar system simulation I am making as part of a University module. To cut things short, my simulation is written in C++ using the Ogre3D rendering engine. I have attempted to…
user2484294
  • 107
  • 1
  • 5
5
votes
2 answers

Infinite loop calculating cubic root

I'm trying to make a function that calculates the cubic root through Newton's method but I seem to have an infinite loop here for some reason? #include #include using namespace std; double CubicRoot(double x, double e); int…
Konsowa
  • 69
  • 5
1
2 3
27 28