Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 7.5s
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: 53.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot t\\ t_2 := x - z \cdot t\\ t_3 := x \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -1.6 \cdot 10^{+119}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6 \cdot 10^{+16}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-86}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-174}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-225}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+203}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* y t))) (t_2 (- x (* z t))) (t_3 (* x (- y))))
   (if (<= y -1.6e+119)
     t_1
     (if (<= y -6e+16)
       t_3
       (if (<= y -2.2e-86)
         (* x (+ z 1.0))
         (if (<= y -6e-174)
           t_2
           (if (<= y -1.16e-225)
             (+ x (* x z))
             (if (<= y 3400.0) t_2 (if (<= y 1.15e+203) t_1 t_3)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (y * t);
	double t_2 = x - (z * t);
	double t_3 = x * -y;
	double tmp;
	if (y <= -1.6e+119) {
		tmp = t_1;
	} else if (y <= -6e+16) {
		tmp = t_3;
	} else if (y <= -2.2e-86) {
		tmp = x * (z + 1.0);
	} else if (y <= -6e-174) {
		tmp = t_2;
	} else if (y <= -1.16e-225) {
		tmp = x + (x * z);
	} else if (y <= 3400.0) {
		tmp = t_2;
	} else if (y <= 1.15e+203) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	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 + (y * t)
    t_2 = x - (z * t)
    t_3 = x * -y
    if (y <= (-1.6d+119)) then
        tmp = t_1
    else if (y <= (-6d+16)) then
        tmp = t_3
    else if (y <= (-2.2d-86)) then
        tmp = x * (z + 1.0d0)
    else if (y <= (-6d-174)) then
        tmp = t_2
    else if (y <= (-1.16d-225)) then
        tmp = x + (x * z)
    else if (y <= 3400.0d0) then
        tmp = t_2
    else if (y <= 1.15d+203) then
        tmp = t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (y * t);
	double t_2 = x - (z * t);
	double t_3 = x * -y;
	double tmp;
	if (y <= -1.6e+119) {
		tmp = t_1;
	} else if (y <= -6e+16) {
		tmp = t_3;
	} else if (y <= -2.2e-86) {
		tmp = x * (z + 1.0);
	} else if (y <= -6e-174) {
		tmp = t_2;
	} else if (y <= -1.16e-225) {
		tmp = x + (x * z);
	} else if (y <= 3400.0) {
		tmp = t_2;
	} else if (y <= 1.15e+203) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (y * t)
	t_2 = x - (z * t)
	t_3 = x * -y
	tmp = 0
	if y <= -1.6e+119:
		tmp = t_1
	elif y <= -6e+16:
		tmp = t_3
	elif y <= -2.2e-86:
		tmp = x * (z + 1.0)
	elif y <= -6e-174:
		tmp = t_2
	elif y <= -1.16e-225:
		tmp = x + (x * z)
	elif y <= 3400.0:
		tmp = t_2
	elif y <= 1.15e+203:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(y * t))
	t_2 = Float64(x - Float64(z * t))
	t_3 = Float64(x * Float64(-y))
	tmp = 0.0
	if (y <= -1.6e+119)
		tmp = t_1;
	elseif (y <= -6e+16)
		tmp = t_3;
	elseif (y <= -2.2e-86)
		tmp = Float64(x * Float64(z + 1.0));
	elseif (y <= -6e-174)
		tmp = t_2;
	elseif (y <= -1.16e-225)
		tmp = Float64(x + Float64(x * z));
	elseif (y <= 3400.0)
		tmp = t_2;
	elseif (y <= 1.15e+203)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (y * t);
	t_2 = x - (z * t);
	t_3 = x * -y;
	tmp = 0.0;
	if (y <= -1.6e+119)
		tmp = t_1;
	elseif (y <= -6e+16)
		tmp = t_3;
	elseif (y <= -2.2e-86)
		tmp = x * (z + 1.0);
	elseif (y <= -6e-174)
		tmp = t_2;
	elseif (y <= -1.16e-225)
		tmp = x + (x * z);
	elseif (y <= 3400.0)
		tmp = t_2;
	elseif (y <= 1.15e+203)
		tmp = t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -1.6e+119], t$95$1, If[LessEqual[y, -6e+16], t$95$3, If[LessEqual[y, -2.2e-86], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -6e-174], t$95$2, If[LessEqual[y, -1.16e-225], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3400.0], t$95$2, If[LessEqual[y, 1.15e+203], t$95$1, t$95$3]]]]]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;y \leq -6 \cdot 10^{-174}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+203}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.59999999999999995e119 or 3400 < y < 1.15e203

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*88.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified57.3%

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

    if -1.59999999999999995e119 < y < -6e16 or 1.15e203 < 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.4%

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

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

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

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

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

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

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

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

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

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

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

    if -6e16 < y < -2.2000000000000002e-86

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
    9. Step-by-step derivation
      1. *-commutative57.3%

        \[\leadsto x + \color{blue}{z \cdot x} \]
      2. distribute-rgt1-in57.3%

        \[\leadsto \color{blue}{\left(z + 1\right) \cdot x} \]
    10. Applied egg-rr57.3%

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

    if -2.2000000000000002e-86 < y < -6.00000000000000042e-174 or -1.16000000000000001e-225 < y < 3400

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*98.0%

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

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

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

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

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

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

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

    if -6.00000000000000042e-174 < y < -1.16000000000000001e-225

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(z \cdot x + z \cdot \left(-t\right)\right)} \]
    7. Applied egg-rr100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+119}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -6 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-86}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -6 \cdot 10^{-174}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{-225}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{+203}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -5.3 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-26}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+204}:\\ \;\;\;\;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 -5.3e+119)
     (* y t)
     (if (<= y -5.6e+16)
       t_1
       (if (<= y -6.6e-26)
         (* y t)
         (if (<= y 3400.0) x (if (<= y 4.9e+204) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * -y;
	double tmp;
	if (y <= -5.3e+119) {
		tmp = y * t;
	} else if (y <= -5.6e+16) {
		tmp = t_1;
	} else if (y <= -6.6e-26) {
		tmp = y * t;
	} else if (y <= 3400.0) {
		tmp = x;
	} else if (y <= 4.9e+204) {
		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 <= (-5.3d+119)) then
        tmp = y * t
    else if (y <= (-5.6d+16)) then
        tmp = t_1
    else if (y <= (-6.6d-26)) then
        tmp = y * t
    else if (y <= 3400.0d0) then
        tmp = x
    else if (y <= 4.9d+204) 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 <= -5.3e+119) {
		tmp = y * t;
	} else if (y <= -5.6e+16) {
		tmp = t_1;
	} else if (y <= -6.6e-26) {
		tmp = y * t;
	} else if (y <= 3400.0) {
		tmp = x;
	} else if (y <= 4.9e+204) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * -y
	tmp = 0
	if y <= -5.3e+119:
		tmp = y * t
	elif y <= -5.6e+16:
		tmp = t_1
	elif y <= -6.6e-26:
		tmp = y * t
	elif y <= 3400.0:
		tmp = x
	elif y <= 4.9e+204:
		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 <= -5.3e+119)
		tmp = Float64(y * t);
	elseif (y <= -5.6e+16)
		tmp = t_1;
	elseif (y <= -6.6e-26)
		tmp = Float64(y * t);
	elseif (y <= 3400.0)
		tmp = x;
	elseif (y <= 4.9e+204)
		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 <= -5.3e+119)
		tmp = y * t;
	elseif (y <= -5.6e+16)
		tmp = t_1;
	elseif (y <= -6.6e-26)
		tmp = y * t;
	elseif (y <= 3400.0)
		tmp = x;
	elseif (y <= 4.9e+204)
		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, -5.3e+119], N[(y * t), $MachinePrecision], If[LessEqual[y, -5.6e+16], t$95$1, If[LessEqual[y, -6.6e-26], N[(y * t), $MachinePrecision], If[LessEqual[y, 3400.0], x, If[LessEqual[y, 4.9e+204], N[(y * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -6.6 \cdot 10^{-26}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4.9 \cdot 10^{+204}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.29999999999999972e119 or -5.6e16 < y < -6.5999999999999997e-26 or 3400 < y < 4.8999999999999997e204

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*86.8%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified56.2%

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

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

    if -5.29999999999999972e119 < y < -5.6e16 or 4.8999999999999997e204 < 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.4%

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

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

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

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

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

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

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

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

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

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

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

    if -6.5999999999999997e-26 < y < 3400

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.3 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -6.6 \cdot 10^{-26}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4.9 \cdot 10^{+204}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 77.0% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq 4.05 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 3.25 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2e-8 or 3.2500000000000002e27 < 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 82.6%

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

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

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

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

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

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

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

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

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

    if -2e-8 < z < 4.05000000000000015e-35 or 1.94999999999999998e-19 < z < 3.2500000000000002e27

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

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

    if 4.05000000000000015e-35 < z < 1.94999999999999998e-19

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{-8}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 4.05 \cdot 10^{-35}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 1.95 \cdot 10^{-19}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 3.25 \cdot 10^{+27}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -2.9 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x + x \cdot z\\

\mathbf{elif}\;y \leq 1.02 \cdot 10^{+204}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.39999999999999973e118 or 3400 < y < 1.02e204

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*88.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified57.3%

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

    if -7.39999999999999973e118 < y < -2.9e16 or 1.02e204 < 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.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.9e16 < y < 3400

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.4 \cdot 10^{+118}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 1.02 \cdot 10^{+204}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 49.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -2 \cdot 10^{+120}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+205}:\\ \;\;\;\;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 -2e+120)
     (* y t)
     (if (<= y -2.6e+17)
       t_1
       (if (<= y 3400.0) (* x (+ z 1.0)) (if (<= y 3.6e+205) (* y t) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * -y;
	double tmp;
	if (y <= -2e+120) {
		tmp = y * t;
	} else if (y <= -2.6e+17) {
		tmp = t_1;
	} else if (y <= 3400.0) {
		tmp = x * (z + 1.0);
	} else if (y <= 3.6e+205) {
		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 <= (-2d+120)) then
        tmp = y * t
    else if (y <= (-2.6d+17)) then
        tmp = t_1
    else if (y <= 3400.0d0) then
        tmp = x * (z + 1.0d0)
    else if (y <= 3.6d+205) 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 <= -2e+120) {
		tmp = y * t;
	} else if (y <= -2.6e+17) {
		tmp = t_1;
	} else if (y <= 3400.0) {
		tmp = x * (z + 1.0);
	} else if (y <= 3.6e+205) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * -y
	tmp = 0
	if y <= -2e+120:
		tmp = y * t
	elif y <= -2.6e+17:
		tmp = t_1
	elif y <= 3400.0:
		tmp = x * (z + 1.0)
	elif y <= 3.6e+205:
		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 <= -2e+120)
		tmp = Float64(y * t);
	elseif (y <= -2.6e+17)
		tmp = t_1;
	elseif (y <= 3400.0)
		tmp = Float64(x * Float64(z + 1.0));
	elseif (y <= 3.6e+205)
		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 <= -2e+120)
		tmp = y * t;
	elseif (y <= -2.6e+17)
		tmp = t_1;
	elseif (y <= 3400.0)
		tmp = x * (z + 1.0);
	elseif (y <= 3.6e+205)
		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, -2e+120], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.6e+17], t$95$1, If[LessEqual[y, 3400.0], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+205], N[(y * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2e120 or 3400 < y < 3.60000000000000002e205

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*88.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified57.3%

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

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

    if -2e120 < y < -2.6e17 or 3.60000000000000002e205 < 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.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e17 < y < 3400

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
    9. Step-by-step derivation
      1. *-commutative52.8%

        \[\leadsto x + \color{blue}{z \cdot x} \]
      2. distribute-rgt1-in52.8%

        \[\leadsto \color{blue}{\left(z + 1\right) \cdot x} \]
    10. Applied egg-rr52.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2 \cdot 10^{+120}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+205}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 49.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -1.7 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+201}:\\ \;\;\;\;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.7e+119)
     (* y t)
     (if (<= y -2.15e+17)
       t_1
       (if (<= y 3400.0) (+ x (* x z)) (if (<= y 4.6e+201) (* y t) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * -y;
	double tmp;
	if (y <= -1.7e+119) {
		tmp = y * t;
	} else if (y <= -2.15e+17) {
		tmp = t_1;
	} else if (y <= 3400.0) {
		tmp = x + (x * z);
	} else if (y <= 4.6e+201) {
		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.7d+119)) then
        tmp = y * t
    else if (y <= (-2.15d+17)) then
        tmp = t_1
    else if (y <= 3400.0d0) then
        tmp = x + (x * z)
    else if (y <= 4.6d+201) 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.7e+119) {
		tmp = y * t;
	} else if (y <= -2.15e+17) {
		tmp = t_1;
	} else if (y <= 3400.0) {
		tmp = x + (x * z);
	} else if (y <= 4.6e+201) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * -y
	tmp = 0
	if y <= -1.7e+119:
		tmp = y * t
	elif y <= -2.15e+17:
		tmp = t_1
	elif y <= 3400.0:
		tmp = x + (x * z)
	elif y <= 4.6e+201:
		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.7e+119)
		tmp = Float64(y * t);
	elseif (y <= -2.15e+17)
		tmp = t_1;
	elseif (y <= 3400.0)
		tmp = Float64(x + Float64(x * z));
	elseif (y <= 4.6e+201)
		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.7e+119)
		tmp = y * t;
	elseif (y <= -2.15e+17)
		tmp = t_1;
	elseif (y <= 3400.0)
		tmp = x + (x * z);
	elseif (y <= 4.6e+201)
		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.7e+119], N[(y * t), $MachinePrecision], If[LessEqual[y, -2.15e+17], t$95$1, If[LessEqual[y, 3400.0], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+201], 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.7 \cdot 10^{+119}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;y \leq 3400:\\
\;\;\;\;x + x \cdot z\\

\mathbf{elif}\;y \leq 4.6 \cdot 10^{+201}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.70000000000000007e119 or 3400 < y < 4.6000000000000002e201

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*88.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified57.3%

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

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

    if -1.70000000000000007e119 < y < -2.15e17 or 4.6000000000000002e201 < 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.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.15e17 < y < 3400

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2.15 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq 3400:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+201}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 84.3% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

    if -1.08e-20 < z < 2.05000000000000006e36

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

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

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

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

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

