Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 7.2s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x + \left(y - z\right) \cdot \left(t - x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
def code(x, y, z, t):
	return x + ((y - z) * (t - x))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - z) * Float64(t - x)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - z) * (t - x));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}

Sampling outcomes in binary64 precision:

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 9 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?

\[\begin{array}{l} \\ x + \left(y - z\right) \cdot \left(t - x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
def code(x, y, z, t):
	return x + ((y - z) * (t - x))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - z) * Float64(t - x)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - z) * (t - x));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(y - z\right) \cdot \left(t - x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((y - z) * (t - x));
}
def code(x, y, z, t):
	return x + ((y - z) * (t - x))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(y - z) * Float64(t - x)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((y - z) * (t - x));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Derivation
  1. Initial program 100.0%

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 69.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -1.55 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-150}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 8200000000000:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))))
   (if (<= y -1.55e+113)
     t_1
     (if (<= y -4.4e-150)
       (* z (- x t))
       (if (<= y 8200000000000.0) (- x (* z t)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -1.55e+113) {
		tmp = t_1;
	} else if (y <= -4.4e-150) {
		tmp = z * (x - t);
	} else if (y <= 8200000000000.0) {
		tmp = x - (z * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (t - x)
    if (y <= (-1.55d+113)) then
        tmp = t_1
    else if (y <= (-4.4d-150)) then
        tmp = z * (x - t)
    else if (y <= 8200000000000.0d0) then
        tmp = x - (z * t)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -1.55e+113) {
		tmp = t_1;
	} else if (y <= -4.4e-150) {
		tmp = z * (x - t);
	} else if (y <= 8200000000000.0) {
		tmp = x - (z * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	tmp = 0
	if y <= -1.55e+113:
		tmp = t_1
	elif y <= -4.4e-150:
		tmp = z * (x - t)
	elif y <= 8200000000000.0:
		tmp = x - (z * t)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -1.55e+113)
		tmp = t_1;
	elseif (y <= -4.4e-150)
		tmp = Float64(z * Float64(x - t));
	elseif (y <= 8200000000000.0)
		tmp = Float64(x - Float64(z * t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	tmp = 0.0;
	if (y <= -1.55e+113)
		tmp = t_1;
	elseif (y <= -4.4e-150)
		tmp = z * (x - t);
	elseif (y <= 8200000000000.0)
		tmp = x - (z * t);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.55e+113], t$95$1, If[LessEqual[y, -4.4e-150], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8200000000000.0], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \left(t - x\right)\\
\mathbf{if}\;y \leq -1.55 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -4.4 \cdot 10^{-150}:\\
\;\;\;\;z \cdot \left(x - t\right)\\

\mathbf{elif}\;y \leq 8200000000000:\\
\;\;\;\;x - z \cdot t\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.54999999999999996e113 or 8.2e12 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
    4. Step-by-step derivation
      1. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(t - x\right)}\right) \]
      2. --lowering--.f6485.8%

        \[\leadsto \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{x}\right)\right) \]
    5. Simplified85.8%

      \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]

    if -1.54999999999999996e113 < y < -4.3999999999999999e-150

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{neg}\left(z \cdot \left(t - x\right)\right) \]
      2. distribute-rgt-neg-inN/A

        \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
      3. mul-1-negN/A

        \[\leadsto z \cdot \left(-1 \cdot \color{blue}{\left(t - x\right)}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(t - x\right)\right)}\right) \]
      5. mul-1-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)\right)\right)\right) \]
      7. +-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)\right)\right)\right) \]
      8. distribute-neg-inN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)}\right)\right) \]
      9. unsub-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - \color{blue}{t}\right)\right) \]
      10. remove-double-negN/A

        \[\leadsto \mathsf{*.f64}\left(z, \left(x - t\right)\right) \]
      11. --lowering--.f6472.8%

        \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(x, \color{blue}{t}\right)\right) \]
    5. Simplified72.8%

      \[\leadsto \color{blue}{z \cdot \left(x - t\right)} \]

    if -4.3999999999999999e-150 < y < 8.2e12

    1. Initial program 100.0%

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

      \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, z\right), \color{blue}{t}\right)\right) \]
    4. Step-by-step derivation
      1. Simplified83.8%

        \[\leadsto x + \left(y - z\right) \cdot \color{blue}{t} \]
      2. Taylor expanded in y around 0

        \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot z\right)} \]
      3. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto x + \left(\mathsf{neg}\left(t \cdot z\right)\right) \]
        2. unsub-negN/A

          \[\leadsto x - \color{blue}{t \cdot z} \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(x, \color{blue}{\left(t \cdot z\right)}\right) \]
        4. *-lowering-*.f6477.5%

          \[\leadsto \mathsf{\_.f64}\left(x, \mathsf{*.f64}\left(t, \color{blue}{z}\right)\right) \]
      4. Simplified77.5%

        \[\leadsto \color{blue}{x - t \cdot z} \]
    5. Recombined 3 regimes into one program.
    6. Final simplification80.4%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.55 \cdot 10^{+113}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-150}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 8200000000000:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 56.3% accurate, 0.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y - z \leq -2 \cdot 10^{-80}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y - z \leq 5 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* (- y z) t)))
       (if (<= (- y z) -2e-80) t_1 (if (<= (- y z) 5e-13) x t_1))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (y - z) * t;
    	double tmp;
    	if ((y - z) <= -2e-80) {
    		tmp = t_1;
    	} else if ((y - z) <= 5e-13) {
    		tmp = x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(x, y, z, t)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        real(8), intent (in) :: z
        real(8), intent (in) :: t
        real(8) :: t_1
        real(8) :: tmp
        t_1 = (y - z) * t
        if ((y - z) <= (-2d-80)) then
            tmp = t_1
        else if ((y - z) <= 5d-13) then
            tmp = x
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double x, double y, double z, double t) {
    	double t_1 = (y - z) * t;
    	double tmp;
    	if ((y - z) <= -2e-80) {
    		tmp = t_1;
    	} else if ((y - z) <= 5e-13) {
    		tmp = x;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(x, y, z, t):
    	t_1 = (y - z) * t
    	tmp = 0
    	if (y - z) <= -2e-80:
    		tmp = t_1
    	elif (y - z) <= 5e-13:
    		tmp = x
    	else:
    		tmp = t_1
    	return tmp
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(y - z) * t)
    	tmp = 0.0
    	if (Float64(y - z) <= -2e-80)
    		tmp = t_1;
    	elseif (Float64(y - z) <= 5e-13)
    		tmp = x;
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(x, y, z, t)
    	t_1 = (y - z) * t;
    	tmp = 0.0;
    	if ((y - z) <= -2e-80)
    		tmp = t_1;
    	elseif ((y - z) <= 5e-13)
    		tmp = x;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[N[(y - z), $MachinePrecision], -2e-80], t$95$1, If[LessEqual[N[(y - z), $MachinePrecision], 5e-13], x, t$95$1]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(y - z\right) \cdot t\\
    \mathbf{if}\;y - z \leq -2 \cdot 10^{-80}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y - z \leq 5 \cdot 10^{-13}:\\
    \;\;\;\;x\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.f64 y z) < -1.99999999999999992e-80 or 4.9999999999999999e-13 < (-.f64 y z)

      1. Initial program 100.0%

        \[x + \left(y - z\right) \cdot \left(t - x\right) \]
      2. Add Preprocessing
      3. Taylor expanded in x around 0

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
      4. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(t, \color{blue}{\left(y - z\right)}\right) \]
        2. --lowering--.f6460.4%

          \[\leadsto \mathsf{*.f64}\left(t, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right) \]
      5. Simplified60.4%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]

      if -1.99999999999999992e-80 < (-.f64 y z) < 4.9999999999999999e-13

      1. Initial program 100.0%

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

        \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, z\right), \color{blue}{t}\right)\right) \]
      4. Step-by-step derivation
        1. Simplified99.6%

          \[\leadsto x + \left(y - z\right) \cdot \color{blue}{t} \]
        2. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x} \]
        3. Step-by-step derivation
          1. Simplified68.1%

            \[\leadsto \color{blue}{x} \]
        4. Recombined 2 regimes into one program.
        5. Final simplification61.9%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y - z \leq -2 \cdot 10^{-80}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y - z \leq 5 \cdot 10^{-13}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
        6. Add Preprocessing

        Alternative 4: 81.9% accurate, 0.5× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + x \cdot \left(z - y\right)\\ \mathbf{if}\;x \leq -4.8 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{+16}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (let* ((t_1 (+ x (* x (- z y)))))
           (if (<= x -4.8e+14) t_1 (if (<= x 3.5e+16) (+ x (* (- y z) t)) t_1))))
        double code(double x, double y, double z, double t) {
        	double t_1 = x + (x * (z - y));
        	double tmp;
        	if (x <= -4.8e+14) {
        		tmp = t_1;
        	} else if (x <= 3.5e+16) {
        		tmp = x + ((y - z) * t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        real(8) function code(x, y, z, t)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            real(8), intent (in) :: z
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: tmp
            t_1 = x + (x * (z - y))
            if (x <= (-4.8d+14)) then
                tmp = t_1
            else if (x <= 3.5d+16) then
                tmp = x + ((y - z) * t)
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double x, double y, double z, double t) {
        	double t_1 = x + (x * (z - y));
        	double tmp;
        	if (x <= -4.8e+14) {
        		tmp = t_1;
        	} else if (x <= 3.5e+16) {
        		tmp = x + ((y - z) * t);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(x, y, z, t):
        	t_1 = x + (x * (z - y))
        	tmp = 0
        	if x <= -4.8e+14:
        		tmp = t_1
        	elif x <= 3.5e+16:
        		tmp = x + ((y - z) * t)
        	else:
        		tmp = t_1
        	return tmp
        
        function code(x, y, z, t)
        	t_1 = Float64(x + Float64(x * Float64(z - y)))
        	tmp = 0.0
        	if (x <= -4.8e+14)
        		tmp = t_1;
        	elseif (x <= 3.5e+16)
        		tmp = Float64(x + Float64(Float64(y - z) * t));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(x, y, z, t)
        	t_1 = x + (x * (z - y));
        	tmp = 0.0;
        	if (x <= -4.8e+14)
        		tmp = t_1;
        	elseif (x <= 3.5e+16)
        		tmp = x + ((y - z) * t);
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+14], t$95$1, If[LessEqual[x, 3.5e+16], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := x + x \cdot \left(z - y\right)\\
        \mathbf{if}\;x \leq -4.8 \cdot 10^{+14}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq 3.5 \cdot 10^{+16}:\\
        \;\;\;\;x + \left(y - z\right) \cdot t\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if x < -4.8e14 or 3.5e16 < x

          1. Initial program 100.0%

            \[x + \left(y - z\right) \cdot \left(t - x\right) \]
          2. Add Preprocessing
          3. Taylor expanded in t around 0

            \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(-1 \cdot \left(x \cdot \left(y - z\right)\right)\right)}\right) \]
          4. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(x \cdot \left(y - z\right)\right)\right)\right) \]
            2. distribute-rgt-neg-inN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\left(y - z\right)\right)\right)}\right)\right) \]
            3. mul-1-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \left(x \cdot \left(-1 \cdot \color{blue}{\left(y - z\right)}\right)\right)\right) \]
            4. *-lowering-*.f64N/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(-1 \cdot \left(y - z\right)\right)}\right)\right) \]
            5. mul-1-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(y - z\right)\right)\right)\right)\right) \]
            6. sub-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)\right)\right)\right) \]
            7. +-commutativeN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)\right)\right)\right) \]
            8. distribute-neg-inN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right)\right) \]
            9. unsub-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) - \color{blue}{y}\right)\right)\right) \]
            10. remove-double-negN/A

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(z - y\right)\right)\right) \]
            11. --lowering--.f6481.1%

              \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(z, \color{blue}{y}\right)\right)\right) \]
          5. Simplified81.1%

            \[\leadsto x + \color{blue}{x \cdot \left(z - y\right)} \]

          if -4.8e14 < x < 3.5e16

          1. Initial program 100.0%

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

            \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, z\right), \color{blue}{t}\right)\right) \]
          4. Step-by-step derivation
            1. Simplified88.4%

              \[\leadsto x + \left(y - z\right) \cdot \color{blue}{t} \]
          5. Recombined 2 regimes into one program.
          6. Add Preprocessing

          Alternative 5: 76.4% accurate, 0.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := x + x \cdot \left(z - y\right)\\ \mathbf{if}\;x \leq -950000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-26}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (+ x (* x (- z y)))))
             (if (<= x -950000000.0) t_1 (if (<= x 8e-26) (* (- y z) t) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = x + (x * (z - y));
          	double tmp;
          	if (x <= -950000000.0) {
          		tmp = t_1;
          	} else if (x <= 8e-26) {
          		tmp = (y - z) * t;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: tmp
              t_1 = x + (x * (z - y))
              if (x <= (-950000000.0d0)) then
                  tmp = t_1
              else if (x <= 8d-26) then
                  tmp = (y - z) * t
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double t_1 = x + (x * (z - y));
          	double tmp;
          	if (x <= -950000000.0) {
          		tmp = t_1;
          	} else if (x <= 8e-26) {
          		tmp = (y - z) * t;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = x + (x * (z - y))
          	tmp = 0
          	if x <= -950000000.0:
          		tmp = t_1
          	elif x <= 8e-26:
          		tmp = (y - z) * t
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(x + Float64(x * Float64(z - y)))
          	tmp = 0.0
          	if (x <= -950000000.0)
          		tmp = t_1;
          	elseif (x <= 8e-26)
          		tmp = Float64(Float64(y - z) * t);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = x + (x * (z - y));
          	tmp = 0.0;
          	if (x <= -950000000.0)
          		tmp = t_1;
          	elseif (x <= 8e-26)
          		tmp = (y - z) * t;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -950000000.0], t$95$1, If[LessEqual[x, 8e-26], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := x + x \cdot \left(z - y\right)\\
          \mathbf{if}\;x \leq -950000000:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;x \leq 8 \cdot 10^{-26}:\\
          \;\;\;\;\left(y - z\right) \cdot t\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < -9.5e8 or 8.0000000000000003e-26 < x

            1. Initial program 100.0%

              \[x + \left(y - z\right) \cdot \left(t - x\right) \]
            2. Add Preprocessing
            3. Taylor expanded in t around 0

              \[\leadsto \mathsf{+.f64}\left(x, \color{blue}{\left(-1 \cdot \left(x \cdot \left(y - z\right)\right)\right)}\right) \]
            4. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \left(\mathsf{neg}\left(x \cdot \left(y - z\right)\right)\right)\right) \]
              2. distribute-rgt-neg-inN/A

                \[\leadsto \mathsf{+.f64}\left(x, \left(x \cdot \color{blue}{\left(\mathsf{neg}\left(\left(y - z\right)\right)\right)}\right)\right) \]
              3. mul-1-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \left(x \cdot \left(-1 \cdot \color{blue}{\left(y - z\right)}\right)\right)\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \color{blue}{\left(-1 \cdot \left(y - z\right)\right)}\right)\right) \]
              5. mul-1-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(y - z\right)\right)\right)\right)\right) \]
              6. sub-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(y + \left(\mathsf{neg}\left(z\right)\right)\right)\right)\right)\right)\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(z\right)\right) + y\right)\right)\right)\right)\right) \]
              8. distribute-neg-inN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(y\right)\right)}\right)\right)\right) \]
              9. unsub-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z\right)\right)\right)\right) - \color{blue}{y}\right)\right)\right) \]
              10. remove-double-negN/A

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \left(z - y\right)\right)\right) \]
              11. --lowering--.f6479.8%

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(z, \color{blue}{y}\right)\right)\right) \]
            5. Simplified79.8%

              \[\leadsto x + \color{blue}{x \cdot \left(z - y\right)} \]

            if -9.5e8 < x < 8.0000000000000003e-26

            1. Initial program 100.0%

              \[x + \left(y - z\right) \cdot \left(t - x\right) \]
            2. Add Preprocessing
            3. Taylor expanded in x around 0

              \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(t, \color{blue}{\left(y - z\right)}\right) \]
              2. --lowering--.f6481.3%

                \[\leadsto \mathsf{*.f64}\left(t, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right) \]
            5. Simplified81.3%

              \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification80.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -950000000:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \mathbf{elif}\;x \leq 8 \cdot 10^{-26}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 6: 66.9% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -7 \cdot 10^{+111}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 50000000000:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* y (- t x))))
             (if (<= y -7e+111) t_1 (if (<= y 50000000000.0) (* z (- x t)) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = y * (t - x);
          	double tmp;
          	if (y <= -7e+111) {
          		tmp = t_1;
          	} else if (y <= 50000000000.0) {
          		tmp = z * (x - t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: tmp
              t_1 = y * (t - x)
              if (y <= (-7d+111)) then
                  tmp = t_1
              else if (y <= 50000000000.0d0) then
                  tmp = z * (x - t)
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double t_1 = y * (t - x);
          	double tmp;
          	if (y <= -7e+111) {
          		tmp = t_1;
          	} else if (y <= 50000000000.0) {
          		tmp = z * (x - t);
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = y * (t - x)
          	tmp = 0
          	if y <= -7e+111:
          		tmp = t_1
          	elif y <= 50000000000.0:
          		tmp = z * (x - t)
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(y * Float64(t - x))
          	tmp = 0.0
          	if (y <= -7e+111)
          		tmp = t_1;
          	elseif (y <= 50000000000.0)
          		tmp = Float64(z * Float64(x - t));
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = y * (t - x);
          	tmp = 0.0;
          	if (y <= -7e+111)
          		tmp = t_1;
          	elseif (y <= 50000000000.0)
          		tmp = z * (x - t);
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+111], t$95$1, If[LessEqual[y, 50000000000.0], N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := y \cdot \left(t - x\right)\\
          \mathbf{if}\;y \leq -7 \cdot 10^{+111}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq 50000000000:\\
          \;\;\;\;z \cdot \left(x - t\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -7.0000000000000004e111 or 5e10 < y

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(t - x\right)}\right) \]
              2. --lowering--.f6485.8%

                \[\leadsto \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{x}\right)\right) \]
            5. Simplified85.8%

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]

            if -7.0000000000000004e111 < y < 5e10

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
            4. Step-by-step derivation
              1. mul-1-negN/A

                \[\leadsto \mathsf{neg}\left(z \cdot \left(t - x\right)\right) \]
              2. distribute-rgt-neg-inN/A

                \[\leadsto z \cdot \color{blue}{\left(\mathsf{neg}\left(\left(t - x\right)\right)\right)} \]
              3. mul-1-negN/A

                \[\leadsto z \cdot \left(-1 \cdot \color{blue}{\left(t - x\right)}\right) \]
              4. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(z, \color{blue}{\left(-1 \cdot \left(t - x\right)\right)}\right) \]
              5. mul-1-negN/A

                \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\left(t - x\right)\right)\right)\right) \]
              6. sub-negN/A

                \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)\right)\right)\right) \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{*.f64}\left(z, \left(\mathsf{neg}\left(\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)\right)\right)\right) \]
              8. distribute-neg-inN/A

                \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) + \color{blue}{\left(\mathsf{neg}\left(t\right)\right)}\right)\right) \]
              9. unsub-negN/A

                \[\leadsto \mathsf{*.f64}\left(z, \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(x\right)\right)\right)\right) - \color{blue}{t}\right)\right) \]
              10. remove-double-negN/A

                \[\leadsto \mathsf{*.f64}\left(z, \left(x - t\right)\right) \]
              11. --lowering--.f6467.9%

                \[\leadsto \mathsf{*.f64}\left(z, \mathsf{\_.f64}\left(x, \color{blue}{t}\right)\right) \]
            5. Simplified67.9%

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

          Alternative 7: 60.8% accurate, 0.6× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -1.25 \cdot 10^{+113}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+27}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (let* ((t_1 (* y (- t x))))
             (if (<= y -1.25e+113) t_1 (if (<= y 4.3e+27) (* (- y z) t) t_1))))
          double code(double x, double y, double z, double t) {
          	double t_1 = y * (t - x);
          	double tmp;
          	if (y <= -1.25e+113) {
          		tmp = t_1;
          	} else if (y <= 4.3e+27) {
          		tmp = (y - z) * t;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: t_1
              real(8) :: tmp
              t_1 = y * (t - x)
              if (y <= (-1.25d+113)) then
                  tmp = t_1
              else if (y <= 4.3d+27) then
                  tmp = (y - z) * t
              else
                  tmp = t_1
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double t_1 = y * (t - x);
          	double tmp;
          	if (y <= -1.25e+113) {
          		tmp = t_1;
          	} else if (y <= 4.3e+27) {
          		tmp = (y - z) * t;
          	} else {
          		tmp = t_1;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	t_1 = y * (t - x)
          	tmp = 0
          	if y <= -1.25e+113:
          		tmp = t_1
          	elif y <= 4.3e+27:
          		tmp = (y - z) * t
          	else:
          		tmp = t_1
          	return tmp
          
          function code(x, y, z, t)
          	t_1 = Float64(y * Float64(t - x))
          	tmp = 0.0
          	if (y <= -1.25e+113)
          		tmp = t_1;
          	elseif (y <= 4.3e+27)
          		tmp = Float64(Float64(y - z) * t);
          	else
          		tmp = t_1;
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	t_1 = y * (t - x);
          	tmp = 0.0;
          	if (y <= -1.25e+113)
          		tmp = t_1;
          	elseif (y <= 4.3e+27)
          		tmp = (y - z) * t;
          	else
          		tmp = t_1;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e+113], t$95$1, If[LessEqual[y, 4.3e+27], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_1 := y \cdot \left(t - x\right)\\
          \mathbf{if}\;y \leq -1.25 \cdot 10^{+113}:\\
          \;\;\;\;t\_1\\
          
          \mathbf{elif}\;y \leq 4.3 \cdot 10^{+27}:\\
          \;\;\;\;\left(y - z\right) \cdot t\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_1\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -1.25e113 or 4.30000000000000008e27 < y

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(t - x\right)}\right) \]
              2. --lowering--.f6487.1%

                \[\leadsto \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{x}\right)\right) \]
            5. Simplified87.1%

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]

            if -1.25e113 < y < 4.30000000000000008e27

            1. Initial program 100.0%

              \[x + \left(y - z\right) \cdot \left(t - x\right) \]
            2. Add Preprocessing
            3. Taylor expanded in x around 0

              \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(t, \color{blue}{\left(y - z\right)}\right) \]
              2. --lowering--.f6458.6%

                \[\leadsto \mathsf{*.f64}\left(t, \mathsf{\_.f64}\left(y, \color{blue}{z}\right)\right) \]
            5. Simplified58.6%

              \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification70.3%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.25 \cdot 10^{+113}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{+27}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
          5. Add Preprocessing

          Alternative 8: 38.3% accurate, 0.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{-46}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-11}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
          (FPCore (x y z t)
           :precision binary64
           (if (<= y -1.6e-46) (* y t) (if (<= y 2.9e-11) x (* y t))))
          double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -1.6e-46) {
          		tmp = y * t;
          	} else if (y <= 2.9e-11) {
          		tmp = x;
          	} else {
          		tmp = y * t;
          	}
          	return tmp;
          }
          
          real(8) function code(x, y, z, t)
              real(8), intent (in) :: x
              real(8), intent (in) :: y
              real(8), intent (in) :: z
              real(8), intent (in) :: t
              real(8) :: tmp
              if (y <= (-1.6d-46)) then
                  tmp = y * t
              else if (y <= 2.9d-11) then
                  tmp = x
              else
                  tmp = y * t
              end if
              code = tmp
          end function
          
          public static double code(double x, double y, double z, double t) {
          	double tmp;
          	if (y <= -1.6e-46) {
          		tmp = y * t;
          	} else if (y <= 2.9e-11) {
          		tmp = x;
          	} else {
          		tmp = y * t;
          	}
          	return tmp;
          }
          
          def code(x, y, z, t):
          	tmp = 0
          	if y <= -1.6e-46:
          		tmp = y * t
          	elif y <= 2.9e-11:
          		tmp = x
          	else:
          		tmp = y * t
          	return tmp
          
          function code(x, y, z, t)
          	tmp = 0.0
          	if (y <= -1.6e-46)
          		tmp = Float64(y * t);
          	elseif (y <= 2.9e-11)
          		tmp = x;
          	else
          		tmp = Float64(y * t);
          	end
          	return tmp
          end
          
          function tmp_2 = code(x, y, z, t)
          	tmp = 0.0;
          	if (y <= -1.6e-46)
          		tmp = y * t;
          	elseif (y <= 2.9e-11)
          		tmp = x;
          	else
          		tmp = y * t;
          	end
          	tmp_2 = tmp;
          end
          
          code[x_, y_, z_, t_] := If[LessEqual[y, -1.6e-46], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.9e-11], x, N[(y * t), $MachinePrecision]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;y \leq -1.6 \cdot 10^{-46}:\\
          \;\;\;\;y \cdot t\\
          
          \mathbf{elif}\;y \leq 2.9 \cdot 10^{-11}:\\
          \;\;\;\;x\\
          
          \mathbf{else}:\\
          \;\;\;\;y \cdot t\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if y < -1.6e-46 or 2.9e-11 < y

            1. Initial program 100.0%

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

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            4. Step-by-step derivation
              1. *-lowering-*.f64N/A

                \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{\left(t - x\right)}\right) \]
              2. --lowering--.f6476.0%

                \[\leadsto \mathsf{*.f64}\left(y, \mathsf{\_.f64}\left(t, \color{blue}{x}\right)\right) \]
            5. Simplified76.0%

              \[\leadsto \color{blue}{y \cdot \left(t - x\right)} \]
            6. Taylor expanded in t around inf

              \[\leadsto \mathsf{*.f64}\left(y, \color{blue}{t}\right) \]
            7. Step-by-step derivation
              1. Simplified41.2%

                \[\leadsto y \cdot \color{blue}{t} \]

              if -1.6e-46 < y < 2.9e-11

              1. Initial program 100.0%

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

                \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, z\right), \color{blue}{t}\right)\right) \]
              4. Step-by-step derivation
                1. Simplified82.1%

                  \[\leadsto x + \left(y - z\right) \cdot \color{blue}{t} \]
                2. Taylor expanded in x around inf

                  \[\leadsto \color{blue}{x} \]
                3. Step-by-step derivation
                  1. Simplified29.9%

                    \[\leadsto \color{blue}{x} \]
                4. Recombined 2 regimes into one program.
                5. Add Preprocessing

                Alternative 9: 18.3% accurate, 9.0× speedup?

                \[\begin{array}{l} \\ x \end{array} \]
                (FPCore (x y z t) :precision binary64 x)
                double code(double x, double y, double z, double t) {
                	return x;
                }
                
                real(8) function code(x, y, z, t)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    real(8), intent (in) :: z
                    real(8), intent (in) :: t
                    code = x
                end function
                
                public static double code(double x, double y, double z, double t) {
                	return x;
                }
                
                def code(x, y, z, t):
                	return x
                
                function code(x, y, z, t)
                	return x
                end
                
                function tmp = code(x, y, z, t)
                	tmp = x;
                end
                
                code[x_, y_, z_, t_] := x
                
                \begin{array}{l}
                
                \\
                x
                \end{array}
                
                Derivation
                1. Initial program 100.0%

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

                  \[\leadsto \mathsf{+.f64}\left(x, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(y, z\right), \color{blue}{t}\right)\right) \]
                4. Step-by-step derivation
                  1. Simplified68.9%

                    \[\leadsto x + \left(y - z\right) \cdot \color{blue}{t} \]
                  2. Taylor expanded in x around inf

                    \[\leadsto \color{blue}{x} \]
                  3. Step-by-step derivation
                    1. Simplified15.7%

                      \[\leadsto \color{blue}{x} \]
                    2. Add Preprocessing

                    Developer Target 1: 96.1% accurate, 0.6× speedup?

                    \[\begin{array}{l} \\ x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right) \end{array} \]
                    (FPCore (x y z t)
                     :precision binary64
                     (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
                    double code(double x, double y, double z, double t) {
                    	return x + ((t * (y - z)) + (-x * (y - z)));
                    }
                    
                    real(8) function code(x, y, z, t)
                        real(8), intent (in) :: x
                        real(8), intent (in) :: y
                        real(8), intent (in) :: z
                        real(8), intent (in) :: t
                        code = x + ((t * (y - z)) + (-x * (y - z)))
                    end function
                    
                    public static double code(double x, double y, double z, double t) {
                    	return x + ((t * (y - z)) + (-x * (y - z)));
                    }
                    
                    def code(x, y, z, t):
                    	return x + ((t * (y - z)) + (-x * (y - z)))
                    
                    function code(x, y, z, t)
                    	return Float64(x + Float64(Float64(t * Float64(y - z)) + Float64(Float64(-x) * Float64(y - z))))
                    end
                    
                    function tmp = code(x, y, z, t)
                    	tmp = x + ((t * (y - z)) + (-x * (y - z)));
                    end
                    
                    code[x_, y_, z_, t_] := N[(x + N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] + N[((-x) * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    x + \left(t \cdot \left(y - z\right) + \left(-x\right) \cdot \left(y - z\right)\right)
                    \end{array}
                    

                    Reproduce

                    ?
                    herbie shell --seed 2024140 
                    (FPCore (x y z t)
                      :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
                      :precision binary64
                    
                      :alt
                      (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))
                    
                      (+ x (* (- y z) (- t x))))