/**
 * Mandelbulber v2, a 3D fractal generator  _%}}i*<.        ____                _______
 * Copyright (C) 2017 Mandelbulber Team   _>]|=||i=i<,     / __ \___  ___ ___  / ___/ /
 *                                        \><||i|=>>%)    / /_/ / _ \/ -_) _ \/ /__/ /__
 * This file is part of Mandelbulber.     )<=i=]=|=i<>    \____/ .__/\__/_//_/\___/____/
 * The project is licensed under GPLv3,   -<>>=|><|||`        /_/
 * see also COPYING file in this folder.    ~+{i%+++
 *
 * From M3D. A formula made by Trafassel, the original Ide's Formula thread
 * @reference http://www.fractalforums.com/videos/formula-21-%28julia-set-interpretation%29/

 * This file has been autogenerated by tools/populateUiInformation.php
 * from the function "Ides2Iteration" in the file fractal_formulas.cpp
 * D O    N O T    E D I T    T H I S    F I L E !
 */

REAL4 Ides2Iteration(REAL4 z, __constant sFractalCl *fractal, sExtendedAuxCl *aux)
{
	Q_UNUSED(aux);

	REAL4 z2 = z * z;
	REAL4 newZ;
	newZ.x = mad(fractal->transformCommon.constantMultiplier121.x, z2.x,
		-fractal->transformCommon.additionConstant0555.x * (z2.y + z2.z));
	newZ.y = fractal->transformCommon.constantMultiplier121.y * z.x * z.y * z.z;
	newZ.z = mad(fractal->transformCommon.constantMultiplier121.z, z2.z,
		-fractal->transformCommon.additionConstant0555.z * (z2.x + z2.y));
	newZ.w = z.w;
	z = newZ + z;
	return z;
}