Simple workaround to use fast computation is to use functions from spec.
header similar to following:

#ifndef FAST_MATH_H
#define FAST_MATH_H

#include <cmath>

inline double fast_sin(long double x) {
    return sinl(x);
}

inline double fast_cos(long double x) {
    return cosl(x);
}

inline double fast_tan(long double x) {
    return tanl(x);
}

inline double fast_asin(long double x) {
    return asinl(x);
}

inline double fast_acos(long double x) {
    return acosl(x);
}

inline double fast_atan(long double x) {
    return atanl(x);
}

inline double fast_atan2(long double x, long double y) {
    return atan2l(x, y);
}

inline double fast_sinh(long double x) {
    return sinhl(x);
}

inline double fast_cosh(long double x) {
    return coshl(x);
}

inline double fast_asinh(long double x) {
    return asinhl(x);
}

inline double fast_acosh(long double x) {
    return acoshl(x);
}

inline double fast_pow(long double x, long double y) {
    return powl(x, y);
}

inline double fast_sqrt(long double x) {
    return sqrtl(x);
}

inline double fast_exp(long double x) {
    return expl(x);
}

inline double fast_log(long double x) {
    return logl(x);
}

inline double fast_log10(long double x) {
    return log10l(x);
}

#endif  /* FAST_MATH_H */

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/192134

Title:
  slow math sin function for some values on amd64

To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/192134/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to