From: peter.noreply@tin.it   
      
   On Mon, 14 Jul 2025 06:04:13 GMT   
   anton@mips.complang.tuwien.ac.at (Anton Ertl) wrote:   
      
   > dxf writes:   
   > >On 13/07/2025 7:01 pm, Anton Ertl wrote:   
   > >> ...   
   > >> For Forth, Inc. and MPE AFAIK their respective IA-32 Forth system   
   > >> was the only one with hardware FP for many years, so there   
   > >> probably was little pressure from users for bit-identical results   
   > >> with, say, SPARC, because they did not have a Forth system that   
   > >> ran on SPARC.   
   > >   
   > >What do you mean by "bit-identical results"? Since SSE2 comes   
   > >without transcendentals (or basics such as FABS and FNEGATE) and   
   > >implementers are expected to supply their own, if anything, I expect   
   > >results across platforms and compilers to vary.   
   >   
   > There are operations for which IEEE 754 specifies the result to the   
   > last bit (except that AFAIK the representation of NaNs is not   
   > specified exactly), among them F+ F- F* F/ FSQRT, probably also   
   > FNEGATE and FABS. It does not specify the exact result for   
   > transcendental functions, but if your implementation performs the same   
   > bit-exact operations for computing a transcendental function on two   
   > IEEE 754 compliant platforms, the result will be bit-identical (if it   
   > is a number). So just use the same implementations of transcentental   
   > functions, and your results will be bit-identical; concerning the   
   > NaNs, if you find a difference, check if the involved values are NaNs.   
   >   
   > - anton   
      
   This of course excludes the use of libm or other math libraries provided   
   by the distribution. They will change between releases.   
   I have with success used fdlibm, that is the base for many others. I   
   gives max 1 ulp rounding error. I have now also tested the core-math   
   project https://gitlab.inria.fr/core-math/core-math This gives   
   correctly rounded functions at the cost of being 10 times the compiled   
   size! A complete library with trig, log, pow etc comes in at 500k.   
      
   Peter   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|