DoubleFloat
sf.spad line 302
[edit on github]
DoubleFloat is intended to make accessible hardware floating point arithmetic in FriCAS, 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.
- * : (%, %) -> %
- from Magma
- * : (%, 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
- 0 : () -> %
- from AbelianMonoid
- 1 : () -> %
- from MagmaWithUnit
- < : (%, %) -> Boolean
- from PartialOrder
- <= : (%, %) -> Boolean
- from PartialOrder
- = : (%, %) -> Boolean
- from BasicType
- > : (%, %) -> Boolean
- from PartialOrder
- >= : (%, %) -> Boolean
- from PartialOrder
- Beta : (%, %) -> %
- from SpecialFunctionCategory
- Beta : (%, %, %) -> %
- from SpecialFunctionCategory
- D : % -> %
- from DifferentialRing
- D : (%, NonNegativeInteger) -> %
- from DifferentialRing
- Gamma : % -> %
- from SpecialFunctionCategory
- Gamma : (%, %) -> %
- from SpecialFunctionCategory
- OMwrite : % -> String
- from OpenMath
- OMwrite : (%, Boolean) -> String
- from OpenMath
- OMwrite : (OpenMathDevice, %) -> Void
- from OpenMath
- OMwrite : (OpenMathDevice, %, Boolean) -> Void
- from OpenMath
- ^ : (%, %) -> %
- from ElementaryFunctionCategory
- ^ : (%, Fraction(Integer)) -> %
- from RadicalCategory
- ^ : (%, Integer) -> %
- from DivisionRing
- ^ : (%, NonNegativeInteger) -> %
- from MagmaWithUnit
- ^ : (%, PositiveInteger) -> %
- from Magma
- abs : % -> %
- from OrderedRing
- acos : % -> %
- from ArcTrigonometricFunctionCategory
- acosh : % -> %
- from ArcHyperbolicFunctionCategory
- acot : % -> %
- from ArcTrigonometricFunctionCategory
- acoth : % -> %
- from ArcHyperbolicFunctionCategory
- acsc : % -> %
- from ArcTrigonometricFunctionCategory
- acsch : % -> %
- from ArcHyperbolicFunctionCategory
- airyAi : % -> %
- from SpecialFunctionCategory
- airyAiPrime : % -> %
- from SpecialFunctionCategory
- airyBi : % -> %
- from SpecialFunctionCategory
- airyBiPrime : % -> %
- from SpecialFunctionCategory
- angerJ : (%, %) -> %
- from SpecialFunctionCategory
- annihilate? : (%, %) -> Boolean
- from Rng
- antiCommutator : (%, %) -> %
- from NonAssociativeSemiRng
- asec : % -> %
- from ArcTrigonometricFunctionCategory
- asech : % -> %
- from ArcHyperbolicFunctionCategory
- asin : % -> %
- from ArcTrigonometricFunctionCategory
- asinh : % -> %
- from ArcHyperbolicFunctionCategory
- associates? : (%, %) -> Boolean
- from EntireRing
- associator : (%, %, %) -> %
- from NonAssociativeRng
- atan : % -> %
- from ArcTrigonometricFunctionCategory
- atan : (%, %) -> %
atan(x, y)
computes the arc tangent from x
with phase y
.
- atanh : % -> %
- from ArcHyperbolicFunctionCategory
- base : () -> PositiveInteger
- from FloatingPointSystem
- besselI : (%, %) -> %
- from SpecialFunctionCategory
- besselJ : (%, %) -> %
- from SpecialFunctionCategory
- besselK : (%, %) -> %
- from SpecialFunctionCategory
- besselY : (%, %) -> %
- from SpecialFunctionCategory
- bits : () -> PositiveInteger
- from FloatingPointSystem
- ceiling : % -> %
- from RealNumberSystem
- characteristic : () -> NonNegativeInteger
- from NonAssociativeRing
- charlierC : (%, %, %) -> %
- from SpecialFunctionCategory
- coerce : % -> %
- from Algebra(%)
- coerce : Fraction(Integer) -> %
- from Algebra(Fraction(Integer))
- coerce : Integer -> %
- from NonAssociativeRing
- coerce : % -> OutputForm
- from CoercibleTo(OutputForm)
- commutator : (%, %) -> %
- from NonAssociativeRng
- conjugate : % -> %
- from SpecialFunctionCategory
- 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 : % -> %
- from TrigonometricFunctionCategory
- cosh : % -> %
- from HyperbolicFunctionCategory
- cot : % -> %
- from TrigonometricFunctionCategory
- coth : % -> %
- from HyperbolicFunctionCategory
- csc : % -> %
- from TrigonometricFunctionCategory
- csch : % -> %
- from HyperbolicFunctionCategory
- differentiate : % -> %
- from DifferentialRing
- differentiate : (%, NonNegativeInteger) -> %
- from DifferentialRing
- digamma : % -> %
- from SpecialFunctionCategory
- digits : () -> PositiveInteger
- from FloatingPointSystem
- diracDelta : % -> %
- from SpecialFunctionCategory
- divide : (%, %) -> Record(quotient : %, remainder : %)
- from EuclideanDomain
- doubleFloatFormat : String -> String
change the output format for doublefloats using lisp format strings
- ellipticE : % -> %
- from SpecialFunctionCategory
- ellipticE : (%, %) -> %
- from SpecialFunctionCategory
- ellipticF : (%, %) -> %
- from SpecialFunctionCategory
- ellipticK : % -> %
- from SpecialFunctionCategory
- ellipticPi : (%, %, %) -> %
- from SpecialFunctionCategory
- euclideanSize : % -> NonNegativeInteger
- from EuclideanDomain
- exp : % -> %
- from ElementaryFunctionCategory
- exp1 : () -> %
exp1()
returns the natural log base 2.718281828...
.
- 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
- factor : % -> Factored(%)
- from UniqueFactorizationDomain
- float : (Integer, Integer) -> %
- from FloatingPointSystem
- float : (Integer, Integer, PositiveInteger) -> %
- from FloatingPointSystem
- floor : % -> %
- from RealNumberSystem
- fractionPart : % -> %
- from RealNumberSystem
- gcd : (%, %) -> %
- from GcdDomain
- gcd : List(%) -> %
- from GcdDomain
- gcdPolynomial : (SparseUnivariatePolynomial(%), SparseUnivariatePolynomial(%)) -> SparseUnivariatePolynomial(%)
- from GcdDomain
- hahnQ : (%, %, %, %, %) -> %
- from SpecialFunctionCategory
- hahnR : (%, %, %, %, %) -> %
- from SpecialFunctionCategory
- hahnS : (%, %, %, %, %) -> %
- from SpecialFunctionCategory
- hahn_p : (%, %, %, %, %) -> %
- from SpecialFunctionCategory
- hankelH1 : (%, %) -> %
- from SpecialFunctionCategory
- hankelH2 : (%, %) -> %
- from SpecialFunctionCategory
- hash : % -> SingleInteger
- from Hashable
- hashUpdate! : (HashState, %) -> HashState
- from Hashable
- hermiteH : (%, %) -> %
- from SpecialFunctionCategory
- hypergeometricF : (List(%), List(%), %) -> %
- from SpecialFunctionCategory
- inv : % -> %
- from DivisionRing
- jacobiCn : (%, %) -> %
- from SpecialFunctionCategory
- jacobiDn : (%, %) -> %
- from SpecialFunctionCategory
- jacobiP : (%, %, %, %) -> %
- from SpecialFunctionCategory
- jacobiSn : (%, %) -> %
- from SpecialFunctionCategory
- jacobiTheta : (%, %) -> %
- from SpecialFunctionCategory
- jacobiZeta : (%, %) -> %
- from SpecialFunctionCategory
- kelvinBei : (%, %) -> %
- from SpecialFunctionCategory
- kelvinBer : (%, %) -> %
- from SpecialFunctionCategory
- kelvinKei : (%, %) -> %
- from SpecialFunctionCategory
- kelvinKer : (%, %) -> %
- from SpecialFunctionCategory
- krawtchoukK : (%, %, %, %) -> %
- from SpecialFunctionCategory
- kummerM : (%, %, %) -> %
- from SpecialFunctionCategory
- kummerU : (%, %, %) -> %
- from SpecialFunctionCategory
- laguerreL : (%, %, %) -> %
- from SpecialFunctionCategory
- lambertW : % -> %
- from SpecialFunctionCategory
- latex : % -> String
- from SetCategory
- lcm : (%, %) -> %
- from GcdDomain
- lcm : List(%) -> %
- from GcdDomain
- lcmCoef : (%, %) -> Record(llcm_res : %, coeff1 : %, coeff2 : %)
- from LeftOreRing
- leftPower : (%, NonNegativeInteger) -> %
- from MagmaWithUnit
- leftPower : (%, PositiveInteger) -> %
- from Magma
- leftRecip : % -> Union(%, "failed")
- from MagmaWithUnit
- legendreP : (%, %, %) -> %
- from SpecialFunctionCategory
- legendreQ : (%, %, %) -> %
- from SpecialFunctionCategory
- lerchPhi : (%, %, %) -> %
- from SpecialFunctionCategory
- log : % -> %
- from ElementaryFunctionCategory
- log10 : % -> %
log10(x)
computes the logarithm with base 10 for x
.
- log2 : % -> %
log2(x)
computes the logarithm with base 2 for x
.
- lommelS1 : (%, %, %) -> %
- from SpecialFunctionCategory
- lommelS2 : (%, %, %) -> %
- from SpecialFunctionCategory
- mantissa : % -> Integer
- from FloatingPointSystem
- max : () -> % if % hasn't arbitraryExponent and % hasn't arbitraryPrecision
- from FloatingPointSystem
- max : (%, %) -> %
- from OrderedSet
- meijerG : (List(%), List(%), List(%), List(%), %) -> %
- from SpecialFunctionCategory
- meixnerM : (%, %, %, %) -> %
- from SpecialFunctionCategory
- meixnerP : (%, %, %, %) -> %
- from SpecialFunctionCategory
- min : () -> % if % hasn't arbitraryExponent and % hasn't arbitraryPrecision
- from FloatingPointSystem
- min : (%, %) -> %
- from OrderedSet
- multiEuclidean : (List(%), %) -> Union(List(%), "failed")
- from EuclideanDomain
- negative? : % -> Boolean
- from OrderedRing
- norm : % -> %
- from RealNumberSystem
- nthRoot : (%, Integer) -> %
- from RadicalCategory
- one? : % -> Boolean
- from MagmaWithUnit
- opposite? : (%, %) -> Boolean
- from AbelianMonoid
- order : % -> Integer
- from FloatingPointSystem
- patternMatch : (%, Pattern(Float), PatternMatchResult(Float, %)) -> PatternMatchResult(Float, %)
- from PatternMatchable(Float)
- pi : () -> %
- from TranscendentalFunctionCategory
- plenaryPower : (%, PositiveInteger) -> %
- from NonAssociativeAlgebra(%)
- polygamma : (%, %) -> %
- from SpecialFunctionCategory
- polylog : (%, %) -> %
- from SpecialFunctionCategory
- positive? : % -> Boolean
- from OrderedRing
- precision : () -> PositiveInteger
- from FloatingPointSystem
- prime? : % -> Boolean
- from UniqueFactorizationDomain
- principalIdeal : List(%) -> Record(coef : List(%), generator : %)
- from PrincipalIdealDomain
- qlog : % -> %
qlog(x)
computes natural logarithm of x
. It assumes that x > 0
.
- qsqrt : % -> %
qsqrt(x)
computes square root of x
. It assumes that x >= 0
.
- quo : (%, %) -> %
- from EuclideanDomain
- racahR : (%, %, %, %, %, %) -> %
- from SpecialFunctionCategory
- rationalApproximation : (%, NonNegativeInteger) -> Fraction(Integer)
rationalApproximation(f, n)
computes a rational approximation r
to f
with relative error < 10^(-n)
.
- rationalApproximation : (%, NonNegativeInteger, NonNegativeInteger) -> Fraction(Integer)
rationalApproximation(f, n, b)
computes a rational approximation r
to f
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 : % -> %
- from SpecialFunctionCategory
- rightPower : (%, NonNegativeInteger) -> %
- from MagmaWithUnit
- rightPower : (%, PositiveInteger) -> %
- from Magma
- rightRecip : % -> Union(%, "failed")
- from MagmaWithUnit
- round : % -> %
- from RealNumberSystem
- sample : () -> %
- from AbelianMonoid
- sec : % -> %
- from TrigonometricFunctionCategory
- sech : % -> %
- from HyperbolicFunctionCategory
- sign : % -> %
- from SpecialFunctionCategory
- sign : % -> Integer
- from OrderedRing
- sin : % -> %
- from TrigonometricFunctionCategory
- sinh : % -> %
- from HyperbolicFunctionCategory
- sizeLess? : (%, %) -> Boolean
- from EuclideanDomain
- smaller? : (%, %) -> Boolean
- from Comparable
- sqrt : % -> %
- from RadicalCategory
- squareFree : % -> Factored(%)
- from UniqueFactorizationDomain
- squareFreePart : % -> %
- from UniqueFactorizationDomain
- struveH : (%, %) -> %
- from SpecialFunctionCategory
- struveL : (%, %) -> %
- from SpecialFunctionCategory
- subtractIfCan : (%, %) -> Union(%, "failed")
- from CancellationAbelianMonoid
- tan : % -> %
- from TrigonometricFunctionCategory
- tanh : % -> %
- from HyperbolicFunctionCategory
- 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 : % -> %
- from SpecialFunctionCategory
- weberE : (%, %) -> %
- from SpecialFunctionCategory
- weierstrassP : (%, %, %) -> %
- from SpecialFunctionCategory
- weierstrassPInverse : (%, %, %) -> %
- from SpecialFunctionCategory
- weierstrassPPrime : (%, %, %) -> %
- from SpecialFunctionCategory
- weierstrassSigma : (%, %, %) -> %
- from SpecialFunctionCategory
- weierstrassZeta : (%, %, %) -> %
- from SpecialFunctionCategory
- whittakerM : (%, %, %) -> %
- from SpecialFunctionCategory
- whittakerW : (%, %, %) -> %
- from SpecialFunctionCategory
- wholePart : % -> Integer
- from RealNumberSystem
- wilsonW : (%, %, %, %, %, %) -> %
- from SpecialFunctionCategory
- zero? : % -> Boolean
- from AbelianMonoid
- ~= : (%, %) -> Boolean
- from BasicType
Module(Fraction(Integer))
ConvertibleTo(Float)
PrincipalIdealDomain
PartialOrder
NonAssociativeSemiRing
OrderedAbelianGroup
BiModule(%, %)
ConvertibleTo(InputForm)
SemiRing
canonicalUnitNormal
Rng
TrigonometricFunctionCategory
ArcTrigonometricFunctionCategory
CoercibleFrom(Integer)
CancellationAbelianMonoid
TranscendentalFunctionCategory
EntireRing
PatternMatchable(Float)
LeftOreRing
NonAssociativeAlgebra(Fraction(Integer))
unitsKnown
RadicalCategory
Field
noZeroDivisors
RetractableTo(Fraction(Integer))
SpecialFunctionCategory
OrderedSet
UniqueFactorizationDomain
SemiGroup
RightModule(Fraction(Integer))
Magma
GcdDomain
LeftModule(%)
NonAssociativeRing
ArcHyperbolicFunctionCategory
CharacteristicZero
CommutativeRing
CoercibleFrom(Fraction(Integer))
Algebra(%)
DifferentialRing
OrderedAbelianMonoid
DivisionRing
OpenMath
NonAssociativeSemiRng
EuclideanDomain
Approximate
canonicalsClosed
Comparable
TwoSidedRecip
RetractableTo(Integer)
OrderedCancellationAbelianMonoid
OrderedRing
RealNumberSystem
FloatingPointSystem
CommutativeStar
AbelianMonoid
MagmaWithUnit
RightModule(%)
Hashable
RealConstant
ConvertibleTo(String)
ConvertibleTo(DoubleFloat)
OrderedAbelianSemiGroup
Module(%)
CoercibleTo(OutputForm)
ConvertibleTo(Pattern(Float))
SemiRng
Monoid
NonAssociativeAlgebra(%)
Algebra(Fraction(Integer))
BasicType
Ring
AbelianSemiGroup
IntegralDomain
SetCategory
ElementaryFunctionCategory
NonAssociativeRng
BiModule(Fraction(Integer), Fraction(Integer))
HyperbolicFunctionCategory
AbelianGroup
LeftModule(Fraction(Integer))