Diagrams.Solve.Polynomial:quartForm from diagrams-solve-0.1, B

Percentage Accurate: 100.0% → 100.0%
Time: 1.9s
Alternatives: 7
Speedup: 1.4×

Specification

?
\[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
double code(double x, double y, double z, double t) {
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + 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 = (((1.0d0 / 8.0d0) * x) - ((y * z) / 2.0d0)) + t
end function
public static double code(double x, double y, double z, double t) {
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
def code(x, y, z, t):
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(1.0 / 8.0) * x) - Float64(Float64(y * z) / 2.0)) + t)
end
function tmp = code(x, y, z, t)
	tmp = (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / 8.0), $MachinePrecision] * x), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] + t), $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 =
	((((1) / (8)) * x) - ((y * z) / (2))) + t
END code
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t

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 7 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: 100.0% accurate, 1.0× speedup?

\[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))
double code(double x, double y, double z, double t) {
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + 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 = (((1.0d0 / 8.0d0) * x) - ((y * z) / 2.0d0)) + t
end function
public static double code(double x, double y, double z, double t) {
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
}
def code(x, y, z, t):
	return (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t
function code(x, y, z, t)
	return Float64(Float64(Float64(Float64(1.0 / 8.0) * x) - Float64(Float64(y * z) / 2.0)) + t)
end
function tmp = code(x, y, z, t)
	tmp = (((1.0 / 8.0) * x) - ((y * z) / 2.0)) + t;
end
code[x_, y_, z_, t_] := N[(N[(N[(N[(1.0 / 8.0), $MachinePrecision] * x), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision] + t), $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 =
	((((1) / (8)) * x) - ((y * z) / (2))) + t
END code
\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t

Alternative 1: 100.0% accurate, 1.4× speedup?

\[\mathsf{fma}\left(y, z \cdot -0.5, \mathsf{fma}\left(x, 0.125, t\right)\right) \]
(FPCore (x y z t)
  :precision binary64
  :pre TRUE
  (fma y (* z -0.5) (fma x 0.125 t)))
double code(double x, double y, double z, double t) {
	return fma(y, (z * -0.5), fma(x, 0.125, t));
}
function code(x, y, z, t)
	return fma(y, Float64(z * -0.5), fma(x, 0.125, t))
end
code[x_, y_, z_, t_] := N[(y * N[(z * -0.5), $MachinePrecision] + N[(x * 0.125 + t), $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 =
	(y * (z * (-5e-1))) + ((x * (125e-3)) + t)
END code
\mathsf{fma}\left(y, z \cdot -0.5, \mathsf{fma}\left(x, 0.125, t\right)\right)
Derivation
  1. Initial program 100.0%

    \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
  2. Step-by-step derivation
    1. Applied rewrites100.0%

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

    Alternative 2: 86.2% accurate, 1.0× speedup?

    \[\begin{array}{l} t_1 := -0.5 \cdot \left(y \cdot z\right) + t\\ \mathbf{if}\;t \leq -1.6770947112847438 \cdot 10^{-50}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 76298940059016.36:\\ \;\;\;\;\mathsf{fma}\left(y, -0.5 \cdot z, 0.125 \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
    (FPCore (x y z t)
      :precision binary64
      :pre TRUE
      (let* ((t_1 (+ (* -0.5 (* y z)) t)))
      (if (<= t -1.6770947112847438e-50)
        t_1
        (if (<= t 76298940059016.36) (fma y (* -0.5 z) (* 0.125 x)) t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (-0.5 * (y * z)) + t;
    	double tmp;
    	if (t <= -1.6770947112847438e-50) {
    		tmp = t_1;
    	} else if (t <= 76298940059016.36) {
    		tmp = fma(y, (-0.5 * z), (0.125 * x));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(-0.5 * Float64(y * z)) + t)
    	tmp = 0.0
    	if (t <= -1.6770947112847438e-50)
    		tmp = t_1;
    	elseif (t <= 76298940059016.36)
    		tmp = fma(y, Float64(-0.5 * z), Float64(0.125 * x));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[t, -1.6770947112847438e-50], t$95$1, If[LessEqual[t, 76298940059016.36], N[(y * N[(-0.5 * z), $MachinePrecision] + N[(0.125 * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
    
    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 t_1 = (((-5e-1) * (y * z)) + t) IN
    		LET tmp_1 = IF (t <= (76298940059016359375e-6)) THEN ((y * ((-5e-1) * z)) + ((125e-3) * x)) ELSE t_1 ENDIF IN
    		LET tmp = IF (t <= (-167709471128474384815647562929888437797664347855967950775217343270676325862336514112358919563496671100570645038506509306522611509049358602396750939078629016876220703125e-217)) THEN t_1 ELSE tmp_1 ENDIF IN
    	tmp
    END code
    \begin{array}{l}
    t_1 := -0.5 \cdot \left(y \cdot z\right) + t\\
    \mathbf{if}\;t \leq -1.6770947112847438 \cdot 10^{-50}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t \leq 76298940059016.36:\\
    \;\;\;\;\mathsf{fma}\left(y, -0.5 \cdot z, 0.125 \cdot x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if t < -1.6770947112847438e-50 or 76298940059016.359 < t

      1. Initial program 100.0%

        \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
      2. Taylor expanded in x around 0

        \[\leadsto \frac{-1}{2} \cdot \left(y \cdot z\right) + t \]
      3. Step-by-step derivation
        1. Applied rewrites67.8%

          \[\leadsto -0.5 \cdot \left(y \cdot z\right) + t \]

        if -1.6770947112847438e-50 < t < 76298940059016.359

        1. Initial program 100.0%

          \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
        2. Taylor expanded in y around 0

          \[\leadsto t + \frac{1}{8} \cdot x \]
        3. Step-by-step derivation
          1. Applied rewrites64.6%

            \[\leadsto t + 0.125 \cdot x \]
          2. Applied rewrites64.6%

            \[\leadsto \mathsf{fma}\left(0.125, x, t\right) \]
          3. Taylor expanded in t around 0

            \[\leadsto \frac{1}{8} \cdot x - \frac{1}{2} \cdot \left(y \cdot z\right) \]
          4. Step-by-step derivation
            1. Applied rewrites68.2%

              \[\leadsto 0.125 \cdot x - 0.5 \cdot \left(y \cdot z\right) \]
            2. Applied rewrites68.2%

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

          Alternative 3: 85.0% accurate, 0.9× speedup?

          \[\begin{array}{l} t_1 := -0.5 \cdot \left(y \cdot z\right) + t\\ \mathbf{if}\;y \cdot z \leq -3.811187879761372 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \cdot z \leq 5.193479599924079 \cdot 10^{-49}:\\ \;\;\;\;\mathsf{fma}\left(0.125, x, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
          (FPCore (x y z t)
            :precision binary64
            :pre TRUE
            (let* ((t_1 (+ (* -0.5 (* y z)) t)))
            (if (<= (* y z) -3.811187879761372e-39)
              t_1
              (if (<= (* y z) 5.193479599924079e-49) (fma 0.125 x t) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = (-0.5 * (y * z)) + t;
          	double tmp;
          	if ((y * z) <= -3.811187879761372e-39) {
          		tmp = t_1;
          	} else if ((y * z) <= 5.193479599924079e-49) {
          		tmp = fma(0.125, x, t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          function code(x, y, z, t)
          	t_1 = Float64(Float64(-0.5 * Float64(y * z)) + t)
          	tmp = 0.0
          	if (Float64(y * z) <= -3.811187879761372e-39)
          		tmp = t_1;
          	elseif (Float64(y * z) <= 5.193479599924079e-49)
          		tmp = fma(0.125, x, t);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[N[(y * z), $MachinePrecision], -3.811187879761372e-39], t$95$1, If[LessEqual[N[(y * z), $MachinePrecision], 5.193479599924079e-49], N[(0.125 * x + t), $MachinePrecision], t$95$1]]]
          
          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 t_1 = (((-5e-1) * (y * z)) + t) IN
          		LET tmp_1 = IF ((y * z) <= (519347959992407922738789092435664841483204930658308108660499036343171355847186042158132009909050298978109699785556393355719952131810401851907954551279544830322265625e-213)) THEN (((125e-3) * x) + t) ELSE t_1 ENDIF IN
          		LET tmp = IF ((y * z) <= (-3811187879761372015349719338492753709029299134921760281036981209992095526189864673376994075372514204913532154250788153149187564849853515625e-177)) THEN t_1 ELSE tmp_1 ENDIF IN
          	tmp
          END code
          \begin{array}{l}
          t_1 := -0.5 \cdot \left(y \cdot z\right) + t\\
          \mathbf{if}\;y \cdot z \leq -3.811187879761372 \cdot 10^{-39}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \cdot z \leq 5.193479599924079 \cdot 10^{-49}:\\
          \;\;\;\;\mathsf{fma}\left(0.125, x, t\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 y z) < -3.811187879761372e-39 or 5.1934795999240792e-49 < (*.f64 y z)

            1. Initial program 100.0%

              \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
            2. Taylor expanded in x around 0

              \[\leadsto \frac{-1}{2} \cdot \left(y \cdot z\right) + t \]
            3. Step-by-step derivation
              1. Applied rewrites67.8%

                \[\leadsto -0.5 \cdot \left(y \cdot z\right) + t \]

              if -3.811187879761372e-39 < (*.f64 y z) < 5.1934795999240792e-49

              1. Initial program 100.0%

                \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
              2. Taylor expanded in y around 0

                \[\leadsto t + \frac{1}{8} \cdot x \]
              3. Step-by-step derivation
                1. Applied rewrites64.6%

                  \[\leadsto t + 0.125 \cdot x \]
                2. Applied rewrites64.6%

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

              Alternative 4: 83.1% accurate, 1.0× speedup?

              \[\begin{array}{l} t_1 := -0.5 \cdot \left(y \cdot z\right)\\ \mathbf{if}\;y \cdot z \leq -5.175013782460881 \cdot 10^{+99}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \cdot z \leq 6.4573354302613295 \cdot 10^{+72}:\\ \;\;\;\;\mathsf{fma}\left(0.125, x, t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \]
              (FPCore (x y z t)
                :precision binary64
                :pre TRUE
                (let* ((t_1 (* -0.5 (* y z))))
                (if (<= (* y z) -5.175013782460881e+99)
                  t_1
                  (if (<= (* y z) 6.4573354302613295e+72) (fma 0.125 x t) t_1))))
              double code(double x, double y, double z, double t) {
              	double t_1 = -0.5 * (y * z);
              	double tmp;
              	if ((y * z) <= -5.175013782460881e+99) {
              		tmp = t_1;
              	} else if ((y * z) <= 6.4573354302613295e+72) {
              		tmp = fma(0.125, x, t);
              	} else {
              		tmp = t_1;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	t_1 = Float64(-0.5 * Float64(y * z))
              	tmp = 0.0
              	if (Float64(y * z) <= -5.175013782460881e+99)
              		tmp = t_1;
              	elseif (Float64(y * z) <= 6.4573354302613295e+72)
              		tmp = fma(0.125, x, t);
              	else
              		tmp = t_1;
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.5 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(y * z), $MachinePrecision], -5.175013782460881e+99], t$95$1, If[LessEqual[N[(y * z), $MachinePrecision], 6.4573354302613295e+72], N[(0.125 * x + t), $MachinePrecision], t$95$1]]]
              
              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 t_1 = ((-5e-1) * (y * z)) IN
              		LET tmp_1 = IF ((y * z) <= (6457335430261329547810767699390821776343632049679724029847141179088437248)) THEN (((125e-3) * x) + t) ELSE t_1 ENDIF IN
              		LET tmp = IF ((y * z) <= (-5175013782460881157524174131526843532796470125390131372701020118359893052427140865462262724732911616)) THEN t_1 ELSE tmp_1 ENDIF IN
              	tmp
              END code
              \begin{array}{l}
              t_1 := -0.5 \cdot \left(y \cdot z\right)\\
              \mathbf{if}\;y \cdot z \leq -5.175013782460881 \cdot 10^{+99}:\\
              \;\;\;\;t\_1\\
              
              \mathbf{elif}\;y \cdot z \leq 6.4573354302613295 \cdot 10^{+72}:\\
              \;\;\;\;\mathsf{fma}\left(0.125, x, t\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_1\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (*.f64 y z) < -5.1750137824608812e99 or 6.4573354302613295e72 < (*.f64 y z)

                1. Initial program 100.0%

                  \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
                2. Taylor expanded in y around 0

                  \[\leadsto t + \frac{1}{8} \cdot x \]
                3. Step-by-step derivation
                  1. Applied rewrites64.6%

                    \[\leadsto t + 0.125 \cdot x \]
                  2. Applied rewrites64.6%

                    \[\leadsto \mathsf{fma}\left(0.125, x, t\right) \]
                  3. Taylor expanded in y around inf

                    \[\leadsto \frac{-1}{2} \cdot \left(y \cdot z\right) \]
                  4. Step-by-step derivation
                    1. Applied rewrites36.8%

                      \[\leadsto -0.5 \cdot \left(y \cdot z\right) \]

                    if -5.1750137824608812e99 < (*.f64 y z) < 6.4573354302613295e72

                    1. Initial program 100.0%

                      \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
                    2. Taylor expanded in y around 0

                      \[\leadsto t + \frac{1}{8} \cdot x \]
                    3. Step-by-step derivation
                      1. Applied rewrites64.6%

                        \[\leadsto t + 0.125 \cdot x \]
                      2. Applied rewrites64.6%

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

                    Alternative 5: 64.6% accurate, 3.3× speedup?

                    \[\mathsf{fma}\left(0.125, x, t\right) \]
                    (FPCore (x y z t)
                      :precision binary64
                      :pre TRUE
                      (fma 0.125 x t))
                    double code(double x, double y, double z, double t) {
                    	return fma(0.125, x, t);
                    }
                    
                    function code(x, y, z, t)
                    	return fma(0.125, x, t)
                    end
                    
                    code[x_, y_, z_, t_] := N[(0.125 * x + t), $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 =
                    	((125e-3) * x) + t
                    END code
                    \mathsf{fma}\left(0.125, x, t\right)
                    
                    Derivation
                    1. Initial program 100.0%

                      \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
                    2. Taylor expanded in y around 0

                      \[\leadsto t + \frac{1}{8} \cdot x \]
                    3. Step-by-step derivation
                      1. Applied rewrites64.6%

                        \[\leadsto t + 0.125 \cdot x \]
                      2. Applied rewrites64.6%

                        \[\leadsto \mathsf{fma}\left(0.125, x, t\right) \]
                      3. Add Preprocessing

                      Alternative 6: 50.1% accurate, 1.7× speedup?

                      \[\begin{array}{l} \mathbf{if}\;t \leq -1.6770947112847438 \cdot 10^{-50}:\\ \;\;\;\;t\\ \mathbf{elif}\;t \leq 9.624175003052535 \cdot 10^{+19}:\\ \;\;\;\;0.125 \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
                      (FPCore (x y z t)
                        :precision binary64
                        :pre TRUE
                        (if (<= t -1.6770947112847438e-50)
                        t
                        (if (<= t 9.624175003052535e+19) (* 0.125 x) t)))
                      double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (t <= -1.6770947112847438e-50) {
                      		tmp = t;
                      	} else if (t <= 9.624175003052535e+19) {
                      		tmp = 0.125 * x;
                      	} else {
                      		tmp = t;
                      	}
                      	return tmp;
                      }
                      
                      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
                          real(8) :: tmp
                          if (t <= (-1.6770947112847438d-50)) then
                              tmp = t
                          else if (t <= 9.624175003052535d+19) then
                              tmp = 0.125d0 * x
                          else
                              tmp = t
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	double tmp;
                      	if (t <= -1.6770947112847438e-50) {
                      		tmp = t;
                      	} else if (t <= 9.624175003052535e+19) {
                      		tmp = 0.125 * x;
                      	} else {
                      		tmp = t;
                      	}
                      	return tmp;
                      }
                      
                      def code(x, y, z, t):
                      	tmp = 0
                      	if t <= -1.6770947112847438e-50:
                      		tmp = t
                      	elif t <= 9.624175003052535e+19:
                      		tmp = 0.125 * x
                      	else:
                      		tmp = t
                      	return tmp
                      
                      function code(x, y, z, t)
                      	tmp = 0.0
                      	if (t <= -1.6770947112847438e-50)
                      		tmp = t;
                      	elseif (t <= 9.624175003052535e+19)
                      		tmp = Float64(0.125 * x);
                      	else
                      		tmp = t;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(x, y, z, t)
                      	tmp = 0.0;
                      	if (t <= -1.6770947112847438e-50)
                      		tmp = t;
                      	elseif (t <= 9.624175003052535e+19)
                      		tmp = 0.125 * x;
                      	else
                      		tmp = t;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[x_, y_, z_, t_] := If[LessEqual[t, -1.6770947112847438e-50], t, If[LessEqual[t, 9.624175003052535e+19], N[(0.125 * x), $MachinePrecision], t]]
                      
                      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_1 = IF (t <= (96241750030525349888)) THEN ((125e-3) * x) ELSE t ENDIF IN
                      	LET tmp = IF (t <= (-167709471128474384815647562929888437797664347855967950775217343270676325862336514112358919563496671100570645038506509306522611509049358602396750939078629016876220703125e-217)) THEN t ELSE tmp_1 ENDIF IN
                      	tmp
                      END code
                      \begin{array}{l}
                      \mathbf{if}\;t \leq -1.6770947112847438 \cdot 10^{-50}:\\
                      \;\;\;\;t\\
                      
                      \mathbf{elif}\;t \leq 9.624175003052535 \cdot 10^{+19}:\\
                      \;\;\;\;0.125 \cdot x\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\\
                      
                      
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if t < -1.6770947112847438e-50 or 96241750030525350000 < t

                        1. Initial program 100.0%

                          \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
                        2. Taylor expanded in y around 0

                          \[\leadsto t + \frac{1}{8} \cdot x \]
                        3. Step-by-step derivation
                          1. Applied rewrites64.6%

                            \[\leadsto t + 0.125 \cdot x \]
                          2. Taylor expanded in x around 0

                            \[\leadsto t \]
                          3. Step-by-step derivation
                            1. Applied rewrites33.1%

                              \[\leadsto t \]

                            if -1.6770947112847438e-50 < t < 96241750030525350000

                            1. Initial program 100.0%

                              \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
                            2. Taylor expanded in y around 0

                              \[\leadsto t + \frac{1}{8} \cdot x \]
                            3. Step-by-step derivation
                              1. Applied rewrites64.6%

                                \[\leadsto t + 0.125 \cdot x \]
                              2. Taylor expanded in x around 0

                                \[\leadsto t \]
                              3. Step-by-step derivation
                                1. Applied rewrites33.1%

                                  \[\leadsto t \]
                                2. Taylor expanded in x around inf

                                  \[\leadsto \frac{1}{8} \cdot x \]
                                3. Step-by-step derivation
                                  1. Applied rewrites33.3%

                                    \[\leadsto 0.125 \cdot x \]
                                4. Recombined 2 regimes into one program.
                                5. Add Preprocessing

                                Alternative 7: 33.1% accurate, 19.8× speedup?

                                \[t \]
                                (FPCore (x y z t)
                                  :precision binary64
                                  :pre TRUE
                                  t)
                                double code(double x, double y, double z, double t) {
                                	return 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 = t
                                end function
                                
                                public static double code(double x, double y, double z, double t) {
                                	return t;
                                }
                                
                                def code(x, y, z, t):
                                	return t
                                
                                function code(x, y, z, t)
                                	return t
                                end
                                
                                function tmp = code(x, y, z, t)
                                	tmp = t;
                                end
                                
                                code[x_, y_, z_, t_] := t
                                
                                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
                                END code
                                t
                                
                                Derivation
                                1. Initial program 100.0%

                                  \[\left(\frac{1}{8} \cdot x - \frac{y \cdot z}{2}\right) + t \]
                                2. Taylor expanded in y around 0

                                  \[\leadsto t + \frac{1}{8} \cdot x \]
                                3. Step-by-step derivation
                                  1. Applied rewrites64.6%

                                    \[\leadsto t + 0.125 \cdot x \]
                                  2. Taylor expanded in x around 0

                                    \[\leadsto t \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites33.1%

                                      \[\leadsto t \]
                                    2. Add Preprocessing

                                    Reproduce

                                    ?
                                    herbie shell --seed 2026092 
                                    (FPCore (x y z t)
                                      :name "Diagrams.Solve.Polynomial:quartForm  from diagrams-solve-0.1, B"
                                      :precision binary64
                                      (+ (- (* (/ 1.0 8.0) x) (/ (* y z) 2.0)) t))