Thread overview
[Issue 19732] make std.complex.expi fast.
Mar 12, 2019
Bastiaan Veelo
Mar 12, 2019
Bastiaan Veelo
Oct 01, 2019
Bastiaan Veelo
Oct 01, 2019
kinke
Oct 01, 2019
Bastiaan Veelo
Oct 01, 2019
Bastiaan Veelo
March 12, 2019
https://issues.dlang.org/show_bug.cgi?id=19732

Bastiaan Veelo <Bastiaan@Veelo.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All
                 OS|Windows                     |All

--
March 12, 2019
https://issues.dlang.org/show_bug.cgi?id=19732

--- Comment #1 from Bastiaan Veelo <Bastiaan@Veelo.net> ---
Related documentation issues: https://issues.dlang.org/show_bug.cgi?id=19733

--
October 01, 2019
https://issues.dlang.org/show_bug.cgi?id=19732

Bastiaan Veelo <Bastiaan@Veelo.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Bastiaan Veelo <Bastiaan@Veelo.net> ---
Nowadays, the x87 instruction fsincos is slower, not faster, than computing sin and cos separately.

https://stackoverflow.com/questions/12485190/calling-fsincos-instruction-in-llvm-slower-than-calling-libc-sin-cos-functions

Therefore, there is no need for assembly in the expi() implementation, which was removed in https://github.com/dlang/phobos/commit/029440c2f9008ff2fe8803c97900394bfe9b4e4e.

--
October 01, 2019
https://issues.dlang.org/show_bug.cgi?id=19732

kinke <kinke@gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kinke@gmx.net

--- Comment #3 from kinke <kinke@gmx.net> ---
(In reply to Bastiaan Veelo from comment #2)
> Nowadays, the x87 instruction fsincos is slower, not faster, than computing sin and cos separately.
> 
> https://stackoverflow.com/questions/12485190/calling-fsincos-instruction-in- llvm-slower-than-calling-libc-sin-cos-functions

Have you actually tested this on your box? I recently came to completely different results with LDC on my i5-3550: https://github.com/ldc-developers/ldc/pull/2855#issuecomment-491560143

Note that `long double` is extremely rare in C(++), but ubiquitous in D.

--
October 01, 2019
https://issues.dlang.org/show_bug.cgi?id=19732

--- Comment #4 from Bastiaan Veelo <Bastiaan@Veelo.net> ---
(In reply to kinke from comment #3)
> (In reply to Bastiaan Veelo from comment #2)
> > Nowadays, the x87 instruction fsincos is slower, not faster, than computing sin and cos separately.
> > 
> > https://stackoverflow.com/questions/12485190/calling-fsincos-instruction-in- llvm-slower-than-calling-libc-sin-cos-functions
> 
> Have you actually tested this on your box? I recently came to completely different results with LDC on my i5-3550: https://github.com/ldc-developers/ldc/pull/2855#issuecomment-491560143
> 
> Note that `long double` is extremely rare in C(++), but ubiquitous in D.

No I have not. What I'd like to know is why fsincos was removed from std.complex.expi in 2012, and why it wasn't readed when std.math.expi was deprecated last year.

Feel free to reopen, as you have done the test.

--
October 01, 2019
https://issues.dlang.org/show_bug.cgi?id=19732

--- Comment #5 from Bastiaan Veelo <Bastiaan@Veelo.net> ---
Maybe there should be a std.math.sincos that does not depend on complex numbers at all?

--