11.07.2015 Views

Fixed and Arbitrary Precision Numerical Fields - Sage

Fixed and Arbitrary Precision Numerical Fields - Sage

Fixed and Arbitrary Precision Numerical Fields - Sage

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Sage</strong> Reference Manual: <strong>Fixed</strong> <strong>and</strong> <strong>Arbitrary</strong> <strong>Precision</strong> <strong>Numerical</strong> <strong>Fields</strong>, Release 6.2EXAMPLES:sage: RealField(100)(2).csch()0.27572056477178320775835148216cube_root()Return the cubic root (defined over the real numbers) of self.EXAMPLES:sage: r = 125.0; r.cube_root()5.00000000000000sage: r = -119.0sage: r.cube_root()^3 - r-1.42108547152020e-14# illustrates precision losseint()Returns the exponential integral of this number.EXAMPLES:sage: r = 1.0sage: r.eint()1.89511781635594sage: r = -1.0sage: r.eint()NaNepsilon(field=None)Returns abs(self) divided by 2 b where b is the precision in bits of self.abs(self) multiplied by the ulp() of 1.Equivalently, returnThis is a scale-invariant version of ulp() <strong>and</strong> it lies in [u/2, u) where u is self.ulp() (except in thecase of zero or underflow).INPUT:•field – RealField used as parent of the result. If not specified, use parent(self).OUTPUT:field(self.abs() / 2^self.precision())EXAMPLES:sage: RR(2^53).epsilon()1.00000000000000sage: RR(0).epsilon()0.000000000000000sage: a = RR.pi()sage: a.epsilon()3.48786849800863e-16sage: a.ulp()/2, a.ulp()(2.22044604925031e-16, 4.44089209850063e-16)sage: a / 2^a.precision()3.48786849800863e-16sage: (-a).epsilon()3.48786849800863e-16We use a different field:38 Chapter 2. <strong>Arbitrary</strong> <strong>Precision</strong> Real Numbers

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!