[R-SIG-Mac] .Machine differences between Intel and M1

Matthew Heun m@tthew@heun @end|ng |rom me@com
Tue Dec 21 21:21:30 CET 2021


All:

I'm seeing some test failures on a new M1 Pro machine that I do not see on my Intel machine.  I'm investigating whether the test failures are caused by machine precision differences.  On my M1 Pro machine, differences of large numbers are greater than a specified tolerance.  (On my Intel machine, differences between the supposed same numbers are within tolerance.)

The output of .Machine shows some differences.  I have 2 questions below, each identified by "****".

(1) For sizeof.longdouble, I see the following:

Intel machine:

> $sizeof.longdouble
> [1] 16

M1 Pro machine:

> $sizeof.longdouble
> [1] 8



?.Machine says:

sizeof.longdouble	
the number of bytes in a C long double type. Will be zero if there is no such type (or its use was disabled when R was built), otherwise possibly12 (most 32-bit builds) or 16 (most 64-bit builds).

The M1 Pro uses a 64-bit architecture.  So this result is surprising to me.

Furthermore, 

> > capabilities("long.double")
> long.double 
>        TRUE 

So somebody thinks that long doubles are supported.

**** Is the difference in sizeof.longdouble between the Intel and M1 architectures expected?


(2) Also, my M1 Pro machine is missing additional fields (that the Intel machine reports):

> $longdouble.eps
> [1] 1.084202e-19
> 
> $longdouble.neg.eps
> [1] 5.421011e-20
> 
> $longdouble.digits
> [1] 64
> 
> $longdouble.rounding
> [1] 5
> 
> $longdouble.guard
> [1] 0
> 
> $longdouble.ulp.digits
> [1] -63
> 
> $longdouble.neg.ulp.digits
> [1] -64
> 
> $longdouble.exponent
> [1] 15
> 
> $longdouble.min.exp
> [1] -16382
> 
> $longdouble.max.exp
> [1] 16384

**** Is there a reason why the above entries are missing from the output of .Machine on the M1 Pro machine?



My R installation is:  4.1.2 Patched (2021/12/16, r81394)



Any help will be appreciated.



Cheers,

Matt



More information about the R-SIG-Mac mailing list