Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B

Percentage Accurate: 90.6% → 97.5%
Time: 3.5s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t):
	return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t)
	return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t)))
end
function tmp = code(x, y, z, t)
	tmp = (x * x) - ((y * 4.0) * ((z * z) - t));
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t: real): real =
	(x * x) - ((y * (4)) * ((z * z) - t))
END code
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 90.6% accurate, 1.0× speedup?

\[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (- (* x x) (* (* y 4.0) (- (* z z) t))))
double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
real(8) function code(x, y, z, t)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = (x * x) - ((y * 4.0d0) * ((z * z) - t))
end function
public static double code(double x, double y, double z, double t) {
	return (x * x) - ((y * 4.0) * ((z * z) - t));
}
def code(x, y, z, t):
	return (x * x) - ((y * 4.0) * ((z * z) - t))
function code(x, y, z, t)
	return Float64(Float64(x * x) - Float64(Float64(y * 4.0) * Float64(Float64(z * z) - t)))
end
function tmp = code(x, y, z, t)
	tmp = (x * x) - ((y * 4.0) * ((z * z) - t));
end
code[x_, y_, z_, t_] := N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
f(x, y, z, t):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t: real): real =
	(x * x) - ((y * (4)) * ((z * z) - t))
END code
x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right)

Alternative 1: 97.5% accurate, 0.6× speedup?

