Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 7.4s
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.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -7.2 \cdot 10^{+118}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-196}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{-233}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-82}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+184}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= y -7.2e+118)
     (* y t)
     (if (<= y -1.35e-196)
       t_1
       (if (<= y 9.6e-233)
         x
         (if (<= y 5.4e-169)
           t_1
           (if (<= y 2.35e-82) x (if (<= y 4e+184) (* y t) (* x (- y))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -7.2e+118) {
		tmp = y * t;
	} else if (y <= -1.35e-196) {
		tmp = t_1;
	} else if (y <= 9.6e-233) {
		tmp = x;
	} else if (y <= 5.4e-169) {
		tmp = t_1;
	} else if (y <= 2.35e-82) {
		tmp = x;
	} else if (y <= 4e+184) {
		tmp = y * t;
	} else {
		tmp = x * -y;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (y <= (-7.2d+118)) then
        tmp = y * t
    else if (y <= (-1.35d-196)) then
        tmp = t_1
    else if (y <= 9.6d-233) then
        tmp = x
    else if (y <= 5.4d-169) then
        tmp = t_1
    else if (y <= 2.35d-82) then
        tmp = x
    else if (y <= 4d+184) then
        tmp = y * t
    else
        tmp = x * -y
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -7.2e+118) {
		tmp = y * t;
	} else if (y <= -1.35e-196) {
		tmp = t_1;
	} else if (y <= 9.6e-233) {
		tmp = x;
	} else if (y <= 5.4e-169) {
		tmp = t_1;
	} else if (y <= 2.35e-82) {
		tmp = x;
	} else if (y <= 4e+184) {
		tmp = y * t;
	} else {
		tmp = x * -y;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if y <= -7.2e+118:
		tmp = y * t
	elif y <= -1.35e-196:
		tmp = t_1
	elif y <= 9.6e-233:
		tmp = x
	elif y <= 5.4e-169:
		tmp = t_1
	elif y <= 2.35e-82:
		tmp = x
	elif y <= 4e+184:
		tmp = y * t
	else:
		tmp = x * -y
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -7.2e+118)
		tmp = Float64(y * t);
	elseif (y <= -1.35e-196)
		tmp = t_1;
	elseif (y <= 9.6e-233)
		tmp = x;
	elseif (y <= 5.4e-169)
		tmp = t_1;
	elseif (y <= 2.35e-82)
		tmp = x;
	elseif (y <= 4e+184)
		tmp = Float64(y * t);
	else
		tmp = Float64(x * Float64(-y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (y <= -7.2e+118)
		tmp = y * t;
	elseif (y <= -1.35e-196)
		tmp = t_1;
	elseif (y <= 9.6e-233)
		tmp = x;
	elseif (y <= 5.4e-169)
		tmp = t_1;
	elseif (y <= 2.35e-82)
		tmp = x;
	elseif (y <= 4e+184)
		tmp = y * t;
	else
		tmp = x * -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -7.2e+118], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.35e-196], t$95$1, If[LessEqual[y, 9.6e-233], x, If[LessEqual[y, 5.4e-169], t$95$1, If[LessEqual[y, 2.35e-82], x, If[LessEqual[y, 4e+184], N[(y * t), $MachinePrecision], N[(x * (-y)), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.35 \cdot 10^{-196}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 9.6 \cdot 10^{-233}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 5.4 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.35 \cdot 10^{-82}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 4 \cdot 10^{+184}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.2e118 or 2.35e-82 < y < 4.00000000000000007e184

    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 y around inf 80.1%

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified45.1%

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

    if -7.2e118 < y < -1.34999999999999991e-196 or 9.5999999999999996e-233 < y < 5.4000000000000003e-169

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999991e-196 < y < 9.5999999999999996e-233 or 5.4000000000000003e-169 < y < 2.35e-82

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

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

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

    if 4.00000000000000007e184 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.2 \cdot 10^{+118}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-196}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 9.6 \cdot 10^{-233}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 5.4 \cdot 10^{-169}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.35 \cdot 10^{-82}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 4 \cdot 10^{+184}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 53.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y - z \leq 4 \cdot 10^{-51}:\\
\;\;\;\;x\\

\mathbf{elif}\;y - z \leq 10^{+188} \lor \neg \left(y - z \leq 10^{+222}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (-.f64 y z) < -1.00000000000000006e-32 or 4e-51 < (-.f64 y z) < 1e188 or 1e222 < (-.f64 y z)

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -1.00000000000000006e-32 < (-.f64 y z) < 4e-51

    1. Initial program 100.0%

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

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

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

    if 1e188 < (-.f64 y z) < 1e222

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{z \cdot x} \]
    9. Taylor expanded in z around inf 81.7%

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

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

Alternative 4: 61.7% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t \leq -9.6 \cdot 10^{-111}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -4.8 \cdot 10^{-162}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;t \leq 3.8 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.45000000000000006e-17 or -6.00000000000000038e-60 < t < -9.6000000000000003e-111 or 3.8e16 < t

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -2.45000000000000006e-17 < t < -6.00000000000000038e-60 or -4.8000000000000004e-162 < t < 3.8e16

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in58.6%

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

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

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

    if -9.6000000000000003e-111 < t < -4.8000000000000004e-162

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot x} \]
    8. Simplified100.0%

      \[\leadsto x + \color{blue}{z \cdot x} \]
    9. Taylor expanded in z around inf 88.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.45 \cdot 10^{-17}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq -6 \cdot 10^{-60}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq -9.6 \cdot 10^{-111}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq -4.8 \cdot 10^{-162}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 3.8 \cdot 10^{+16}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := z \cdot \left(x - t\right)\\ t_3 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -4800000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-168}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-303}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-243}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 15.5:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))) (t_2 (* z (- x t))) (t_3 (* x (- 1.0 y))))
   (if (<= z -4800000.0)
     t_2
     (if (<= z -1.05e-168)
       t_3
       (if (<= z -1.9e-303)
         t_1
         (if (<= z 8.2e-243) t_3 (if (<= z 15.5) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = z * (x - t);
	double t_3 = x * (1.0 - y);
	double tmp;
	if (z <= -4800000.0) {
		tmp = t_2;
	} else if (z <= -1.05e-168) {
		tmp = t_3;
	} else if (z <= -1.9e-303) {
		tmp = t_1;
	} else if (z <= 8.2e-243) {
		tmp = t_3;
	} else if (z <= 15.5) {
		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) :: t_3
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = z * (x - t)
    t_3 = x * (1.0d0 - y)
    if (z <= (-4800000.0d0)) then
        tmp = t_2
    else if (z <= (-1.05d-168)) then
        tmp = t_3
    else if (z <= (-1.9d-303)) then
        tmp = t_1
    else if (z <= 8.2d-243) then
        tmp = t_3
    else if (z <= 15.5d0) 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 = y * (t - x);
	double t_2 = z * (x - t);
	double t_3 = x * (1.0 - y);
	double tmp;
	if (z <= -4800000.0) {
		tmp = t_2;
	} else if (z <= -1.05e-168) {
		tmp = t_3;
	} else if (z <= -1.9e-303) {
		tmp = t_1;
	} else if (z <= 8.2e-243) {
		tmp = t_3;
	} else if (z <= 15.5) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = z * (x - t)
	t_3 = x * (1.0 - y)
	tmp = 0
	if z <= -4800000.0:
		tmp = t_2
	elif z <= -1.05e-168:
		tmp = t_3
	elif z <= -1.9e-303:
		tmp = t_1
	elif z <= 8.2e-243:
		tmp = t_3
	elif z <= 15.5:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(z * Float64(x - t))
	t_3 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -4800000.0)
		tmp = t_2;
	elseif (z <= -1.05e-168)
		tmp = t_3;
	elseif (z <= -1.9e-303)
		tmp = t_1;
	elseif (z <= 8.2e-243)
		tmp = t_3;
	elseif (z <= 15.5)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = z * (x - t);
	t_3 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -4800000.0)
		tmp = t_2;
	elseif (z <= -1.05e-168)
		tmp = t_3;
	elseif (z <= -1.9e-303)
		tmp = t_1;
	elseif (z <= 8.2e-243)
		tmp = t_3;
	elseif (z <= 15.5)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4800000.0], t$95$2, If[LessEqual[z, -1.05e-168], t$95$3, If[LessEqual[z, -1.9e-303], t$95$1, If[LessEqual[z, 8.2e-243], t$95$3, If[LessEqual[z, 15.5], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-168}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-303}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8.2 \cdot 10^{-243}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 15.5:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8e6 or 15.5 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot z - t \cdot z} \]
      4. distribute-rgt-out--80.2%

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

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

    if -4.8e6 < z < -1.04999999999999997e-168 or -1.90000000000000005e-303 < z < 8.19999999999999962e-243

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot 1 + \color{blue}{x \cdot \left(-y\right)} \]
      4. distribute-lft-in65.1%

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

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

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

    if -1.04999999999999997e-168 < z < -1.90000000000000005e-303 or 8.19999999999999962e-243 < z < 15.5

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4800000:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-168}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-303}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 8.2 \cdot 10^{-243}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 15.5:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 71.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-171}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 0.205:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.3799999999999999e-6 or 0.204999999999999988 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot z - t \cdot z} \]
      4. distribute-rgt-out--79.5%

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

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

    if -1.3799999999999999e-6 < z < -6.7999999999999997e-171 or -2.59999999999999992e-275 < z < 0.204999999999999988

    1. Initial program 100.0%

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

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

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

    if -6.7999999999999997e-171 < z < -2.59999999999999992e-275

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.38 \cdot 10^{-6}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-171}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-275}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 0.205:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 68.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -1:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-168}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-277}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 0.225:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- x t))))
   (if (<= z -1.0)
     t_1
     (if (<= z -2.5e-168)
       (- x (* z t))
       (if (<= z -3.2e-277)
         (* y (- t x))
         (if (<= z 0.225) (+ x (* y t)) t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= -2.5e-168) {
		tmp = x - (z * t);
	} else if (z <= -3.2e-277) {
		tmp = y * (t - x);
	} else if (z <= 0.225) {
		tmp = x + (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 * (x - t)
    if (z <= (-1.0d0)) then
        tmp = t_1
    else if (z <= (-2.5d-168)) then
        tmp = x - (z * t)
    else if (z <= (-3.2d-277)) then
        tmp = y * (t - x)
    else if (z <= 0.225d0) then
        tmp = x + (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 * (x - t);
	double tmp;
	if (z <= -1.0) {
		tmp = t_1;
	} else if (z <= -2.5e-168) {
		tmp = x - (z * t);
	} else if (z <= -3.2e-277) {
		tmp = y * (t - x);
	} else if (z <= 0.225) {
		tmp = x + (y * t);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	tmp = 0
	if z <= -1.0:
		tmp = t_1
	elif z <= -2.5e-168:
		tmp = x - (z * t)
	elif z <= -3.2e-277:
		tmp = y * (t - x)
	elif z <= 0.225:
		tmp = x + (y * t)
	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.0)
		tmp = t_1;
	elseif (z <= -2.5e-168)
		tmp = Float64(x - Float64(z * t));
	elseif (z <= -3.2e-277)
		tmp = Float64(y * Float64(t - x));
	elseif (z <= 0.225)
		tmp = Float64(x + Float64(y * t));
	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.0)
		tmp = t_1;
	elseif (z <= -2.5e-168)
		tmp = x - (z * t);
	elseif (z <= -3.2e-277)
		tmp = y * (t - x);
	elseif (z <= 0.225)
		tmp = x + (y * t);
	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.0], t$95$1, If[LessEqual[z, -2.5e-168], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e-277], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 0.225], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1 or 0.225000000000000006 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot z - t \cdot z} \]
      4. distribute-rgt-out--80.2%

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

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

    if -1 < z < -2.50000000000000001e-168

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

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

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

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

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

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

    if -2.50000000000000001e-168 < z < -3.1999999999999998e-277

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

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

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

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

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

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

    if -3.1999999999999998e-277 < z < 0.225000000000000006

    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 y around inf 78.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-168}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-277}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 0.225:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 36.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 4.2 \cdot 10^{-75}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.4e-33 or 4.2000000000000002e-75 < y < 9.9999999999999998e185

    1. Initial program 100.0%

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
    8. Step-by-step derivation
      1. *-commutative40.4%

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified40.4%

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

    if -1.4e-33 < y < 4.2000000000000002e-75

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

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

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

    if 9.9999999999999998e185 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-33}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{-75}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 10^{+186}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 76.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.74999999999999997e-6 or 3.99999999999999993e77 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot z - t \cdot z} \]
      4. distribute-rgt-out--82.4%

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

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

    if -1.74999999999999997e-6 < z < 3.99999999999999993e77

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

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

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

