 	#define NEWTON_UNROLLER	#pragma unroll NEWTON_UNROLL
 #else
 	#define NEWTON_UNROLLER #pragma unroll 1
+#endif
+#ifdef WARP_VOTING
+	#define ANY(X) (__any((X)))
+	#define ALL(X) (__all((X)))
+#else
+	#define ANY(X) ((X))
+	#define ALL(X) ((X))
 #endif
 #define Max_no_steps (200000)
 #define NewtonMaxit (8)


            NewtonDone = (NewtonRate * NewtonIncrement <= NewtonTol);
#ifndef NEWTON_UNROLL
            if (NewtonDone) break;
            if (NewtonIter == NewtonMaxit - 1) {
            	//todo implement return codes
				y[0] = logf(-1);
				return;
            }
#else //only break if it's at the end of the unroll
            if (NewtonDone && (NewtonIter + 1) % NewtonIter == 0) break;
            if ((NewtonIter + 1) % NewtonIter == 0 && NewtonIter == NewtonMaxit - 1) {
            	//todo implement return codes
				y[0] = logf(-1);
				return;
            }
#endif
		}
		if (!NewtonDone) {
			H = Fac * H;
			Reject = true;
			SkipJac = true;

			}
		}
		Nsteps += 1;
		if (Nsteps >= Max_no_steps)
		{
			y[0] = logf(-1);
			return;
		}
		if (0.1 * fabs(H) <= fabs(t) * Roundoff)
		{
			y[0] = logf(-1);
			return;
		}
