Casting MapResult

John Colvin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jun 16 09:37:34 PDT 2015


On Tuesday, 16 June 2015 at 14:43:17 UTC, jmh530 wrote:
> On Tuesday, 16 June 2015 at 13:15:05 UTC, John Colvin wrote:
>
>>
>> *consistent as in different implementations performing very 
>> similarly instead of seeing big differences like you have here.
>
> That's a good point. I tried numpy's exp (which uses C at a low 
> level, I think) and found it takes about a fifth as long. I 
> went searching for numpy's implementation, but could only find 
> a C header containing the function prototype.
>
> I only have dmd on my work computer and it probably would be a 
> hassle to get the others working right now.

Have you tried using core.stdc.math.exp instead of std.math.exp? 
It's probably faster, although not necessarily quite as accurate.

If you want really fast exponentiation of an array though, you 
want to use SIMD. Something like http://www.yeppp.info would be 
easy to use from D.


More information about the Digitalmars-d-learn mailing list