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.

359 questions
74
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…
Pale Blue Dot
  • 5,611
  • 10
  • 66
  • 100
67
votes
4 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 plan 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.
  • 41,192
  • 25
  • 117
  • 233
13
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
  • 301
  • 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
  • 188,173
  • 57
  • 343
  • 523
11
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
  • 1,490
  • 1
  • 10
  • 22
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
  • 32,737
  • 10
  • 68
  • 106
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
  • 636
  • 1
  • 6
  • 22
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,242
  • 2
  • 15
  • 29
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
  • 3
  • 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…
Priyanshu Khandelwal
  • 2,018
  • 2
  • 16
  • 33
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
4
votes
2 answers

Newtons Method in Python

I'm writing a program in python that will solve for zeros using newtons method. I finished writing the rough version of it, then realized a couple different things and was wondering if I need to impement/change this. (knowledge of the subject may…
Shantanu
  • 484
  • 5
  • 14
4
votes
3 answers

efficiently approximate real solution for polynomial function

I want to efficiently solve a degree-7 polynomial in k. For example, with the following set of 7 unconditional probabilities, p <- c(0.0496772, 0.04584501, 0.04210299, 0.04026439, 0.03844668, 0.03487194, 0.03137491) the overall event probability is…
jayb
  • 491
  • 3
  • 14
1
2 3
23 24