std.math.pow produces incorrect results when used with std.parallelism

2013-06-01 Thread finalpatch

the following code compiled with GDC shows the bug
(I'm using the gcc 4.8 windows mingw32 version from 
https://bitbucket.org/goshawk/gdc/downloads)


import std.math;
import std.stdio;
import std.range;
import std.parallelism;

void main()
{
enum n = 1000;
float step = 1.0f/n;

float[n] results_singlethreaded;
float[n] results_multithreaded;

foreach(i; iota(n))
results_singlethreaded[i] = pow(step * i, 0.4545f);
foreach(i; parallel(iota(n)))
results_multithreaded[i] = pow(step * i, 0.4545f);
foreach(i; iota(n))
assert(results_singlethreaded[i] == 
results_multithreaded[i]);

}

~/Desktop $ ./test.exe
core.exception.AssertError@test.d(26): Assertion failure

The same code passes without assertion when compiled with DMD.


Re: std.math.pow produces incorrect results when used with std.parallelism

2013-06-02 Thread finalpatch

Bug reported as #58
http://bugzilla.gdcproject.org/show_bug.cgi?id=58
I have added the output from feqrel to the report.

On Sunday, 2 June 2013 at 08:28:42 UTC, Johannes Pfau wrote:


The same code passes without assertion when compiled with DMD.


Please file a bug report on bugzilla.gdcproject.org

I can't reproduce this on linux/posix. Could you use feqrel to 
check

the number of equal bits of the single/multithreaded results?