<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Basic//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="150px" height="150px" viewBox="0 0 150 150" version="1.1" baseProfile="basic">
	<defs>
		<!-- Definitions:
			t = 100
			1/t = 0.01
			a = 75/(150*0.71) = 0.70422535211267605633802816901408 (this corresponds to the value at (1,0), taken to be the value at the center of the right boundary, and results in the correct scaling as x is actually 0.5*x+0.5)
			1/a = 1.42
			
			invz = 1/(t*z)
			pf   = t*a*invz*(x+0.5) - 0.5*t*a*invz + 0.5
			
			For iterative refinement (substituting zpf for x and solving):
			
			t*a*invz*zpf = pf + 0.5*t*a*invz - 0.5
			zpf = pf/(t*a*invz) + 0.5 - 0.5/(t*a*invz)
			    = (1/(t*a))*t*z*pf - 0.5*t*z/(t*a) + 0.5
			    = (1/a)*z*pf - 0.5*(1/a)*z + 0.5
			
			r + 0.5 = x - zpf + 0.5
			
			c + 0.5 = pf - (t*a*invz*zpf - 0.5*t*a*invz + 0.5) + 0.5
			        = t*a*invz*(x-zpf) + 0.5
			        = t*a*invz*(r+0.5) - 0.5*t*a*invz + 0.5
			
			pf' = pf + (c+0.5) - 0.5
		-->

		<g id="symbolz">
			<radialGradient id="gradientz" r="71%"> <!-- Slightly more than sqrt(2)*50% -->
				<stop offset="0" stop-color="rgb(1%,0%,0%)"/> <!-- The red channel corresponds to 1/t -->
				<stop offset="0.01" stop-color="rgb(1%,0%,0%)"/> <!-- The offset corresponds to 1/t. -->
				<stop offset="1" stop-color="#f00"/>
			</radialGradient>
			<rect width="150" height="150" fill="url(#gradientz)"/>
		</g>

		<g id="symbolx">
			<!-- It might be possible to compensate for the flat area in the middle
			     of z (that tries to prevent a division by zero, amongst other things)
			     by adjusting this gradient in the middle as well... -->
			<linearGradient id="gradientx">
				<stop offset="0" stop-color="#000"/>
				<stop offset="1" stop-color="#F00"/>
			</linearGradient>
			<rect width="150" height="150" fill="url(#gradientx)"/>
		</g>

		<g id="symbolstops">
			<linearGradient id="gradientstops" x1="1%" x2="99%"> <!-- Not completely to the edge to avoid sampling "over the edge" -->
				<stop offset="0" stop-color="#f00"/>
				<stop offset="0.33" stop-color="#0f0"/>
				<stop offset="0.67" stop-color="#00f"/>
				<stop offset="1" stop-color="#000" stop-opacity="0"/>
			</linearGradient>
			<rect width="150" height="150" fill="url(#gradientstops)"/>
		</g>

		<g id="symbolxoffset">
			<linearGradient id="gradientxoffset">
				<stop offset="0" stop-color="#F00"/>
				<stop offset="1" stop-color="#000"/>
			</linearGradient>
			<rect width="150" height="150" fill="url(#gradientxoffset)"/>
		</g>

		<filter id="gradient" x="0" y="0" width="1" height="1" color-interpolation-filters="sRGB">
			<!-- Create proper gradient surface in f -->
			<feImage xlink:href="#symbolz" result="z"/>
			<feComponentTransfer in="z" result="invz">
				<feFuncR type="gamma" amplitude="0.01" exponent="-1"/> <!-- The amplitude corresponds to 1/t -->
			</feComponentTransfer>
			<feImage xlink:href="#symbolx" result="x"/>
			<feComposite in="invz" in2="x" result="pf" operator="arithmetic" k1="70.422535211267605633802816901408" k2="-35.211267605633802816901408450704" k4="0.5"/>
			<!-- First iterative refinement block -->
			<feComposite in="z" in2="pf" result="zpf" operator="arithmetic" k1="1.136" k2="-0.568" k4="0.5"/> <!-- Scaled by 4/5 (but still centered around 0.5) so that values slightly outside the range [0,1] can also be represented (and corrected for) -->
			<feComposite in="x" in2="zpf" result="r" operator="arithmetic" k2="1" k3="-1.25" k4="0.625"/> <!-- As zpf was scaled but k4 was kept at 0.5 this k4 value needs to be adjusted correspondingly (0.5*5/4=0.625) -->
			<feComposite in="invz" in2="r" result="c" operator="arithmetic" k1="70.422535211267605633802816901408" k2="-35.211267605633802816901408450704" k4="0.5"/>
			<feComposite in="pf" in2="c" result="pf" operator="arithmetic" k2="1" k3="1" k4="-0.5"/>
			<!-- Second iterative refinement block -->
			<feComposite in="z" in2="pf" result="zpf" operator="arithmetic" k1="1.42" k2="-0.71" k4="0.5"/>
			<feComposite in="x" in2="zpf" result="r" operator="arithmetic" k2="1" k3="-1" k4="0.5"/>
			<feComposite in="invz" in2="r" result="c" operator="arithmetic" k1="70.422535211267605633802816901408" k2="-35.211267605633802816901408450704" k4="0.5"/>
			<feComposite in="pf" in2="c" result="pf" operator="arithmetic" k2="1" k3="1" k4="-0.5"/>
			<!--<feColorMatrix in="pf" type="matrix" values="1 0 0 0 0  1 0 0 0 0  1 0 0 0 0  0 0 0 0 1" />-->
			<feColorMatrix in="pf" result="f" type="matrix" values="0.98 0 0 0 0.01 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0"/> <!-- The scaling and offset of the red channel are slightly adjusted in correspondence with the slightly "compressed" gradient -->
			<!-- Color gradient -->
			<feImage xlink:href="#symbolxoffset" result="xoffset"/>
			<feComposite in="f" in2="xoffset" result="fp" operator="arithmetic" k2="0.5" k3="0.5"/>
			<feImage xlink:href="#symbolstops" result="stops"/>
			<feDisplacementMap in="stops" in2="fp" scale="300" xChannelSelector="R" yChannelSelector="G"/> <!-- The scale is 2*150 -->
		</filter>
	</defs>
	<rect width="150" height="150" filter="url(#gradient)"/>
</svg>