Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.6s
Alternatives: 16
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 16 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-def100.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. Final simplification100.0%

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

Alternative 2: 51.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y - z \leq 10^{-19}:\\
\;\;\;\;x\\

\mathbf{elif}\;y - z \leq 5 \cdot 10^{+174} \lor \neg \left(y - z \leq 2 \cdot 10^{+267}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 y z) < -5.00000000000000019e-26 or 9.9999999999999998e-20 < (-.f64 y z) < 4.9999999999999997e174 or 1.9999999999999999e267 < (-.f64 y z)

    1. Initial program 100.0%

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

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

    if -5.00000000000000019e-26 < (-.f64 y z) < 9.9999999999999998e-20

    1. Initial program 100.0%

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

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

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

    if 4.9999999999999997e174 < (-.f64 y z) < 1.9999999999999999e267

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y - z \leq -5 \cdot 10^{-26}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y - z \leq 10^{-19}:\\ \;\;\;\;x\\ \mathbf{elif}\;y - z \leq 5 \cdot 10^{+174} \lor \neg \left(y - z \leq 2 \cdot 10^{+267}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 3: 69.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := z \cdot \left(x - t\right)\\ \mathbf{if}\;y \leq -1.76 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-14}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-26}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-291}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-242}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-121}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))))
   (if (<= y -1.76e+30)
     t_1
     (if (<= y -3.4e-14)
       (- x (* y x))
       (if (<= y -1.15e-26)
         (* (- y z) t)
         (if (<= y 3.4e-291)
           (- x (* z t))
           (if (<= y 9e-242)
             t_2
             (if (<= y 6.8e-121)
               (+ x (* z x))
               (if (<= y 7.8e-11) t_2 t_1)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * (x - t);
	double tmp;
	if (y <= -1.76e+30) {
		tmp = t_1;
	} else if (y <= -3.4e-14) {
		tmp = x - (y * x);
	} else if (y <= -1.15e-26) {
		tmp = (y - z) * t;
	} else if (y <= 3.4e-291) {
		tmp = x - (z * t);
	} else if (y <= 9e-242) {
		tmp = t_2;
	} else if (y <= 6.8e-121) {
		tmp = x + (z * x);
	} else if (y <= 7.8e-11) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = z * (x - t)
    if (y <= (-1.76d+30)) then
        tmp = t_1
    else if (y <= (-3.4d-14)) then
        tmp = x - (y * x)
    else if (y <= (-1.15d-26)) then
        tmp = (y - z) * t
    else if (y <= 3.4d-291) then
        tmp = x - (z * t)
    else if (y <= 9d-242) then
        tmp = t_2
    else if (y <= 6.8d-121) then
        tmp = x + (z * x)
    else if (y <= 7.8d-11) then
        tmp = t_2
    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 t_2 = z * (x - t);
	double tmp;
	if (y <= -1.76e+30) {
		tmp = t_1;
	} else if (y <= -3.4e-14) {
		tmp = x - (y * x);
	} else if (y <= -1.15e-26) {
		tmp = (y - z) * t;
	} else if (y <= 3.4e-291) {
		tmp = x - (z * t);
	} else if (y <= 9e-242) {
		tmp = t_2;
	} else if (y <= 6.8e-121) {
		tmp = x + (z * x);
	} else if (y <= 7.8e-11) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = z * (x - t)
	tmp = 0
	if y <= -1.76e+30:
		tmp = t_1
	elif y <= -3.4e-14:
		tmp = x - (y * x)
	elif y <= -1.15e-26:
		tmp = (y - z) * t
	elif y <= 3.4e-291:
		tmp = x - (z * t)
	elif y <= 9e-242:
		tmp = t_2
	elif y <= 6.8e-121:
		tmp = x + (z * x)
	elif y <= 7.8e-11:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(z * Float64(x - t))
	tmp = 0.0
	if (y <= -1.76e+30)
		tmp = t_1;
	elseif (y <= -3.4e-14)
		tmp = Float64(x - Float64(y * x));
	elseif (y <= -1.15e-26)
		tmp = Float64(Float64(y - z) * t);
	elseif (y <= 3.4e-291)
		tmp = Float64(x - Float64(z * t));
	elseif (y <= 9e-242)
		tmp = t_2;
	elseif (y <= 6.8e-121)
		tmp = Float64(x + Float64(z * x));
	elseif (y <= 7.8e-11)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = z * (x - t);
	tmp = 0.0;
	if (y <= -1.76e+30)
		tmp = t_1;
	elseif (y <= -3.4e-14)
		tmp = x - (y * x);
	elseif (y <= -1.15e-26)
		tmp = (y - z) * t;
	elseif (y <= 3.4e-291)
		tmp = x - (z * t);
	elseif (y <= 9e-242)
		tmp = t_2;
	elseif (y <= 6.8e-121)
		tmp = x + (z * x);
	elseif (y <= 7.8e-11)
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.76e+30], t$95$1, If[LessEqual[y, -3.4e-14], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.15e-26], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 3.4e-291], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-242], t$95$2, If[LessEqual[y, 6.8e-121], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-11], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.4 \cdot 10^{-14}:\\
\;\;\;\;x - y \cdot x\\

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

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

\mathbf{elif}\;y \leq 9 \cdot 10^{-242}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 6.8 \cdot 10^{-121}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.7600000000000001e30 or 7.80000000000000021e-11 < y

    1. Initial program 100.0%

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

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

    if -1.7600000000000001e30 < y < -3.40000000000000003e-14

    1. Initial program 99.9%

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

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

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

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

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

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

    if -3.40000000000000003e-14 < y < -1.15000000000000004e-26

    1. Initial program 100.0%

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

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

    if -1.15000000000000004e-26 < y < 3.40000000000000026e-291

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 3.40000000000000026e-291 < y < 8.9999999999999997e-242 or 6.80000000000000003e-121 < y < 7.80000000000000021e-11

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 8.9999999999999997e-242 < y < 6.80000000000000003e-121

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(-\color{blue}{\left(-z\right)}\right)\right) \cdot x \]
      3. remove-double-neg76.4%

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

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

        \[\leadsto \color{blue}{x \cdot 1 + x \cdot z} \]
      6. *-rgt-identity76.5%

        \[\leadsto \color{blue}{x} + x \cdot z \]
    7. Simplified76.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.76 \cdot 10^{+30}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{-14}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{-26}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 3.4 \cdot 10^{-291}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-242}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 6.8 \cdot 10^{-121}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 4: 37.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq -2.9 \cdot 10^{-285}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 8.4 \cdot 10^{-268}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq 6.1 \cdot 10^{-238}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 1.35 \cdot 10^{-132}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{-19}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.7 \cdot 10^{+63}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.6000000000000001e-17

    1. Initial program 100.0%

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

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

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

    if -1.6000000000000001e-17 < y < -2.9e-285 or 8.39999999999999991e-268 < y < 6.1000000000000001e-238 or 1.34999999999999995e-132 < y < 1.59999999999999991e-19

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.9e-285 < y < 8.39999999999999991e-268 or 1.59999999999999991e-19 < y < 4.7000000000000003e63

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 6.1000000000000001e-238 < y < 1.34999999999999995e-132

    1. Initial program 100.0%

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

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

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

    if 4.7000000000000003e63 < y

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{-17}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{-285}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 8.4 \cdot 10^{-268}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 6.1 \cdot 10^{-238}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-132}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-19}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;y \leq 4.7 \cdot 10^{+63}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]

