*ja = (jt * r - t * jr) / R;
}
+static inline void ses_split_r(double* r1, double* jr1, double tr, double jtr, double r0, double jr0)
+{
+ double R;
+
+ R = tr * tr + jtr * jtr;
+ tr /= R;
+ jtr /= -R;
+
+ R = r0* r0 + jr0 * jr0;
+ r0 /= R;
+ jr0 /= -R;
+
+ tr -= r0;
+ jtr -= jr0;
+
+ R = tr * tr + jtr * jtr;
+ *r1 = tr / R;
+ *jr1 = jtr / -R;
+}
+
+static inline void ses_merge_r(double* tr, double* jtr, double r0, double jr0, double r1, double jr1)
+{
+ double R;
+
+ R = r0* r0 + jr0 * jr0;
+ r0 /= R;
+ jr0 /= -R;
+
+ R = r1* r1 + jr1 * jr1;
+ r1 /= R;
+ jr1 /= -R;
+
+ r0 += r1;
+ jr0 += jr1;
+
+ R = r0* r0 + jr0 * jr0;
+ *tr = r0 / R;
+ *jtr = jr0 / -R;
+}
+
#endif