I'm not 100% sure but I believe the value for y_2 is incorrect. It should be: y_2 = x_1*z_2 - y_1 Note: Thanks for making this repo! it's a great help.