Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.8s
Alternatives: 13
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 13 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, 0.1× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(y - z, t - x, x\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
	return fma((y - z), (t - x), x);
}
function code(x, y, z, t)
	return fma(Float64(y - z), Float64(t - x), x)
end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}

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

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Step-by-step derivation
    1. +-commutative100.0%

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(t - x\right) + x} \]
    2. fma-define100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  3. Simplified100.0%

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  4. Add Preprocessing
  5. Final simplification100.0%

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

Alternative 2: 59.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ \mathbf{if}\;t \leq -1.2 \cdot 10^{+173}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{+81}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-123}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-155}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-78} \lor \neg \left(t \leq 1.3 \cdot 10^{+65}\right) \land t \leq 3.25 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) t)))
   (if (<= t -1.2e+173)
     t_1
     (if (<= t -4.2e+81)
       (- x (* z t))
       (if (<= t -4.8e-123)
         t_1
         (if (<= t 6e-155)
           (* x (- 1.0 y))
           (if (or (<= t 3e-78) (and (not (<= t 1.3e+65)) (<= t 3.25e+106)))
             (+ x (* z x))
             t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * t;
	double tmp;
	if (t <= -1.2e+173) {
		tmp = t_1;
	} else if (t <= -4.2e+81) {
		tmp = x - (z * t);
	} else if (t <= -4.8e-123) {
		tmp = t_1;
	} else if (t <= 6e-155) {
		tmp = x * (1.0 - y);
	} else if ((t <= 3e-78) || (!(t <= 1.3e+65) && (t <= 3.25e+106))) {
		tmp = x + (z * 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 (t <= (-1.2d+173)) then
        tmp = t_1
    else if (t <= (-4.2d+81)) then
        tmp = x - (z * t)
    else if (t <= (-4.8d-123)) then
        tmp = t_1
    else if (t <= 6d-155) then
        tmp = x * (1.0d0 - y)
    else if ((t <= 3d-78) .or. (.not. (t <= 1.3d+65)) .and. (t <= 3.25d+106)) then
        tmp = x + (z * 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 (t <= -1.2e+173) {
		tmp = t_1;
	} else if (t <= -4.2e+81) {
		tmp = x - (z * t);
	} else if (t <= -4.8e-123) {
		tmp = t_1;
	} else if (t <= 6e-155) {
		tmp = x * (1.0 - y);
	} else if ((t <= 3e-78) || (!(t <= 1.3e+65) && (t <= 3.25e+106))) {
		tmp = x + (z * x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * t
	tmp = 0
	if t <= -1.2e+173:
		tmp = t_1
	elif t <= -4.2e+81:
		tmp = x - (z * t)
	elif t <= -4.8e-123:
		tmp = t_1
	elif t <= 6e-155:
		tmp = x * (1.0 - y)
	elif (t <= 3e-78) or (not (t <= 1.3e+65) and (t <= 3.25e+106)):
		tmp = x + (z * x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (t <= -1.2e+173)
		tmp = t_1;
	elseif (t <= -4.2e+81)
		tmp = Float64(x - Float64(z * t));
	elseif (t <= -4.8e-123)
		tmp = t_1;
	elseif (t <= 6e-155)
		tmp = Float64(x * Float64(1.0 - y));
	elseif ((t <= 3e-78) || (!(t <= 1.3e+65) && (t <= 3.25e+106)))
		tmp = Float64(x + Float64(z * 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 (t <= -1.2e+173)
		tmp = t_1;
	elseif (t <= -4.2e+81)
		tmp = x - (z * t);
	elseif (t <= -4.8e-123)
		tmp = t_1;
	elseif (t <= 6e-155)
		tmp = x * (1.0 - y);
	elseif ((t <= 3e-78) || (~((t <= 1.3e+65)) && (t <= 3.25e+106)))
		tmp = x + (z * 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[t, -1.2e+173], t$95$1, If[LessEqual[t, -4.2e+81], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -4.8e-123], t$95$1, If[LessEqual[t, 6e-155], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3e-78], And[N[Not[LessEqual[t, 1.3e+65]], $MachinePrecision], LessEqual[t, 3.25e+106]]], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -4.2 \cdot 10^{+81}:\\
\;\;\;\;x - z \cdot t\\

\mathbf{elif}\;t \leq -4.8 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 6 \cdot 10^{-155}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\

\mathbf{elif}\;t \leq 3 \cdot 10^{-78} \lor \neg \left(t \leq 1.3 \cdot 10^{+65}\right) \land t \leq 3.25 \cdot 10^{+106}:\\
\;\;\;\;x + z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.2e173 or -4.1999999999999997e81 < t < -4.8e-123 or 2.99999999999999988e-78 < t < 1.30000000000000001e65 or 3.2500000000000001e106 < t

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in98.4%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr98.4%

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(y + -1 \cdot z\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg76.3%

        \[\leadsto t \cdot \left(y + \color{blue}{\left(-z\right)}\right) \]
      2. sub-neg76.3%

        \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
    9. Simplified76.3%

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

    if -1.2e173 < t < -4.1999999999999997e81

    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 88.7%

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

      \[\leadsto \color{blue}{x + -1 \cdot \left(t \cdot z\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg83.0%

        \[\leadsto x + \color{blue}{\left(-t \cdot z\right)} \]
      2. unsub-neg83.0%

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative83.0%

        \[\leadsto x - \color{blue}{z \cdot t} \]
    6. Simplified83.0%

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

    if -4.8e-123 < t < 5.99999999999999967e-155

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg87.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg87.9%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified87.9%

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

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

    if 5.99999999999999967e-155 < t < 2.99999999999999988e-78 or 1.30000000000000001e65 < t < 3.2500000000000001e106

    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 83.9%

      \[\leadsto x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg83.9%

        \[\leadsto x + \color{blue}{\left(-z \cdot \left(t - x\right)\right)} \]
      2. distribute-lft-neg-out83.9%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \left(t - x\right)} \]
      3. *-commutative83.9%

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification73.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{+173}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq -4.2 \cdot 10^{+81}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-123}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq 6 \cdot 10^{-155}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-78} \lor \neg \left(t \leq 1.3 \cdot 10^{+65}\right) \land t \leq 3.25 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 60.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(y - z\right) \cdot t\\ \mathbf{if}\;t \leq -5.3 \cdot 10^{-123}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-78} \lor \neg \left(t \leq 1.8 \cdot 10^{+65}\right) \land t \leq 3.25 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* (- y z) t)))
   (if (<= t -5.3e-123)
     t_1
     (if (<= t 3.4e-159)
       (* x (- 1.0 y))
       (if (or (<= t 3e-78) (and (not (<= t 1.8e+65)) (<= t 3.25e+106)))
         (+ x (* z x))
         t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = (y - z) * t;
	double tmp;
	if (t <= -5.3e-123) {
		tmp = t_1;
	} else if (t <= 3.4e-159) {
		tmp = x * (1.0 - y);
	} else if ((t <= 3e-78) || (!(t <= 1.8e+65) && (t <= 3.25e+106))) {
		tmp = x + (z * 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 (t <= (-5.3d-123)) then
        tmp = t_1
    else if (t <= 3.4d-159) then
        tmp = x * (1.0d0 - y)
    else if ((t <= 3d-78) .or. (.not. (t <= 1.8d+65)) .and. (t <= 3.25d+106)) then
        tmp = x + (z * 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 (t <= -5.3e-123) {
		tmp = t_1;
	} else if (t <= 3.4e-159) {
		tmp = x * (1.0 - y);
	} else if ((t <= 3e-78) || (!(t <= 1.8e+65) && (t <= 3.25e+106))) {
		tmp = x + (z * x);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = (y - z) * t
	tmp = 0
	if t <= -5.3e-123:
		tmp = t_1
	elif t <= 3.4e-159:
		tmp = x * (1.0 - y)
	elif (t <= 3e-78) or (not (t <= 1.8e+65) and (t <= 3.25e+106)):
		tmp = x + (z * x)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (t <= -5.3e-123)
		tmp = t_1;
	elseif (t <= 3.4e-159)
		tmp = Float64(x * Float64(1.0 - y));
	elseif ((t <= 3e-78) || (!(t <= 1.8e+65) && (t <= 3.25e+106)))
		tmp = Float64(x + Float64(z * 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 (t <= -5.3e-123)
		tmp = t_1;
	elseif (t <= 3.4e-159)
		tmp = x * (1.0 - y);
	elseif ((t <= 3e-78) || (~((t <= 1.8e+65)) && (t <= 3.25e+106)))
		tmp = x + (z * 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[t, -5.3e-123], t$95$1, If[LessEqual[t, 3.4e-159], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3e-78], And[N[Not[LessEqual[t, 1.8e+65]], $MachinePrecision], LessEqual[t, 3.25e+106]]], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(y - z\right) \cdot t\\
\mathbf{if}\;t \leq -5.3 \cdot 10^{-123}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 3.4 \cdot 10^{-159}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\

\mathbf{elif}\;t \leq 3 \cdot 10^{-78} \lor \neg \left(t \leq 1.8 \cdot 10^{+65}\right) \land t \leq 3.25 \cdot 10^{+106}:\\
\;\;\;\;x + z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.29999999999999971e-123 or 2.99999999999999988e-78 < t < 1.79999999999999989e65 or 3.2500000000000001e106 < t

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in98.6%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr98.6%

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(y + -1 \cdot z\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg73.8%

        \[\leadsto t \cdot \left(y + \color{blue}{\left(-z\right)}\right) \]
      2. sub-neg73.8%

        \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
    9. Simplified73.8%

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

    if -5.29999999999999971e-123 < t < 3.39999999999999984e-159

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg87.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg87.9%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified87.9%

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

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

    if 3.39999999999999984e-159 < t < 2.99999999999999988e-78 or 1.79999999999999989e65 < t < 3.2500000000000001e106

    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 83.9%

      \[\leadsto x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg83.9%

        \[\leadsto x + \color{blue}{\left(-z \cdot \left(t - x\right)\right)} \]
      2. distribute-lft-neg-out83.9%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \left(t - x\right)} \]
      3. *-commutative83.9%

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification72.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{-123}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{-78} \lor \neg \left(t \leq 1.8 \cdot 10^{+65}\right) \land t \leq 3.25 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 37.9% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -1.45 \cdot 10^{-10}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-116}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-139}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-64}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+104}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= y -1.45e-10)
     (* y t)
     (if (<= y -4e-116)
       x
       (if (<= y 3.5e-139)
         t_1
         (if (<= y 1.25e-64) x (if (<= y 2.1e+104) t_1 (* y (- x)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -1.45e-10) {
		tmp = y * t;
	} else if (y <= -4e-116) {
		tmp = x;
	} else if (y <= 3.5e-139) {
		tmp = t_1;
	} else if (y <= 1.25e-64) {
		tmp = x;
	} else if (y <= 2.1e+104) {
		tmp = t_1;
	} else {
		tmp = y * -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) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (y <= (-1.45d-10)) then
        tmp = y * t
    else if (y <= (-4d-116)) then
        tmp = x
    else if (y <= 3.5d-139) then
        tmp = t_1
    else if (y <= 1.25d-64) then
        tmp = x
    else if (y <= 2.1d+104) then
        tmp = t_1
    else
        tmp = y * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -1.45e-10) {
		tmp = y * t;
	} else if (y <= -4e-116) {
		tmp = x;
	} else if (y <= 3.5e-139) {
		tmp = t_1;
	} else if (y <= 1.25e-64) {
		tmp = x;
	} else if (y <= 2.1e+104) {
		tmp = t_1;
	} else {
		tmp = y * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if y <= -1.45e-10:
		tmp = y * t
	elif y <= -4e-116:
		tmp = x
	elif y <= 3.5e-139:
		tmp = t_1
	elif y <= 1.25e-64:
		tmp = x
	elif y <= 2.1e+104:
		tmp = t_1
	else:
		tmp = y * -x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -1.45e-10)
		tmp = Float64(y * t);
	elseif (y <= -4e-116)
		tmp = x;
	elseif (y <= 3.5e-139)
		tmp = t_1;
	elseif (y <= 1.25e-64)
		tmp = x;
	elseif (y <= 2.1e+104)
		tmp = t_1;
	else
		tmp = Float64(y * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (y <= -1.45e-10)
		tmp = y * t;
	elseif (y <= -4e-116)
		tmp = x;
	elseif (y <= 3.5e-139)
		tmp = t_1;
	elseif (y <= 1.25e-64)
		tmp = x;
	elseif (y <= 2.1e+104)
		tmp = t_1;
	else
		tmp = y * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -1.45e-10], N[(y * t), $MachinePrecision], If[LessEqual[y, -4e-116], x, If[LessEqual[y, 3.5e-139], t$95$1, If[LessEqual[y, 1.25e-64], x, If[LessEqual[y, 2.1e+104], t$95$1, N[(y * (-x)), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(-t\right)\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{-10}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -4 \cdot 10^{-116}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-64}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.4499999999999999e-10

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in96.8%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr96.8%

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

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

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

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

    if -1.4499999999999999e-10 < y < -4e-116 or 3.50000000000000001e-139 < y < 1.25000000000000008e-64

    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 82.2%

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

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

    if -4e-116 < y < 3.50000000000000001e-139 or 1.25000000000000008e-64 < y < 2.0999999999999998e104

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in99.1%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr99.1%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    8. Step-by-step derivation
      1. associate-*r*40.6%

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot z} \]
      2. neg-mul-140.6%

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    9. Simplified40.6%

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

    if 2.0999999999999998e104 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg64.5%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg64.5%

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - y\right)} \]
    7. Taylor expanded in y around inf 61.8%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    8. Step-by-step derivation
      1. associate-*r*61.8%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot y} \]
      2. neg-mul-161.8%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot y \]
      3. *-commutative61.8%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    9. Simplified61.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.45 \cdot 10^{-10}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-116}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-139}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-64}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+104}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+66} \lor \neg \left(x \leq -230000 \lor \neg \left(x \leq -2 \cdot 10^{-39}\right) \land x \leq 1.95 \cdot 10^{-118}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -6.8e+66)
         (not
          (or (<= x -230000.0) (and (not (<= x -2e-39)) (<= x 1.95e-118)))))
   (* x (+ (- z y) 1.0))
   (* (- y z) t)))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -6.8e+66) || !((x <= -230000.0) || (!(x <= -2e-39) && (x <= 1.95e-118)))) {
		tmp = x * ((z - y) + 1.0);
	} else {
		tmp = (y - z) * 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 ((x <= (-6.8d+66)) .or. (.not. (x <= (-230000.0d0)) .or. (.not. (x <= (-2d-39))) .and. (x <= 1.95d-118))) then
        tmp = x * ((z - y) + 1.0d0)
    else
        tmp = (y - z) * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -6.8e+66) || !((x <= -230000.0) || (!(x <= -2e-39) && (x <= 1.95e-118)))) {
		tmp = x * ((z - y) + 1.0);
	} else {
		tmp = (y - z) * t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -6.8e+66) or not ((x <= -230000.0) or (not (x <= -2e-39) and (x <= 1.95e-118))):
		tmp = x * ((z - y) + 1.0)
	else:
		tmp = (y - z) * t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -6.8e+66) || !((x <= -230000.0) || (!(x <= -2e-39) && (x <= 1.95e-118))))
		tmp = Float64(x * Float64(Float64(z - y) + 1.0));
	else
		tmp = Float64(Float64(y - z) * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -6.8e+66) || ~(((x <= -230000.0) || (~((x <= -2e-39)) && (x <= 1.95e-118)))))
		tmp = x * ((z - y) + 1.0);
	else
		tmp = (y - z) * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.8e+66], N[Not[Or[LessEqual[x, -230000.0], And[N[Not[LessEqual[x, -2e-39]], $MachinePrecision], LessEqual[x, 1.95e-118]]]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+66} \lor \neg \left(x \leq -230000 \lor \neg \left(x \leq -2 \cdot 10^{-39}\right) \land x \leq 1.95 \cdot 10^{-118}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

\mathbf{else}:\\
\;\;\;\;\left(y - z\right) \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -6.8000000000000006e66 or -2.3e5 < x < -1.99999999999999986e-39 or 1.95e-118 < x

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg81.6%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg81.6%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified81.6%

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

    if -6.8000000000000006e66 < x < -2.3e5 or -1.99999999999999986e-39 < x < 1.95e-118

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in100.0%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr100.0%

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(y + -1 \cdot z\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg77.3%

        \[\leadsto t \cdot \left(y + \color{blue}{\left(-z\right)}\right) \]
      2. sub-neg77.3%

        \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
    9. Simplified77.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.8 \cdot 10^{+66} \lor \neg \left(x \leq -230000 \lor \neg \left(x \leq -2 \cdot 10^{-39}\right) \land x \leq 1.95 \cdot 10^{-118}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 61.2% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{-123} \lor \neg \left(t \leq 2.5 \cdot 10^{-79}\right) \land \left(t \leq 1.8 \cdot 10^{+65} \lor \neg \left(t \leq 5.6 \cdot 10^{+100}\right)\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -5.3e-123)
         (and (not (<= t 2.5e-79)) (or (<= t 1.8e+65) (not (<= t 5.6e+100)))))
   (* (- y z) t)
   (* x (- 1.0 y))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -5.3e-123) || (!(t <= 2.5e-79) && ((t <= 1.8e+65) || !(t <= 5.6e+100)))) {
		tmp = (y - z) * t;
	} else {
		tmp = x * (1.0 - y);
	}
	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 ((t <= (-5.3d-123)) .or. (.not. (t <= 2.5d-79)) .and. (t <= 1.8d+65) .or. (.not. (t <= 5.6d+100))) then
        tmp = (y - z) * t
    else
        tmp = x * (1.0d0 - y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -5.3e-123) || (!(t <= 2.5e-79) && ((t <= 1.8e+65) || !(t <= 5.6e+100)))) {
		tmp = (y - z) * t;
	} else {
		tmp = x * (1.0 - y);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -5.3e-123) or (not (t <= 2.5e-79) and ((t <= 1.8e+65) or not (t <= 5.6e+100))):
		tmp = (y - z) * t
	else:
		tmp = x * (1.0 - y)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -5.3e-123) || (!(t <= 2.5e-79) && ((t <= 1.8e+65) || !(t <= 5.6e+100))))
		tmp = Float64(Float64(y - z) * t);
	else
		tmp = Float64(x * Float64(1.0 - y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -5.3e-123) || (~((t <= 2.5e-79)) && ((t <= 1.8e+65) || ~((t <= 5.6e+100)))))
		tmp = (y - z) * t;
	else
		tmp = x * (1.0 - y);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.3e-123], And[N[Not[LessEqual[t, 2.5e-79]], $MachinePrecision], Or[LessEqual[t, 1.8e+65], N[Not[LessEqual[t, 5.6e+100]], $MachinePrecision]]]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.3 \cdot 10^{-123} \lor \neg \left(t \leq 2.5 \cdot 10^{-79}\right) \land \left(t \leq 1.8 \cdot 10^{+65} \lor \neg \left(t \leq 5.6 \cdot 10^{+100}\right)\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.29999999999999971e-123 or 2.5e-79 < t < 1.79999999999999989e65 or 5.5999999999999996e100 < t

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in98.0%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr98.0%

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(y + -1 \cdot z\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg73.4%

        \[\leadsto t \cdot \left(y + \color{blue}{\left(-z\right)}\right) \]
      2. sub-neg73.4%

        \[\leadsto t \cdot \color{blue}{\left(y - z\right)} \]
    9. Simplified73.4%

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

    if -5.29999999999999971e-123 < t < 2.5e-79 or 1.79999999999999989e65 < t < 5.5999999999999996e100

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg86.9%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg86.9%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified86.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.3 \cdot 10^{-123} \lor \neg \left(t \leq 2.5 \cdot 10^{-79}\right) \land \left(t \leq 1.8 \cdot 10^{+65} \lor \neg \left(t \leq 5.6 \cdot 10^{+100}\right)\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 77.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+130} \lor \neg \left(x \leq 2.8 \cdot 10^{-118}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= x -1.25e+130) (not (<= x 2.8e-118)))
   (* x (+ (- z y) 1.0))
   (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.25e+130) || !(x <= 2.8e-118)) {
		tmp = x * ((z - y) + 1.0);
	} else {
		tmp = x + ((y - z) * 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 ((x <= (-1.25d+130)) .or. (.not. (x <= 2.8d-118))) then
        tmp = x * ((z - y) + 1.0d0)
    else
        tmp = x + ((y - z) * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.25e+130) || !(x <= 2.8e-118)) {
		tmp = x * ((z - y) + 1.0);
	} else {
		tmp = x + ((y - z) * t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.25e+130) or not (x <= 2.8e-118):
		tmp = x * ((z - y) + 1.0)
	else:
		tmp = x + ((y - z) * t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -1.25e+130) || !(x <= 2.8e-118))
		tmp = Float64(x * Float64(Float64(z - y) + 1.0));
	else
		tmp = Float64(x + Float64(Float64(y - z) * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x <= -1.25e+130) || ~((x <= 2.8e-118)))
		tmp = x * ((z - y) + 1.0);
	else
		tmp = x + ((y - z) * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.25e+130], N[Not[LessEqual[x, 2.8e-118]], $MachinePrecision]], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+130} \lor \neg \left(x \leq 2.8 \cdot 10^{-118}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

\mathbf{else}:\\
\;\;\;\;x + \left(y - z\right) \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.2499999999999999e130 or 2.8e-118 < x

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg83.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg83.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified83.8%

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

    if -1.2499999999999999e130 < x < 2.8e-118

    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 81.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+130} \lor \neg \left(x \leq 2.8 \cdot 10^{-118}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 83.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+97} \lor \neg \left(z \leq 9.8 \cdot 10^{+52}\right):\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -4.2e+97) (not (<= z 9.8e+52)))
   (- x (* z (- t x)))
   (+ x (* y (- t x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4.2e+97) || !(z <= 9.8e+52)) {
		tmp = x - (z * (t - x));
	} else {
		tmp = x + (y * (t - 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 <= (-4.2d+97)) .or. (.not. (z <= 9.8d+52))) then
        tmp = x - (z * (t - x))
    else
        tmp = x + (y * (t - x))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -4.2e+97) || !(z <= 9.8e+52)) {
		tmp = x - (z * (t - x));
	} else {
		tmp = x + (y * (t - x));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -4.2e+97) or not (z <= 9.8e+52):
		tmp = x - (z * (t - x))
	else:
		tmp = x + (y * (t - x))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -4.2e+97) || !(z <= 9.8e+52))
		tmp = Float64(x - Float64(z * Float64(t - x)));
	else
		tmp = Float64(x + Float64(y * Float64(t - x)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -4.2e+97) || ~((z <= 9.8e+52)))
		tmp = x - (z * (t - x));
	else
		tmp = x + (y * (t - x));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -4.2e+97], N[Not[LessEqual[z, 9.8e+52]], $MachinePrecision]], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+97} \lor \neg \left(z \leq 9.8 \cdot 10^{+52}\right):\\
\;\;\;\;x - z \cdot \left(t - x\right)\\

\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(t - x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.20000000000000023e97 or 9.79999999999999993e52 < 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 92.5%

      \[\leadsto x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg92.5%

        \[\leadsto x + \color{blue}{\left(-z \cdot \left(t - x\right)\right)} \]
      2. distribute-lft-neg-out92.5%

        \[\leadsto x + \color{blue}{\left(-z\right) \cdot \left(t - x\right)} \]
      3. *-commutative92.5%

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

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

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

      \[\leadsto x + \color{blue}{z \cdot \left(x + -1 \cdot t\right)} \]
    8. Step-by-step derivation
      1. neg-mul-192.5%

        \[\leadsto x + z \cdot \left(x + \color{blue}{\left(-t\right)}\right) \]
      2. unsub-neg92.5%

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

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

    if -4.20000000000000023e97 < z < 9.79999999999999993e52

    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 84.7%

      \[\leadsto x + \color{blue}{y \cdot \left(t - x\right)} \]
    4. Step-by-step derivation
      1. *-commutative84.7%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot y} \]
    5. Simplified84.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.2 \cdot 10^{+97} \lor \neg \left(z \leq 9.8 \cdot 10^{+52}\right):\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 53.8% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-123} \lor \neg \left(t \leq 9.6 \cdot 10^{-189}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= t -3.3e-123) (not (<= t 9.6e-189))) (* (- y z) t) (* y (- x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -3.3e-123) || !(t <= 9.6e-189)) {
		tmp = (y - z) * t;
	} else {
		tmp = y * -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 ((t <= (-3.3d-123)) .or. (.not. (t <= 9.6d-189))) then
        tmp = (y - z) * t
    else
        tmp = y * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -3.3e-123) || !(t <= 9.6e-189)) {
		tmp = (y - z) * t;
	} else {
		tmp = y * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -3.3e-123) or not (t <= 9.6e-189):
		tmp = (y - z) * t
	else:
		tmp = y * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((t <= -3.3e-123) || !(t <= 9.6e-189))
		tmp = Float64(Float64(y - z) * t);
	else
		tmp = Float64(y * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((t <= -3.3e-123) || ~((t <= 9.6e-189)))
		tmp = (y - z) * t;
	else
		tmp = y * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.3e-123], N[Not[LessEqual[t, 9.6e-189]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], N[(y * (-x)), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-123} \lor \neg \left(t \leq 9.6 \cdot 10^{-189}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.3000000000000003e-123 or 9.5999999999999994e-189 < t

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in98.3%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr98.3%

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

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

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

      \[\leadsto \color{blue}{t \cdot \left(y + -1 \cdot z\right)} \]
    8. Step-by-step derivation
      1. mul-1-neg64.7%

        \[\leadsto t \cdot \left(y + \color{blue}{\left(-z\right)}\right) \]
      2. sub-neg64.7%

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

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

    if -3.3000000000000003e-123 < t < 9.5999999999999994e-189

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg90.3%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg90.3%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified90.3%

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

      \[\leadsto \color{blue}{x \cdot \left(1 - y\right)} \]
    7. Taylor expanded in y around inf 45.3%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    8. Step-by-step derivation
      1. associate-*r*45.3%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot y} \]
      2. neg-mul-145.3%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot y \]
      3. *-commutative45.3%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    9. Simplified45.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.3 \cdot 10^{-123} \lor \neg \left(t \leq 9.6 \cdot 10^{-189}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 38.5% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-6}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= y -1.4e-6) (* y t) (if (<= y 1.0) x (* y (- x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.4e-6) {
		tmp = y * t;
	} else if (y <= 1.0) {
		tmp = x;
	} else {
		tmp = y * -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 (y <= (-1.4d-6)) then
        tmp = y * t
    else if (y <= 1.0d0) then
        tmp = x
    else
        tmp = y * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (y <= -1.4e-6) {
		tmp = y * t;
	} else if (y <= 1.0) {
		tmp = x;
	} else {
		tmp = y * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if y <= -1.4e-6:
		tmp = y * t
	elif y <= 1.0:
		tmp = x
	else:
		tmp = y * -x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (y <= -1.4e-6)
		tmp = Float64(y * t);
	elseif (y <= 1.0)
		tmp = x;
	else
		tmp = Float64(y * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (y <= -1.4e-6)
		tmp = y * t;
	elseif (y <= 1.0)
		tmp = x;
	else
		tmp = y * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.4e-6], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.0], x, N[(y * (-x)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-6}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 1:\\
\;\;\;\;x\\

\mathbf{else}:\\
\;\;\;\;y \cdot \left(-x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.39999999999999994e-6

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in96.8%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr96.8%

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

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

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

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

    if -1.39999999999999994e-6 < y < 1

    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 73.6%

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

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

    if 1 < y

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg55.8%

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right) \]
      2. unsub-neg55.8%

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
    5. Simplified55.8%

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

      \[\leadsto \color{blue}{x \cdot \left(1 - y\right)} \]
    7. Taylor expanded in y around inf 44.4%

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    8. Step-by-step derivation
      1. associate-*r*44.4%

        \[\leadsto \color{blue}{\left(-1 \cdot x\right) \cdot y} \]
      2. neg-mul-144.4%

        \[\leadsto \color{blue}{\left(-x\right)} \cdot y \]
      3. *-commutative44.4%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    9. Simplified44.4%

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

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

Alternative 11: 38.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{-9} \lor \neg \left(y \leq 9.2 \cdot 10^{-18}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= y -1.12e-9) (not (<= y 9.2e-18))) (* y t) x))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.12e-9) || !(y <= 9.2e-18)) {
		tmp = y * t;
	} else {
		tmp = 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 ((y <= (-1.12d-9)) .or. (.not. (y <= 9.2d-18))) then
        tmp = y * t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((y <= -1.12e-9) || !(y <= 9.2e-18)) {
		tmp = y * t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (y <= -1.12e-9) or not (y <= 9.2e-18):
		tmp = y * t
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((y <= -1.12e-9) || !(y <= 9.2e-18))
		tmp = Float64(y * t);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((y <= -1.12e-9) || ~((y <= 9.2e-18)))
		tmp = y * t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.12e-9], N[Not[LessEqual[y, 9.2e-18]], $MachinePrecision]], N[(y * t), $MachinePrecision], x]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.12 \cdot 10^{-9} \lor \neg \left(y \leq 9.2 \cdot 10^{-18}\right):\\
\;\;\;\;y \cdot t\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.12000000000000006e-9 or 9.2000000000000004e-18 < y

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto x + \color{blue}{\left(t - x\right) \cdot \left(y - z\right)} \]
      2. sub-neg100.0%

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in96.9%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr96.9%

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

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

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

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

    if -1.12000000000000006e-9 < y < 9.2000000000000004e-18

    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 74.2%

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification40.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.12 \cdot 10^{-9} \lor \neg \left(y \leq 9.2 \cdot 10^{-18}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 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. Final simplification100.0%

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

Alternative 13: 18.7% 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 65.4%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification18.5%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.6% 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 2024040 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

  :herbie-target
  (+ x (+ (* t (- y z)) (* (- x) (- y z))))

  (+ x (* (- y z) (- t x))))