quadratic equations
quadratic equations
https://www.popularmechanics.com/scienc ... equations/ a new way to do quadratic equations. is this faster aswell as easier ?
Live long and phosphor!
-- https://github.com/netpipe/Luna Game Engine Status 95%
-- https://github.com/netpipe/Luna Game Engine Status 95%
-
- Competition winner
- Posts: 688
- Joined: Mon Sep 10, 2012 8:51 am
Re: quadratic equations
Not to me. Looks more complicated than necessary, actually. But maybe I just had a better math book than everyone else in highschool. ¯\_(ツ)_/¯
EDIT: As a "proof" I guess it's better than the original "convenient guess" that made the original derivation work smoothly. But for kids in highschool, it's too abstract.
EDIT: As a "proof" I guess it's better than the original "convenient guess" that made the original derivation work smoothly. But for kids in highschool, it's too abstract.
-
- Posts: 4
- Joined: Sun Apr 22, 2018 7:18 am
Re: quadratic equations
If we know that there is a solution and we have an approximate initial guess, is it faster to apply the Newton rule multiple times instead of calculating the solutions with the quadratic formula (-b±sqrt(b*b-4*a*c))/(2*a)?
x[0] = x0, x[k+1] = (a * x[k] * x[k] - c) / (2 * a * x[k] + b)
x1 ≈ x[10]
x2 ≈ -b / a - x1
example:
x0 = 1, a = 4, b = 6, c = -5
x[1] = 0.64285714285714
x[2] = 0.5970695970696
x[3] = 0.59629142667892
x[4] = 0.59629120178364
x[5] = 0.59629120178363
x[6] = 0.59629120178363
x[7] = 0.59629120178363
x[8] = 0.59629120178363
x[9] = 0.59629120178363
x[10] = 0.59629120178363
x1 = x[10]
x2 = -2.0962912017836
x[0] = x0, x[k+1] = (a * x[k] * x[k] - c) / (2 * a * x[k] + b)
x1 ≈ x[10]
x2 ≈ -b / a - x1
example:
x0 = 1, a = 4, b = 6, c = -5
x[1] = 0.64285714285714
x[2] = 0.5970695970696
x[3] = 0.59629142667892
x[4] = 0.59629120178364
x[5] = 0.59629120178363
x[6] = 0.59629120178363
x[7] = 0.59629120178363
x[8] = 0.59629120178363
x[9] = 0.59629120178363
x[10] = 0.59629120178363
x1 = x[10]
x2 = -2.0962912017836
Re: quadratic equations
nope IEEE754 sqrt is much faster than floating point division applied multiple times.