Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 7.6s
Alternatives: 10
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 10 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} \\ \left(t - x\right) \cdot \left(y - z\right) + x \end{array} \]
(FPCore (x y z t) :precision binary64 (+ (* (- t x) (- y z)) x))
double code(double x, double y, double z, double t) {
	return ((t - x) * (y - z)) + 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 = ((t - x) * (y - z)) + x
end function
public static double code(double x, double y, double z, double t) {
	return ((t - x) * (y - z)) + x;
}
def code(x, y, z, t):
	return ((t - x) * (y - z)) + x
function code(x, y, z, t)
	return Float64(Float64(Float64(t - x) * Float64(y - z)) + x)
end
function tmp = code(x, y, z, t)
	tmp = ((t - x) * (y - z)) + x;
end
code[x_, y_, z_, t_] := N[(N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

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

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

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

Alternative 2: 67.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ \mathbf{if}\;y \leq -5.4 \cdot 10^{+24}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1 \cdot 10^{-142}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-242}:\\ \;\;\;\;\left(x - t\right) \cdot z\\ \mathbf{elif}\;y \leq 4.55 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- t x) y)))
   (if (<= y -5.4e+24)
     t_1
     (if (<= y -1e-142)
       (fma z x x)
       (if (<= y -1.35e-242)
         (* (- x t) z)
         (if (<= y 4.55e-7) (fma z x x) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = (t - x) * y;
	double tmp;
	if (y <= -5.4e+24) {
		tmp = t_1;
	} else if (y <= -1e-142) {
		tmp = fma(z, x, x);
	} else if (y <= -1.35e-242) {
		tmp = (x - t) * z;
	} else if (y <= 4.55e-7) {
		tmp = fma(z, x, x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
function code(x, y, z, t)
	t_1 = Float64(Float64(t - x) * y)
	tmp = 0.0
	if (y <= -5.4e+24)
		tmp = t_1;
	elseif (y <= -1e-142)
		tmp = fma(z, x, x);
	elseif (y <= -1.35e-242)
		tmp = Float64(Float64(x - t) * z);
	elseif (y <= 4.55e-7)
		tmp = fma(z, x, x);
	else
		tmp = t_1;
	end
	return tmp
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -5.4e+24], t$95$1, If[LessEqual[y, -1e-142], N[(z * x + x), $MachinePrecision], If[LessEqual[y, -1.35e-242], N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, 4.55e-7], N[(z * x + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1 \cdot 10^{-142}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\

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

\mathbf{elif}\;y \leq 4.55 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(z, x, x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.4e24 or 4.5499999999999998e-7 < 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. *-commutativeN/A

        \[\leadsto \color{blue}{\left(t - x\right) \cdot y} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(t - x\right) \cdot y} \]
      3. lower--.f6477.9

        \[\leadsto \color{blue}{\left(t - x\right)} \cdot y \]
    5. Applied rewrites77.9%

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

    if -5.4e24 < y < -1e-142 or -1.35e-242 < y < 4.5499999999999998e-7

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right) + x} \]
      2. *-commutativeN/A

        \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} + x \]
      3. associate-*r*N/A

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{x} - t, z, x\right) \]
      11. lower--.f6488.7

        \[\leadsto \mathsf{fma}\left(\color{blue}{x - t}, z, x\right) \]
    5. Applied rewrites88.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(x - t, z, x\right)} \]
    6. Taylor expanded in t around 0

      \[\leadsto x + \color{blue}{x \cdot z} \]
    7. Step-by-step derivation
      1. Applied rewrites65.1%

        \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]

      if -1e-142 < y < -1.35e-242

      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. *-commutativeN/A

          \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} \]
        2. associate-*r*N/A

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

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

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

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \cdot z \]
        6. +-commutativeN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \cdot z \]
        7. distribute-neg-inN/A

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

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

          \[\leadsto \left(\color{blue}{x} - t\right) \cdot z \]
        10. lower--.f6480.0

          \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
      5. Applied rewrites80.0%

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

    Alternative 3: 71.8% accurate, 0.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(t - x\right) \cdot y\\ \mathbf{if}\;y \leq -9.5 \cdot 10^{+66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.5 \cdot 10^{-12}:\\ \;\;\;\;\left(x - t\right) \cdot z\\ \mathbf{elif}\;y \leq 116:\\ \;\;\;\;\mathsf{fma}\left(-t, z, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (x y z t)
     :precision binary64
     (let* ((t_1 (* (- t x) y)))
       (if (<= y -9.5e+66)
         t_1
         (if (<= y -2.5e-12)
           (* (- x t) z)
           (if (<= y 116.0) (fma (- t) z x) t_1)))))
    double code(double x, double y, double z, double t) {
    	double t_1 = (t - x) * y;
    	double tmp;
    	if (y <= -9.5e+66) {
    		tmp = t_1;
    	} else if (y <= -2.5e-12) {
    		tmp = (x - t) * z;
    	} else if (y <= 116.0) {
    		tmp = fma(-t, z, x);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    function code(x, y, z, t)
    	t_1 = Float64(Float64(t - x) * y)
    	tmp = 0.0
    	if (y <= -9.5e+66)
    		tmp = t_1;
    	elseif (y <= -2.5e-12)
    		tmp = Float64(Float64(x - t) * z);
    	elseif (y <= 116.0)
    		tmp = fma(Float64(-t), z, x);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -9.5e+66], t$95$1, If[LessEqual[y, -2.5e-12], N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, 116.0], N[((-t) * z + x), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_1 := \left(t - x\right) \cdot y\\
    \mathbf{if}\;y \leq -9.5 \cdot 10^{+66}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;y \leq -2.5 \cdot 10^{-12}:\\
    \;\;\;\;\left(x - t\right) \cdot z\\
    
    \mathbf{elif}\;y \leq 116:\\
    \;\;\;\;\mathsf{fma}\left(-t, z, x\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if y < -9.50000000000000051e66 or 116 < 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. *-commutativeN/A

          \[\leadsto \color{blue}{\left(t - x\right) \cdot y} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(t - x\right) \cdot y} \]
        3. lower--.f6482.9

          \[\leadsto \color{blue}{\left(t - x\right)} \cdot y \]
      5. Applied rewrites82.9%

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

      if -9.50000000000000051e66 < y < -2.49999999999999985e-12

      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. *-commutativeN/A

          \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} \]
        2. associate-*r*N/A

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

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

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

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \cdot z \]
        6. +-commutativeN/A

          \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \cdot z \]
        7. distribute-neg-inN/A

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

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

          \[\leadsto \left(\color{blue}{x} - t\right) \cdot z \]
        10. lower--.f6466.8

          \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
      5. Applied rewrites66.8%

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

      if -2.49999999999999985e-12 < y < 116

      1. Initial program 100.0%

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

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

          \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right) + x} \]
        2. *-commutativeN/A

          \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} + x \]
        3. associate-*r*N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{x} - t, z, x\right) \]
        11. lower--.f6489.2

          \[\leadsto \mathsf{fma}\left(\color{blue}{x - t}, z, x\right) \]
      5. Applied rewrites89.2%

        \[\leadsto \color{blue}{\mathsf{fma}\left(x - t, z, x\right)} \]
      6. Taylor expanded in t around inf

        \[\leadsto \mathsf{fma}\left(-1 \cdot t, z, x\right) \]
      7. Step-by-step derivation
        1. Applied rewrites70.6%

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

      Alternative 4: 84.5% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \mathsf{fma}\left(x - t, z, x\right)\\ \mathbf{if}\;z \leq -1400000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (fma (- x t) z x)))
         (if (<= z -1400000000000.0)
           t_1
           (if (<= z 1.15e+41) (fma (- t x) y x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = fma((x - t), z, x);
      	double tmp;
      	if (z <= -1400000000000.0) {
      		tmp = t_1;
      	} else if (z <= 1.15e+41) {
      		tmp = fma((t - x), y, x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = fma(Float64(x - t), z, x)
      	tmp = 0.0
      	if (z <= -1400000000000.0)
      		tmp = t_1;
      	elseif (z <= 1.15e+41)
      		tmp = fma(Float64(t - x), y, x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * z + x), $MachinePrecision]}, If[LessEqual[z, -1400000000000.0], t$95$1, If[LessEqual[z, 1.15e+41], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \mathsf{fma}\left(x - t, z, x\right)\\
      \mathbf{if}\;z \leq -1400000000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\
      \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.4e12 or 1.1499999999999999e41 < z

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right) + x} \]
          2. *-commutativeN/A

            \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} + x \]
          3. associate-*r*N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{x} - t, z, x\right) \]
          11. lower--.f6485.0

            \[\leadsto \mathsf{fma}\left(\color{blue}{x - t}, z, x\right) \]
        5. Applied rewrites85.0%

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

        if -1.4e12 < z < 1.1499999999999999e41

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(t - x\right) \cdot y} + x \]
          3. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
          4. lower--.f6489.2

            \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, y, x\right) \]
        5. Applied rewrites89.2%

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

      Alternative 5: 84.5% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x - t\right) \cdot z\\ \mathbf{if}\;z \leq -1500000000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\ \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (let* ((t_1 (* (- x t) z)))
         (if (<= z -1500000000000.0)
           t_1
           (if (<= z 1.15e+41) (fma (- t x) y x) t_1))))
      double code(double x, double y, double z, double t) {
      	double t_1 = (x - t) * z;
      	double tmp;
      	if (z <= -1500000000000.0) {
      		tmp = t_1;
      	} else if (z <= 1.15e+41) {
      		tmp = fma((t - x), y, x);
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	t_1 = Float64(Float64(x - t) * z)
      	tmp = 0.0
      	if (z <= -1500000000000.0)
      		tmp = t_1;
      	elseif (z <= 1.15e+41)
      		tmp = fma(Float64(t - x), y, x);
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -1500000000000.0], t$95$1, If[LessEqual[z, 1.15e+41], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_1 := \left(x - t\right) \cdot z\\
      \mathbf{if}\;z \leq -1500000000000:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;z \leq 1.15 \cdot 10^{+41}:\\
      \;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if z < -1.5e12 or 1.1499999999999999e41 < z

        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. *-commutativeN/A

            \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} \]
          2. associate-*r*N/A

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

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

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

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \cdot z \]
          6. +-commutativeN/A

            \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \cdot z \]
          7. distribute-neg-inN/A

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

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

            \[\leadsto \left(\color{blue}{x} - t\right) \cdot z \]
          10. lower--.f6484.9

            \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
        5. Applied rewrites84.9%

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

        if -1.5e12 < z < 1.1499999999999999e41

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{y \cdot \left(t - x\right) + x} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(t - x\right) \cdot y} + x \]
          3. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, y, x\right)} \]
          4. lower--.f6489.2

            \[\leadsto \mathsf{fma}\left(\color{blue}{t - x}, y, x\right) \]
        5. Applied rewrites89.2%

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

      Alternative 6: 62.2% accurate, 0.7× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -0.0035:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{elif}\;x \leq 0.2:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \end{array} \end{array} \]
      (FPCore (x y z t)
       :precision binary64
       (if (<= x -0.0035) (fma z x x) (if (<= x 0.2) (* t (- y z)) (fma z x x))))
      double code(double x, double y, double z, double t) {
      	double tmp;
      	if (x <= -0.0035) {
      		tmp = fma(z, x, x);
      	} else if (x <= 0.2) {
      		tmp = t * (y - z);
      	} else {
      		tmp = fma(z, x, x);
      	}
      	return tmp;
      }
      
      function code(x, y, z, t)
      	tmp = 0.0
      	if (x <= -0.0035)
      		tmp = fma(z, x, x);
      	elseif (x <= 0.2)
      		tmp = Float64(t * Float64(y - z));
      	else
      		tmp = fma(z, x, x);
      	end
      	return tmp
      end
      
      code[x_, y_, z_, t_] := If[LessEqual[x, -0.0035], N[(z * x + x), $MachinePrecision], If[LessEqual[x, 0.2], N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision], N[(z * x + x), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;x \leq -0.0035:\\
      \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
      
      \mathbf{elif}\;x \leq 0.2:\\
      \;\;\;\;t \cdot \left(y - z\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < -0.00350000000000000007 or 0.20000000000000001 < x

        1. Initial program 100.0%

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

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

            \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right) + x} \]
          2. *-commutativeN/A

            \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} + x \]
          3. associate-*r*N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{x} - t, z, x\right) \]
          11. lower--.f6471.5

            \[\leadsto \mathsf{fma}\left(\color{blue}{x - t}, z, x\right) \]
        5. Applied rewrites71.5%

          \[\leadsto \color{blue}{\mathsf{fma}\left(x - t, z, x\right)} \]
        6. Taylor expanded in t around 0

          \[\leadsto x + \color{blue}{x \cdot z} \]
        7. Step-by-step derivation
          1. Applied rewrites66.0%

            \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]

          if -0.00350000000000000007 < x < 0.20000000000000001

          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 \color{blue}{t \cdot \left(y - z\right)} \]
          4. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
            2. lower--.f6472.1

              \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
          5. Applied rewrites72.1%

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

        Alternative 7: 46.8% accurate, 0.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -2.5 \cdot 10^{+61}:\\ \;\;\;\;\left(-t\right) \cdot z\\ \mathbf{elif}\;t \leq 4.2 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot y\\ \end{array} \end{array} \]
        (FPCore (x y z t)
         :precision binary64
         (if (<= t -2.5e+61) (* (- t) z) (if (<= t 4.2e+112) (fma z x x) (* t y))))
        double code(double x, double y, double z, double t) {
        	double tmp;
        	if (t <= -2.5e+61) {
        		tmp = -t * z;
        	} else if (t <= 4.2e+112) {
        		tmp = fma(z, x, x);
        	} else {
        		tmp = t * y;
        	}
        	return tmp;
        }
        
        function code(x, y, z, t)
        	tmp = 0.0
        	if (t <= -2.5e+61)
        		tmp = Float64(Float64(-t) * z);
        	elseif (t <= 4.2e+112)
        		tmp = fma(z, x, x);
        	else
        		tmp = Float64(t * y);
        	end
        	return tmp
        end
        
        code[x_, y_, z_, t_] := If[LessEqual[t, -2.5e+61], N[((-t) * z), $MachinePrecision], If[LessEqual[t, 4.2e+112], N[(z * x + x), $MachinePrecision], N[(t * y), $MachinePrecision]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;t \leq -2.5 \cdot 10^{+61}:\\
        \;\;\;\;\left(-t\right) \cdot z\\
        
        \mathbf{elif}\;t \leq 4.2 \cdot 10^{+112}:\\
        \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t \cdot y\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if t < -2.50000000000000009e61

          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. *-commutativeN/A

              \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} \]
            2. associate-*r*N/A

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

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

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

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \cdot z \]
            6. +-commutativeN/A

              \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \cdot z \]
            7. distribute-neg-inN/A

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

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

              \[\leadsto \left(\color{blue}{x} - t\right) \cdot z \]
            10. lower--.f6457.0

              \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
          5. Applied rewrites57.0%

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

            \[\leadsto \left(-1 \cdot t\right) \cdot z \]
          7. Step-by-step derivation
            1. Applied rewrites52.9%

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

            if -2.50000000000000009e61 < t < 4.1999999999999998e112

            1. Initial program 100.0%

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

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

                \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right) + x} \]
              2. *-commutativeN/A

                \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} + x \]
              3. associate-*r*N/A

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{x} - t, z, x\right) \]
              11. lower--.f6466.9

                \[\leadsto \mathsf{fma}\left(\color{blue}{x - t}, z, x\right) \]
            5. Applied rewrites66.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(x - t, z, x\right)} \]
            6. Taylor expanded in t around 0

              \[\leadsto x + \color{blue}{x \cdot z} \]
            7. Step-by-step derivation
              1. Applied rewrites56.1%

                \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]

              if 4.1999999999999998e112 < t

              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 \color{blue}{t \cdot \left(y - z\right)} \]
              4. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                2. lower--.f6482.5

                  \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
              5. Applied rewrites82.5%

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

                \[\leadsto t \cdot \color{blue}{y} \]
              7. Step-by-step derivation
                1. Applied rewrites51.8%

                  \[\leadsto t \cdot \color{blue}{y} \]
              8. Recombined 3 regimes into one program.
              9. Add Preprocessing

              Alternative 8: 49.3% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+76}:\\ \;\;\;\;t \cdot y\\ \mathbf{elif}\;y \leq 4.55 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot y\\ \end{array} \end{array} \]
              (FPCore (x y z t)
               :precision binary64
               (if (<= y -1e+76) (* t y) (if (<= y 4.55e-7) (fma z x x) (* t y))))
              double code(double x, double y, double z, double t) {
              	double tmp;
              	if (y <= -1e+76) {
              		tmp = t * y;
              	} else if (y <= 4.55e-7) {
              		tmp = fma(z, x, x);
              	} else {
              		tmp = t * y;
              	}
              	return tmp;
              }
              
              function code(x, y, z, t)
              	tmp = 0.0
              	if (y <= -1e+76)
              		tmp = Float64(t * y);
              	elseif (y <= 4.55e-7)
              		tmp = fma(z, x, x);
              	else
              		tmp = Float64(t * y);
              	end
              	return tmp
              end
              
              code[x_, y_, z_, t_] := If[LessEqual[y, -1e+76], N[(t * y), $MachinePrecision], If[LessEqual[y, 4.55e-7], N[(z * x + x), $MachinePrecision], N[(t * y), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;y \leq -1 \cdot 10^{+76}:\\
              \;\;\;\;t \cdot y\\
              
              \mathbf{elif}\;y \leq 4.55 \cdot 10^{-7}:\\
              \;\;\;\;\mathsf{fma}\left(z, x, x\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;t \cdot y\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if y < -1e76 or 4.5499999999999998e-7 < y

                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 \color{blue}{t \cdot \left(y - z\right)} \]
                4. Step-by-step derivation
                  1. lower-*.f64N/A

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

                    \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
                5. Applied rewrites54.2%

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

                  \[\leadsto t \cdot \color{blue}{y} \]
                7. Step-by-step derivation
                  1. Applied rewrites45.4%

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

                  if -1e76 < y < 4.5499999999999998e-7

                  1. Initial program 100.0%

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

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

                      \[\leadsto \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right) + x} \]
                    2. *-commutativeN/A

                      \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} + x \]
                    3. associate-*r*N/A

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{fma}\left(\color{blue}{x} - t, z, x\right) \]
                    11. lower--.f6485.4

                      \[\leadsto \mathsf{fma}\left(\color{blue}{x - t}, z, x\right) \]
                  5. Applied rewrites85.4%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(x - t, z, x\right)} \]
                  6. Taylor expanded in t around 0

                    \[\leadsto x + \color{blue}{x \cdot z} \]
                  7. Step-by-step derivation
                    1. Applied rewrites57.6%

                      \[\leadsto \mathsf{fma}\left(z, \color{blue}{x}, x\right) \]
                  8. Recombined 2 regimes into one program.
                  9. Add Preprocessing

                  Alternative 9: 38.5% accurate, 0.8× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.5 \cdot 10^{+24}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+41}:\\ \;\;\;\;t \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
                  (FPCore (x y z t)
                   :precision binary64
                   (if (<= z -5.5e+24) (* z x) (if (<= z 2.8e+41) (* t y) (* z x))))
                  double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (z <= -5.5e+24) {
                  		tmp = z * x;
                  	} else if (z <= 2.8e+41) {
                  		tmp = t * y;
                  	} else {
                  		tmp = z * x;
                  	}
                  	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 (z <= (-5.5d+24)) then
                          tmp = z * x
                      else if (z <= 2.8d+41) then
                          tmp = t * y
                      else
                          tmp = z * x
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double y, double z, double t) {
                  	double tmp;
                  	if (z <= -5.5e+24) {
                  		tmp = z * x;
                  	} else if (z <= 2.8e+41) {
                  		tmp = t * y;
                  	} else {
                  		tmp = z * x;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, y, z, t):
                  	tmp = 0
                  	if z <= -5.5e+24:
                  		tmp = z * x
                  	elif z <= 2.8e+41:
                  		tmp = t * y
                  	else:
                  		tmp = z * x
                  	return tmp
                  
                  function code(x, y, z, t)
                  	tmp = 0.0
                  	if (z <= -5.5e+24)
                  		tmp = Float64(z * x);
                  	elseif (z <= 2.8e+41)
                  		tmp = Float64(t * y);
                  	else
                  		tmp = Float64(z * x);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, y, z, t)
                  	tmp = 0.0;
                  	if (z <= -5.5e+24)
                  		tmp = z * x;
                  	elseif (z <= 2.8e+41)
                  		tmp = t * y;
                  	else
                  		tmp = z * x;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, y_, z_, t_] := If[LessEqual[z, -5.5e+24], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.8e+41], N[(t * y), $MachinePrecision], N[(z * x), $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;z \leq -5.5 \cdot 10^{+24}:\\
                  \;\;\;\;z \cdot x\\
                  
                  \mathbf{elif}\;z \leq 2.8 \cdot 10^{+41}:\\
                  \;\;\;\;t \cdot y\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;z \cdot x\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if z < -5.5000000000000002e24 or 2.7999999999999999e41 < z

                    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. *-commutativeN/A

                        \[\leadsto -1 \cdot \color{blue}{\left(\left(t - x\right) \cdot z\right)} \]
                      2. associate-*r*N/A

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

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

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

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(t + \left(\mathsf{neg}\left(x\right)\right)\right)}\right)\right) \cdot z \]
                      6. +-commutativeN/A

                        \[\leadsto \left(\mathsf{neg}\left(\color{blue}{\left(\left(\mathsf{neg}\left(x\right)\right) + t\right)}\right)\right) \cdot z \]
                      7. distribute-neg-inN/A

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

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

                        \[\leadsto \left(\color{blue}{x} - t\right) \cdot z \]
                      10. lower--.f6484.8

                        \[\leadsto \color{blue}{\left(x - t\right)} \cdot z \]
                    5. Applied rewrites84.8%

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

                      \[\leadsto x \cdot \color{blue}{z} \]
                    7. Step-by-step derivation
                      1. Applied rewrites45.0%

                        \[\leadsto z \cdot \color{blue}{x} \]

                      if -5.5000000000000002e24 < z < 2.7999999999999999e41

                      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 \color{blue}{t \cdot \left(y - z\right)} \]
                      4. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                        2. lower--.f6442.0

                          \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
                      5. Applied rewrites42.0%

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

                        \[\leadsto t \cdot \color{blue}{y} \]
                      7. Step-by-step derivation
                        1. Applied rewrites33.1%

                          \[\leadsto t \cdot \color{blue}{y} \]
                      8. Recombined 2 regimes into one program.
                      9. Add Preprocessing

                      Alternative 10: 25.4% accurate, 2.5× speedup?

                      \[\begin{array}{l} \\ t \cdot y \end{array} \]
                      (FPCore (x y z t) :precision binary64 (* t y))
                      double code(double x, double y, double z, double t) {
                      	return t * y;
                      }
                      
                      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 = t * y
                      end function
                      
                      public static double code(double x, double y, double z, double t) {
                      	return t * y;
                      }
                      
                      def code(x, y, z, t):
                      	return t * y
                      
                      function code(x, y, z, t)
                      	return Float64(t * y)
                      end
                      
                      function tmp = code(x, y, z, t)
                      	tmp = t * y;
                      end
                      
                      code[x_, y_, z_, t_] := N[(t * y), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      t \cdot y
                      \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 \color{blue}{t \cdot \left(y - z\right)} \]
                      4. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
                        2. lower--.f6445.7

                          \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
                      5. Applied rewrites45.7%

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

                        \[\leadsto t \cdot \color{blue}{y} \]
                      7. Step-by-step derivation
                        1. Applied rewrites24.6%

                          \[\leadsto t \cdot \color{blue}{y} \]
                        2. Add Preprocessing

                        Developer Target 1: 96.4% 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 2024240 
                        (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))))