Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.4s
Alternatives: 17
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 17 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: 46.2% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := x \cdot \left(z + 1\right)\\ t_3 := y \cdot \left(-x\right)\\ \mathbf{if}\;y \leq -3.9 \cdot 10^{+204}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{+76}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-297}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-77}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+53}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+118}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* x (+ z 1.0))) (t_3 (* y (- x))))
   (if (<= y -3.9e+204)
     (* y t)
     (if (<= y -6.8e+76)
       t_3
       (if (<= y -3e+29)
         t_1
         (if (<= y 9e-297)
           t_2
           (if (<= y 2.9e-77)
             t_1
             (if (<= y 3.6e+53) t_2 (if (<= y 2.9e+118) t_3 (* y t))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (z + 1.0);
	double t_3 = y * -x;
	double tmp;
	if (y <= -3.9e+204) {
		tmp = y * t;
	} else if (y <= -6.8e+76) {
		tmp = t_3;
	} else if (y <= -3e+29) {
		tmp = t_1;
	} else if (y <= 9e-297) {
		tmp = t_2;
	} else if (y <= 2.9e-77) {
		tmp = t_1;
	} else if (y <= 3.6e+53) {
		tmp = t_2;
	} else if (y <= 2.9e+118) {
		tmp = t_3;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = z * -t
    t_2 = x * (z + 1.0d0)
    t_3 = y * -x
    if (y <= (-3.9d+204)) then
        tmp = y * t
    else if (y <= (-6.8d+76)) then
        tmp = t_3
    else if (y <= (-3d+29)) then
        tmp = t_1
    else if (y <= 9d-297) then
        tmp = t_2
    else if (y <= 2.9d-77) then
        tmp = t_1
    else if (y <= 3.6d+53) then
        tmp = t_2
    else if (y <= 2.9d+118) then
        tmp = t_3
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (z + 1.0);
	double t_3 = y * -x;
	double tmp;
	if (y <= -3.9e+204) {
		tmp = y * t;
	} else if (y <= -6.8e+76) {
		tmp = t_3;
	} else if (y <= -3e+29) {
		tmp = t_1;
	} else if (y <= 9e-297) {
		tmp = t_2;
	} else if (y <= 2.9e-77) {
		tmp = t_1;
	} else if (y <= 3.6e+53) {
		tmp = t_2;
	} else if (y <= 2.9e+118) {
		tmp = t_3;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = x * (z + 1.0)
	t_3 = y * -x
	tmp = 0
	if y <= -3.9e+204:
		tmp = y * t
	elif y <= -6.8e+76:
		tmp = t_3
	elif y <= -3e+29:
		tmp = t_1
	elif y <= 9e-297:
		tmp = t_2
	elif y <= 2.9e-77:
		tmp = t_1
	elif y <= 3.6e+53:
		tmp = t_2
	elif y <= 2.9e+118:
		tmp = t_3
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(x * Float64(z + 1.0))
	t_3 = Float64(y * Float64(-x))
	tmp = 0.0
	if (y <= -3.9e+204)
		tmp = Float64(y * t);
	elseif (y <= -6.8e+76)
		tmp = t_3;
	elseif (y <= -3e+29)
		tmp = t_1;
	elseif (y <= 9e-297)
		tmp = t_2;
	elseif (y <= 2.9e-77)
		tmp = t_1;
	elseif (y <= 3.6e+53)
		tmp = t_2;
	elseif (y <= 2.9e+118)
		tmp = t_3;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = x * (z + 1.0);
	t_3 = y * -x;
	tmp = 0.0;
	if (y <= -3.9e+204)
		tmp = y * t;
	elseif (y <= -6.8e+76)
		tmp = t_3;
	elseif (y <= -3e+29)
		tmp = t_1;
	elseif (y <= 9e-297)
		tmp = t_2;
	elseif (y <= 2.9e-77)
		tmp = t_1;
	elseif (y <= 3.6e+53)
		tmp = t_2;
	elseif (y <= 2.9e+118)
		tmp = t_3;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[y, -3.9e+204], N[(y * t), $MachinePrecision], If[LessEqual[y, -6.8e+76], t$95$3, If[LessEqual[y, -3e+29], t$95$1, If[LessEqual[y, 9e-297], t$95$2, If[LessEqual[y, 2.9e-77], t$95$1, If[LessEqual[y, 3.6e+53], t$95$2, If[LessEqual[y, 2.9e+118], t$95$3, N[(y * t), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -6.8 \cdot 10^{+76}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -3 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 9 \cdot 10^{-297}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 3.6 \cdot 10^{+53}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 2.9 \cdot 10^{+118}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.90000000000000017e204 or 2.90000000000000016e118 < 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 87.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+87.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. +-commutative87.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-neg87.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-neg87.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-sub87.1%

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

        \[\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-neg87.1%

        \[\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-neg87.1%

        \[\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-in87.1%

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

        \[\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. +-commutative87.1%

        \[\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-in87.1%

        \[\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-neg87.1%

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

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

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

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

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

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

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

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

    if -3.90000000000000017e204 < y < -6.7999999999999994e76 or 3.6e53 < y < 2.90000000000000016e118

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -6.7999999999999994e76 < y < -2.9999999999999999e29 or 8.99999999999999951e-297 < y < 2.8999999999999999e-77

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 68.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+68.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. +-commutative68.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-neg68.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-neg68.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-sub73.0%

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

        \[\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-neg73.0%

        \[\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-neg73.0%

        \[\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-in73.0%

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

        \[\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. +-commutative73.0%

        \[\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-in73.0%

        \[\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-neg73.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    11. Simplified58.2%

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

    if -2.9999999999999999e29 < y < 8.99999999999999951e-297 or 2.8999999999999999e-77 < y < 3.6e53

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    8. Simplified60.0%

      \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification59.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+204}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{+76}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -3 \cdot 10^{+29}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 9 \cdot 10^{-297}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{-77}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+53}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.9 \cdot 10^{+118}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 64.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;y \leq -28500:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-297}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-77}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 470000000000:\\ \;\;\;\;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 (* x (+ z 1.0))))
   (if (<= y -28500.0)
     t_1
     (if (<= y 8.2e-297)
       t_2
       (if (<= y 6.2e-77) (* z (- t)) (if (<= y 470000000000.0) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -28500.0) {
		tmp = t_1;
	} else if (y <= 8.2e-297) {
		tmp = t_2;
	} else if (y <= 6.2e-77) {
		tmp = z * -t;
	} else if (y <= 470000000000.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) :: tmp
    t_1 = y * (t - x)
    t_2 = x * (z + 1.0d0)
    if (y <= (-28500.0d0)) then
        tmp = t_1
    else if (y <= 8.2d-297) then
        tmp = t_2
    else if (y <= 6.2d-77) then
        tmp = z * -t
    else if (y <= 470000000000.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 = y * (t - x);
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -28500.0) {
		tmp = t_1;
	} else if (y <= 8.2e-297) {
		tmp = t_2;
	} else if (y <= 6.2e-77) {
		tmp = z * -t;
	} else if (y <= 470000000000.0) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = x * (z + 1.0)
	tmp = 0
	if y <= -28500.0:
		tmp = t_1
	elif y <= 8.2e-297:
		tmp = t_2
	elif y <= 6.2e-77:
		tmp = z * -t
	elif y <= 470000000000.0:
		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(x * Float64(z + 1.0))
	tmp = 0.0
	if (y <= -28500.0)
		tmp = t_1;
	elseif (y <= 8.2e-297)
		tmp = t_2;
	elseif (y <= 6.2e-77)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 470000000000.0)
		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 = x * (z + 1.0);
	tmp = 0.0;
	if (y <= -28500.0)
		tmp = t_1;
	elseif (y <= 8.2e-297)
		tmp = t_2;
	elseif (y <= 6.2e-77)
		tmp = z * -t;
	elseif (y <= 470000000000.0)
		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[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -28500.0], t$95$1, If[LessEqual[y, 8.2e-297], t$95$2, If[LessEqual[y, 6.2e-77], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 470000000000.0], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 8.2 \cdot 10^{-297}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 470000000000:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -28500 or 4.7e11 < 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 91.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+91.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. +-commutative91.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-neg91.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-neg91.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-sub91.7%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg91.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-neg91.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-neg91.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-in91.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-neg91.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. +-commutative91.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-in91.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-neg91.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-neg91.7%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified91.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 81.6%

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

    if -28500 < y < 8.2000000000000004e-297 or 6.20000000000000016e-77 < y < 4.7e11

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    8. Simplified63.9%

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

    if 8.2000000000000004e-297 < y < 6.20000000000000016e-77

    1. Initial program 99.9%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 62.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+62.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. +-commutative62.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-neg62.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-neg62.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-sub67.6%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg67.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-neg67.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-neg67.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-in67.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-neg67.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. +-commutative67.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-in67.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-neg67.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-neg67.6%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified67.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 t around inf 39.0%

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

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

        \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(1 - \frac{z}{y}\right)}\right) \]
    8. Simplified39.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -28500:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-297}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 6.2 \cdot 10^{-77}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 470000000000:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 72.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -3.5 \cdot 10^{-63}:\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

\mathbf{elif}\;y \leq 5500000000:\\
\;\;\;\;x - z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.8000000000000002e27 or 5.5e9 < 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 91.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+91.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. +-commutative91.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-neg91.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-neg91.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-sub91.2%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg91.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-neg91.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-neg91.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-in91.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-neg91.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. +-commutative91.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-in91.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-neg91.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-neg91.2%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified91.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 y around inf 83.6%

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

    if -5.8000000000000002e27 < y < -3.50000000000000003e-63

    1. Initial program 100.0%

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

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

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

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

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

    if -3.50000000000000003e-63 < y < 5.5e9

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+27}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -3.5 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;y \leq 5500000000:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.6% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq 7500000000:\\
\;\;\;\;x - z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.39999999999999995e70 or 7.5e9 < 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 90.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+90.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. +-commutative90.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-neg90.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-neg90.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.2%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg90.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-neg90.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-neg90.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-in90.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-neg90.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. +-commutative90.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-in90.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-neg90.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-neg90.2%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified90.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 y around inf 89.1%

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

    if -1.39999999999999995e70 < y < -2.64999999999999986e-114

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

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

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

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

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

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

    if -2.64999999999999986e-114 < y < 7.5e9

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 6: 69.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 3 \cdot 10^{-297}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -850 or 1.25e10 < 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 91.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+91.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. +-commutative91.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-neg91.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-neg91.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-sub91.7%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg91.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-neg91.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-neg91.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-in91.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-neg91.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. +-commutative91.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-in91.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-neg91.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-neg91.7%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified91.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 81.6%

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

    if -850 < y < 2.99999999999999995e-297

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(z + 1\right)} \]
    8. Simplified66.7%

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

    if 2.99999999999999995e-297 < y < 1.25e10

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 7: 49.1% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -4.2 \cdot 10^{-54}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 7 \cdot 10^{+57}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.6e65 or 6.9999999999999995e57 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 73.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+73.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. +-commutative73.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-neg73.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-neg73.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-sub77.4%

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

        \[\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-neg77.4%

        \[\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-neg77.4%

        \[\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-in77.4%

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

        \[\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. +-commutative77.4%

        \[\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-in77.4%

        \[\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-neg77.4%

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

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

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

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

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

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

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

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

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

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

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

    if -4.6e65 < z < -4.2e-54

    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.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+76.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. +-commutative76.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-neg76.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-neg76.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-sub81.8%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg81.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-neg81.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-neg81.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-in81.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-neg81.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. +-commutative81.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-in81.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-neg81.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-neg81.8%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified81.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 t around inf 58.8%

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

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

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

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

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

    if -4.2e-54 < z < 6.9999999999999995e57

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.6 \cdot 10^{+65}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -4.2 \cdot 10^{-54}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 39.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-276}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 2.5 \cdot 10^{-23}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.4e60 or 2.5000000000000001e-23 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around inf 75.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+75.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. +-commutative75.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-neg75.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-neg75.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-sub78.5%

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

        \[\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-neg78.5%

        \[\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-neg78.5%

        \[\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-in78.5%

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

        \[\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. +-commutative78.5%

        \[\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-in78.5%

        \[\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-neg78.5%

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

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

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

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

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

        \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(1 - \frac{z}{y}\right)}\right) \]
    8. Simplified48.0%

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

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

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

        \[\leadsto \color{blue}{\left(-t\right)} \cdot z \]
    11. Simplified48.2%

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

    if -3.4e60 < z < 3.8e-276

    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 83.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+83.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. +-commutative83.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-neg83.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-neg83.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-sub85.4%

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

        \[\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-neg85.4%

        \[\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-neg85.4%

        \[\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-in85.4%

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

        \[\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. +-commutative85.4%

        \[\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-in85.4%

        \[\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-neg85.4%

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

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

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

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

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

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

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

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

    if 3.8e-276 < z < 2.5000000000000001e-23

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+60}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-276}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.5 \cdot 10^{-23}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 38.0% accurate, 0.5× speedup?

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

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

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

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.7999999999999997e51 or 6.5000000000000001e-14 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -5.7999999999999997e51 < z < 5.09999999999999968e-276

    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-sub85.1%

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

        \[\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-neg85.1%

        \[\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-neg85.1%

        \[\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-in85.1%

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

        \[\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. +-commutative85.1%

        \[\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-in85.1%

        \[\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-neg85.1%

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

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

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

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

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

        \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(1 - \frac{z}{y}\right)}\right) \]
    8. Simplified49.0%

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

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

    if 5.09999999999999968e-276 < z < 6.5000000000000001e-14

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+51}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-276}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 84.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+70} \lor \neg \left(y \leq 1.08 \cdot 10^{+15}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e70 or 1.08e15 < 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 90.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+90.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. +-commutative90.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-neg90.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-neg90.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.2%

        \[\leadsto y \cdot \left(t + \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} - x\right)\right) \]
      6. unsub-neg90.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-neg90.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-neg90.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-in90.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-neg90.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. +-commutative90.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-in90.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-neg90.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-neg90.2%

        \[\leadsto y \cdot \left(t + \left(\frac{x + z \cdot \color{blue}{\left(x - t\right)}}{y} - x\right)\right) \]
    5. Simplified90.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 y around inf 89.1%

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

    if -1.3e70 < y < 1.08e15

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 11: 80.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.22 \cdot 10^{-100} \lor \neg \left(t \leq 4.9 \cdot 10^{-54}\right):\\
\;\;\;\;x - t \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.2199999999999999e-100 or 4.90000000000000021e-54 < 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 84.6%

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

    if -2.2199999999999999e-100 < t < 4.90000000000000021e-54

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 12: 83.4% accurate, 0.5× speedup?

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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -1.02e51 < z < 4.0000000000000004e44

    1. Initial program 99.9%

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

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

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

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

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

Alternative 13: 70.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+50} \lor \neg \left(z \leq 6.5 \cdot 10^{-14}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.9999999999999996e50 or 6.5000000000000001e-14 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -5.9999999999999996e50 < z < 6.5000000000000001e-14

    1. Initial program 99.9%

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

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

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

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

Alternative 14: 35.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 1.9 \cdot 10^{+20}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.8000000000000001e89

    1. Initial program 100.0%

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

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

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

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

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

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

    if -8.8000000000000001e89 < x < 1.9e20

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.9e20 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

Alternative 15: 36.7% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -1 < z < 6.5000000000000001e-14

    1. Initial program 99.9%

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

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

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

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

Alternative 16: 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 17: 17.5% accurate, 9.0× speedup?

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

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

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

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

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

Developer Target 1: 96.1% 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 2024123 
(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))))