[6.32] Accurate Approximate Solutions To Quadratic Equations With Large Coefficients - Texas Instruments TI-89 Tip List

Graphing calculator
Hide thumbs Also See for TI-89:
Table of Contents

Advertisement

You can use this method with any of the built-in regression commands. You need to enter as many
points as there are coefficients in the equation. For example, the CubicReg command fits the data to a
cubic polynomial with four coefficients, so you would need to enter four points.
I mentioned that the function str2var() is called by quadint(). This is str2var():
str2var(xy)
Func
©("x,y") returns {x,y}
©15oct00 dburkett@infinet.com
local s,x,y
instring(xy,",")→s
if s=0:return "str2var err"
expr(left(xy,s-1))→x
expr(right(xy,dim(xy)-s))→y
return {x,y}
EndFunc

[6.32] Accurate approximate solutions to quadratic equations with large coefficients

This tip shows a method to calculate the approximate roots of the quadratic equation ax
when a and b are very small. In this case, calculating the roots with the 'classical' solution formula
results in less accurate roots. The classical solution is
−b! b 2 −4ac
x =
2a
These solutions result in round-off errors for small values of a and b. A better solution is
q = − 1 2
b + sign ( b ) b 2 − 4ac
q
x1 =
a
This function, quadrtic(), uses these equations.
quadrtic(aa,bb,cc)
func
©(a,b,c) in ax^2+bx+c=0
©27oct00 dburkett@infinet.com
local q
when(bb≠0,⁻(bb+sign(bb)*√(bb*bb-4*aa*cc))/2,⁻(bb+√(bb*bb-4*aa*cc))/2)→q
{q/aa,cc/q}
Endfunc
To use quadrtic(), call it with the coefficients (a,b,c). The two roots are returned as a list. For example,
quadrtic(8,-6,1)
or
then
x2 = c q
and
returns
©Find comma
©Return error string if no comma found
©Get 'x' from string
©Get 'y' from string
©Return list of x & y
2c
x =
−b! b 2 −4ac
{0.5,0.25}
2
+ bx + c =,
6 - 60

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ti-92+

Table of Contents