Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.2s
Alternatives: 12
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 12 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x + \left(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. Final simplification100.0%

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

Alternative 2: 69.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + 1\right)\\ t_2 := y \cdot \left(t - x\right)\\ t_3 := x - z \cdot t\\ \mathbf{if}\;y \leq -430:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-132}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-213}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-303}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-163}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-46}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))) (t_3 (- x (* z t))))
   (if (<= y -430.0)
     t_2
     (if (<= y -1.1e-132)
       t_3
       (if (<= y -3.2e-213)
         t_1
         (if (<= y -1.02e-303)
           t_3
           (if (<= y 2.6e-163) t_1 (if (<= y 5.5e-46) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double t_3 = x - (z * t);
	double tmp;
	if (y <= -430.0) {
		tmp = t_2;
	} else if (y <= -1.1e-132) {
		tmp = t_3;
	} else if (y <= -3.2e-213) {
		tmp = t_1;
	} else if (y <= -1.02e-303) {
		tmp = t_3;
	} else if (y <= 2.6e-163) {
		tmp = t_1;
	} else if (y <= 5.5e-46) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * (z + 1.0d0)
    t_2 = y * (t - x)
    t_3 = x - (z * t)
    if (y <= (-430.0d0)) then
        tmp = t_2
    else if (y <= (-1.1d-132)) then
        tmp = t_3
    else if (y <= (-3.2d-213)) then
        tmp = t_1
    else if (y <= (-1.02d-303)) then
        tmp = t_3
    else if (y <= 2.6d-163) then
        tmp = t_1
    else if (y <= 5.5d-46) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double t_3 = x - (z * t);
	double tmp;
	if (y <= -430.0) {
		tmp = t_2;
	} else if (y <= -1.1e-132) {
		tmp = t_3;
	} else if (y <= -3.2e-213) {
		tmp = t_1;
	} else if (y <= -1.02e-303) {
		tmp = t_3;
	} else if (y <= 2.6e-163) {
		tmp = t_1;
	} else if (y <= 5.5e-46) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + 1.0)
	t_2 = y * (t - x)
	t_3 = x - (z * t)
	tmp = 0
	if y <= -430.0:
		tmp = t_2
	elif y <= -1.1e-132:
		tmp = t_3
	elif y <= -3.2e-213:
		tmp = t_1
	elif y <= -1.02e-303:
		tmp = t_3
	elif y <= 2.6e-163:
		tmp = t_1
	elif y <= 5.5e-46:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + 1.0))
	t_2 = Float64(y * Float64(t - x))
	t_3 = Float64(x - Float64(z * t))
	tmp = 0.0
	if (y <= -430.0)
		tmp = t_2;
	elseif (y <= -1.1e-132)
		tmp = t_3;
	elseif (y <= -3.2e-213)
		tmp = t_1;
	elseif (y <= -1.02e-303)
		tmp = t_3;
	elseif (y <= 2.6e-163)
		tmp = t_1;
	elseif (y <= 5.5e-46)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z + 1.0);
	t_2 = y * (t - x);
	t_3 = x - (z * t);
	tmp = 0.0;
	if (y <= -430.0)
		tmp = t_2;
	elseif (y <= -1.1e-132)
		tmp = t_3;
	elseif (y <= -3.2e-213)
		tmp = t_1;
	elseif (y <= -1.02e-303)
		tmp = t_3;
	elseif (y <= 2.6e-163)
		tmp = t_1;
	elseif (y <= 5.5e-46)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -430.0], t$95$2, If[LessEqual[y, -1.1e-132], t$95$3, If[LessEqual[y, -3.2e-213], t$95$1, If[LessEqual[y, -1.02e-303], t$95$3, If[LessEqual[y, 2.6e-163], t$95$1, If[LessEqual[y, 5.5e-46], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-132}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -3.2 \cdot 10^{-213}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.02 \cdot 10^{-303}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 2.6 \cdot 10^{-163}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 5.5 \cdot 10^{-46}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -430 or 5.49999999999999983e-46 < 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 79.4%

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

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

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

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

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

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

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

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

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

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

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

    if -430 < y < -1.09999999999999995e-132 or -3.19999999999999972e-213 < y < -1.01999999999999996e-303 or 2.60000000000000002e-163 < y < 5.49999999999999983e-46

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

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

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

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

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

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

    if -1.09999999999999995e-132 < y < -3.19999999999999972e-213 or -1.01999999999999996e-303 < y < 2.60000000000000002e-163

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -430:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-132}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-213}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -1.02 \cdot 10^{-303}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-163}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{-46}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.4% accurate, 0.3× 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 -1.05 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-44}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-49}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-130}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-9}:\\ \;\;\;\;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 -1.05e+17)
     t_1
     (if (<= y -2.8e-44)
       t_2
       (if (<= y -9.5e-49)
         (* y t)
         (if (<= y -8.5e-130) (* z (- t)) (if (<= y 2.6e-9) 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 <= -1.05e+17) {
		tmp = t_1;
	} else if (y <= -2.8e-44) {
		tmp = t_2;
	} else if (y <= -9.5e-49) {
		tmp = y * t;
	} else if (y <= -8.5e-130) {
		tmp = z * -t;
	} else if (y <= 2.6e-9) {
		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 <= (-1.05d+17)) then
        tmp = t_1
    else if (y <= (-2.8d-44)) then
        tmp = t_2
    else if (y <= (-9.5d-49)) then
        tmp = y * t
    else if (y <= (-8.5d-130)) then
        tmp = z * -t
    else if (y <= 2.6d-9) 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 <= -1.05e+17) {
		tmp = t_1;
	} else if (y <= -2.8e-44) {
		tmp = t_2;
	} else if (y <= -9.5e-49) {
		tmp = y * t;
	} else if (y <= -8.5e-130) {
		tmp = z * -t;
	} else if (y <= 2.6e-9) {
		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 <= -1.05e+17:
		tmp = t_1
	elif y <= -2.8e-44:
		tmp = t_2
	elif y <= -9.5e-49:
		tmp = y * t
	elif y <= -8.5e-130:
		tmp = z * -t
	elif y <= 2.6e-9:
		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 <= -1.05e+17)
		tmp = t_1;
	elseif (y <= -2.8e-44)
		tmp = t_2;
	elseif (y <= -9.5e-49)
		tmp = Float64(y * t);
	elseif (y <= -8.5e-130)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 2.6e-9)
		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 <= -1.05e+17)
		tmp = t_1;
	elseif (y <= -2.8e-44)
		tmp = t_2;
	elseif (y <= -9.5e-49)
		tmp = y * t;
	elseif (y <= -8.5e-130)
		tmp = z * -t;
	elseif (y <= 2.6e-9)
		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, -1.05e+17], t$95$1, If[LessEqual[y, -2.8e-44], t$95$2, If[LessEqual[y, -9.5e-49], N[(y * t), $MachinePrecision], If[LessEqual[y, -8.5e-130], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 2.6e-9], 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 -1.05 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2.8 \cdot 10^{-44}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -9.5 \cdot 10^{-49}:\\
\;\;\;\;y \cdot t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.05e17 or 2.6000000000000001e-9 < 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 83.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
      4. sub-neg80.3%

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

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

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

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

    if -1.05e17 < y < -2.8e-44 or -8.50000000000000033e-130 < y < 2.6000000000000001e-9

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

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

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

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

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

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

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

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

    if -2.8e-44 < y < -9.50000000000000006e-49

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x + t \cdot y} \]
    5. Taylor expanded in x around 0 100.0%

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

    if -9.50000000000000006e-49 < y < -8.50000000000000033e-130

    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 + \color{blue}{t \cdot \left(y - z\right)} \]
    4. Taylor expanded in y around 0 68.4%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.05 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{-44}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{-49}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -8.5 \cdot 10^{-130}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.6 \cdot 10^{-9}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 66.8% accurate, 0.3× 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 -1.2 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-31}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-76}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-128}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-7}:\\ \;\;\;\;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 -1.2e+17)
     t_1
     (if (<= y -1.16e-31)
       t_2
       (if (<= y -2e-76)
         (+ x (* y t))
         (if (<= y -1.3e-128) (* z (- t)) (if (<= y 1.02e-7) 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 <= -1.2e+17) {
		tmp = t_1;
	} else if (y <= -1.16e-31) {
		tmp = t_2;
	} else if (y <= -2e-76) {
		tmp = x + (y * t);
	} else if (y <= -1.3e-128) {
		tmp = z * -t;
	} else if (y <= 1.02e-7) {
		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 <= (-1.2d+17)) then
        tmp = t_1
    else if (y <= (-1.16d-31)) then
        tmp = t_2
    else if (y <= (-2d-76)) then
        tmp = x + (y * t)
    else if (y <= (-1.3d-128)) then
        tmp = z * -t
    else if (y <= 1.02d-7) 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 <= -1.2e+17) {
		tmp = t_1;
	} else if (y <= -1.16e-31) {
		tmp = t_2;
	} else if (y <= -2e-76) {
		tmp = x + (y * t);
	} else if (y <= -1.3e-128) {
		tmp = z * -t;
	} else if (y <= 1.02e-7) {
		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 <= -1.2e+17:
		tmp = t_1
	elif y <= -1.16e-31:
		tmp = t_2
	elif y <= -2e-76:
		tmp = x + (y * t)
	elif y <= -1.3e-128:
		tmp = z * -t
	elif y <= 1.02e-7:
		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 <= -1.2e+17)
		tmp = t_1;
	elseif (y <= -1.16e-31)
		tmp = t_2;
	elseif (y <= -2e-76)
		tmp = Float64(x + Float64(y * t));
	elseif (y <= -1.3e-128)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 1.02e-7)
		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 <= -1.2e+17)
		tmp = t_1;
	elseif (y <= -1.16e-31)
		tmp = t_2;
	elseif (y <= -2e-76)
		tmp = x + (y * t);
	elseif (y <= -1.3e-128)
		tmp = z * -t;
	elseif (y <= 1.02e-7)
		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, -1.2e+17], t$95$1, If[LessEqual[y, -1.16e-31], t$95$2, If[LessEqual[y, -2e-76], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.3e-128], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 1.02e-7], 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 -1.2 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.16 \cdot 10^{-31}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;y \leq 1.02 \cdot 10^{-7}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.2e17 or 1.02e-7 < 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 83.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
      4. sub-neg80.3%

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

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

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

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

    if -1.2e17 < y < -1.15999999999999998e-31 or -1.2999999999999999e-128 < y < 1.02e-7

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

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

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

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

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

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

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

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

    if -1.15999999999999998e-31 < y < -1.99999999999999985e-76

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

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

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

    if -1.99999999999999985e-76 < y < -1.2999999999999999e-128

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.2 \cdot 10^{+17}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-31}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-76}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{-128}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{-7}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -2.8 \cdot 10^{+108}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;y \leq 26.5:\\
\;\;\;\;x \cdot \left(z + 1\right)\\

