Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

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

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

Alternative 2: 48.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := x + y \cdot t\\ \mathbf{if}\;x \leq -2.3 \cdot 10^{+233}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -7.3 \cdot 10^{-292}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-292}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+57}:\\ \;\;\;\;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 (* y t))))
   (if (<= x -2.3e+233)
     t_1
     (if (<= x -2.6e+106)
       (+ x (* z x))
       (if (<= x -3.2e-169)
         t_1
         (if (<= x -7.3e-292)
           t_2
           (if (<= x 3.4e-292) (- x (* z t)) (if (<= x 3.8e+57) 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 + (y * t);
	double tmp;
	if (x <= -2.3e+233) {
		tmp = t_1;
	} else if (x <= -2.6e+106) {
		tmp = x + (z * x);
	} else if (x <= -3.2e-169) {
		tmp = t_1;
	} else if (x <= -7.3e-292) {
		tmp = t_2;
	} else if (x <= 3.4e-292) {
		tmp = x - (z * t);
	} else if (x <= 3.8e+57) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    t_2 = x + (y * t)
    if (x <= (-2.3d+233)) then
        tmp = t_1
    else if (x <= (-2.6d+106)) then
        tmp = x + (z * x)
    else if (x <= (-3.2d-169)) then
        tmp = t_1
    else if (x <= (-7.3d-292)) then
        tmp = t_2
    else if (x <= 3.4d-292) then
        tmp = x - (z * t)
    else if (x <= 3.8d+57) 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 + (y * t);
	double tmp;
	if (x <= -2.3e+233) {
		tmp = t_1;
	} else if (x <= -2.6e+106) {
		tmp = x + (z * x);
	} else if (x <= -3.2e-169) {
		tmp = t_1;
	} else if (x <= -7.3e-292) {
		tmp = t_2;
	} else if (x <= 3.4e-292) {
		tmp = x - (z * t);
	} else if (x <= 3.8e+57) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = x + (y * t)
	tmp = 0
	if x <= -2.3e+233:
		tmp = t_1
	elif x <= -2.6e+106:
		tmp = x + (z * x)
	elif x <= -3.2e-169:
		tmp = t_1
	elif x <= -7.3e-292:
		tmp = t_2
	elif x <= 3.4e-292:
		tmp = x - (z * t)
	elif x <= 3.8e+57:
		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(y * t))
	tmp = 0.0
	if (x <= -2.3e+233)
		tmp = t_1;
	elseif (x <= -2.6e+106)
		tmp = Float64(x + Float64(z * x));
	elseif (x <= -3.2e-169)
		tmp = t_1;
	elseif (x <= -7.3e-292)
		tmp = t_2;
	elseif (x <= 3.4e-292)
		tmp = Float64(x - Float64(z * t));
	elseif (x <= 3.8e+57)
		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 + (y * t);
	tmp = 0.0;
	if (x <= -2.3e+233)
		tmp = t_1;
	elseif (x <= -2.6e+106)
		tmp = x + (z * x);
	elseif (x <= -3.2e-169)
		tmp = t_1;
	elseif (x <= -7.3e-292)
		tmp = t_2;
	elseif (x <= 3.4e-292)
		tmp = x - (z * t);
	elseif (x <= 3.8e+57)
		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[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+233], t$95$1, If[LessEqual[x, -2.6e+106], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.2e-169], t$95$1, If[LessEqual[x, -7.3e-292], t$95$2, If[LessEqual[x, 3.4e-292], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+57], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.6 \cdot 10^{+106}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;x \leq -3.2 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -7.3 \cdot 10^{-292}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 3.4 \cdot 10^{-292}:\\
\;\;\;\;x - z \cdot t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.30000000000000001e233 or -2.6000000000000002e106 < x < -3.19999999999999995e-169 or 3.7999999999999999e57 < x

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.30000000000000001e233 < x < -2.6000000000000002e106

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x + 1 \cdot x} \]
      2. *-un-lft-identity77.9%

        \[\leadsto z \cdot x + \color{blue}{x} \]
    10. Applied egg-rr77.9%

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

    if -3.19999999999999995e-169 < x < -7.2999999999999997e-292 or 3.40000000000000017e-292 < x < 3.7999999999999999e57

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

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

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

    if -7.2999999999999997e-292 < x < 3.40000000000000017e-292

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+233}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{+106}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-169}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -7.3 \cdot 10^{-292}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;x \leq 3.4 \cdot 10^{-292}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+57}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.8% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{+236}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{+104}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-169} \lor \neg \left(x \leq 4.5 \cdot 10^{+57}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))))
   (if (<= x -2.5e+236)
     t_1
     (if (<= x -7.5e+104)
       (+ x (* z x))
       (if (or (<= x -2e-169) (not (<= x 4.5e+57))) t_1 (+ x (* y t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double tmp;
	if (x <= -2.5e+236) {
		tmp = t_1;
	} else if (x <= -7.5e+104) {
		tmp = x + (z * x);
	} else if ((x <= -2e-169) || !(x <= 4.5e+57)) {
		tmp = t_1;
	} else {
		tmp = x + (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) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    if (x <= (-2.5d+236)) then
        tmp = t_1
    else if (x <= (-7.5d+104)) then
        tmp = x + (z * x)
    else if ((x <= (-2d-169)) .or. (.not. (x <= 4.5d+57))) then
        tmp = t_1
    else
        tmp = x + (y * t)
    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 (x <= -2.5e+236) {
		tmp = t_1;
	} else if (x <= -7.5e+104) {
		tmp = x + (z * x);
	} else if ((x <= -2e-169) || !(x <= 4.5e+57)) {
		tmp = t_1;
	} else {
		tmp = x + (y * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	tmp = 0
	if x <= -2.5e+236:
		tmp = t_1
	elif x <= -7.5e+104:
		tmp = x + (z * x)
	elif (x <= -2e-169) or not (x <= 4.5e+57):
		tmp = t_1
	else:
		tmp = x + (y * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (x <= -2.5e+236)
		tmp = t_1;
	elseif (x <= -7.5e+104)
		tmp = Float64(x + Float64(z * x));
	elseif ((x <= -2e-169) || !(x <= 4.5e+57))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	tmp = 0.0;
	if (x <= -2.5e+236)
		tmp = t_1;
	elseif (x <= -7.5e+104)
		tmp = x + (z * x);
	elseif ((x <= -2e-169) || ~((x <= 4.5e+57)))
		tmp = t_1;
	else
		tmp = x + (y * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e+236], t$95$1, If[LessEqual[x, -7.5e+104], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -2e-169], N[Not[LessEqual[x, 4.5e+57]], $MachinePrecision]], t$95$1, N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -7.5 \cdot 10^{+104}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;x \leq -2 \cdot 10^{-169} \lor \neg \left(x \leq 4.5 \cdot 10^{+57}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.49999999999999985e236 or -7.5000000000000002e104 < x < -2.00000000000000004e-169 or 4.49999999999999996e57 < x

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.49999999999999985e236 < x < -7.5000000000000002e104

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x + 1 \cdot x} \]
      2. *-un-lft-identity77.9%

        \[\leadsto z \cdot x + \color{blue}{x} \]
    10. Applied egg-rr77.9%

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

    if -2.00000000000000004e-169 < x < 4.49999999999999996e57

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{+236}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -7.5 \cdot 10^{+104}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-169} \lor \neg \left(x \leq 4.5 \cdot 10^{+57}\right):\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 48.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;x \leq -2.2 \cdot 10^{+236}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{+104}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-172} \lor \neg \left(x \leq 7.5 \cdot 10^{+57}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))))
   (if (<= x -2.2e+236)
     t_1
     (if (<= x -4.2e+104)
       (* x (+ z 1.0))
       (if (or (<= x -1.65e-172) (not (<= x 7.5e+57))) t_1 (+ x (* y t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double tmp;
	if (x <= -2.2e+236) {
		tmp = t_1;
	} else if (x <= -4.2e+104) {
		tmp = x * (z + 1.0);
	} else if ((x <= -1.65e-172) || !(x <= 7.5e+57)) {
		tmp = t_1;
	} else {
		tmp = x + (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) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    if (x <= (-2.2d+236)) then
        tmp = t_1
    else if (x <= (-4.2d+104)) then
        tmp = x * (z + 1.0d0)
    else if ((x <= (-1.65d-172)) .or. (.not. (x <= 7.5d+57))) then
        tmp = t_1
    else
        tmp = x + (y * t)
    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 (x <= -2.2e+236) {
		tmp = t_1;
	} else if (x <= -4.2e+104) {
		tmp = x * (z + 1.0);
	} else if ((x <= -1.65e-172) || !(x <= 7.5e+57)) {
		tmp = t_1;
	} else {
		tmp = x + (y * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	tmp = 0
	if x <= -2.2e+236:
		tmp = t_1
	elif x <= -4.2e+104:
		tmp = x * (z + 1.0)
	elif (x <= -1.65e-172) or not (x <= 7.5e+57):
		tmp = t_1
	else:
		tmp = x + (y * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (x <= -2.2e+236)
		tmp = t_1;
	elseif (x <= -4.2e+104)
		tmp = Float64(x * Float64(z + 1.0));
	elseif ((x <= -1.65e-172) || !(x <= 7.5e+57))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	tmp = 0.0;
	if (x <= -2.2e+236)
		tmp = t_1;
	elseif (x <= -4.2e+104)
		tmp = x * (z + 1.0);
	elseif ((x <= -1.65e-172) || ~((x <= 7.5e+57)))
		tmp = t_1;
	else
		tmp = x + (y * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+236], t$95$1, If[LessEqual[x, -4.2e+104], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.65e-172], N[Not[LessEqual[x, 7.5e+57]], $MachinePrecision]], t$95$1, N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -1.65 \cdot 10^{-172} \lor \neg \left(x \leq 7.5 \cdot 10^{+57}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.19999999999999978e236 or -4.1999999999999997e104 < x < -1.65e-172 or 7.5000000000000006e57 < x

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.19999999999999978e236 < x < -4.1999999999999997e104

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -1.65e-172 < x < 7.5000000000000006e57

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.2 \cdot 10^{+236}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -4.2 \cdot 10^{+104}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -1.65 \cdot 10^{-172} \lor \neg \left(x \leq 7.5 \cdot 10^{+57}\right):\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 46.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;x \leq -4.2 \cdot 10^{+233}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{+106}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-169} \lor \neg \left(x \leq 1.6 \cdot 10^{-63}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))))
   (if (<= x -4.2e+233)
     t_1
     (if (<= x -2.5e+106)
       (* x (+ z 1.0))
       (if (or (<= x -3.2e-169) (not (<= x 1.6e-63))) t_1 (* y t))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double tmp;
	if (x <= -4.2e+233) {
		tmp = t_1;
	} else if (x <= -2.5e+106) {
		tmp = x * (z + 1.0);
	} else if ((x <= -3.2e-169) || !(x <= 1.6e-63)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    if (x <= (-4.2d+233)) then
        tmp = t_1
    else if (x <= (-2.5d+106)) then
        tmp = x * (z + 1.0d0)
    else if ((x <= (-3.2d-169)) .or. (.not. (x <= 1.6d-63))) then
        tmp = t_1
    else
        tmp = y * t
    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 (x <= -4.2e+233) {
		tmp = t_1;
	} else if (x <= -2.5e+106) {
		tmp = x * (z + 1.0);
	} else if ((x <= -3.2e-169) || !(x <= 1.6e-63)) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	tmp = 0
	if x <= -4.2e+233:
		tmp = t_1
	elif x <= -2.5e+106:
		tmp = x * (z + 1.0)
	elif (x <= -3.2e-169) or not (x <= 1.6e-63):
		tmp = t_1
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (x <= -4.2e+233)
		tmp = t_1;
	elseif (x <= -2.5e+106)
		tmp = Float64(x * Float64(z + 1.0));
	elseif ((x <= -3.2e-169) || !(x <= 1.6e-63))
		tmp = t_1;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	tmp = 0.0;
	if (x <= -4.2e+233)
		tmp = t_1;
	elseif (x <= -2.5e+106)
		tmp = x * (z + 1.0);
	elseif ((x <= -3.2e-169) || ~((x <= 1.6e-63)))
		tmp = t_1;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.2e+233], t$95$1, If[LessEqual[x, -2.5e+106], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -3.2e-169], N[Not[LessEqual[x, 1.6e-63]], $MachinePrecision]], t$95$1, N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \leq -3.2 \cdot 10^{-169} \lor \neg \left(x \leq 1.6 \cdot 10^{-63}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.19999999999999993e233 or -2.4999999999999999e106 < x < -3.19999999999999995e-169 or 1.59999999999999994e-63 < x

    1. Initial program 99.9%

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

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

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

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

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

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

    if -4.19999999999999993e233 < x < -2.4999999999999999e106

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -3.19999999999999995e-169 < x < 1.59999999999999994e-63

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.2 \cdot 10^{+233}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{+106}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -3.2 \cdot 10^{-169} \lor \neg \left(x \leq 1.6 \cdot 10^{-63}\right):\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 33.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(-x\right)\\ \mathbf{if}\;x \leq -1.3 \cdot 10^{+236}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+93}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-169} \lor \neg \left(x \leq 2.3 \cdot 10^{+50}\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- x))))
   (if (<= x -1.3e+236)
     t_1
     (if (<= x -1.15e+93)
       (* z x)
       (if (or (<= x -4.8e-169) (not (<= x 2.3e+50))) t_1 (* y t))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * -x;
	double tmp;
	if (x <= -1.3e+236) {
		tmp = t_1;
	} else if (x <= -1.15e+93) {
		tmp = z * x;
	} else if ((x <= -4.8e-169) || !(x <= 2.3e+50)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = y * -x
    if (x <= (-1.3d+236)) then
        tmp = t_1
    else if (x <= (-1.15d+93)) then
        tmp = z * x
    else if ((x <= (-4.8d-169)) .or. (.not. (x <= 2.3d+50))) then
        tmp = t_1
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * -x;
	double tmp;
	if (x <= -1.3e+236) {
		tmp = t_1;
	} else if (x <= -1.15e+93) {
		tmp = z * x;
	} else if ((x <= -4.8e-169) || !(x <= 2.3e+50)) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * -x
	tmp = 0
	if x <= -1.3e+236:
		tmp = t_1
	elif x <= -1.15e+93:
		tmp = z * x
	elif (x <= -4.8e-169) or not (x <= 2.3e+50):
		tmp = t_1
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(-x))
	tmp = 0.0
	if (x <= -1.3e+236)
		tmp = t_1;
	elseif (x <= -1.15e+93)
		tmp = Float64(z * x);
	elseif ((x <= -4.8e-169) || !(x <= 2.3e+50))
		tmp = t_1;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * -x;
	tmp = 0.0;
	if (x <= -1.3e+236)
		tmp = t_1;
	elseif (x <= -1.15e+93)
		tmp = z * x;
	elseif ((x <= -4.8e-169) || ~((x <= 2.3e+50)))
		tmp = t_1;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, If[LessEqual[x, -1.3e+236], t$95$1, If[LessEqual[x, -1.15e+93], N[(z * x), $MachinePrecision], If[Or[LessEqual[x, -4.8e-169], N[Not[LessEqual[x, 2.3e+50]], $MachinePrecision]], t$95$1, N[(y * t), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.15 \cdot 10^{+93}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;x \leq -4.8 \cdot 10^{-169} \lor \neg \left(x \leq 2.3 \cdot 10^{+50}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -1.3e236 or -1.1500000000000001e93 < x < -4.80000000000000021e-169 or 2.29999999999999997e50 < x

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -1.3e236 < x < -1.1500000000000001e93

    1. Initial program 99.9%

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

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

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

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

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

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

    if -4.80000000000000021e-169 < x < 2.29999999999999997e50

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.3 \cdot 10^{+236}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;x \leq -1.15 \cdot 10^{+93}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;x \leq -4.8 \cdot 10^{-169} \lor \neg \left(x \leq 2.3 \cdot 10^{+50}\right):\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 36.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+64}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -5.6 \cdot 10^{-167}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+122}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.80000000000000024e64 or 1.49999999999999993e122 < z

    1. Initial program 99.9%

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

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

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

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

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

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

    if -2.80000000000000024e64 < z < -5.59999999999999971e-167 or 1.25000000000000001e-151 < z < 1.49999999999999993e122

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -5.59999999999999971e-167 < z < 1.25000000000000001e-151

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+64}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-167}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-151}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+122}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 85.3% accurate, 0.5× speedup?

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

    1. Initial program 99.9%

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

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

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

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

    if -9.0999999999999997e-7 < y < 1.80000000000000011e-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.5%

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

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

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

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

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

Alternative 9: 79.5% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-87} \lor \neg \left(x \leq 3.6 \cdot 10^{-59}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.8e-87 or 3.6e-59 < x

    1. Initial program 99.9%

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

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

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

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

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

    if -3.8e-87 < x < 3.6e-59

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

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

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

Alternative 10: 64.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-169} \lor \neg \left(x \leq 4.4 \cdot 10^{-65}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.7000000000000002e-169 or 4.40000000000000042e-65 < x

    1. Initial program 99.9%

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

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

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

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

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

    if -2.7000000000000002e-169 < x < 4.40000000000000042e-65

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

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

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

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

Alternative 11: 50.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+18} \lor \neg \left(y \leq 185\right):\\
\;\;\;\;y \cdot \left(-x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.6e18 or 185 < y

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

    if -4.6e18 < y < 185

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

Alternative 12: 37.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -0.00279999999999999997 or 6.20000000000000027e-5 < z

    1. Initial program 99.9%

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

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

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

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

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

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

    if -0.00279999999999999997 < z < 6.20000000000000027e-5

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

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

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

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

Alternative 13: 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 99.9%

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

Alternative 14: 18.0% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Add Preprocessing

Developer target: 96.4% 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 2024094 
(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))))