Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.3s
Alternatives: 12
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 12 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.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 5.4 \cdot 10^{-185}:\\
\;\;\;\;t \cdot \left(-z\right)\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+184}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.65e-15 or 1.1500000000000001e22 < y < 1.29999999999999997e184

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -1.65e-15 < y < 5.39999999999999976e-185

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. *-commutative45.8%

        \[\leadsto -\color{blue}{z \cdot t} \]
      3. distribute-rgt-neg-in45.8%

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

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

    if 5.39999999999999976e-185 < y < 1.1500000000000001e22

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.29999999999999997e184 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.65 \cdot 10^{-15}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-185}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+22}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+184}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 9 \cdot 10^{-61}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 8.4 \cdot 10^{+21}:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;y \leq 1.12 \cdot 10^{+179}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.52e-49 or 8.4e21 < y < 1.11999999999999997e179

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -1.52e-49 < y < 9e-61

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

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

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

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

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

    if 9e-61 < y < 8.4e21

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.11999999999999997e179 < y

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.52 \cdot 10^{-49}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-61}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+21}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;y \leq 1.12 \cdot 10^{+179}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 70.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 4 \cdot 10^{-186}:\\
\;\;\;\;x - z \cdot t\\

\mathbf{elif}\;y \leq 8.4 \cdot 10^{+21}:\\
\;\;\;\;x + x \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.99999999999999976e-11 or 8.4e21 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -3.99999999999999976e-11 < y < 3.9999999999999996e-186

    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 \color{blue}{x + -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. unsub-neg92.5%

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

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

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

    if 3.9999999999999996e-186 < y < 8.4e21

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + x \cdot \color{blue}{z} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 5: 55.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-185}:\\
\;\;\;\;t \cdot \left(-z\right)\\

\mathbf{elif}\;y \leq 8.4 \cdot 10^{+21}:\\
\;\;\;\;x \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.54999999999999991e-18 or 8.4e21 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -2.54999999999999991e-18 < y < 5.4999999999999998e-185

    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 \color{blue}{x + -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. unsub-neg92.5%

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

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

      \[\leadsto x - z \cdot \color{blue}{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. mul-1-neg46.4%

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. *-commutative46.4%

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

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

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

    if 5.4999999999999998e-185 < y < 8.4e21

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.55 \cdot 10^{-18}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-185}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{+21}:\\ \;\;\;\;x \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 38.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 5.8 \cdot 10^{-60}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 2.2 \cdot 10^{+22}:\\
\;\;\;\;x \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4499999999999999e-53 or 2.2e22 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -1.4499999999999999e-53 < y < 5.7999999999999999e-60

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

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

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

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

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

    if 5.7999999999999999e-60 < y < 2.2e22

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 84.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.15 \cdot 10^{-7} \lor \neg \left(y \leq 3 \cdot 10^{+22}\right):\\
\;\;\;\;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 < -3.15000000000000002e-7 or 3e22 < y

    1. Initial program 99.9%

      \[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} \]
    6. Taylor expanded in x around 0 83.1%

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

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

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

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

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

    if -3.15000000000000002e-7 < y < 3e22

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

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

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

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

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

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

Alternative 8: 80.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.75 \cdot 10^{-40} \lor \neg \left(x \leq 3.4 \cdot 10^{+21}\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 -1.75e-40) (not (<= x 3.4e+21)))
   (+ x (* x (- z y)))
   (+ x (* t (- y z)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.75e-40) || !(x <= 3.4e+21)) {
		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 <= (-1.75d-40)) .or. (.not. (x <= 3.4d+21))) 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 <= -1.75e-40) || !(x <= 3.4e+21)) {
		tmp = x + (x * (z - y));
	} else {
		tmp = x + (t * (y - z));
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x <= -1.75e-40) or not (x <= 3.4e+21):
		tmp = x + (x * (z - y))
	else:
		tmp = x + (t * (y - z))
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((x <= -1.75e-40) || !(x <= 3.4e+21))
		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 <= -1.75e-40) || ~((x <= 3.4e+21)))
		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, -1.75e-40], N[Not[LessEqual[x, 3.4e+21]], $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 -1.75 \cdot 10^{-40} \lor \neg \left(x \leq 3.4 \cdot 10^{+21}\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 < -1.7500000000000001e-40 or 3.4e21 < 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 83.6%

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

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

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

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

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

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

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

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

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

    if -1.7500000000000001e-40 < x < 3.4e21

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

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

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

Alternative 9: 67.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{-7} \lor \neg \left(y \leq 8.4 \cdot 10^{+21}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

\mathbf{else}:\\
\;\;\;\;x + x \cdot z\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.9999999999999999e-7 or 8.4e21 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -1.9999999999999999e-7 < y < 8.4e21

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 46.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.5 \cdot 10^{-40} \lor \neg \left(x \leq 3.6 \cdot 10^{-100}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.50000000000000002e-40 or 3.5999999999999999e-100 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.50000000000000002e-40 < x < 3.5999999999999999e-100

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.5% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x \cdot z\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.1499999999999999 or 1 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999 < z < 1

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \lor \neg \left(z \leq 1\right):\\ \;\;\;\;x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 18.3% accurate, 9.0× speedup?

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

\\
x
\end{array}
Derivation
  1. Initial program 100.0%

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

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

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

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

    \[\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 2024145 
(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))))