Alternative 5: 70.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ t_2 := x + y \cdot t\\ t_3 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -4.3 \cdot 10^{-13}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-75}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-128}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-228}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-290}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq 1600000000:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- x t))) (t_2 (+ x (* y t))) (t_3 (* x (- 1.0 y))))
   (if (<= z -4.3e-13)
     t_1
     (if (<= z -7.5e-75)
       t_3
       (if (<= z -2.8e-128)
         (* (- y z) t)
         (if (<= z -4.2e-228)
           t_2
           (if (<= z -5e-290) t_3 (if (<= z 1600000000.0) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = x + (y * t);
	double t_3 = x * (1.0 - y);
	double tmp;
	if (z <= -4.3e-13) {
		tmp = t_1;
	} else if (z <= -7.5e-75) {
		tmp = t_3;
	} else if (z <= -2.8e-128) {
		tmp = (y - z) * t;
	} else if (z <= -4.2e-228) {
		tmp = t_2;
	} else if (z <= -5e-290) {
		tmp = t_3;
	} else if (z <= 1600000000.0) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = z * (x - t)
    t_2 = x + (y * t)
    t_3 = x * (1.0d0 - y)
    if (z <= (-4.3d-13)) then
        tmp = t_1
    else if (z <= (-7.5d-75)) then
        tmp = t_3
    else if (z <= (-2.8d-128)) then
        tmp = (y - z) * t
    else if (z <= (-4.2d-228)) then
        tmp = t_2
    else if (z <= (-5d-290)) then
        tmp = t_3
    else if (z <= 1600000000.0d0) then
        tmp = t_2
    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 = z * (x - t);
	double t_2 = x + (y * t);
	double t_3 = x * (1.0 - y);
	double tmp;
	if (z <= -4.3e-13) {
		tmp = t_1;
	} else if (z <= -7.5e-75) {
		tmp = t_3;
	} else if (z <= -2.8e-128) {
		tmp = (y - z) * t;
	} else if (z <= -4.2e-228) {
		tmp = t_2;
	} else if (z <= -5e-290) {
		tmp = t_3;
	} else if (z <= 1600000000.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	t_2 = x + (y * t)
	t_3 = x * (1.0 - y)
	tmp = 0
	if z <= -4.3e-13:
		tmp = t_1
	elif z <= -7.5e-75:
		tmp = t_3
	elif z <= -2.8e-128:
		tmp = (y - z) * t
	elif z <= -4.2e-228:
		tmp = t_2
	elif z <= -5e-290:
		tmp = t_3
	elif z <= 1600000000.0:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x - t))
	t_2 = Float64(x + Float64(y * t))
	t_3 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -4.3e-13)
		tmp = t_1;
	elseif (z <= -7.5e-75)
		tmp = t_3;
	elseif (z <= -2.8e-128)
		tmp = Float64(Float64(y - z) * t);
	elseif (z <= -4.2e-228)
		tmp = t_2;
	elseif (z <= -5e-290)
		tmp = t_3;
	elseif (z <= 1600000000.0)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x - t);
	t_2 = x + (y * t);
	t_3 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -4.3e-13)
		tmp = t_1;
	elseif (z <= -7.5e-75)
		tmp = t_3;
	elseif (z <= -2.8e-128)
		tmp = (y - z) * t;
	elseif (z <= -4.2e-228)
		tmp = t_2;
	elseif (z <= -5e-290)
		tmp = t_3;
	elseif (z <= 1600000000.0)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.3e-13], t$95$1, If[LessEqual[z, -7.5e-75], t$95$3, If[LessEqual[z, -2.8e-128], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, -4.2e-228], t$95$2, If[LessEqual[z, -5e-290], t$95$3, If[LessEqual[z, 1600000000.0], t$95$2, t$95$1]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := z \cdot \left(x - t\right)\\
t_2 := x + y \cdot t\\
t_3 := x \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -4.3 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-75}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-228}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -5 \cdot 10^{-290}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq 1600000000:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.2999999999999999e-13 or 1.6e9 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -4.2999999999999999e-13 < z < -7.50000000000000017e-75 or -4.19999999999999982e-228 < z < -5.0000000000000001e-290

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

    if -7.50000000000000017e-75 < z < -2.7999999999999998e-128

    1. Initial program 100.0%

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

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

    if -2.7999999999999998e-128 < z < -4.19999999999999982e-228 or -5.0000000000000001e-290 < z < 1.6e9

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto y \cdot t - \color{blue}{-1 \cdot x} \]
    7. Step-by-step derivation
      1. neg-mul-172.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.3 \cdot 10^{-13}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-75}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-128}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-228}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq -5 \cdot 10^{-290}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1600000000:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 6: 70.4% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;y \leq 4.1 \cdot 10^{-241}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{-122}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-11}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.60000000000000038e-7 or 6e-11 < y

    1. Initial program 100.0%

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

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

    if -5.60000000000000038e-7 < y < 5.39999999999999997e-290

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 5.39999999999999997e-290 < y < 4.0999999999999999e-241 or 3.2000000000000002e-122 < y < 6e-11

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 4.0999999999999999e-241 < y < 3.2000000000000002e-122

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(1 + \left(-\color{blue}{\left(-z\right)}\right)\right) \cdot x \]
      3. remove-double-neg76.4%

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

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

        \[\leadsto \color{blue}{x \cdot 1 + x \cdot z} \]
      6. *-rgt-identity76.5%

        \[\leadsto \color{blue}{x} + x \cdot z \]
    7. Simplified76.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.6 \cdot 10^{-7}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-290}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 4.1 \cdot 10^{-241}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-122}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-11}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 7: 38.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+76}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{+39}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq -5.5:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -6.4 \cdot 10^{-75}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3400000000:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.99999999999999991e76 or -2.4000000000000001e39 < z < -5.5 or 3.4e9 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -4.99999999999999991e76 < z < -2.4000000000000001e39 or -6.39999999999999953e-75 < z < 3.4e9

    1. Initial program 100.0%

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

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

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

    if -5.5 < z < -6.39999999999999953e-75

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification43.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+76}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{+39}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq -5.5:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3400000000:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 8: 39.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{+75}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -3.1 \cdot 10^{+34}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq -175:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -8.8 \cdot 10^{-75}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 750000000:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.59999999999999992e75 or -3.09999999999999977e34 < z < -175 or 7.5e8 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -1.59999999999999992e75 < z < -3.09999999999999977e34 or -8.80000000000000022e-75 < z < 7.5e8

    1. Initial program 100.0%

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

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

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

    if -175 < z < -8.80000000000000022e-75

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.6 \cdot 10^{+75}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.1 \cdot 10^{+34}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq -175:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -8.8 \cdot 10^{-75}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 750000000:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]

