From 7b1cd5585db8b0b7e844a08c0732477137ca9991 Mon Sep 17 00:00:00 2001 From: Bastiaan Veelo Date: Tue, 1 Oct 2019 11:49:05 +0200 Subject: [PATCH 1/2] Resolve expi() documentation issues due to deprecation. Fixes issue 19733 https://issues.dlang.org/show_bug.cgi?id=19733 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 commit 029440c2f9008ff2fe8803c97900394bfe9b4e4e. --- std/complex.d | 6 ------ std/math.d | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/std/complex.d b/std/complex.d index 7dba21f97dd..ef124ebf1c4 100644 --- a/std/complex.d +++ b/std/complex.d @@ -864,12 +864,6 @@ deprecated /** Params: y = A real number. Returns: The value of cos(y) + i sin(y). - - Note: - `expi` is included here for convenience and for easy migration of code - that uses $(REF _expi, std,math). Unlike $(REF _expi, std,math), which uses the - x87 $(I fsincos) instruction when possible, this function is no faster - than calculating cos(y) and sin(y) separately. */ Complex!real expi(real y) @trusted pure nothrow @nogc { diff --git a/std/math.d b/std/math.d index d58b5bae827..5e011c7b321 100644 --- a/std/math.d +++ b/std/math.d @@ -23,7 +23,7 @@ $(TR $(TDNW Classics) $(TD $(TR $(TDNW Trigonometry) $(TD $(MYREF sin) $(MYREF cos) $(MYREF tan) $(MYREF asin) $(MYREF acos) $(MYREF atan) $(MYREF atan2) $(MYREF sinh) $(MYREF cosh) $(MYREF tanh) - $(MYREF asinh) $(MYREF acosh) $(MYREF atanh) $(MYREF expi) + $(MYREF asinh) $(MYREF acosh) $(MYREF atanh) )) $(TR $(TDNW Rounding) $(TD $(MYREF ceil) $(MYREF floor) $(MYREF round) $(MYREF lround) From 297d5baa97e0abe7c6ce8940a4b8bb3edae4cff1 Mon Sep 17 00:00:00 2001 From: Bastiaan Veelo Date: Tue, 1 Oct 2019 11:49:05 +0200 Subject: [PATCH 2/2] Resolve expi() documentation issues due to deprecation. Fix issue 19733: https://issues.dlang.org/show_bug.cgi?id=19733 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 commit 029440c2f9008ff2fe8803c97900394bfe9b4e4e. --- std/complex.d | 6 ------ std/math.d | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/std/complex.d b/std/complex.d index 7dba21f97dd..ef124ebf1c4 100644 --- a/std/complex.d +++ b/std/complex.d @@ -864,12 +864,6 @@ deprecated /** Params: y = A real number. Returns: The value of cos(y) + i sin(y). - - Note: - `expi` is included here for convenience and for easy migration of code - that uses $(REF _expi, std,math). Unlike $(REF _expi, std,math), which uses the - x87 $(I fsincos) instruction when possible, this function is no faster - than calculating cos(y) and sin(y) separately. */ Complex!real expi(real y) @trusted pure nothrow @nogc { diff --git a/std/math.d b/std/math.d index d58b5bae827..5e011c7b321 100644 --- a/std/math.d +++ b/std/math.d @@ -23,7 +23,7 @@ $(TR $(TDNW Classics) $(TD $(TR $(TDNW Trigonometry) $(TD $(MYREF sin) $(MYREF cos) $(MYREF tan) $(MYREF asin) $(MYREF acos) $(MYREF atan) $(MYREF atan2) $(MYREF sinh) $(MYREF cosh) $(MYREF tanh) - $(MYREF asinh) $(MYREF acosh) $(MYREF atanh) $(MYREF expi) + $(MYREF asinh) $(MYREF acosh) $(MYREF atanh) )) $(TR $(TDNW Rounding) $(TD $(MYREF ceil) $(MYREF floor) $(MYREF round) $(MYREF lround)