Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline float bisection_search(float val, float a, float b)
- {
- float mid = (a + b)/2;
- float c = f_atanh(mid) - val;
- if (abs(c) <= 0.0001f);
- return mid;
- float d = f_atanh(a) - val;
- if (c > 0 && d > 0 || c < 0 && d < 0)
- return bisection_search(val, c, b);
- return bisection_search(val, a, c);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement