Re: [PATCH] Simplify pow with constant

2017-08-04 Thread Joseph Myers
On Fri, 4 Aug 2017, Richard Biener wrote: > >> Do this only for fast-math as accuracy is reduced. This is much faster > >> since pow is more complex than exp - with a current GLIBC the speedup > >> is more than 7 times for this transformation. > > > > Is it bound to be so on future glibc

Re: [PATCH] Simplify pow with constant

2017-08-04 Thread Wilco Dijkstra
Richard Biener wrote: > On Fri, Aug 4, 2017 at 2:26 PM, Alexander Monakov wrote: > > On Fri, 4 Aug 2017, Wilco Dijkstra wrote: > >> This patch simplifies pow (C, x) into exp (x * C1), where C1 = log (C). > > > > I don't think you can do that for non-positive C. True, that can

Re: [PATCH] Simplify pow with constant

2017-08-04 Thread Richard Biener
On Fri, Aug 4, 2017 at 2:26 PM, Alexander Monakov wrote: > On Fri, 4 Aug 2017, Wilco Dijkstra wrote: >> This patch simplifies pow (C, x) into exp (x * C1), where C1 = log (C). > > I don't think you can do that for non-positive C. Hmm, the question is also how this interacts

Re: [PATCH] Simplify pow with constant

2017-08-04 Thread Alexander Monakov
On Fri, 4 Aug 2017, Wilco Dijkstra wrote: > This patch simplifies pow (C, x) into exp (x * C1), where C1 = log (C). I don't think you can do that for non-positive C. > Do this only for fast-math as accuracy is reduced. This is much faster > since pow is more complex than exp - with a current

[PATCH] Simplify pow with constant

2017-08-04 Thread Wilco Dijkstra
This patch simplifies pow (C, x) into exp (x * C1), where C1 = log (C). Do this only for fast-math as accuracy is reduced. This is much faster since pow is more complex than exp - with a current GLIBC the speedup is more than 7 times for this transformation. ChangeLog: 2017-08-04 Wilco Dijkstra