\[\begin{array}{l} \mathbf{if}\;y \cdot 4 \leq 5 \cdot 10^{-13}:\\ \;\;\;\;\mathsf{fma}\left(z, \left(z \cdot y\right) \cdot -4, \mathsf{fma}\left(t \cdot 4, y, x \cdot x\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right)\\ \end{array} \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (if (<= (* y 4.0) 5e-13)
  (fma z (* (* z y) -4.0) (fma (* t 4.0) y (* x x)))
  (fma x x (* (- t (* z z)) (* 4.0 y)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y * 4.0) <= 5e-13) {
		tmp = fma(z, ((z * y) * -4.0), fma((t * 4.0), y, (x * x)));
	} else {
		tmp = fma(x, x, ((t - (z * z)) * (4.0 * y)));
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(y * 4.0) <= 5e-13)
		tmp = fma(z, Float64(Float64(z * y) * -4.0), fma(Float64(t * 4.0), y, Float64(x * x)));
	else
		tmp = fma(x, x, Float64(Float64(t - Float64(z * z)) * Float64(4.0 * y)));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[N[(y * 4.0), $MachinePrecision], 5e-13], N[(z * N[(N[(z * y), $MachinePrecision] * -4.0), $MachinePrecision] + N[(N[(t * 4.0), $MachinePrecision] * y + N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
f(x, y, z, t):
	x in [-inf, +inf],
	y in [-inf, +inf],
	z in [-inf, +inf],
	t in [-inf, +inf]
code: THEORY
BEGIN
f(x, y, z, t: real): real =
	LET tmp = IF ((y * (4)) <= (499999999999999989943323814627807683626421753064761333007481880486011505126953125e-93)) THEN ((z * ((z * y) * (-4))) + (((t * (4)) * y) + (x * x))) ELSE ((x * x) + ((t - (z * z)) * ((4) * y))) ENDIF IN
	tmp
END code
\begin{array}{l}
\mathbf{if}\;y \cdot 4 \leq 5 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(z, \left(z \cdot y\right) \cdot -4, \mathsf{fma}\left(t \cdot 4, y, x \cdot x\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y #s(literal 4 binary64)) < 4.9999999999999999e-13

    1. Initial program 90.6%

      \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
    2. Step-by-step derivation
      1. Applied rewrites95.8%

        \[\leadsto \mathsf{fma}\left(z, \left(z \cdot y\right) \cdot -4, \mathsf{fma}\left(t \cdot 4, y, x \cdot x\right)\right) \]

      if 4.9999999999999999e-13 < (*.f64 y #s(literal 4 binary64))

      1. Initial program 90.6%

        \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
      2. Step-by-step derivation
        1. Applied rewrites92.7%

          \[\leadsto \mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right) \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 2: 93.3% accurate, 0.7× speedup?

      \[\begin{array}{l} \mathbf{if}\;\left|z\right| \leq 4.553313464441803 \cdot 10^{+204}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot y, \left|z\right| \cdot \left|z\right| - t, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\left|z\right|, \left(\left|z\right| \cdot y\right) \cdot -4, 4 \cdot \left(t \cdot y\right)\right)\\ \end{array} \]
      (FPCore (x y z t)
        :precision binary64
        :pre TRUE
        (if (<= (fabs z) 4.553313464441803e+204)
        (fma (* -4.0 y) (- (* (fabs z) (fabs z)) t) (* x x))
        (fma (fabs z) (* (* (fabs z) y) -4.0) (* 4.0 (* t y)))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (fabs(z) <= 4.553313464441803e+204) {
      		tmp = fma((-4.0 * y), ((fabs(z) * fabs(z)) - t), (x * x));
      	} else {
      		tmp = fma(fabs(z), ((fabs(z) * y) * -4.0), (4.0 * (t * y)));
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (abs(z) <= 4.553313464441803e+204)
      		tmp = fma(Float64(-4.0 * y), Float64(Float64(abs(z) * abs(z)) - t), Float64(x * x));
      	else
      		tmp = fma(abs(z), Float64(Float64(abs(z) * y) * -4.0), Float64(4.0 * Float64(t * y)));
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[N[Abs[z], $MachinePrecision], 4.553313464441803e+204], N[(N[(-4.0 * y), $MachinePrecision] * N[(N[(N[Abs[z], $MachinePrecision] * N[Abs[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(N[Abs[z], $MachinePrecision] * N[(N[(N[Abs[z], $MachinePrecision] * y), $MachinePrecision] * -4.0), $MachinePrecision] + N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
      
      f(x, y, z, t):
      	x in [-inf, +inf],
      	y in [-inf, +inf],
      	z in [-inf, +inf],
      	t in [-inf, +inf]
      code: THEORY
      BEGIN
      f(x, y, z, t: real): real =
      	LET tmp = IF ((abs(z)) <= (4553313464441803095702017080874442897530261790610683880936152257060862062836227398642403794392205383831373657791293678248013195343041934433486540824526049739045745406568539878196053709330357813653270429696)) THEN ((((-4) * y) * (((abs(z)) * (abs(z))) - t)) + (x * x)) ELSE (((abs(z)) * (((abs(z)) * y) * (-4))) + ((4) * (t * y))) ENDIF IN
      	tmp
      END code
      \begin{array}{l}
      \mathbf{if}\;\left|z\right| \leq 4.553313464441803 \cdot 10^{+204}:\\
      \;\;\;\;\mathsf{fma}\left(-4 \cdot y, \left|z\right| \cdot \left|z\right| - t, x \cdot x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(\left|z\right|, \left(\left|z\right| \cdot y\right) \cdot -4, 4 \cdot \left(t \cdot y\right)\right)\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < 4.5533134644418031e204

        1. Initial program 90.6%

          \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
        2. Step-by-step derivation
          1. Applied rewrites91.6%

            \[\leadsto \mathsf{fma}\left(-4 \cdot y, z \cdot z - t, x \cdot x\right) \]

          if 4.5533134644418031e204 < z

          1. Initial program 90.6%

            \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
          2. Step-by-step derivation
            1. Applied rewrites95.8%

              \[\leadsto \mathsf{fma}\left(z, \left(z \cdot y\right) \cdot -4, \mathsf{fma}\left(t \cdot 4, y, x \cdot x\right)\right) \]
            2. Taylor expanded in x around 0

              \[\leadsto \mathsf{fma}\left(z, \left(z \cdot y\right) \cdot -4, 4 \cdot \left(t \cdot y\right)\right) \]
            3. Step-by-step derivation
              1. Applied rewrites63.1%

                \[\leadsto \mathsf{fma}\left(z, \left(z \cdot y\right) \cdot -4, 4 \cdot \left(t \cdot y\right)\right) \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 3: 92.9% accurate, 0.7× speedup?

            \[\begin{array}{l} \mathbf{if}\;z \cdot z \leq 3.459163940415505 \cdot 10^{+267}:\\ \;\;\;\;\mathsf{fma}\left(-4 \cdot y, z \cdot z - t, x \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right)\\ \end{array} \]
            (FPCore (x y z t)
              :precision binary64
              :pre TRUE
              (if (<= (* z z) 3.459163940415505e+267)
              (fma (* -4.0 y) (- (* z z) t) (* x x))
              (fma x x (* (- t (* z z)) (* 4.0 y)))))
            double code(double x, double y, double z, double t) {
            	double tmp;
            	if ((z * z) <= 3.459163940415505e+267) {
            		tmp = fma((-4.0 * y), ((z * z) - t), (x * x));
            	} else {
            		tmp = fma(x, x, ((t - (z * z)) * (4.0 * y)));
            	}
            	return tmp;
            }
            
            function code(x, y, z, t)
            	tmp = 0.0
            	if (Float64(z * z) <= 3.459163940415505e+267)
            		tmp = fma(Float64(-4.0 * y), Float64(Float64(z * z) - t), Float64(x * x));
            	else
            		tmp = fma(x, x, Float64(Float64(t - Float64(z * z)) * Float64(4.0 * y)));
            	end
            	return tmp
            end
            
            code[x_, y_, z_, t_] := If[LessEqual[N[(z * z), $MachinePrecision], 3.459163940415505e+267], N[(N[(-4.0 * y), $MachinePrecision] * N[(N[(z * z), $MachinePrecision] - t), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision], N[(x * x + N[(N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
            
            f(x, y, z, t):
            	x in [-inf, +inf],
            	y in [-inf, +inf],
            	z in [-inf, +inf],
            	t in [-inf, +inf]
            code: THEORY
            BEGIN
            f(x, y, z, t: real): real =
            	LET tmp = IF ((z * z) <= (3459163940415505154807243167145246733638957054914899056796149349151503158639401562216956921212260941731586295517881620060871458325638565914945780935367462669091573565733790389311719644459867358991729700294134409948470761764934080832587912644085449904199498676924579840)) THEN ((((-4) * y) * ((z * z) - t)) + (x * x)) ELSE ((x * x) + ((t - (z * z)) * ((4) * y))) ENDIF IN
            	tmp
            END code
            \begin{array}{l}
            \mathbf{if}\;z \cdot z \leq 3.459163940415505 \cdot 10^{+267}:\\
            \;\;\;\;\mathsf{fma}\left(-4 \cdot y, z \cdot z - t, x \cdot x\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right)\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 z z) < 3.4591639404155052e267

              1. Initial program 90.6%

                \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
              2. Step-by-step derivation
                1. Applied rewrites91.6%

                  \[\leadsto \mathsf{fma}\left(-4 \cdot y, z \cdot z - t, x \cdot x\right) \]

                if 3.4591639404155052e267 < (*.f64 z z)

                1. Initial program 90.6%

                  \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                2. Step-by-step derivation
                  1. Applied rewrites92.7%

                    \[\leadsto \mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right) \]
                3. Recombined 2 regimes into one program.
                4. Add Preprocessing

                Alternative 4: 92.7% accurate, 1.0× speedup?

                \[\mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right) \]
                (FPCore (x y z t)
                  :precision binary64
                  :pre TRUE
                  (fma x x (* (- t (* z z)) (* 4.0 y))))
                double code(double x, double y, double z, double t) {
                	return fma(x, x, ((t - (z * z)) * (4.0 * y)));
                }
                
                function code(x, y, z, t)
                	return fma(x, x, Float64(Float64(t - Float64(z * z)) * Float64(4.0 * y)))
                end
                
                code[x_, y_, z_, t_] := N[(x * x + N[(N[(t - N[(z * z), $MachinePrecision]), $MachinePrecision] * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                
                f(x, y, z, t):
                	x in [-inf, +inf],
                	y in [-inf, +inf],
                	z in [-inf, +inf],
                	t in [-inf, +inf]
                code: THEORY
                BEGIN
                f(x, y, z, t: real): real =
                	(x * x) + ((t - (z * z)) * ((4) * y))
                END code
                \mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right)
                
                Derivation
                1. Initial program 90.6%

                  \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                2. Step-by-step derivation
                  1. Applied rewrites92.7%

                    \[\leadsto \mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right) \]
                  2. Add Preprocessing

                  Alternative 5: 67.5% accurate, 1.5× speedup?

                  \[\mathsf{fma}\left(t, 4 \cdot y, x \cdot x\right) \]
                  (FPCore (x y z t)
                    :precision binary64
                    :pre TRUE
                    (fma t (* 4.0 y) (* x x)))
                  double code(double x, double y, double z, double t) {
                  	return fma(t, (4.0 * y), (x * x));
                  }
                  
                  function code(x, y, z, t)
                  	return fma(t, Float64(4.0 * y), Float64(x * x))
                  end
                  
                  code[x_, y_, z_, t_] := N[(t * N[(4.0 * y), $MachinePrecision] + N[(x * x), $MachinePrecision]), $MachinePrecision]
                  
                  f(x, y, z, t):
                  	x in [-inf, +inf],
                  	y in [-inf, +inf],
                  	z in [-inf, +inf],
                  	t in [-inf, +inf]
                  code: THEORY
                  BEGIN
                  f(x, y, z, t: real): real =
                  	(t * ((4) * y)) + (x * x)
                  END code
                  \mathsf{fma}\left(t, 4 \cdot y, x \cdot x\right)
                  
                  Derivation
                  1. Initial program 90.6%

                    \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                  2. Step-by-step derivation
                    1. Applied rewrites92.7%

                      \[\leadsto \mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right) \]
                    2. Taylor expanded in z around 0

                      \[\leadsto \mathsf{fma}\left(x, x, t \cdot \left(4 \cdot y\right)\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites67.2%

                        \[\leadsto \mathsf{fma}\left(x, x, t \cdot \left(4 \cdot y\right)\right) \]
                      2. Step-by-step derivation
                        1. Applied rewrites67.5%

                          \[\leadsto \mathsf{fma}\left(t, 4 \cdot y, x \cdot x\right) \]
                        2. Add Preprocessing

                        Alternative 6: 67.2% accurate, 1.5× speedup?

                        \[\mathsf{fma}\left(x, x, t \cdot \left(4 \cdot y\right)\right) \]
                        (FPCore (x y z t)
                          :precision binary64
                          :pre TRUE
                          (fma x x (* t (* 4.0 y))))
                        double code(double x, double y, double z, double t) {
                        	return fma(x, x, (t * (4.0 * y)));
                        }
                        
                        function code(x, y, z, t)
                        	return fma(x, x, Float64(t * Float64(4.0 * y)))
                        end
                        
                        code[x_, y_, z_, t_] := N[(x * x + N[(t * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                        
                        f(x, y, z, t):
                        	x in [-inf, +inf],
                        	y in [-inf, +inf],
                        	z in [-inf, +inf],
                        	t in [-inf, +inf]
                        code: THEORY
                        BEGIN
                        f(x, y, z, t: real): real =
                        	(x * x) + (t * ((4) * y))
                        END code
                        \mathsf{fma}\left(x, x, t \cdot \left(4 \cdot y\right)\right)
                        
                        Derivation
                        1. Initial program 90.6%

                          \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                        2. Step-by-step derivation
                          1. Applied rewrites92.7%

                            \[\leadsto \mathsf{fma}\left(x, x, \left(t - z \cdot z\right) \cdot \left(4 \cdot y\right)\right) \]
                          2. Taylor expanded in z around 0

                            \[\leadsto \mathsf{fma}\left(x, x, t \cdot \left(4 \cdot y\right)\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites67.2%

                              \[\leadsto \mathsf{fma}\left(x, x, t \cdot \left(4 \cdot y\right)\right) \]
                            2. Add Preprocessing

                            Alternative 7: 31.1% accurate, 2.6× speedup?

                            \[t \cdot \left(4 \cdot y\right) \]
                            (FPCore (x y z t)
                              :precision binary64
                              :pre TRUE
                              (* t (* 4.0 y)))
                            double code(double x, double y, double z, double t) {
                            	return t * (4.0 * y);
                            }
                            
                            real(8) function code(x, y, z, t)
                            use fmin_fmax_functions
                                real(8), intent (in) :: x
                                real(8), intent (in) :: y
                                real(8), intent (in) :: z
                                real(8), intent (in) :: t
                                code = t * (4.0d0 * y)
                            end function
                            
                            public static double code(double x, double y, double z, double t) {
                            	return t * (4.0 * y);
                            }
                            
                            def code(x, y, z, t):
                            	return t * (4.0 * y)
                            
                            function code(x, y, z, t)
                            	return Float64(t * Float64(4.0 * y))
                            end
                            
                            function tmp = code(x, y, z, t)
                            	tmp = t * (4.0 * y);
                            end
                            
                            code[x_, y_, z_, t_] := N[(t * N[(4.0 * y), $MachinePrecision]), $MachinePrecision]
                            
                            f(x, y, z, t):
                            	x in [-inf, +inf],
                            	y in [-inf, +inf],
                            	z in [-inf, +inf],
                            	t in [-inf, +inf]
                            code: THEORY
                            BEGIN
                            f(x, y, z, t: real): real =
                            	t * ((4) * y)
                            END code
                            t \cdot \left(4 \cdot y\right)
                            
                            Derivation
                            1. Initial program 90.6%

                              \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                            2. Taylor expanded in t around inf

                              \[\leadsto 4 \cdot \left(t \cdot y\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites31.1%

                                \[\leadsto 4 \cdot \left(t \cdot y\right) \]
                              2. Step-by-step derivation
                                1. Applied rewrites31.1%

                                  \[\leadsto t \cdot \left(4 \cdot y\right) \]
                                2. Add Preprocessing

                                Alternative 8: 31.1% accurate, 2.6× speedup?

                                \[4 \cdot \left(t \cdot y\right) \]
                                (FPCore (x y z t)
                                  :precision binary64
                                  :pre TRUE
                                  (* 4.0 (* t y)))
                                double code(double x, double y, double z, double t) {
                                	return 4.0 * (t * y);
                                }
                                
                                real(8) function code(x, y, z, t)
                                use fmin_fmax_functions
                                    real(8), intent (in) :: x
                                    real(8), intent (in) :: y
                                    real(8), intent (in) :: z
                                    real(8), intent (in) :: t
                                    code = 4.0d0 * (t * y)
                                end function
                                
                                public static double code(double x, double y, double z, double t) {
                                	return 4.0 * (t * y);
                                }
                                
                                def code(x, y, z, t):
                                	return 4.0 * (t * y)
                                
                                function code(x, y, z, t)
                                	return Float64(4.0 * Float64(t * y))
                                end
                                
                                function tmp = code(x, y, z, t)
                                	tmp = 4.0 * (t * y);
                                end
                                
                                code[x_, y_, z_, t_] := N[(4.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]
                                
                                f(x, y, z, t):
                                	x in [-inf, +inf],
                                	y in [-inf, +inf],
                                	z in [-inf, +inf],
                                	t in [-inf, +inf]
                                code: THEORY
                                BEGIN
                                f(x, y, z, t: real): real =
                                	(4) * (t * y)
                                END code
                                4 \cdot \left(t \cdot y\right)
                                
                                Derivation
                                1. Initial program 90.6%

                                  \[x \cdot x - \left(y \cdot 4\right) \cdot \left(z \cdot z - t\right) \]
                                2. Taylor expanded in t around inf

                                  \[\leadsto 4 \cdot \left(t \cdot y\right) \]
                                3. Step-by-step derivation
                                  1. Applied rewrites31.1%

                                    \[\leadsto 4 \cdot \left(t \cdot y\right) \]
                                  2. Add Preprocessing

                                  Reproduce

                                  ?
                                  herbie shell --seed 2026092 
                                  (FPCore (x y z t)
                                    :name "Graphics.Rasterific.Shading:$sradialGradientWithFocusShader from Rasterific-0.6.1, B"
                                    :precision binary64
                                    (- (* x x) (* (* y 4.0) (- (* z z) t))))