Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
merge latest lieonn, no bin chg.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitsofcotton authored Jul 10, 2024
1 parent b0ba8a5 commit 17d3227
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lieonn.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2720,7 +2720,10 @@ template <typename T> static inline SimpleVector<T> linearInvariant(const Simple
template <typename T> static inline T makeProgramInvariantPartial(const T& in, const T& ratio, const bool& on01 = false) {
auto res(on01 ? in :
((atan(- in) / atan(T(int(1))) / T(int(2))) + T(int(1))) / T(int(2)) );
if(res == T(int(0)) ) res = T(int(1));
// N.B. better 0 handling, {0, 1} vanished before.
res += sqrt(SimpleMatrix<T>().epsilon());
// N.B. CPU float glitch.
res /= T(int(1)) + sqrt(sqrt(SimpleMatrix<T>().epsilon()));
assert(T(int(0)) < res && res <= T(int(1)));
return res *= ratio;
}
Expand Down

0 comments on commit 17d3227

Please sign in to comment.