DoubleFloat¶
sf.spad line 303 [edit on github]
DoubleFloat is intended to make accessible hardware floating point arithmetic in Language{}, either native double precision, or IEEE. On most machines, there will be hardware support for the arithmetic operations: +, *, / and possibly also the sqrt operation. The operations exp, log, sin, cos, atan are normally coded in software based on minimax polynomial/rational approximations. Some general comments about the accuracy of the operations: the operations +, *, / and sqrt are expected to be fully accurate. The operations exp, log, sin, cos and atan are not expected to be fully accurate. In particular, sin and cos will lose all precision for large arguments. The Float domain provides an alternative to the DoubleFloat
domain. It provides an arbitrary precision model of floating point arithmetic. This means that accuracy problems like those above are eliminated by increasing the working precision where necessary. Float provides some special functions such as erf, the error function in addition to the elementary functions. The disadvantage of Float is that it is much more expensive than small floats when the latter can be used.
- 0: %
from AbelianMonoid
- 1: %
from MagmaWithUnit
- *: (%, %) -> %
from LeftModule %
- *: (%, Fraction Integer) -> %
from RightModule Fraction Integer
- *: (Fraction Integer, %) -> %
from LeftModule Fraction Integer
- *: (Integer, %) -> %
from AbelianGroup
- *: (NonNegativeInteger, %) -> %
from AbelianMonoid
- *: (PositiveInteger, %) -> %
from AbelianSemiGroup
- +: (%, %) -> %
from AbelianSemiGroup
- -: % -> %
from AbelianGroup
- -: (%, %) -> %
from AbelianGroup
- /: (%, %) -> %
from Field
- /: (%, Integer) -> %
from FloatingPointSystem
- <=: (%, %) -> Boolean
from PartialOrder
- <: (%, %) -> Boolean
from PartialOrder
- >=: (%, %) -> Boolean
from PartialOrder
- >: (%, %) -> Boolean
from PartialOrder
- ^: (%, %) -> %
- ^: (%, Fraction Integer) -> %
from RadicalCategory
- ^: (%, Integer) -> %
from DivisionRing
- ^: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- ^: (%, PositiveInteger) -> %
from Magma
- abs: % -> %
from OrderedRing
- acos: % -> %
- acosh: % -> %
- acot: % -> %
- acoth: % -> %
- acsc: % -> %
- acsch: % -> %
- airyAi: % -> %
- airyAiPrime: % -> %
- airyBi: % -> %
- airyBiPrime: % -> %
- angerJ: (%, %) -> %
- annihilate?: (%, %) -> Boolean
from Rng
- antiCommutator: (%, %) -> %
- asec: % -> %
- asech: % -> %
- asin: % -> %
- asinh: % -> %
- associates?: (%, %) -> Boolean
from EntireRing
- associator: (%, %, %) -> %
from NonAssociativeRng
- atan: % -> %
- atan: (%, %) -> %
atan(x, y)
computes the arc tangent fromx
with phasey
.
- atanh: % -> %
- base: () -> PositiveInteger
from FloatingPointSystem
- besselI: (%, %) -> %
- besselJ: (%, %) -> %
- besselK: (%, %) -> %
- besselY: (%, %) -> %
- bits: () -> PositiveInteger
from FloatingPointSystem
- ceiling: % -> %
from RealNumberSystem
- characteristic: () -> NonNegativeInteger
from NonAssociativeRing
- charlierC: (%, %, %) -> %
- coerce: % -> %
from Algebra %
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- coerce: Fraction Integer -> %
from CoercibleFrom Fraction Integer
- coerce: Integer -> %
from CoercibleFrom Integer
- commutator: (%, %) -> %
from NonAssociativeRng
- conjugate: % -> %
- convert: % -> DoubleFloat
from ConvertibleTo DoubleFloat
- convert: % -> Float
from ConvertibleTo Float
- convert: % -> InputForm
from ConvertibleTo InputForm
- convert: % -> Pattern Float
from ConvertibleTo Pattern Float
- convert: % -> String
from ConvertibleTo String
- cos: % -> %
- cosh: % -> %
- cot: % -> %
- coth: % -> %
- csc: % -> %
- csch: % -> %
- D: % -> %
from DifferentialRing
- D: (%, NonNegativeInteger) -> %
from DifferentialRing
- differentiate: % -> %
from DifferentialRing
- differentiate: (%, NonNegativeInteger) -> %
from DifferentialRing
- digamma: % -> %
- digits: () -> PositiveInteger
from FloatingPointSystem
- diracDelta: % -> %
- divide: (%, %) -> Record(quotient: %, remainder: %)
from EuclideanDomain
- doubleFloatFormat: String -> String
change the output format for doublefloats using lisp format strings
- ellipticF: (%, %) -> %
- ellipticK: % -> %
- ellipticPi: (%, %, %) -> %
- euclideanSize: % -> NonNegativeInteger
from EuclideanDomain
- exp1: () -> %
exp1()
returns the natural log base2.718281828...
.
- exp: % -> %
- exponent: % -> Integer
from FloatingPointSystem
- expressIdealMember: (List %, %) -> Union(List %, failed)
from PrincipalIdealDomain
- exquo: (%, %) -> Union(%, failed)
from EntireRing
- extendedEuclidean: (%, %) -> Record(coef1: %, coef2: %, generator: %)
from EuclideanDomain
- extendedEuclidean: (%, %, %) -> Union(Record(coef1: %, coef2: %), failed)
from EuclideanDomain
- float: (Integer, Integer) -> %
from FloatingPointSystem
- float: (Integer, Integer, PositiveInteger) -> %
from FloatingPointSystem
- floor: % -> %
from RealNumberSystem
- fractionPart: % -> %
from RealNumberSystem
- gcdPolynomial: (SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial %
from GcdDomain
- hankelH1: (%, %) -> %
- hankelH2: (%, %) -> %
- hash: % -> SingleInteger
from Hashable
- hashUpdate!: (HashState, %) -> HashState
from Hashable
- hermiteH: (%, %) -> %
- hypergeometricF: (List %, List %, %) -> %
- inv: % -> %
from DivisionRing
- jacobiCn: (%, %) -> %
- jacobiDn: (%, %) -> %
- jacobiP: (%, %, %, %) -> %
- jacobiSn: (%, %) -> %
- jacobiTheta: (%, %) -> %
- jacobiZeta: (%, %) -> %
- kelvinBei: (%, %) -> %
- kelvinBer: (%, %) -> %
- kelvinKei: (%, %) -> %
- kelvinKer: (%, %) -> %
- kummerM: (%, %, %) -> %
- kummerU: (%, %, %) -> %
- laguerreL: (%, %, %) -> %
- lambertW: % -> %
- latex: % -> String
from SetCategory
- lcmCoef: (%, %) -> Record(llcm_res: %, coeff1: %, coeff2: %)
from LeftOreRing
- leftPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- leftPower: (%, PositiveInteger) -> %
from Magma
- leftRecip: % -> Union(%, failed)
from MagmaWithUnit
- legendreP: (%, %, %) -> %
- legendreQ: (%, %, %) -> %
- lerchPhi: (%, %, %) -> %
- log10: % -> %
log10(x)
computes the logarithm with base 10 forx
.
- log2: % -> %
log2(x)
computes the logarithm with base 2 forx
.
- log: % -> %
- lommelS1: (%, %, %) -> %
- lommelS2: (%, %, %) -> %
- mantissa: % -> Integer
from FloatingPointSystem
- max: (%, %) -> %
from OrderedSet
- max: () -> % if % hasn’t arbitraryExponent and % hasn’t arbitraryPrecision
from FloatingPointSystem
- meixnerM: (%, %, %, %) -> %
- min: (%, %) -> %
from OrderedSet
- min: () -> % if % hasn’t arbitraryExponent and % hasn’t arbitraryPrecision
from FloatingPointSystem
- multiEuclidean: (List %, %) -> Union(List %, failed)
from EuclideanDomain
- negative?: % -> Boolean
from OrderedRing
- norm: % -> %
from RealNumberSystem
- nthRoot: (%, Integer) -> %
from RadicalCategory
- OMwrite: % -> String
from OpenMath
- OMwrite: (%, Boolean) -> String
from OpenMath
- OMwrite: (OpenMathDevice, %) -> Void
from OpenMath
- OMwrite: (OpenMathDevice, %, Boolean) -> Void
from OpenMath
- one?: % -> Boolean
from MagmaWithUnit
- opposite?: (%, %) -> Boolean
from AbelianMonoid
- order: % -> Integer
from FloatingPointSystem
- patternMatch: (%, Pattern Float, PatternMatchResult(Float, %)) -> PatternMatchResult(Float, %)
from PatternMatchable Float
- pi: () -> %
- plenaryPower: (%, PositiveInteger) -> %
from NonAssociativeAlgebra %
- polygamma: (%, %) -> %
- polylog: (%, %) -> %
- positive?: % -> Boolean
from OrderedRing
- precision: () -> PositiveInteger
from FloatingPointSystem
- principalIdeal: List % -> Record(coef: List %, generator: %)
from PrincipalIdealDomain
- qlog: % -> %
qlog(x)
computes natural logarithm ofx
. It assumes thatx > 0
.
- qsqrt: % -> %
qsqrt(x)
computes square root ofx
. It assumes thatx >= 0
.
- quo: (%, %) -> %
from EuclideanDomain
- rationalApproximation: (%, NonNegativeInteger) -> Fraction Integer
rationalApproximation(f, n)
computes a rational approximationr
tof
with relative error< 10^(-n)
.
- rationalApproximation: (%, NonNegativeInteger, NonNegativeInteger) -> Fraction Integer
rationalApproximation(f, n, b)
computes a rational approximationr
tof
with relative error< b^(-n)
(that is,|(r-f)/f| < b^(-n)
).
- recip: % -> Union(%, failed)
from MagmaWithUnit
- rem: (%, %) -> %
from EuclideanDomain
- retract: % -> Fraction Integer
from RetractableTo Fraction Integer
- retract: % -> Integer
from RetractableTo Integer
- retractIfCan: % -> Union(Fraction Integer, failed)
from RetractableTo Fraction Integer
- retractIfCan: % -> Union(Integer, failed)
from RetractableTo Integer
- riemannZeta: % -> %
- rightPower: (%, NonNegativeInteger) -> %
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> %
from Magma
- rightRecip: % -> Union(%, failed)
from MagmaWithUnit
- round: % -> %
from RealNumberSystem
- sample: %
from AbelianMonoid
- sec: % -> %
- sech: % -> %
- sign: % -> %
- sign: % -> Integer
from OrderedRing
- sin: % -> %
- sinh: % -> %
- sizeLess?: (%, %) -> Boolean
from EuclideanDomain
- smaller?: (%, %) -> Boolean
from Comparable
- sqrt: % -> %
from RadicalCategory
- squareFree: % -> Factored %
- squareFreePart: % -> %
- struveH: (%, %) -> %
- struveL: (%, %) -> %
- subtractIfCan: (%, %) -> Union(%, failed)
- tan: % -> %
- tanh: % -> %
- toString: % -> String
from FloatingPointSystem
- toString: (%, NonNegativeInteger) -> String
from FloatingPointSystem
- truncate: % -> %
from RealNumberSystem
- unit?: % -> Boolean
from EntireRing
- unitCanonical: % -> %
from EntireRing
- unitNormal: % -> Record(unit: %, canonical: %, associate: %)
from EntireRing
- unitStep: % -> %
- weberE: (%, %) -> %
- weierstrassP: (%, %, %) -> %
- weierstrassPInverse: (%, %, %) -> %
- weierstrassPPrime: (%, %, %) -> %
- weierstrassSigma: (%, %, %) -> %
- weierstrassZeta: (%, %, %) -> %
- whittakerM: (%, %, %) -> %
- whittakerW: (%, %, %) -> %
- wholePart: % -> Integer
from RealNumberSystem
- zero?: % -> Boolean
from AbelianMonoid
Algebra %
ArcTrigonometricFunctionCategory
BiModule(%, %)
BiModule(Fraction Integer, Fraction Integer)
CoercibleFrom Fraction Integer
Module %
NonAssociativeAlgebra Fraction Integer
OrderedCancellationAbelianMonoid
RetractableTo Fraction Integer