Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.3s
Alternatives: 14
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 14 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

Alternative 2: 35.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.8 \cdot 10^{-54}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;t \leq -5 \cdot 10^{-169}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 13.5:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= t -1.8e-54)
   (* y t)
   (if (<= t -5e-169) (* z x) (if (<= t 13.5) (* y (- x)) (* y t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.8e-54) {
		tmp = y * t;
	} else if (t <= -5e-169) {
		tmp = z * x;
	} else if (t <= 13.5) {
		tmp = y * -x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (t <= (-1.8d-54)) then
        tmp = y * t
    else if (t <= (-5d-169)) then
        tmp = z * x
    else if (t <= 13.5d0) then
        tmp = y * -x
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (t <= -1.8e-54) {
		tmp = y * t;
	} else if (t <= -5e-169) {
		tmp = z * x;
	} else if (t <= 13.5) {
		tmp = y * -x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if t <= -1.8e-54:
		tmp = y * t
	elif t <= -5e-169:
		tmp = z * x
	elif t <= 13.5:
		tmp = y * -x
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (t <= -1.8e-54)
		tmp = Float64(y * t);
	elseif (t <= -5e-169)
		tmp = Float64(z * x);
	elseif (t <= 13.5)
		tmp = Float64(y * Float64(-x));
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (t <= -1.8e-54)
		tmp = y * t;
	elseif (t <= -5e-169)
		tmp = z * x;
	elseif (t <= 13.5)
		tmp = y * -x;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.8e-54], N[(y * t), $MachinePrecision], If[LessEqual[t, -5e-169], N[(z * x), $MachinePrecision], If[LessEqual[t, 13.5], N[(y * (-x)), $MachinePrecision], N[(y * t), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -5 \cdot 10^{-169}:\\
\;\;\;\;z \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.79999999999999988e-54 or 13.5 < t

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+77.7%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg79.3%

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative79.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in79.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg79.3%

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
    8. Step-by-step derivation
      1. *-commutative41.6%

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified41.6%

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

    if -1.79999999999999988e-54 < t < -5.0000000000000002e-169

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.0000000000000002e-169 < t < 13.5

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+89.2%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg90.3%

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative90.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in90.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg90.3%

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

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

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

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

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

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

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

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

Alternative 3: 80.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.7 \cdot 10^{-56} \lor \neg \left(t \leq 180000000\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.7000000000000002e-56 or 1.8e8 < t

    1. Initial program 100.0%

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

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

    if -3.7000000000000002e-56 < t < 1.8e8

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 71.5% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.8999999999999997e44

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+96.9%

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} - x\right)\right) \]
      3. mul-1-neg96.9%

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

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg96.9%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg96.9%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{z \cdot \left(-\left(t - x\right)\right)}}{y} - x\right)\right) \]
      10. sub-neg96.9%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative96.9%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg96.9%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(\color{blue}{x} + \left(-t\right)\right)}{y} - x\right)\right) \]
      14. sub-neg96.9%

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

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

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

    if -6.8999999999999997e44 < y < 5.10000000000000045e-53

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

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

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

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

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

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

    if 5.10000000000000045e-53 < 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 64.6%

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

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

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

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

Alternative 5: 62.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-55}:\\
\;\;\;\;x - z \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -7.00000000000000051e-55

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

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

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

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

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

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

    if -7.00000000000000051e-55 < t < 5.8e8

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

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

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

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

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

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

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

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

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

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

    if 5.8e8 < t

    1. Initial program 100.0%

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

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

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

Alternative 6: 71.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.2 \cdot 10^{+44} \lor \neg \left(y \leq 2.25 \cdot 10^{+16}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

\mathbf{else}:\\
\;\;\;\;x - z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.1999999999999993e44 or 2.25e16 < 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 97.6%

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+97.6%

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative97.6%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in97.6%

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

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

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

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

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

    if -8.1999999999999993e44 < y < 2.25e16

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

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

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

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

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

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

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

Alternative 7: 67.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+45} \lor \neg \left(y \leq 2.2 \cdot 10^{-12}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.00000000000000011e45 or 2.19999999999999992e-12 < 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 97.7%

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+97.7%

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg97.7%

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative97.7%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in97.7%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg97.7%

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

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

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

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

    if -3.00000000000000011e45 < y < 2.19999999999999992e-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 0 52.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 56.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+44} \lor \neg \left(y \leq 2.3 \cdot 10^{-58}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.60000000000000027e44 or 2.2999999999999999e-58 < 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 97.1%

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+97.1%

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} - x\right)\right) \]
      3. mul-1-neg97.1%

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

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg97.8%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg97.8%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{z \cdot \left(-\left(t - x\right)\right)}}{y} - x\right)\right) \]
      10. sub-neg97.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative97.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in97.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg97.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(\color{blue}{x} + \left(-t\right)\right)}{y} - x\right)\right) \]
      14. sub-neg97.8%

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

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

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

    if -6.60000000000000027e44 < y < 2.2999999999999999e-58

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 42.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.5 \cdot 10^{-111}:\\
\;\;\;\;z \cdot \left(-t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.50000000000000004e-111

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

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

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

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

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

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

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

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

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

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

    if -1.50000000000000004e-111 < t < 3.6e7

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.6e7 < t

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+76.9%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg80.3%

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative80.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in80.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg80.3%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified48.8%

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

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

Alternative 10: 34.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-111}:\\
\;\;\;\;z \cdot \left(-t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.29999999999999991e-111

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999991e-111 < t < 10

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+87.8%

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg90.8%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg90.8%

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{z \cdot \left(-\left(t - x\right)\right)}}{y} - x\right)\right) \]
      10. sub-neg90.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative90.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in90.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg90.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(\color{blue}{x} + \left(-t\right)\right)}{y} - x\right)\right) \]
      14. sub-neg90.8%

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

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

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

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

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

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

    if 10 < t

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+76.9%

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} - x\right)\right) \]
      8. mul-1-neg80.3%

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative80.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in80.3%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg80.3%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified48.8%

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

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

Alternative 11: 38.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+100} \lor \neg \left(z \leq 2.9 \cdot 10^{+77}\right):\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.20000000000000014e100 or 2.9000000000000002e77 < 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 48.6%

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

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

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

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

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

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

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

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

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

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

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

    if -6.20000000000000014e100 < z < 2.9000000000000002e77

    1. Initial program 100.0%

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

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified36.8%

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

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

Alternative 12: 37.3% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.79999999999999992e-11 or 1 < 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 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.0%

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

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

    if -1.79999999999999992e-11 < 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 86.5%

      \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
    4. Step-by-step derivation
      1. associate--l+86.5%

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

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} - x\right)\right) \]
      3. mul-1-neg86.5%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
      11. +-commutative86.7%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(\left(-x\right) + t\right)}\right)}{y} - x\right)\right) \]
      12. distribute-neg-in86.7%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
      13. remove-double-neg86.7%

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

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

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

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

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

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

Alternative 13: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 14: 17.0% 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 81.7%

    \[\leadsto \color{blue}{y \cdot \left(\left(t + \left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right)\right) - x\right)} \]
  4. Step-by-step derivation
    1. associate--l+81.7%

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \left(-\color{blue}{\left(t + \left(-x\right)\right)}\right)}{y} - x\right)\right) \]
    11. +-commutative84.2%

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

      \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(\left(-\left(-x\right)\right) + \left(-t\right)\right)}}{y} - x\right)\right) \]
    13. remove-double-neg84.2%

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

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

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

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

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

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

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

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

Reproduce

?
herbie shell --seed 2024146 
(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))))