Alternative 10: 81.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+92} \lor \neg \left(x \leq 5.2 \cdot 10^{-44}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.35e92 or 5.1999999999999996e-44 < x

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e92 < x < 5.1999999999999996e-44

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

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

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

Alternative 11: 84.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+14} \lor \neg \left(z \leq 300\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 < -7.2e14 or 300 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot z - t \cdot z} \]
      4. distribute-rgt-out--80.2%

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

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

    if -7.2e14 < z < 300

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

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

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

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

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

Alternative 12: 84.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{-30} \lor \neg \left(z \leq 135\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 < -2.59999999999999987e-30 or 135 < 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 80.5%

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

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

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

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

    if -2.59999999999999987e-30 < z < 135

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

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

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

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

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

Alternative 13: 37.7% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{x \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative40.2%

        \[\leadsto x + \color{blue}{z \cdot x} \]
    8. Simplified40.2%

      \[\leadsto x + \color{blue}{z \cdot x} \]
    9. Taylor expanded in z around inf 40.2%

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

    if -1 < z < 0.0030000000000000001

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

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

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

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

Alternative 14: 36.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-33} \lor \neg \left(y \leq 6.2 \cdot 10^{-77}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.89999999999999997e-33 or 6.20000000000000016e-77 < 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 74.9%

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y} \]
    8. Step-by-step derivation
      1. *-commutative40.9%

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified40.9%

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

    if -1.89999999999999997e-33 < y < 6.20000000000000016e-77

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{-33} \lor \neg \left(y \leq 6.2 \cdot 10^{-77}\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(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 16: 17.9% 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 65.9%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification19.0%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.1% accurate, 0.6× speedup?

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

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

Reproduce

?
herbie shell --seed 2024095 
(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))))