-
Notifications
You must be signed in to change notification settings - Fork 292
Closed
Description
#include <iostream>
#include "xsimd/xsimd.hpp"
int main(int argc, char *argv[]) {
std::cout << xsimd::pow(xsimd::batch<float>(0.f), xsimd::batch<float>(-1.f)) << "\n";
std::cout << std::pow(0.f, -1.f) << "\n";
}
produces (on sse2+ and neon)
(0, 0, 0, 0)
inf
The reason is the fix applied in #684. The result is always set to zero for input zero to work around floating point exceptions, but it should be infinity for 0^(negative number). I worked on a patch, but wasn't clever enough to do this without adding an extra comparison and an extra select(). This feels like it should be possible with one clever check somehow.
Metadata
Metadata
Assignees
Labels
No labels