| 62 | #endif |
| 63 | } |
| 64 | static double Jmax(int m, int n) { |
| 65 | double rlow, rhigh = Jroot(m, n), rtry; |
| 66 | if (n == 0) |
| 67 | rlow = 0; |
| 68 | else |
| 69 | rlow = Jroot(m, n - 1); |
| 70 | double jplow = Jprime(m, rlow), jptry; |
| 71 | do { |
| 72 | rtry = rlow + (rhigh - rlow) * 0.5; |
| 73 | jptry = Jprime(m, rtry); |
| 74 | if (jplow * jptry < 0) |
| 75 | rhigh = rtry; |
| 76 | else |
| 77 | rlow = rtry; |
| 78 | } while (rhigh - rlow > rhigh * 1e-15); |
| 79 | return rtry; |
| 80 | } |
| 81 | |
| 82 | static double ktrans, kax; |
| 83 | static int m_for_J; |
no test coverage detected