Alternative 9: 68.6% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := z \cdot \left(x - t\right)\\ \mathbf{if}\;y \leq -1.02 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-238}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-124}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))))
   (if (<= y -1.02e+27)
     t_1
     (if (<= y 4.5e-238)
       t_2
       (if (<= y 3.5e-124) (+ x (* z x)) (if (<= y 7.8e-11) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * (x - t);
	double tmp;
	if (y <= -1.02e+27) {
		tmp = t_1;
	} else if (y <= 4.5e-238) {
		tmp = t_2;
	} else if (y <= 3.5e-124) {
		tmp = x + (z * x);
	} else if (y <= 7.8e-11) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = z * (x - t)
    if (y <= (-1.02d+27)) then
        tmp = t_1
    else if (y <= 4.5d-238) then
        tmp = t_2
    else if (y <= 3.5d-124) then
        tmp = x + (z * x)
    else if (y <= 7.8d-11) then
        tmp = t_2
    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 t_2 = z * (x - t);
	double tmp;
	if (y <= -1.02e+27) {
		tmp = t_1;
	} else if (y <= 4.5e-238) {
		tmp = t_2;
	} else if (y <= 3.5e-124) {
		tmp = x + (z * x);
	} else if (y <= 7.8e-11) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = z * (x - t)
	tmp = 0
	if y <= -1.02e+27:
		tmp = t_1
	elif y <= 4.5e-238:
		tmp = t_2
	elif y <= 3.5e-124:
		tmp = x + (z * x)
	elif y <= 7.8e-11:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(z * Float64(x - t))
	tmp = 0.0
	if (y <= -1.02e+27)
		tmp = t_1;
	elseif (y <= 4.5e-238)
		tmp = t_2;
	elseif (y <= 3.5e-124)
		tmp = Float64(x + Float64(z * x));
	elseif (y <= 7.8e-11)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = z * (x - t);
	tmp = 0.0;
	if (y <= -1.02e+27)
		tmp = t_1;
	elseif (y <= 4.5e-238)
		tmp = t_2;
	elseif (y <= 3.5e-124)
		tmp = x + (z * x);
	elseif (y <= 7.8e-11)
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+27], t$95$1, If[LessEqual[y, 4.5e-238], t$95$2, If[LessEqual[y, 3.5e-124], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.8e-11], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 4.5 \cdot 10^{-238}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-124}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.0199999999999999e27 or 7.80000000000000021e-11 < y

    1. Initial program 100.0%

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

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

    if -1.0199999999999999e27 < y < 4.49999999999999996e-238 or 3.4999999999999999e-124 < y < 7.80000000000000021e-11

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 4.49999999999999996e-238 < y < 3.4999999999999999e-124

    1. Initial program 100.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(1 - -1 \cdot z\right) \cdot x} \]
    6. Step-by-step derivation
      1. sub-neg78.7%

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

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

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

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

        \[\leadsto \color{blue}{x \cdot 1 + x \cdot z} \]
      6. *-rgt-identity78.7%

        \[\leadsto \color{blue}{x} + x \cdot z \]
    7. Simplified78.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+27}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 4.5 \cdot 10^{-238}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-124}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{-11}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 10: 83.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-12} \lor \neg \left(z \leq 20000000\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.79999999999999996e-12 or 2e7 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -3.79999999999999996e-12 < z < 2e7

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{-12} \lor \neg \left(z \leq 20000000\right):\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 11: 84.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-17} \lor \neg \left(y \leq 3.1 \cdot 10^{-11}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -9.50000000000000029e-17 or 3.10000000000000028e-11 < y

    1. Initial program 100.0%

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

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

    if -9.50000000000000029e-17 < y < 3.10000000000000028e-11

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-17} \lor \neg \left(y \leq 3.1 \cdot 10^{-11}\right):\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \end{array} \]

Alternative 12: 61.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.3 \cdot 10^{-103} \lor \neg \left(t \leq 2.05 \cdot 10^{+15}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.30000000000000023e-103 or 2.05e15 < t

    1. Initial program 100.0%

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

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

    if -4.30000000000000023e-103 < t < 2.05e15

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.3 \cdot 10^{-103} \lor \neg \left(t \leq 2.05 \cdot 10^{+15}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]

Alternative 13: 68.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+24} \lor \neg \left(y \leq 7.8 \cdot 10^{-11}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.49999999999999959e24 or 7.80000000000000021e-11 < y

    1. Initial program 100.0%

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

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

    if -8.49999999999999959e24 < y < 7.80000000000000021e-11

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{+24} \lor \neg \left(y \leq 7.8 \cdot 10^{-11}\right):\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]

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

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

Alternative 15: 36.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 2.4 \cdot 10^{-111}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.70000000000000004e-55 or 2.4000000000000001e-111 < y

    1. Initial program 100.0%

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

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

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

    if -2.70000000000000004e-55 < y < 2.4000000000000001e-111

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-55}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-111}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 16: 18.1% 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. Taylor expanded in z around 0 56.5%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification17.2%

    \[\leadsto x \]

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

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

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