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 BasicType

>=: (%, %) -> Boolean

from PartialOrder

>: (%, %) -> Boolean

from PartialOrder

^: (%, %) -> %

from ElementaryFunctionCategory

^: (%, Fraction Integer) -> %

from RadicalCategory

^: (%, Integer) -> %

from DivisionRing

^: (%, NonNegativeInteger) -> %

from MagmaWithUnit

^: (%, PositiveInteger) -> %

from Magma

~=: (%, %) -> Boolean

from BasicType

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

Beta: (%, %) -> %

from SpecialFunctionCategory

Beta: (%, %, %) -> %

from SpecialFunctionCategory

bits: () -> PositiveInteger

from FloatingPointSystem

ceiling: % -> %

from RealNumberSystem

characteristic: () -> NonNegativeInteger

from NonAssociativeRing

charlierC: (%, %, %) -> %

from SpecialFunctionCategory

coerce: % -> %

from Algebra %

coerce: % -> OutputForm

from CoercibleTo OutputForm

coerce: Fraction Integer -> %

from CoercibleFrom Fraction Integer

coerce: Integer -> %

from CoercibleFrom Integer

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

D: % -> %

from DifferentialRing

D: (%, NonNegativeInteger) -> %

from DifferentialRing

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

exp1: () -> %

exp1() returns the natural log base 2.718281828....

exp: % -> %

from ElementaryFunctionCategory

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

Gamma: % -> %

from SpecialFunctionCategory

Gamma: (%, %) -> %

from SpecialFunctionCategory

gcd: (%, %) -> %

from GcdDomain

gcd: List % -> %

from GcdDomain

gcdPolynomial: (SparseUnivariatePolynomial %, SparseUnivariatePolynomial %) -> SparseUnivariatePolynomial %

from GcdDomain

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

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

log10: % -> %

log10(x) computes the logarithm with base 10 for x.

log2: % -> %

log2(x) computes the logarithm with base 2 for x.

log: % -> %

from ElementaryFunctionCategory

lommelS1: (%, %, %) -> %

from SpecialFunctionCategory

lommelS2: (%, %, %) -> %

from SpecialFunctionCategory

mantissa: % -> Integer

from FloatingPointSystem

max: (%, %) -> %

from OrderedSet

max: () -> % if % hasn’t arbitraryExponent and % hasn’t arbitraryPrecision

from FloatingPointSystem

meijerG: (List %, List %, List %, List %, %) -> %

from SpecialFunctionCategory

meixnerM: (%, %, %, %) -> %

from SpecialFunctionCategory

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: () -> %

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

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

zero?: % -> Boolean

from AbelianMonoid

AbelianGroup

AbelianMonoid

AbelianSemiGroup

Algebra %

Algebra Fraction Integer

Approximate

ArcHyperbolicFunctionCategory

ArcTrigonometricFunctionCategory

BasicType

BiModule(%, %)

BiModule(Fraction Integer, Fraction Integer)

CancellationAbelianMonoid

canonicalsClosed

canonicalUnitNormal

CharacteristicZero

CoercibleFrom Fraction Integer

CoercibleFrom Integer

CoercibleTo OutputForm

CommutativeRing

CommutativeStar

Comparable

ConvertibleTo DoubleFloat

ConvertibleTo Float

ConvertibleTo InputForm

ConvertibleTo Pattern Float

ConvertibleTo String

DifferentialRing

DivisionRing

ElementaryFunctionCategory

EntireRing

EuclideanDomain

Field

FloatingPointSystem

GcdDomain

Hashable

HyperbolicFunctionCategory

IntegralDomain

LeftModule %

LeftModule Fraction Integer

LeftOreRing

Magma

MagmaWithUnit

Module %

Module Fraction Integer

Monoid

NonAssociativeAlgebra %

NonAssociativeAlgebra Fraction Integer

NonAssociativeRing

NonAssociativeRng

NonAssociativeSemiRing

NonAssociativeSemiRng

noZeroDivisors

OpenMath

OrderedAbelianGroup

OrderedAbelianMonoid

OrderedAbelianSemiGroup

OrderedCancellationAbelianMonoid

OrderedRing

OrderedSet

PartialOrder

PatternMatchable Float

PrincipalIdealDomain

RadicalCategory

RealConstant

RealNumberSystem

RetractableTo Fraction Integer

RetractableTo Integer

RightModule %

RightModule Fraction Integer

Ring

Rng

SemiGroup

SemiRing

SemiRng

SetCategory

SpecialFunctionCategory

TranscendentalFunctionCategory

TrigonometricFunctionCategory

TwoSidedRecip

UniqueFactorizationDomain

unitsKnown