Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.9s
Alternatives: 16
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 16 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 36.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := y \cdot \left(-x\right)\\ \mathbf{if}\;z \leq -3.4 \cdot 10^{+34}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-57}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-289}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-231}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-96}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+72}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* y (- x))))
   (if (<= z -3.4e+34)
     t_1
     (if (<= z -1.5e-26)
       t_2
       (if (<= z -2.3e-57)
         t_1
         (if (<= z -8e-289)
           x
           (if (<= z 1.35e-231)
             t_2
             (if (<= z 1.25e-96) x (if (<= z 2.7e+72) (* y t) t_1)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = y * -x;
	double tmp;
	if (z <= -3.4e+34) {
		tmp = t_1;
	} else if (z <= -1.5e-26) {
		tmp = t_2;
	} else if (z <= -2.3e-57) {
		tmp = t_1;
	} else if (z <= -8e-289) {
		tmp = x;
	} else if (z <= 1.35e-231) {
		tmp = t_2;
	} else if (z <= 1.25e-96) {
		tmp = x;
	} else if (z <= 2.7e+72) {
		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) :: t_2
    real(8) :: tmp
    t_1 = z * -t
    t_2 = y * -x
    if (z <= (-3.4d+34)) then
        tmp = t_1
    else if (z <= (-1.5d-26)) then
        tmp = t_2
    else if (z <= (-2.3d-57)) then
        tmp = t_1
    else if (z <= (-8d-289)) then
        tmp = x
    else if (z <= 1.35d-231) then
        tmp = t_2
    else if (z <= 1.25d-96) then
        tmp = x
    else if (z <= 2.7d+72) 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 = z * -t;
	double t_2 = y * -x;
	double tmp;
	if (z <= -3.4e+34) {
		tmp = t_1;
	} else if (z <= -1.5e-26) {
		tmp = t_2;
	} else if (z <= -2.3e-57) {
		tmp = t_1;
	} else if (z <= -8e-289) {
		tmp = x;
	} else if (z <= 1.35e-231) {
		tmp = t_2;
	} else if (z <= 1.25e-96) {
		tmp = x;
	} else if (z <= 2.7e+72) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = y * -x
	tmp = 0
	if z <= -3.4e+34:
		tmp = t_1
	elif z <= -1.5e-26:
		tmp = t_2
	elif z <= -2.3e-57:
		tmp = t_1
	elif z <= -8e-289:
		tmp = x
	elif z <= 1.35e-231:
		tmp = t_2
	elif z <= 1.25e-96:
		tmp = x
	elif z <= 2.7e+72:
		tmp = y * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(y * Float64(-x))
	tmp = 0.0
	if (z <= -3.4e+34)
		tmp = t_1;
	elseif (z <= -1.5e-26)
		tmp = t_2;
	elseif (z <= -2.3e-57)
		tmp = t_1;
	elseif (z <= -8e-289)
		tmp = x;
	elseif (z <= 1.35e-231)
		tmp = t_2;
	elseif (z <= 1.25e-96)
		tmp = x;
	elseif (z <= 2.7e+72)
		tmp = Float64(y * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = y * -x;
	tmp = 0.0;
	if (z <= -3.4e+34)
		tmp = t_1;
	elseif (z <= -1.5e-26)
		tmp = t_2;
	elseif (z <= -2.3e-57)
		tmp = t_1;
	elseif (z <= -8e-289)
		tmp = x;
	elseif (z <= 1.35e-231)
		tmp = t_2;
	elseif (z <= 1.25e-96)
		tmp = x;
	elseif (z <= 2.7e+72)
		tmp = y * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[z, -3.4e+34], t$95$1, If[LessEqual[z, -1.5e-26], t$95$2, If[LessEqual[z, -2.3e-57], t$95$1, If[LessEqual[z, -8e-289], x, If[LessEqual[z, 1.35e-231], t$95$2, If[LessEqual[z, 1.25e-96], x, If[LessEqual[z, 2.7e+72], N[(y * t), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-26}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.3 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -8 \cdot 10^{-289}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-231}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.25 \cdot 10^{-96}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.7 \cdot 10^{+72}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -3.3999999999999999e34 or -1.50000000000000006e-26 < z < -2.3e-57 or 2.7000000000000001e72 < 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out53.5%

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

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

    if -3.3999999999999999e34 < z < -1.50000000000000006e-26 or -8.0000000000000001e-289 < z < 1.35000000000000011e-231

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot y \]
      3. *-commutative53.2%

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

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

    if -2.3e-57 < z < -8.0000000000000001e-289 or 1.35000000000000011e-231 < z < 1.24999999999999999e-96

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

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

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

    if 1.24999999999999999e-96 < z < 2.7000000000000001e72

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.4 \cdot 10^{+34}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-26}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq -2.3 \cdot 10^{-57}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{-289}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-231}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-96}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{+72}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -5.1 \cdot 10^{-198}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.5 \cdot 10^{-258}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-95}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{+72}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.40000000000000001e-56 or 3.3999999999999998e72 < 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. *-commutative100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out49.1%

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

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

    if -2.40000000000000001e-56 < z < -5.0999999999999997e-198 or 7.4999999999999998e-258 < z < 1.8999999999999999e-95

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

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

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

    if -5.0999999999999997e-198 < z < 7.4999999999999998e-258 or 1.8999999999999999e-95 < z < 3.3999999999999998e72

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{-56}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -5.1 \cdot 10^{-198}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{-258}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-95}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{+72}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.042 \lor \neg \left(t \leq -7.8 \cdot 10^{-51}\right) \land \left(t \leq -4.5 \cdot 10^{-113} \lor \neg \left(t \leq 6.2 \cdot 10^{+74}\right)\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.0420000000000000026 or -7.7999999999999995e-51 < t < -4.5000000000000001e-113 or 6.20000000000000043e74 < 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 86.1%

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

    if -0.0420000000000000026 < t < -7.7999999999999995e-51 or -4.5000000000000001e-113 < t < 6.20000000000000043e74

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x + x \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      6. associate--r+86.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.042 \lor \neg \left(t \leq -7.8 \cdot 10^{-51}\right) \land \left(t \leq -4.5 \cdot 10^{-113} \lor \neg \left(t \leq 6.2 \cdot 10^{+74}\right)\right):\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 74.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ t_2 := x + \left(y - z\right) \cdot t\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+81}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-265}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-97}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{+31}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- x t))) (t_2 (+ x (* (- y z) t))))
   (if (<= z -1.85e+81)
     t_1
     (if (<= z 9e-265)
       t_2
       (if (<= z 1.85e-97) (* x (- 1.0 y)) (if (<= z 1.42e+31) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = x + ((y - z) * t);
	double tmp;
	if (z <= -1.85e+81) {
		tmp = t_1;
	} else if (z <= 9e-265) {
		tmp = t_2;
	} else if (z <= 1.85e-97) {
		tmp = x * (1.0 - y);
	} else if (z <= 1.42e+31) {
		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 = z * (x - t)
    t_2 = x + ((y - z) * t)
    if (z <= (-1.85d+81)) then
        tmp = t_1
    else if (z <= 9d-265) then
        tmp = t_2
    else if (z <= 1.85d-97) then
        tmp = x * (1.0d0 - y)
    else if (z <= 1.42d+31) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = x + ((y - z) * t);
	double tmp;
	if (z <= -1.85e+81) {
		tmp = t_1;
	} else if (z <= 9e-265) {
		tmp = t_2;
	} else if (z <= 1.85e-97) {
		tmp = x * (1.0 - y);
	} else if (z <= 1.42e+31) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	t_2 = x + ((y - z) * t)
	tmp = 0
	if z <= -1.85e+81:
		tmp = t_1
	elif z <= 9e-265:
		tmp = t_2
	elif z <= 1.85e-97:
		tmp = x * (1.0 - y)
	elif z <= 1.42e+31:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x - t))
	t_2 = Float64(x + Float64(Float64(y - z) * t))
	tmp = 0.0
	if (z <= -1.85e+81)
		tmp = t_1;
	elseif (z <= 9e-265)
		tmp = t_2;
	elseif (z <= 1.85e-97)
		tmp = Float64(x * Float64(1.0 - y));
	elseif (z <= 1.42e+31)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x - t);
	t_2 = x + ((y - z) * t);
	tmp = 0.0;
	if (z <= -1.85e+81)
		tmp = t_1;
	elseif (z <= 9e-265)
		tmp = t_2;
	elseif (z <= 1.85e-97)
		tmp = x * (1.0 - y);
	elseif (z <= 1.42e+31)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+81], t$95$1, If[LessEqual[z, 9e-265], t$95$2, If[LessEqual[z, 1.85e-97], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.42e+31], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 9 \cdot 10^{-265}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 1.42 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.85e81 or 1.41999999999999997e31 < 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.9%

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

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

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

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

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

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

    if -1.85e81 < z < 9.0000000000000006e-265 or 1.84999999999999988e-97 < z < 1.41999999999999997e31

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

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

    if 9.0000000000000006e-265 < z < 1.84999999999999988e-97

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+81}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-265}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-97}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{+31}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 61.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.16 \lor \neg \left(t \leq -1.4 \cdot 10^{-48}\right) \land \left(t \leq -4.7 \cdot 10^{-113} \lor \neg \left(t \leq 6.8 \cdot 10^{+74}\right)\right):\\
\;\;\;\;t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.160000000000000003 or -1.40000000000000002e-48 < t < -4.7000000000000002e-113 or 6.7999999999999998e74 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--77.2%

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

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

    if -0.160000000000000003 < t < -1.40000000000000002e-48 or -4.7000000000000002e-113 < t < 6.7999999999999998e74

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.16 \lor \neg \left(t \leq -1.4 \cdot 10^{-48}\right) \land \left(t \leq -4.7 \cdot 10^{-113} \lor \neg \left(t \leq 6.8 \cdot 10^{+74}\right)\right):\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ t_2 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -3.9 \cdot 10^{+33}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-96}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-18}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+32}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- x t))) (t_2 (* x (- 1.0 y))))
   (if (<= z -3.9e+33)
     t_1
     (if (<= z 2.3e-96)
       t_2
       (if (<= z 5.4e-18) (* (- y z) t) (if (<= z 1.5e+32) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = x * (1.0 - y);
	double tmp;
	if (z <= -3.9e+33) {
		tmp = t_1;
	} else if (z <= 2.3e-96) {
		tmp = t_2;
	} else if (z <= 5.4e-18) {
		tmp = (y - z) * t;
	} else if (z <= 1.5e+32) {
		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 = z * (x - t)
    t_2 = x * (1.0d0 - y)
    if (z <= (-3.9d+33)) then
        tmp = t_1
    else if (z <= 2.3d-96) then
        tmp = t_2
    else if (z <= 5.4d-18) then
        tmp = (y - z) * t
    else if (z <= 1.5d+32) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double t_2 = x * (1.0 - y);
	double tmp;
	if (z <= -3.9e+33) {
		tmp = t_1;
	} else if (z <= 2.3e-96) {
		tmp = t_2;
	} else if (z <= 5.4e-18) {
		tmp = (y - z) * t;
	} else if (z <= 1.5e+32) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	t_2 = x * (1.0 - y)
	tmp = 0
	if z <= -3.9e+33:
		tmp = t_1
	elif z <= 2.3e-96:
		tmp = t_2
	elif z <= 5.4e-18:
		tmp = (y - z) * t
	elif z <= 1.5e+32:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(x - t))
	t_2 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -3.9e+33)
		tmp = t_1;
	elseif (z <= 2.3e-96)
		tmp = t_2;
	elseif (z <= 5.4e-18)
		tmp = Float64(Float64(y - z) * t);
	elseif (z <= 1.5e+32)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * (x - t);
	t_2 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -3.9e+33)
		tmp = t_1;
	elseif (z <= 2.3e-96)
		tmp = t_2;
	elseif (z <= 5.4e-18)
		tmp = (y - z) * t;
	elseif (z <= 1.5e+32)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.9e+33], t$95$1, If[LessEqual[z, 2.3e-96], t$95$2, If[LessEqual[z, 5.4e-18], N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[z, 1.5e+32], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-96}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+32}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.9000000000000002e33 or 1.5e32 < 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.0%

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

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

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

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

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

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

    if -3.9000000000000002e33 < z < 2.3e-96 or 5.39999999999999977e-18 < z < 1.5e32

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if 2.3e-96 < z < 5.39999999999999977e-18

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--77.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.9 \cdot 10^{+33}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-96}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 5.4 \cdot 10^{-18}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 69.5% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq 5.5 \cdot 10^{-265}:\\
\;\;\;\;x + y \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.30000000000000007e79 or 1.5e32 < 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.6%

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

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

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

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

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

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

    if -1.30000000000000007e79 < z < -7.49999999999999973e-57

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - \left(z \cdot t - t \cdot y\right)} \]
      6. *-commutative62.2%

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--63.3%

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

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

    if -7.49999999999999973e-57 < z < 5.49999999999999985e-265

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

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

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative69.9%

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

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

    if 5.49999999999999985e-265 < z < 1.5e32

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+79}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-57}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-265}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.9% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -9.4999999999999995e-19 or 1.45e63 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.4999999999999995e-19 < y < 1.35000000000000001e-117

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

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

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

    if 1.35000000000000001e-117 < y < 1.45e63

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    10. Simplified32.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{-19}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.35 \cdot 10^{-117}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+63}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 83.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+67} \lor \neg \left(z \leq 1.3 \cdot 10^{+47}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2e67 or 1.30000000000000002e47 < 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 84.5%

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

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

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

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

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

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

    if -2.2e67 < z < 1.30000000000000002e47

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

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

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

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

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

Alternative 11: 83.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.058 \lor \neg \left(y \leq 1.4 \cdot 10^{+63}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0580000000000000029 or 1.39999999999999993e63 < y

    1. Initial program 100.0%

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

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

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

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

    if -0.0580000000000000029 < y < 1.39999999999999993e63

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 12: 55.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.52 \cdot 10^{-114} \lor \neg \left(t \leq 2.9 \cdot 10^{-104}\right):\\
\;\;\;\;t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.51999999999999997e-114 or 2.9000000000000001e-104 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--63.0%

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

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

    if -1.51999999999999997e-114 < t < 2.9000000000000001e-104

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot y \]
      3. *-commutative43.6%

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

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

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

Alternative 13: 63.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.32000000000000007e-5 or 0.00224999999999999983 < 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 59.7%

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

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

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

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

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

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

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

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

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

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

    if -1.32000000000000007e-5 < x < 0.00224999999999999983

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--72.0%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    10. Simplified72.0%

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

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

Alternative 14: 36.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.02 \cdot 10^{-27} \lor \neg \left(y \leq 1.4 \cdot 10^{+63}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.02000000000000002e-27 or 1.39999999999999993e63 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02000000000000002e-27 < y < 1.39999999999999993e63

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

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

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

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

Alternative 15: 100.0% accurate, 1.0× speedup?

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

\\
x + \left(t - x\right) \cdot \left(y - z\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(t - x\right) \cdot \left(y - z\right) \]
  4. Add Preprocessing

Alternative 16: 17.7% 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 63.5%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification20.4%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.0% 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 2024081 
(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))))