\mathbf{elif}\;y \leq 5 \cdot 10^{+59}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.82e146 or -2.7999999999999998e108 < y < -8.2000000000000005e27 or 4.9999999999999997e59 < y

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

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

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

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

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

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

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

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

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

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

    if -1.82e146 < y < -2.7999999999999998e108 or 26.5 < y < 4.9999999999999997e59

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

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

      \[\leadsto \color{blue}{x + t \cdot y} \]
    5. Taylor expanded in x around 0 61.0%

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

    if -8.2000000000000005e27 < y < 26.5

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.82 \cdot 10^{+146}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -2.8 \cdot 10^{+108}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -8.2 \cdot 10^{+27}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq 26.5:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 5 \cdot 10^{+59}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 65.0% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := x - z \cdot t\\
\mathbf{if}\;t \leq -4.1 \cdot 10^{+258}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.05 \cdot 10^{+92}:\\
\;\;\;\;x + y \cdot t\\

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

\mathbf{elif}\;t \leq 6.2 \cdot 10^{+243}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -4.10000000000000008e258 or 5.5e88 < t < 6.2e243

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

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

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

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

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

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

    if -4.10000000000000008e258 < t < -1.04999999999999993e92

    1. Initial program 100.0%

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

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

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

    if -1.04999999999999993e92 < t < 5.5e88

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

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

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

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

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

    if 6.2e243 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.1 \cdot 10^{+258}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{+92}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+88}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;t \leq 6.2 \cdot 10^{+243}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 37.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -4.7 \cdot 10^{-66}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-209}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 56000000:\\ \;\;\;\;x \cdot \left(-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.7e-66)
     t_1
     (if (<= z 7.6e-209) (* y t) (if (<= z 56000000.0) (* x (- y)) t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -4.7e-66) {
		tmp = t_1;
	} else if (z <= 7.6e-209) {
		tmp = y * t;
	} else if (z <= 56000000.0) {
		tmp = x * -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.7d-66)) then
        tmp = t_1
    else if (z <= 7.6d-209) then
        tmp = y * t
    else if (z <= 56000000.0d0) then
        tmp = x * -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.7e-66) {
		tmp = t_1;
	} else if (z <= 7.6e-209) {
		tmp = y * t;
	} else if (z <= 56000000.0) {
		tmp = x * -y;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -4.7e-66:
		tmp = t_1
	elif z <= 7.6e-209:
		tmp = y * t
	elif z <= 56000000.0:
		tmp = x * -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.7e-66)
		tmp = t_1;
	elseif (z <= 7.6e-209)
		tmp = Float64(y * t);
	elseif (z <= 56000000.0)
		tmp = Float64(x * Float64(-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.7e-66)
		tmp = t_1;
	elseif (z <= 7.6e-209)
		tmp = y * t;
	elseif (z <= 56000000.0)
		tmp = x * -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.7e-66], t$95$1, If[LessEqual[z, 7.6e-209], N[(y * t), $MachinePrecision], If[LessEqual[z, 56000000.0], N[(x * (-y)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 7.6 \cdot 10^{-209}:\\
\;\;\;\;y \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.6999999999999999e-66 or 5.6e7 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -4.6999999999999999e-66 < z < 7.5999999999999998e-209

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

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

      \[\leadsto \color{blue}{x + t \cdot y} \]
    5. Taylor expanded in x around 0 48.8%

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

    if 7.5999999999999998e-209 < z < 5.6e7

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 80.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.9 \cdot 10^{+70} \lor \neg \left(t \leq 2.7 \cdot 10^{-40}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

\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 < -6.8999999999999995e70 or 2.7e-40 < 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.4%

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

    if -6.8999999999999995e70 < t < 2.7e-40

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

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

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

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

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

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

Alternative 9: 85.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -270 \lor \neg \left(z \leq 1050000\right):\\
\;\;\;\;x + 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 < -270 or 1.05e6 < z

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. sub-neg100.0%

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

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

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

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

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

        \[\leadsto x + \left(x \cdot z + \color{blue}{\left(-1 \cdot t\right) \cdot z}\right) \]
      3. distribute-rgt-in85.3%

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

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

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

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

    if -270 < z < 1.05e6

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

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

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

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

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

Alternative 10: 35.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.46 \cdot 10^{+72} \lor \neg \left(t \leq 3.8 \cdot 10^{+65}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.45999999999999999e72 or 3.80000000000000011e65 < t

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{x + t \cdot y} \]
    5. Taylor expanded in x around 0 46.4%

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

    if -1.45999999999999999e72 < t < 3.80000000000000011e65

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 37.0% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{-91} \lor \neg \left(y \leq 1.12 \cdot 10^{-70}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.50000000000000051e-91 or 1.12e-70 < y

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

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

      \[\leadsto \color{blue}{x + t \cdot y} \]
    5. Taylor expanded in x around 0 35.1%

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

    if -7.50000000000000051e-91 < y < 1.12e-70

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

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

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

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

Alternative 12: 18.0% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification15.7%

    \[\leadsto x \]
  6. Add Preprocessing

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

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

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