Alternative 9: 70.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.16 \cdot 10^{+189}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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

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


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

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

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

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

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

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

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

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

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

    if -2.16e189 < x < 3.5000000000000003e126

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

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

    if 3.5000000000000003e126 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
    9. Step-by-step derivation
      1. *-commutative60.0%

        \[\leadsto x + \color{blue}{z \cdot x} \]
      2. distribute-rgt1-in60.0%

        \[\leadsto \color{blue}{\left(z + 1\right) \cdot x} \]
    10. Applied egg-rr60.0%

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

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

Alternative 10: 46.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{-141} \lor \neg \left(x \leq 2.2 \cdot 10^{-108}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.02e-141 or 2.2000000000000001e-108 < x

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

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

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

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

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

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

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

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

    if -1.02e-141 < x < 2.2000000000000001e-108

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*86.5%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified54.2%

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

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

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

Alternative 11: 38.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.7 \cdot 10^{-25} \lor \neg \left(y \leq 3400\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.70000000000000001e-25 or 3400 < y

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + z \cdot \left(\left(t - x\right) \cdot -1 + \frac{\color{blue}{\left(t - x\right) \cdot y}}{z}\right) \]
      3. associate-/l*83.0%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    9. Simplified49.0%

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

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

    if -1.70000000000000001e-25 < y < 3400

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.7 \cdot 10^{-25} \lor \neg \left(y \leq 3400\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 y around inf 57.6%

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

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

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

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