diff --git a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette.rsh b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette.rsh
index 9429564..a1e4ae5 100644
--- a/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette.rsh
+++ b/tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/vignette.rsh
@@ -14,48 +14,43 @@
  * limitations under the License.
  */
 
-static float2 scale;
-static float2 center, dimensions;
-static float range, inv_max_dist, shade, slope;
-static float2 overDimensions;
+static float2 neg_center, axis_scale, inv_dimensions;
+static float sloped_neg_range, sloped_inv_max_dist, shade, opp_shade;
 
 void init_vignette(uint32_t dim_x, uint32_t dim_y, float center_x, float center_y,
         float desired_scale, float desired_shade, float desired_slope) {
 
-    center.x = center_x;
-    center.y = center_y;
-    dimensions.x = (float)dim_x;
-    dimensions.y = (float)dim_y;
+    neg_center.x = -center_x;
+    neg_center.y = -center_y;
+    inv_dimensions.x = 1.f / (float)dim_x;
+    inv_dimensions.y = 1.f / (float)dim_y;
 
-    float max_dist = 0.5;
-    if (dim_x > dim_y) {
-        scale.x = 1.0;
-        scale.y = dimensions.y / dimensions.x;
-        max_dist *= sqrt(scale.y*scale.y + 1);
-    } else {
-        scale.x = dimensions.x / dimensions.y;
-        scale.y = 1.0;
-        max_dist *= sqrt(scale.x*scale.x + 1);
-    }
-    inv_max_dist = 1.0/max_dist;
+    axis_scale = (float2)1.f;
+    if (dim_x > dim_y)
+        axis_scale.y = (float)dim_y / (float)dim_x;
+    else
+        axis_scale.x = (float)dim_x / (float)dim_y;
+
+    const float max_dist = 0.5 * length(axis_scale);
+    sloped_inv_max_dist = desired_slope * 1.f/max_dist;
+
     // Range needs to be between 1.3 to 0.6. When scale is zero then range is
     // 1.3 which means no vignette at all because the luminousity difference is
     // less than 1/256.  Expect input scale to be between 0.0 and 1.0.
-    range = 1.3 - 0.7*sqrt(desired_scale);
-    shade = desired_shade;
-    slope = desired_slope;
+    const float neg_range = 0.7*sqrt(desired_scale) - 1.3;
+    sloped_neg_range = exp(neg_range * desired_slope);
 
-    overDimensions = ((float2)1.f) / dimensions;
+    shade = desired_shade;
+    opp_shade = 1.f - desired_shade;
 }
 
 void root(const uchar4 *in, uchar4 *out, uint32_t x, uint32_t y) {
     // Convert x and y to floating point coordinates with center as origin
     const float4 fin = convert_float4(*in);
-    float2 coord = {(float)x, (float)y};
-    coord *= overDimensions;
-    coord -= center;
-    const float dist = length(scale * coord);
-    const float lumen = shade / (1.0 + exp((dist * inv_max_dist - range) * slope)) + (1.0 - shade);
+    const float2 inCoord = {(float)x, (float)y};
+    const float2 coord = mad(inCoord, inv_dimensions, neg_center);
+    const float sloped_dist_ratio = length(axis_scale * coord)  * sloped_inv_max_dist;
+    const float lumen = opp_shade + shade / ( 1.0 + sloped_neg_range * exp(sloped_dist_ratio) );
     float4 fout;
     fout.rgb = fin.rgb * lumen;
     fout.w = fin.w;
