• Medientyp: E-Artikel
  • Titel: One polynomial approximation to produce correctly rounded results of an elementary function for multiple representations and rounding modes
  • Beteiligte: Lim, Jay P.; Nagarakatte, Santosh
  • Erschienen: Association for Computing Machinery (ACM), 2022
  • Erschienen in: Proceedings of the ACM on Programming Languages, 6 (2022) POPL, Seite 1-28
  • Sprache: Englisch
  • DOI: 10.1145/3498664
  • ISSN: 2475-1421
  • Schlagwörter: Safety, Risk, Reliability and Quality ; Software
  • Entstehung:
  • Anmerkungen:
  • Beschreibung: <jats:p> Mainstream math libraries for floating point (FP) do not produce correctly rounded results for all inputs. In contrast, CR-LIBM and RLIBM provide correctly rounded implementations for a specific FP representation with one rounding mode. Using such libraries for a representation with a new rounding mode or with different precision will result in wrong results due to double rounding. This paper proposes a novel method to generate a single polynomial approximation that produces correctly rounded results for all inputs for multiple rounding modes and multiple precision configurations. To generate a correctly rounded library for <jats:italic>n</jats:italic> -bits, our key idea is to generate a polynomial approximation for a representation with <jats:italic>n</jats:italic> +2-bits using the <jats:italic>round-to-odd</jats:italic> mode. We prove that the resulting polynomial approximation will produce correctly rounded results for all five rounding modes in the standard and for multiple representations with <jats:italic>k</jats:italic> -bits such that | <jats:italic>E</jats:italic> | +1 &lt; <jats:italic>k</jats:italic> ≤ <jats:italic>n</jats:italic> , where | <jats:italic>E</jats:italic> | is the number of exponent bits in the representation. Similar to our prior work in the RLIBM project, we approximate the correctly rounded result when we generate the library with <jats:italic>n</jats:italic> +2-bits using the round-to-odd mode. We also generate polynomial approximations by structuring it as a linear programming problem but propose enhancements to polynomial generation to handle the round-to-odd mode. Our prototype is the first 32-bit float library that produces correctly rounded results with all rounding modes in the IEEE standard for all inputs with a single polynomial approximation. It also produces correctly rounded results for any FP configuration ranging from 10-bits to 32-bits while also being faster than mainstream libraries. </jats:p>
  • Zugangsstatus: Freier Zugang