Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.7s
Alternatives: 10
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 10 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. Final simplification100.0%

    \[\leadsto x + \left(y - z\right) \cdot \left(t - x\right) \]

Alternative 2: 68.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := x + x \cdot z\\ t_3 := x + \left(y - z\right) \cdot t\\ \mathbf{if}\;x \leq -1.6 \cdot 10^{+147}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2 \cdot 10^{+51}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -5.4 \cdot 10^{-26}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+52}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+168} \lor \neg \left(x \leq 4.8 \cdot 10^{+263}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* x z))) (t_3 (+ x (* (- y z) t))))
   (if (<= x -1.6e+147)
     t_2
     (if (<= x -2e+51)
       t_3
       (if (<= x -5.4e-26)
         t_1
         (if (<= x 2.8e+52)
           t_3
           (if (or (<= x 4.6e+168) (not (<= x 4.8e+263))) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (x * z);
	double t_3 = x + ((y - z) * t);
	double tmp;
	if (x <= -1.6e+147) {
		tmp = t_2;
	} else if (x <= -2e+51) {
		tmp = t_3;
	} else if (x <= -5.4e-26) {
		tmp = t_1;
	} else if (x <= 2.8e+52) {
		tmp = t_3;
	} else if ((x <= 4.6e+168) || !(x <= 4.8e+263)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    t_2 = x + (x * z)
    t_3 = x + ((y - z) * t)
    if (x <= (-1.6d+147)) then
        tmp = t_2
    else if (x <= (-2d+51)) then
        tmp = t_3
    else if (x <= (-5.4d-26)) then
        tmp = t_1
    else if (x <= 2.8d+52) then
        tmp = t_3
    else if ((x <= 4.6d+168) .or. (.not. (x <= 4.8d+263))) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (x * z);
	double t_3 = x + ((y - z) * t);
	double tmp;
	if (x <= -1.6e+147) {
		tmp = t_2;
	} else if (x <= -2e+51) {
		tmp = t_3;
	} else if (x <= -5.4e-26) {
		tmp = t_1;
	} else if (x <= 2.8e+52) {
		tmp = t_3;
	} else if ((x <= 4.6e+168) || !(x <= 4.8e+263)) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = x + (x * z)
	t_3 = x + ((y - z) * t)
	tmp = 0
	if x <= -1.6e+147:
		tmp = t_2
	elif x <= -2e+51:
		tmp = t_3
	elif x <= -5.4e-26:
		tmp = t_1
	elif x <= 2.8e+52:
		tmp = t_3
	elif (x <= 4.6e+168) or not (x <= 4.8e+263):
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	t_2 = Float64(x + Float64(x * z))
	t_3 = Float64(x + Float64(Float64(y - z) * t))
	tmp = 0.0
	if (x <= -1.6e+147)
		tmp = t_2;
	elseif (x <= -2e+51)
		tmp = t_3;
	elseif (x <= -5.4e-26)
		tmp = t_1;
	elseif (x <= 2.8e+52)
		tmp = t_3;
	elseif ((x <= 4.6e+168) || !(x <= 4.8e+263))
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	t_2 = x + (x * z);
	t_3 = x + ((y - z) * t);
	tmp = 0.0;
	if (x <= -1.6e+147)
		tmp = t_2;
	elseif (x <= -2e+51)
		tmp = t_3;
	elseif (x <= -5.4e-26)
		tmp = t_1;
	elseif (x <= 2.8e+52)
		tmp = t_3;
	elseif ((x <= 4.6e+168) || ~((x <= 4.8e+263)))
		tmp = t_2;
	else
		tmp = t_1;
	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[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+147], t$95$2, If[LessEqual[x, -2e+51], t$95$3, If[LessEqual[x, -5.4e-26], t$95$1, If[LessEqual[x, 2.8e+52], t$95$3, If[Or[LessEqual[x, 4.6e+168], N[Not[LessEqual[x, 4.8e+263]], $MachinePrecision]], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2 \cdot 10^{+51}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq -5.4 \cdot 10^{-26}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{+52}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 4.6 \cdot 10^{+168} \lor \neg \left(x \leq 4.8 \cdot 10^{+263}\right):\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.59999999999999989e147 or 2.8e52 < x < 4.5999999999999999e168 or 4.8000000000000001e263 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -1.59999999999999989e147 < x < -2e51 or -5.39999999999999963e-26 < x < 2.8e52

    1. Initial program 99.9%

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

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

    if -2e51 < x < -5.39999999999999963e-26 or 4.5999999999999999e168 < x < 4.8000000000000001e263

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.6 \cdot 10^{+147}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;x \leq -2 \cdot 10^{+51}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;x \leq -5.4 \cdot 10^{-26}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+52}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{+168} \lor \neg \left(x \leq 4.8 \cdot 10^{+263}\right):\\ \;\;\;\;x + x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]

Alternative 3: 52.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := x + x \cdot z\\ t_3 := x + y \cdot t\\ \mathbf{if}\;z \leq -3.1 \cdot 10^{+187}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{+110}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-6}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-111}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-202}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+75}:\\ \;\;\;\;t_3\\ \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 (* x z))) (t_3 (+ x (* y t))))
   (if (<= z -3.1e+187)
     t_2
     (if (<= z -7.6e+110)
       t_1
       (if (<= z -2.4e-6)
         t_2
         (if (<= z -7e-111)
           t_3
           (if (<= z -1.35e-202) t_1 (if (<= z 1.36e+75) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (x * z);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -3.1e+187) {
		tmp = t_2;
	} else if (z <= -7.6e+110) {
		tmp = t_1;
	} else if (z <= -2.4e-6) {
		tmp = t_2;
	} else if (z <= -7e-111) {
		tmp = t_3;
	} else if (z <= -1.35e-202) {
		tmp = t_1;
	} else if (z <= 1.36e+75) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    t_2 = x + (x * z)
    t_3 = x + (y * t)
    if (z <= (-3.1d+187)) then
        tmp = t_2
    else if (z <= (-7.6d+110)) then
        tmp = t_1
    else if (z <= (-2.4d-6)) then
        tmp = t_2
    else if (z <= (-7d-111)) then
        tmp = t_3
    else if (z <= (-1.35d-202)) then
        tmp = t_1
    else if (z <= 1.36d+75) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (x * z);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -3.1e+187) {
		tmp = t_2;
	} else if (z <= -7.6e+110) {
		tmp = t_1;
	} else if (z <= -2.4e-6) {
		tmp = t_2;
	} else if (z <= -7e-111) {
		tmp = t_3;
	} else if (z <= -1.35e-202) {
		tmp = t_1;
	} else if (z <= 1.36e+75) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = x + (x * z)
	t_3 = x + (y * t)
	tmp = 0
	if z <= -3.1e+187:
		tmp = t_2
	elif z <= -7.6e+110:
		tmp = t_1
	elif z <= -2.4e-6:
		tmp = t_2
	elif z <= -7e-111:
		tmp = t_3
	elif z <= -1.35e-202:
		tmp = t_1
	elif z <= 1.36e+75:
		tmp = t_3
	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(x * z))
	t_3 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (z <= -3.1e+187)
		tmp = t_2;
	elseif (z <= -7.6e+110)
		tmp = t_1;
	elseif (z <= -2.4e-6)
		tmp = t_2;
	elseif (z <= -7e-111)
		tmp = t_3;
	elseif (z <= -1.35e-202)
		tmp = t_1;
	elseif (z <= 1.36e+75)
		tmp = t_3;
	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 + (x * z);
	t_3 = x + (y * t);
	tmp = 0.0;
	if (z <= -3.1e+187)
		tmp = t_2;
	elseif (z <= -7.6e+110)
		tmp = t_1;
	elseif (z <= -2.4e-6)
		tmp = t_2;
	elseif (z <= -7e-111)
		tmp = t_3;
	elseif (z <= -1.35e-202)
		tmp = t_1;
	elseif (z <= 1.36e+75)
		tmp = t_3;
	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[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e+187], t$95$2, If[LessEqual[z, -7.6e+110], t$95$1, If[LessEqual[z, -2.4e-6], t$95$2, If[LessEqual[z, -7e-111], t$95$3, If[LessEqual[z, -1.35e-202], t$95$1, If[LessEqual[z, 1.36e+75], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -7.6 \cdot 10^{+110}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-6}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -7 \cdot 10^{-111}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq -1.35 \cdot 10^{-202}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.36 \cdot 10^{+75}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.10000000000000012e187 or -7.59999999999999978e110 < z < -2.3999999999999999e-6 or 1.36e75 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -3.10000000000000012e187 < z < -7.59999999999999978e110 or -7.0000000000000001e-111 < z < -1.3499999999999999e-202

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3999999999999999e-6 < z < -7.0000000000000001e-111 or -1.3499999999999999e-202 < z < 1.36e75

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    7. Simplified68.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.1 \cdot 10^{+187}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;z \leq -7.6 \cdot 10^{+110}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-6}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-111}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{-202}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+75}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot z\\ \end{array} \]

Alternative 4: 50.3% accurate, 0.5× 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 -5.2 \cdot 10^{+73}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-114}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-255}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{-170}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-96}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+153}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - 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 -5.2e+73)
     t_2
     (if (<= y -5e-114)
       t_3
       (if (<= y 4.8e-255)
         t_1
         (if (<= y 3.25e-170)
           t_3
           (if (<= y 4e-96) t_1 (if (<= y 3.8e+153) t_2 (* x (- 1.0 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 <= -5.2e+73) {
		tmp = t_2;
	} else if (y <= -5e-114) {
		tmp = t_3;
	} else if (y <= 4.8e-255) {
		tmp = t_1;
	} else if (y <= 3.25e-170) {
		tmp = t_3;
	} else if (y <= 4e-96) {
		tmp = t_1;
	} else if (y <= 3.8e+153) {
		tmp = t_2;
	} else {
		tmp = x * (1.0 - y);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: 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 <= (-5.2d+73)) then
        tmp = t_2
    else if (y <= (-5d-114)) then
        tmp = t_3
    else if (y <= 4.8d-255) then
        tmp = t_1
    else if (y <= 3.25d-170) then
        tmp = t_3
    else if (y <= 4d-96) then
        tmp = t_1
    else if (y <= 3.8d+153) then
        tmp = t_2
    else
        tmp = x * (1.0d0 - y)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (x * z);
	double t_2 = x + (y * t);
	double t_3 = x - (z * t);
	double tmp;
	if (y <= -5.2e+73) {
		tmp = t_2;
	} else if (y <= -5e-114) {
		tmp = t_3;
	} else if (y <= 4.8e-255) {
		tmp = t_1;
	} else if (y <= 3.25e-170) {
		tmp = t_3;
	} else if (y <= 4e-96) {
		tmp = t_1;
	} else if (y <= 3.8e+153) {
		tmp = t_2;
	} else {
		tmp = x * (1.0 - 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 <= -5.2e+73:
		tmp = t_2
	elif y <= -5e-114:
		tmp = t_3
	elif y <= 4.8e-255:
		tmp = t_1
	elif y <= 3.25e-170:
		tmp = t_3
	elif y <= 4e-96:
		tmp = t_1
	elif y <= 3.8e+153:
		tmp = t_2
	else:
		tmp = x * (1.0 - 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 <= -5.2e+73)
		tmp = t_2;
	elseif (y <= -5e-114)
		tmp = t_3;
	elseif (y <= 4.8e-255)
		tmp = t_1;
	elseif (y <= 3.25e-170)
		tmp = t_3;
	elseif (y <= 4e-96)
		tmp = t_1;
	elseif (y <= 3.8e+153)
		tmp = t_2;
	else
		tmp = Float64(x * Float64(1.0 - 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 <= -5.2e+73)
		tmp = t_2;
	elseif (y <= -5e-114)
		tmp = t_3;
	elseif (y <= 4.8e-255)
		tmp = t_1;
	elseif (y <= 3.25e-170)
		tmp = t_3;
	elseif (y <= 4e-96)
		tmp = t_1;
	elseif (y <= 3.8e+153)
		tmp = t_2;
	else
		tmp = x * (1.0 - 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, -5.2e+73], t$95$2, If[LessEqual[y, -5e-114], t$95$3, If[LessEqual[y, 4.8e-255], t$95$1, If[LessEqual[y, 3.25e-170], t$95$3, If[LessEqual[y, 4e-96], t$95$1, If[LessEqual[y, 3.8e+153], t$95$2, N[(x * N[(1.0 - y), $MachinePrecision]), $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 -5.2 \cdot 10^{+73}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -5 \cdot 10^{-114}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 4.8 \cdot 10^{-255}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.25 \cdot 10^{-170}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 4 \cdot 10^{-96}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.8 \cdot 10^{+153}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.2000000000000001e73 or 3.9999999999999996e-96 < y < 3.79999999999999966e153

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -5.2000000000000001e73 < y < -4.99999999999999989e-114 or 4.7999999999999997e-255 < y < 3.25000000000000018e-170

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999989e-114 < y < 4.7999999999999997e-255 or 3.25000000000000018e-170 < y < 3.9999999999999996e-96

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 3.79999999999999966e153 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+73}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -5 \cdot 10^{-114}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{-255}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 3.25 \cdot 10^{-170}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 4 \cdot 10^{-96}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 3.8 \cdot 10^{+153}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]

Alternative 5: 48.4% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;y \leq -5.5 \cdot 10^{+60}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+17}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.25 \cdot 10^{-50}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+16}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+153}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))))
   (if (<= y -5.5e+60)
     (* y t)
     (if (<= y -2e+17)
       t_1
       (if (<= y -3.25e-50)
         (* y t)
         (if (<= y 1.6e+16)
           (+ x (* x z))
           (if (<= y 4.6e+153) (* y t) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double tmp;
	if (y <= -5.5e+60) {
		tmp = y * t;
	} else if (y <= -2e+17) {
		tmp = t_1;
	} else if (y <= -3.25e-50) {
		tmp = y * t;
	} else if (y <= 1.6e+16) {
		tmp = x + (x * z);
	} else if (y <= 4.6e+153) {
		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 * (1.0d0 - y)
    if (y <= (-5.5d+60)) then
        tmp = y * t
    else if (y <= (-2d+17)) then
        tmp = t_1
    else if (y <= (-3.25d-50)) then
        tmp = y * t
    else if (y <= 1.6d+16) then
        tmp = x + (x * z)
    else if (y <= 4.6d+153) 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 * (1.0 - y);
	double tmp;
	if (y <= -5.5e+60) {
		tmp = y * t;
	} else if (y <= -2e+17) {
		tmp = t_1;
	} else if (y <= -3.25e-50) {
		tmp = y * t;
	} else if (y <= 1.6e+16) {
		tmp = x + (x * z);
	} else if (y <= 4.6e+153) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	tmp = 0
	if y <= -5.5e+60:
		tmp = y * t
	elif y <= -2e+17:
		tmp = t_1
	elif y <= -3.25e-50:
		tmp = y * t
	elif y <= 1.6e+16:
		tmp = x + (x * z)
	elif y <= 4.6e+153:
		tmp = y * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (y <= -5.5e+60)
		tmp = Float64(y * t);
	elseif (y <= -2e+17)
		tmp = t_1;
	elseif (y <= -3.25e-50)
		tmp = Float64(y * t);
	elseif (y <= 1.6e+16)
		tmp = Float64(x + Float64(x * z));
	elseif (y <= 4.6e+153)
		tmp = Float64(y * t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	tmp = 0.0;
	if (y <= -5.5e+60)
		tmp = y * t;
	elseif (y <= -2e+17)
		tmp = t_1;
	elseif (y <= -3.25e-50)
		tmp = y * t;
	elseif (y <= 1.6e+16)
		tmp = x + (x * z);
	elseif (y <= 4.6e+153)
		tmp = y * t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.5e+60], N[(y * t), $MachinePrecision], If[LessEqual[y, -2e+17], t$95$1, If[LessEqual[y, -3.25e-50], N[(y * t), $MachinePrecision], If[LessEqual[y, 1.6e+16], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.6e+153], N[(y * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -2 \cdot 10^{+17}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -3.25 \cdot 10^{-50}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 1.6 \cdot 10^{+16}:\\
\;\;\;\;x + x \cdot z\\

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5.5000000000000001e60 or -2e17 < y < -3.24999999999999994e-50 or 1.6e16 < y < 4.6000000000000003e153

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    7. Simplified55.3%

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

    if -5.5000000000000001e60 < y < -2e17 or 4.6000000000000003e153 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.24999999999999994e-50 < y < 1.6e16

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.5 \cdot 10^{+60}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;y \leq -3.25 \cdot 10^{-50}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+16}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{+153}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]

Alternative 6: 80.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+147} \lor \neg \left(x \leq -4.3 \cdot 10^{+111} \lor \neg \left(x \leq -3.5 \cdot 10^{-29}\right) \land x \leq 1.28 \cdot 10^{-23}\right):\\
\;\;\;\;x + x \cdot \left(z - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.34999999999999999e147 or -4.29999999999999993e111 < x < -3.4999999999999997e-29 or 1.28000000000000005e-23 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.34999999999999999e147 < x < -4.29999999999999993e111 or -3.4999999999999997e-29 < x < 1.28000000000000005e-23

    1. Initial program 99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+147} \lor \neg \left(x \leq -4.3 \cdot 10^{+111} \lor \neg \left(x \leq -3.5 \cdot 10^{-29}\right) \land x \leq 1.28 \cdot 10^{-23}\right):\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]

Alternative 7: 83.8% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+64} \lor \neg \left(z \leq 0.00075\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.4999999999999998e64 or 7.5000000000000002e-4 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999998e64 < z < 7.5000000000000002e-4

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.5 \cdot 10^{+64} \lor \neg \left(z \leq 0.00075\right):\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]

Alternative 8: 47.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{-28} \lor \neg \left(x \leq 3.5 \cdot 10^{-25}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.5999999999999999e-28 or 3.5000000000000002e-25 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5999999999999999e-28 < x < 3.5000000000000002e-25

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    7. Simplified46.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.6 \cdot 10^{-28} \lor \neg \left(x \leq 3.5 \cdot 10^{-25}\right):\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 9: 36.6% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;y \leq 1.6 \cdot 10^{-80}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.4e-53 or 1.5999999999999999e-80 < y

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    7. Simplified45.4%

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

    if -3.4e-53 < y < 1.5999999999999999e-80

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{-53}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{-80}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 10: 18.1% 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. Taylor expanded in y around inf 59.5%

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

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

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

    \[\leadsto \color{blue}{x} \]
  6. Final simplification13.3%

    \[\leadsto x \]

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

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

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