Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.7s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

    \[x + \left(y - z\right) \cdot \left(t - x\right) \]
  2. Add Preprocessing
  3. Final simplification100.0%

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

Alternative 2: 48.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-215}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{-289}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-51}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 4.1 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.5e6 or 4.09999999999999981e55 < 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 62.5%

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

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

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

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

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

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

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

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

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

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

    if -2.5e6 < z < -2.4000000000000001e-215 or 5.80000000000000012e-289 < z < 2.15000000000000013e-67 or 1.8e-51 < z < 4.09999999999999981e55

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity64.4%

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

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

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

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

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

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

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

    if -2.4000000000000001e-215 < z < 5.80000000000000012e-289 or 2.15000000000000013e-67 < z < 1.8e-51

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-187.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2500000:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-215}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-289}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-51}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 4.1 \cdot 10^{+55}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 52.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + x \cdot z\\ t_2 := x + y \cdot t\\ t_3 := x - z \cdot t\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{-70}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-257}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{-266}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-112}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+18}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+119}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* x z))) (t_2 (+ x (* y t))) (t_3 (- x (* z t))))
   (if (<= y -2.7e-70)
     t_2
     (if (<= y -4e-257)
       t_3
       (if (<= y 2.85e-266)
         t_1
         (if (<= y 1.3e-112)
           t_3
           (if (<= y 7.8e+18) t_1 (if (<= y 3.8e+119) t_2 (* x (- y))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (x * z);
	double t_2 = x + (y * t);
	double t_3 = x - (z * t);
	double tmp;
	if (y <= -2.7e-70) {
		tmp = t_2;
	} else if (y <= -4e-257) {
		tmp = t_3;
	} else if (y <= 2.85e-266) {
		tmp = t_1;
	} else if (y <= 1.3e-112) {
		tmp = t_3;
	} else if (y <= 7.8e+18) {
		tmp = t_1;
	} else if (y <= 3.8e+119) {
		tmp = t_2;
	} 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) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x + (x * z)
    t_2 = x + (y * t)
    t_3 = x - (z * t)
    if (y <= (-2.7d-70)) then
        tmp = t_2
    else if (y <= (-4d-257)) then
        tmp = t_3
    else if (y <= 2.85d-266) then
        tmp = t_1
    else if (y <= 1.3d-112) then
        tmp = t_3
    else if (y <= 7.8d+18) then
        tmp = t_1
    else if (y <= 3.8d+119) then
        tmp = t_2
    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 = x + (x * z);
	double t_2 = x + (y * t);
	double t_3 = x - (z * t);
	double tmp;
	if (y <= -2.7e-70) {
		tmp = t_2;
	} else if (y <= -4e-257) {
		tmp = t_3;
	} else if (y <= 2.85e-266) {
		tmp = t_1;
	} else if (y <= 1.3e-112) {
		tmp = t_3;
	} else if (y <= 7.8e+18) {
		tmp = t_1;
	} else if (y <= 3.8e+119) {
		tmp = t_2;
	} else {
		tmp = x * -y;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (x * z)
	t_2 = x + (y * t)
	t_3 = x - (z * t)
	tmp = 0
	if y <= -2.7e-70:
		tmp = t_2
	elif y <= -4e-257:
		tmp = t_3
	elif y <= 2.85e-266:
		tmp = t_1
	elif y <= 1.3e-112:
		tmp = t_3
	elif y <= 7.8e+18:
		tmp = t_1
	elif y <= 3.8e+119:
		tmp = t_2
	else:
		tmp = x * -y
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(x * z))
	t_2 = Float64(x + Float64(y * t))
	t_3 = Float64(x - Float64(z * t))
	tmp = 0.0
	if (y <= -2.7e-70)
		tmp = t_2;
	elseif (y <= -4e-257)
		tmp = t_3;
	elseif (y <= 2.85e-266)
		tmp = t_1;
	elseif (y <= 1.3e-112)
		tmp = t_3;
	elseif (y <= 7.8e+18)
		tmp = t_1;
	elseif (y <= 3.8e+119)
		tmp = t_2;
	else
		tmp = Float64(x * Float64(-y));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (x * z);
	t_2 = x + (y * t);
	t_3 = x - (z * t);
	tmp = 0.0;
	if (y <= -2.7e-70)
		tmp = t_2;
	elseif (y <= -4e-257)
		tmp = t_3;
	elseif (y <= 2.85e-266)
		tmp = t_1;
	elseif (y <= 1.3e-112)
		tmp = t_3;
	elseif (y <= 7.8e+18)
		tmp = t_1;
	elseif (y <= 3.8e+119)
		tmp = t_2;
	else
		tmp = x * -y;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e-70], t$95$2, If[LessEqual[y, -4e-257], t$95$3, If[LessEqual[y, 2.85e-266], t$95$1, If[LessEqual[y, 1.3e-112], t$95$3, If[LessEqual[y, 7.8e+18], t$95$1, If[LessEqual[y, 3.8e+119], t$95$2, N[(x * (-y)), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + x \cdot z\\
t_2 := x + y \cdot t\\
t_3 := x - z \cdot t\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{-70}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -4 \cdot 10^{-257}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 2.85 \cdot 10^{-266}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-112}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 7.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.7000000000000001e-70 or 7.8e18 < y < 3.7999999999999999e119

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    6. Simplified52.4%

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

    if -2.7000000000000001e-70 < y < -3.9999999999999999e-257 or 2.8500000000000001e-266 < y < 1.29999999999999996e-112

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

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

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

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

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

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

    if -3.9999999999999999e-257 < y < 2.8500000000000001e-266 or 1.29999999999999996e-112 < y < 7.8e18

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in72.8%

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

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

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

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

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

    if 3.7999999999999999e119 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{-70}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-257}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 2.85 \cdot 10^{-266}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-112}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+18}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+119}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 37.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -2.2 \cdot 10^{-70}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-234}:\\
\;\;\;\;x\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.60000000000000008e58 or 3.05e119 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in62.9%

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

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

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

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

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

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

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

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

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

    if -1.60000000000000008e58 < y < -2.1999999999999999e-70 or 1.85e-4 < y < 3.05e119

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-165.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1999999999999999e-70 < y < 2.09999999999999991e-234

    1. Initial program 99.9%

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

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

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

    if 2.09999999999999991e-234 < y < 1.2500000000000001e-115

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-176.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2500000000000001e-115 < y < 1.85e-4

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.6 \cdot 10^{+58}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -2.2 \cdot 10^{-70}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-234}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-115}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 0.000185:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + x \cdot z\\ t_2 := x \cdot \left(-y\right)\\ \mathbf{if}\;y \leq -9 \cdot 10^{+58}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-15}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-187}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-164}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+18}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* x z))) (t_2 (* x (- y))))
   (if (<= y -9e+58)
     t_2
     (if (<= y -4.2e-15)
       (* y t)
       (if (<= y 2.4e-187)
         t_1
         (if (<= y 6e-164)
           (* z (- t))
           (if (<= y 3.1e+18) t_1 (if (<= y 3.05e+119) (* y t) t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (x * z);
	double t_2 = x * -y;
	double tmp;
	if (y <= -9e+58) {
		tmp = t_2;
	} else if (y <= -4.2e-15) {
		tmp = y * t;
	} else if (y <= 2.4e-187) {
		tmp = t_1;
	} else if (y <= 6e-164) {
		tmp = z * -t;
	} else if (y <= 3.1e+18) {
		tmp = t_1;
	} else if (y <= 3.05e+119) {
		tmp = y * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (x * z)
    t_2 = x * -y
    if (y <= (-9d+58)) then
        tmp = t_2
    else if (y <= (-4.2d-15)) then
        tmp = y * t
    else if (y <= 2.4d-187) then
        tmp = t_1
    else if (y <= 6d-164) then
        tmp = z * -t
    else if (y <= 3.1d+18) then
        tmp = t_1
    else if (y <= 3.05d+119) then
        tmp = y * t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (x * z);
	double t_2 = x * -y;
	double tmp;
	if (y <= -9e+58) {
		tmp = t_2;
	} else if (y <= -4.2e-15) {
		tmp = y * t;
	} else if (y <= 2.4e-187) {
		tmp = t_1;
	} else if (y <= 6e-164) {
		tmp = z * -t;
	} else if (y <= 3.1e+18) {
		tmp = t_1;
	} else if (y <= 3.05e+119) {
		tmp = y * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (x * z)
	t_2 = x * -y
	tmp = 0
	if y <= -9e+58:
		tmp = t_2
	elif y <= -4.2e-15:
		tmp = y * t
	elif y <= 2.4e-187:
		tmp = t_1
	elif y <= 6e-164:
		tmp = z * -t
	elif y <= 3.1e+18:
		tmp = t_1
	elif y <= 3.05e+119:
		tmp = y * t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(x * z))
	t_2 = Float64(x * Float64(-y))
	tmp = 0.0
	if (y <= -9e+58)
		tmp = t_2;
	elseif (y <= -4.2e-15)
		tmp = Float64(y * t);
	elseif (y <= 2.4e-187)
		tmp = t_1;
	elseif (y <= 6e-164)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 3.1e+18)
		tmp = t_1;
	elseif (y <= 3.05e+119)
		tmp = Float64(y * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (x * z);
	t_2 = x * -y;
	tmp = 0.0;
	if (y <= -9e+58)
		tmp = t_2;
	elseif (y <= -4.2e-15)
		tmp = y * t;
	elseif (y <= 2.4e-187)
		tmp = t_1;
	elseif (y <= 6e-164)
		tmp = z * -t;
	elseif (y <= 3.1e+18)
		tmp = t_1;
	elseif (y <= 3.05e+119)
		tmp = y * t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * (-y)), $MachinePrecision]}, If[LessEqual[y, -9e+58], t$95$2, If[LessEqual[y, -4.2e-15], N[(y * t), $MachinePrecision], If[LessEqual[y, 2.4e-187], t$95$1, If[LessEqual[y, 6e-164], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 3.1e+18], t$95$1, If[LessEqual[y, 3.05e+119], N[(y * t), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq 2.4 \cdot 10^{-187}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 3.1 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -8.9999999999999996e58 or 3.05e119 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in62.9%

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

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

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

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

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

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

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

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

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

    if -8.9999999999999996e58 < y < -4.19999999999999962e-15 or 3.1e18 < y < 3.05e119

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.19999999999999962e-15 < y < 2.40000000000000013e-187 or 6.0000000000000002e-164 < y < 3.1e18

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

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

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

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

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

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

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

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

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

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

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

    if 2.40000000000000013e-187 < y < 6.0000000000000002e-164

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-199.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9 \cdot 10^{+58}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -4.2 \cdot 10^{-15}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-187}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-164}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{+18}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 3.05 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 50.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq -2.3 \cdot 10^{-89}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq -5.2 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq 1.2 \cdot 10^{-66}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t \leq 1.85 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.6499999999999999e40 or 1.8499999999999999e67 < t

    1. Initial program 100.0%

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    6. Simplified58.4%

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

    if -1.6499999999999999e40 < t < -2.3e-89 or -5.1999999999999997e-278 < t < 1.20000000000000013e-66

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity68.0%

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

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

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

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

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

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

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

    if -2.3e-89 < t < -5.1999999999999997e-278 or 1.20000000000000013e-66 < t < 1.8499999999999999e67

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.65 \cdot 10^{+40}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;t \leq -2.3 \cdot 10^{-89}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq -5.2 \cdot 10^{-278}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;t \leq 1.2 \cdot 10^{-66}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 1.85 \cdot 10^{+67}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 37.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -2.65 \cdot 10^{-70}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 3 \cdot 10^{-196}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -4.80000000000000009e57 or 5.09999999999999984e119 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in62.9%

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

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

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

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

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

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

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

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

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

    if -4.80000000000000009e57 < y < -2.64999999999999992e-70 or 0.00700000000000000015 < y < 5.09999999999999984e119

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-165.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.64999999999999992e-70 < y < 3e-196

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

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

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

    if 3e-196 < y < 0.00700000000000000015

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

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

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

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in58.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -2.65 \cdot 10^{-70}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-196}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 0.007:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{+119}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 69.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t \leq -2.95 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -3.5 \cdot 10^{-269}:\\
\;\;\;\;x + x \cdot z\\

\mathbf{elif}\;t \leq 5.5 \cdot 10^{-131}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.14999999999999995e-32 or 5.4999999999999997e-131 < t

    1. Initial program 100.0%

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

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

    if -2.14999999999999995e-32 < t < -2.95e-92 or -3.50000000000000019e-269 < t < 5.4999999999999997e-131

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-x \cdot y\right)} \]
      2. *-rgt-identity71.7%

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

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

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

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

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

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

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

    if -2.95e-92 < t < -3.50000000000000019e-269

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.15 \cdot 10^{-32}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq -2.95 \cdot 10^{-92}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq -3.5 \cdot 10^{-269}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{-131}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-197}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -6.1999999999999996e-72 or 0.024 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-155.0%

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{\left(-t \cdot y\right) \cdot \left(\frac{z}{y} + -1\right)} \]
      6. cancel-sign-sub-inv55.0%

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

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

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

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

    if -6.1999999999999996e-72 < y < 3.4999999999999998e-197

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

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

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

    if 3.4999999999999998e-197 < y < 0.024

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

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

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

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

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

        \[\leadsto x + x \cdot \left(-\color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      5. distribute-neg-in58.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{-72}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-197}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 0.024:\\ \;\;\;\;x \cdot z\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 80.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -9 \cdot 10^{+39} \lor \neg \left(t \leq 1.85 \cdot 10^{+67}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.99999999999999991e39 or 1.8499999999999999e67 < t

    1. Initial program 100.0%

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

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

    if -8.99999999999999991e39 < t < 1.8499999999999999e67

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

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

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

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

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

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

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

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

Alternative 11: 84.4% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.38e-27 or 2.1000000000000001e-4 < 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 86.9%

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

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

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

    if -1.38e-27 < y < 2.1000000000000001e-4

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 37.9% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.3499999999999999e-70 or 1.7499999999999999e-29 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto x + \left(\color{blue}{t \cdot \frac{z}{y}} + \left(-t\right)\right) \cdot \left(-y\right) \]
      7. neg-mul-154.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3499999999999999e-70 < y < 1.7499999999999999e-29

    1. Initial program 100.0%

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

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

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

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

Alternative 13: 17.7% accurate, 9.0× speedup?

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

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

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

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

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

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.3% 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 2024058 
(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))))