Menu
Double-double LogoDouble-doubleDocs
GitHub
Double-double LogoDouble-double
  • Docs
  • GitHub
  • Introduction
    • Getting started
  • Functions
    • Basic
      • fastTwoDiff
      • fastTwoSum
      • reduceSignificand
      • split
      • twoDiff
      • twoProduct
      • twoSquare
      • twoSum
    • Unary
      • ddAbs
      • ddDivBy2
      • ddMultBy2
      • ddMultBy4
      • ddMultByNeg2
      • ddMultByNeg4
      • ddNegativeOf
      • ddSign
      • ddSqrt
    • Binary
      • ddAddDd
      • ddCompare
      • ddDiffDd
      • ddDivDd
      • ddMax
      • ddMin
      • ddMultDd
    • Arity > 2
      • ddProduct
      • ddSum
    • Mixed precision
      • ddAddDouble
      • ddDivDouble
      • ddMultDouble
      • doubleDivDouble
      • doubleSqrt
    • With error propagation
      • ddDivDdWithError
      • divWithErr
      • sqrtWithErr
    • TRepresentation
      • bitLength
      • exponent
      • getLowestSetBit / getHighestSetBit
      • isBitAligned
      • lsbExponent
      • msbExponent
      • parseDouble
      • significand

fastTwoDiff

fastTwoDiff(a: number, b: number): number[]

Defined in basic/fast-two-diff.ts:13

Returns the difference and exact error of subtracting two floating point numbers. Uses an EFT (error-free transformation), i.e. a-b === x+y exactly. The returned result is a non-overlapping expansion (smallest value first!).

  • precondition: abs(a) >= abs(b) (a fast test that can be used is (a > b) === (a > -b))

See https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf

Parameters:

NameType
anumber
bnumber

Returns: number[]

Previous
« Introduction
Next
fastTwoSum »

Quick Links

  • Docs
  • GitHub
Copyright © 2020 - Built with Docusaurus.