Skip to content

clang is suboptimal for log(pow(x, y)) with fast-math #76549

Closed
@k-arrows

Description

@k-arrows

Test case:
https://godbolt.org/z/1fvYPxY37

#include<math.h>

double test1(double x) { 
  return log(pow(x, -3)); 
}

double test2(double x) { 
  return -3 * log(x); 
}

My expectation is that the output of test1 will be the same as test2.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions