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, 1.0× speedup?

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

\\
x + \left(t - x\right) \cdot \left(y - z\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(t - x\right) \cdot \left(y - z\right) \]
  4. Add Preprocessing

Alternative 2: 38.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ t_2 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -3.7 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.55 \cdot 10^{-48}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-191}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{+42}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+187}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- y))) (t_2 (* z (- t))))
   (if (<= y -3.7e+14)
     t_1
     (if (<= y -2.55e-48)
       t_2
       (if (<= y -2.7e-191)
         x
         (if (<= y 3.7e+42) t_2 (if (<= y 8e+187) t_1 (* y t))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * -y;
	double t_2 = z * -t;
	double tmp;
	if (y <= -3.7e+14) {
		tmp = t_1;
	} else if (y <= -2.55e-48) {
		tmp = t_2;
	} else if (y <= -2.7e-191) {
		tmp = x;
	} else if (y <= 3.7e+42) {
		tmp = t_2;
	} else if (y <= 8e+187) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * -y
    t_2 = z * -t
    if (y <= (-3.7d+14)) then
        tmp = t_1
    else if (y <= (-2.55d-48)) then
        tmp = t_2
    else if (y <= (-2.7d-191)) then
        tmp = x
    else if (y <= 3.7d+42) then
        tmp = t_2
    else if (y <= 8d+187) then
        tmp = t_1
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * -y;
	double t_2 = z * -t;
	double tmp;
	if (y <= -3.7e+14) {
		tmp = t_1;
	} else if (y <= -2.55e-48) {
		tmp = t_2;
	} else if (y <= -2.7e-191) {
		tmp = x;
	} else if (y <= 3.7e+42) {
		tmp = t_2;
	} else if (y <= 8e+187) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * -y
	t_2 = z * -t
	tmp = 0
	if y <= -3.7e+14:
		tmp = t_1
	elif y <= -2.55e-48:
		tmp = t_2
	elif y <= -2.7e-191:
		tmp = x
	elif y <= 3.7e+42:
		tmp = t_2
	elif y <= 8e+187:
		tmp = t_1
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(-y))
	t_2 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -3.7e+14)
		tmp = t_1;
	elseif (y <= -2.55e-48)
		tmp = t_2;
	elseif (y <= -2.7e-191)
		tmp = x;
	elseif (y <= 3.7e+42)
		tmp = t_2;
	elseif (y <= 8e+187)
		tmp = t_1;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * -y;
	t_2 = z * -t;
	tmp = 0.0;
	if (y <= -3.7e+14)
		tmp = t_1;
	elseif (y <= -2.55e-48)
		tmp = t_2;
	elseif (y <= -2.7e-191)
		tmp = x;
	elseif (y <= 3.7e+42)
		tmp = t_2;
	elseif (y <= 8e+187)
		tmp = t_1;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * (-y)), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -3.7e+14], t$95$1, If[LessEqual[y, -2.55e-48], t$95$2, If[LessEqual[y, -2.7e-191], x, If[LessEqual[y, 3.7e+42], t$95$2, If[LessEqual[y, 8e+187], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2.55 \cdot 10^{-48}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -2.7 \cdot 10^{-191}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 3.7 \cdot 10^{+42}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 8 \cdot 10^{+187}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;y \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.7e14 or 3.69999999999999996e42 < y < 7.99999999999999926e187

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in62.8%

        \[\leadsto x + \color{blue}{x \cdot \left(-\left(y - z\right)\right)} \]
      3. sub-neg62.8%

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in62.8%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg62.8%

        \[\leadsto x + x \cdot \left(\color{blue}{z} + \left(-y\right)\right) \]
      7. sub-neg62.8%

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity56.7%

        \[\leadsto \color{blue}{x \cdot 1} + \left(-x \cdot y\right) \]
      3. distribute-rgt-neg-out56.7%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in56.7%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg56.7%

        \[\leadsto \color{blue}{-x \cdot y} \]
      2. *-commutative56.7%

        \[\leadsto -\color{blue}{y \cdot x} \]
      3. distribute-rgt-neg-in56.7%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    11. Simplified56.7%

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

    if -3.7e14 < y < -2.55000000000000006e-48 or -2.69999999999999999e-191 < y < 3.69999999999999996e42

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - z \cdot t} \]
    7. Taylor expanded in x around 0 46.4%

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-lft-neg-in46.4%

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

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

    if -2.55000000000000006e-48 < y < -2.69999999999999999e-191

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

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

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

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

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

    if 7.99999999999999926e187 < 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-in83.3%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr83.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 59.4%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+59.4%

        \[\leadsto \color{blue}{\left(x + -1 \cdot \left(t \cdot z\right)\right) + t \cdot y} \]
      2. mul-1-neg59.4%

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative59.4%

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification51.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.7 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -2.55 \cdot 10^{-48}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -2.7 \cdot 10^{-191}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 3.7 \cdot 10^{+42}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 8 \cdot 10^{+187}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -9.6 \cdot 10^{-49}:\\
\;\;\;\;x \cdot z\\

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

\mathbf{elif}\;y \leq 2.32 \cdot 10^{+188}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;y \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.8e21 or 0.0043 < y < 2.3200000000000001e188

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in62.1%

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

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

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

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg62.1%

        \[\leadsto x + x \cdot \left(\color{blue}{z} + \left(-y\right)\right) \]
      7. sub-neg62.1%

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity54.8%

        \[\leadsto \color{blue}{x \cdot 1} + \left(-x \cdot y\right) \]
      3. distribute-rgt-neg-out54.8%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in54.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg54.2%

        \[\leadsto \color{blue}{-x \cdot y} \]
      2. *-commutative54.2%

        \[\leadsto -\color{blue}{y \cdot x} \]
      3. distribute-rgt-neg-in54.2%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    11. Simplified54.2%

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

    if -1.8e21 < y < -9.59999999999999969e-49

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in46.9%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in46.9%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg46.9%

        \[\leadsto x + x \cdot \left(\color{blue}{z} + \left(-y\right)\right) \]
      7. sub-neg46.9%

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

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

      \[\leadsto x + x \cdot \color{blue}{z} \]
    7. Taylor expanded in z around inf 46.9%

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

    if -9.59999999999999969e-49 < y < 0.0043

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

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

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

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

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

    if 2.3200000000000001e188 < 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-in83.3%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr83.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 59.4%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+59.4%

        \[\leadsto \color{blue}{\left(x + -1 \cdot \left(t \cdot z\right)\right) + t \cdot y} \]
      2. mul-1-neg59.4%

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative59.4%

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification46.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+21}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -9.6 \cdot 10^{-49}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;y \leq 0.0043:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 2.32 \cdot 10^{+188}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 76.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + x \cdot \left(z - y\right)\\ \mathbf{if}\;x \leq -1.1 \cdot 10^{-87}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{-91}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{elif}\;x \leq 850000000:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* x (- z y)))))
   (if (<= x -1.1e-87)
     t_1
     (if (<= x 2.5e-91)
       (* t (- y z))
       (if (<= x 850000000.0) (+ x (* y (- t x))) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (x * (z - y));
	double tmp;
	if (x <= -1.1e-87) {
		tmp = t_1;
	} else if (x <= 2.5e-91) {
		tmp = t * (y - z);
	} else if (x <= 850000000.0) {
		tmp = x + (y * (t - 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 = x + (x * (z - y))
    if (x <= (-1.1d-87)) then
        tmp = t_1
    else if (x <= 2.5d-91) then
        tmp = t * (y - z)
    else if (x <= 850000000.0d0) then
        tmp = x + (y * (t - 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 = x + (x * (z - y));
	double tmp;
	if (x <= -1.1e-87) {
		tmp = t_1;
	} else if (x <= 2.5e-91) {
		tmp = t * (y - z);
	} else if (x <= 850000000.0) {
		tmp = x + (y * (t - x));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (x * (z - y))
	tmp = 0
	if x <= -1.1e-87:
		tmp = t_1
	elif x <= 2.5e-91:
		tmp = t * (y - z)
	elif x <= 850000000.0:
		tmp = x + (y * (t - x))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(x * Float64(z - y)))
	tmp = 0.0
	if (x <= -1.1e-87)
		tmp = t_1;
	elseif (x <= 2.5e-91)
		tmp = Float64(t * Float64(y - z));
	elseif (x <= 850000000.0)
		tmp = Float64(x + Float64(y * Float64(t - x)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (x * (z - y));
	tmp = 0.0;
	if (x <= -1.1e-87)
		tmp = t_1;
	elseif (x <= 2.5e-91)
		tmp = t * (y - z);
	elseif (x <= 850000000.0)
		tmp = x + (y * (t - x));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.1e-87], t$95$1, If[LessEqual[x, 2.5e-91], N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 850000000.0], N[(x + N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.09999999999999994e-87 or 8.5e8 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in84.0%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in84.0%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg84.0%

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

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

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

    if -1.09999999999999994e-87 < x < 2.49999999999999999e-91

    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.9%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr98.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 87.0%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+87.0%

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative87.0%

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--82.1%

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

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

    if 2.49999999999999999e-91 < x < 8.5e8

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

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

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

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

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

Alternative 5: 84.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+14} \lor \neg \left(y \leq 2.55 \cdot 10^{+42}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.2e14 or 2.55e42 < 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 86.7%

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

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

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

    if -6.2e14 < y < 2.55e42

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

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

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

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

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

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

Alternative 6: 80.6% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{-38} \lor \neg \left(x \leq 2.7 \cdot 10^{-12}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -9.5000000000000009e-38 or 2.6999999999999998e-12 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in85.2%

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

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

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

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg85.2%

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

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

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

    if -9.5000000000000009e-38 < x < 2.6999999999999998e-12

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

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

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

Alternative 7: 75.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-87} \lor \neg \left(x \leq 3.3 \cdot 10^{-91}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.30000000000000001e-87 or 3.30000000000000011e-91 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in80.9%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in80.9%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg80.9%

        \[\leadsto x + x \cdot \left(\color{blue}{z} + \left(-y\right)\right) \]
      7. sub-neg80.9%

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

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

    if -1.30000000000000001e-87 < x < 3.30000000000000011e-91

    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.9%

        \[\leadsto x + \color{blue}{\left(\left(t - x\right) \cdot y + \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr98.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 87.0%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+87.0%

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative87.0%

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--82.1%

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

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

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

Alternative 8: 60.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-65} \lor \neg \left(x \leq 8.5 \cdot 10^{-37}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.50000000000000005e-65 or 8.5000000000000007e-37 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in84.0%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in84.0%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg84.0%

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity63.1%

        \[\leadsto \color{blue}{x \cdot 1} + \left(-x \cdot y\right) \]
      3. distribute-rgt-neg-out63.1%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in63.0%

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

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

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

    if -3.50000000000000005e-65 < x < 8.5000000000000007e-37

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

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+84.0%

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative84.0%

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--76.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{-65} \lor \neg \left(x \leq 8.5 \cdot 10^{-37}\right):\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 53.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-20} \lor \neg \left(t \leq 2 \cdot 10^{-119}\right):\\
\;\;\;\;t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.50000000000000014e-20 or 2.00000000000000003e-119 < 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-in94.7%

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

      \[\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 76.7%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+76.7%

        \[\leadsto \color{blue}{\left(x + -1 \cdot \left(t \cdot z\right)\right) + t \cdot y} \]
      2. mul-1-neg76.7%

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative76.7%

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--65.4%

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

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

    if -1.50000000000000014e-20 < t < 2.00000000000000003e-119

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in84.9%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in84.9%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg84.9%

        \[\leadsto x + x \cdot \left(\color{blue}{z} + \left(-y\right)\right) \]
      7. sub-neg84.9%

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity66.8%

        \[\leadsto \color{blue}{x \cdot 1} + \left(-x \cdot y\right) \]
      3. distribute-rgt-neg-out66.8%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in66.8%

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    10. Step-by-step derivation
      1. mul-1-neg48.7%

        \[\leadsto \color{blue}{-x \cdot y} \]
      2. *-commutative48.7%

        \[\leadsto -\color{blue}{y \cdot x} \]
      3. distribute-rgt-neg-in48.7%

        \[\leadsto \color{blue}{y \cdot \left(-x\right)} \]
    11. Simplified48.7%

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

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

Alternative 10: 60.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{-65}:\\
\;\;\;\;x - x \cdot y\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.8e-65

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-1 \cdot x\right)} \cdot y \]
    7. Step-by-step derivation
      1. neg-mul-161.9%

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

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

    if -2.8e-65 < x < 3.8999999999999999e-37

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

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+84.0%

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative84.0%

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--76.7%

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

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

    if 3.8999999999999999e-37 < x

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in85.0%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in85.0%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg85.0%

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity64.5%

        \[\leadsto \color{blue}{x \cdot 1} + \left(-x \cdot y\right) \]
      3. distribute-rgt-neg-out64.5%

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in64.5%

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

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

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

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

Alternative 11: 38.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+23} \lor \neg \left(z \leq 4.9 \cdot 10^{+14}\right):\\
\;\;\;\;x \cdot z\\

\mathbf{else}:\\
\;\;\;\;y \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.0000000000000004e23 or 4.9e14 < z

    1. Initial program 100.0%

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot \left(y - z\right)\right)} \]
      2. distribute-rgt-neg-in53.5%

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in53.5%

        \[\leadsto x + x \cdot \color{blue}{\left(\left(-\left(-z\right)\right) + \left(-y\right)\right)} \]
      6. remove-double-neg53.5%

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

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

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

      \[\leadsto x + x \cdot \color{blue}{z} \]
    7. Taylor expanded in z around inf 39.8%

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

    if -7.0000000000000004e23 < z < 4.9e14

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

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+70.6%

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative70.6%

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification37.0%

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

Alternative 12: 37.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.4 \cdot 10^{-57} \lor \neg \left(y \leq 0.00022\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.3999999999999998e-57 or 2.20000000000000008e-4 < 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-in91.7%

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

      \[\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 49.6%

      \[\leadsto x + \color{blue}{\left(-1 \cdot \left(t \cdot z\right) + t \cdot y\right)} \]
    6. Step-by-step derivation
      1. associate-+r+49.6%

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative49.6%

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

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

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

    if -8.3999999999999998e-57 < y < 2.20000000000000008e-4

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

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

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

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

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

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

Alternative 13: 18.9% 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 y around inf 63.8%

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

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

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

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

Developer Target 1: 96.3% 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 2024185 
(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))))