summaryrefslogtreecommitdiff
path: root/lib/Numeric/GSL/Polynomials.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Numeric/GSL/Polynomials.hs')
-rw-r--r--lib/Numeric/GSL/Polynomials.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Numeric/GSL/Polynomials.hs b/lib/Numeric/GSL/Polynomials.hs
index 694c003..290c615 100644
--- a/lib/Numeric/GSL/Polynomials.hs
+++ b/lib/Numeric/GSL/Polynomials.hs
@@ -27,22 +27,22 @@ import System.IO.Unsafe (unsafePerformIO)
27import Foreign.C.Types (CInt(..)) 27import Foreign.C.Types (CInt(..))
28#endif 28#endif
29 29
30{- | Solution of general polynomial equations, using /gsl_poly_complex_solve/. For example, 30{- | Solution of general polynomial equations, using /gsl_poly_complex_solve/.
31 the three solutions of x^3 + 8 = 0 31
32For example, the three solutions of x^3 + 8 = 0
33
34>>> polySolve [8,0,0,1]
35[(-2.0) :+ 0.0,1.0 :+ 1.7320508075688776,1.0 :+ (-1.7320508075688776)]
32 36
33@\> polySolve [8,0,0,1]
34[(-1.9999999999999998) :+ 0.0,
35 1.0 :+ 1.732050807568877,
36 1.0 :+ (-1.732050807568877)]@
37 37
38The example in the GSL manual: To find the roots of x^5 -1 = 0: 38The example in the GSL manual: To find the roots of x^5 -1 = 0:
39 39
40@\> polySolve [-1, 0, 0, 0, 0, 1] 40>>> polySolve [-1, 0, 0, 0, 0, 1]
41[(-0.8090169943749475) :+ 0.5877852522924731, 41[(-0.8090169943749472) :+ 0.5877852522924731,
42(-0.8090169943749475) :+ (-0.5877852522924731), 42(-0.8090169943749472) :+ (-0.5877852522924731),
430.30901699437494734 :+ 0.9510565162951536, 430.30901699437494756 :+ 0.9510565162951535,
440.30901699437494734 :+ (-0.9510565162951536), 440.30901699437494756 :+ (-0.9510565162951535),
451.0 :+ 0.0]@ 451.0000000000000002 :+ 0.0]
46 46
47-} 47-}
48polySolve :: [Double] -> [Complex Double] 48polySolve :: [Double] -> [Complex Double]