cyb70289 commented on issue #12681:
URL: https://github.com/apache/arrow/issues/12681#issuecomment-2490386237
I cannot find an example.
I dumped the operands of error case, as shown in below test code.
Build with gcc -O3.
On Arm server, it outputs mismatch:
```
f=0.071641, a=86.263564, b=82.135635
r1 = 82.43136555356123551519
r2 = 82.43136555356122130434
!!!!!! MISMATCH !!!!!!
r1 register = 40549b9b7e444aa7
r2 register = 40549b9b7e444aa6
```
On x86 server, no error:
```
f=0.071641, a=86.263564, b=82.135635
r1 = 82.43136555356123551519
r2 = 82.43136555356123551519
```
test code
```
#include <stdio.h>
// 64bit double register dumped from error case
volatile long fl=0x3fb257174cbebc00, al=0x405590de3a8ef93d,
bl=0x405488ae3e2af9f6;
int main() {
volatile double f = *(volatile double*)&fl;
volatile double a = *(volatile double*)&al;
volatile double b = *(volatile double*)&bl;
printf("f=%f, a=%f, b=%f\n", f, a, b);
double r1 = f * a + (1 - f) * b;
double r2 = (1 - f) * b + f * a;
printf("r1 = %.20f\n", r1);
printf("r2 = %.20f\n", r2);
if (r1 != r2) {
printf("!!!!!! MISMATCH !!!!!!\n");
printf("r1 register = %lx\n", *(long*)&r1);
printf("r2 register = %lx\n", *(long*)&r2);
}
return 0;
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]