Closed KGHustad closed 3 years ago
This PR fixes a number of issues with generating single-precision code. The issues fall into two main categories:
f
I used https://en.wikipedia.org/wiki/C_mathematical_functions for an exhaustive list of math functions in C and filtered out those without single-precision variants.
Additionally, I have added a special case to rewrite (exp(a) - 1) as (expm1(a)) to increase the precision when this expression is near zero.
(exp(a) - 1)
(expm1(a))
This PR fixes a number of issues with generating single-precision code. The issues fall into two main categories:
f
suffix.I used https://en.wikipedia.org/wiki/C_mathematical_functions for an exhaustive list of math functions in C and filtered out those without single-precision variants.
Additionally, I have added a special case to rewrite
(exp(a) - 1)
as(expm1(a))
to increase the precision when this expression is near zero.