1/**
2 * Mandelbulber v2, a 3D fractal generator  _%}}i*<.        ____                _______
3 * Copyright (C) 2020 Mandelbulber Team   _>]|=||i=i<,     / __ \___  ___ ___  / ___/ /
4 *                                        \><||i|=>>%)    / /_/ / _ \/ -_) _ \/ /__/ /__
5 * This file is part of Mandelbulber.     )<=i=]=|=i<>    \____/ .__/\__/_//_/\___/____/
6 * The project is licensed under GPLv3,   -<>>=|><|||`        /_/
7 * see also COPYING file in this folder.    ~+{i%+++
8 *
9 * TransfDifsBoxIteration  fragmentarium code, mdifs by knighty (jan 2012)
10
11 * This file has been autogenerated by tools/populateUiInformation.php
12 * from the file "fractal_transf_difs_box.cpp" in the folder formula/definition
13 * D O    N O T    E D I T    T H I S    F I L E !
14 */
15
16REAL4 TransfDIFSBoxIteration(REAL4 z, __constant sFractalCl *fractal, sExtendedAuxCl *aux)
17{
18	REAL4 zc = z;
19	REAL4 boxSize = fractal->transformCommon.additionConstant111;
20	zc = fabs(zc) - boxSize;
21	zc.x = max(zc.x, 0.0f);
22	zc.y = max(zc.y, 0.0f);
23	zc.z = max(zc.z, 0.0f);
24	REAL zcd = length(zc);
25
26	aux->dist = min(aux->dist, zcd / (aux->DE + 1.0f));
27	return z;
28}