Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.6s
Alternatives: 11
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 11 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(t - x\right) \cdot \left(y - z\right) \end{array} \]
(FPCore (x y z t) :precision binary64 (+ x (* (- t x) (- y z))))
double code(double x, double y, double z, double t) {
	return x + ((t - x) * (y - z));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x + ((t - x) * (y - z))
end function
public static double code(double x, double y, double z, double t) {
	return x + ((t - x) * (y - z));
}
def code(x, y, z, t):
	return x + ((t - x) * (y - z))
function code(x, y, z, t)
	return Float64(x + Float64(Float64(t - x) * Float64(y - z)))
end
function tmp = code(x, y, z, t)
	tmp = x + ((t - x) * (y - z));
end
code[x_, y_, z_, t_] := N[(x + N[(N[(t - x), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

Alternative 2: 54.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -2300000:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{+146} \lor \neg \left(z \leq 6.6 \cdot 10^{+180}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.80000000000000018e273 or 2.3e146 < z < 6.59999999999999978e180

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot x} \]
    8. Simplified88.6%

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified88.6%

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

    if -2.80000000000000018e273 < z < -2.3e6 or 4.7e5 < z < 2.3e146 or 6.59999999999999978e180 < z

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative52.2%

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

      \[\leadsto \color{blue}{x - z \cdot t} \]
    7. Taylor expanded in x around 0 51.7%

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

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

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

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

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

    if -2.3e6 < z < 4.7e5

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.8 \cdot 10^{+273}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -2300000:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq 470000:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+146} \lor \neg \left(z \leq 6.6 \cdot 10^{+180}\right):\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.9% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -6.5 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 92:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+150} \lor \neg \left(z \leq 1.05 \cdot 10^{+179}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.8000000000000003e273 or 3.59999999999999986e150 < z < 1.0499999999999999e179

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x + \color{blue}{z \cdot x} \]
    8. Simplified88.6%

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified88.6%

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

    if -4.8000000000000003e273 < z < -6.49999999999999991e-15 or 92 < z < 3.59999999999999986e150 or 1.0499999999999999e179 < z

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative51.3%

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

      \[\leadsto \color{blue}{x - z \cdot t} \]
    7. Taylor expanded in x around 0 50.2%

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

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

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

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

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

    if -6.49999999999999991e-15 < z < 92

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.8 \cdot 10^{+273}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-15}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq 92:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+150} \lor \neg \left(z \leq 1.05 \cdot 10^{+179}\right):\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 65.2% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := x - z \cdot t\\
t_2 := x + y \cdot t\\
\mathbf{if}\;t \leq -1 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t \leq -1.7 \cdot 10^{+113}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 4.25 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.0000000000000001e209 or 4.24999999999999992e99 < t

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative65.4%

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

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

    if -1.0000000000000001e209 < t < -1.70000000000000009e113 or 8.5000000000000003e42 < t < 4.24999999999999992e99

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

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

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

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

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

    if -1.70000000000000009e113 < t < 8.5000000000000003e42

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

Alternative 5: 53.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -5.5 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6 \cdot 10^{-124}:\\
\;\;\;\;x - x \cdot y\\

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified88.7%

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

    if -1.0000000000000001e272 < z < -5.50000000000000053e92 or 18000 < z

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative51.8%

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

      \[\leadsto \color{blue}{x - z \cdot t} \]
    7. Taylor expanded in x around 0 51.3%

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

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

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

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

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

    if -5.50000000000000053e92 < z < -6e-124

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot y} \]
      3. *-commutative60.7%

        \[\leadsto x - \color{blue}{y \cdot x} \]
    8. Simplified60.7%

      \[\leadsto \color{blue}{x - y \cdot x} \]

    if -6e-124 < z < 18000

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+272}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;z \leq -5.5 \cdot 10^{+92}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-124}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;z \leq 18000:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 54.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot y\\ \mathbf{if}\;y \leq -1.95 \cdot 10^{+16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+30}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+209}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* x y))))
   (if (<= y -1.95e+16)
     t_1
     (if (<= y 7.8e+30)
       (- x (* z t))
       (if (<= y 9.5e+209) t_1 (+ x (* y t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (x * y);
	double tmp;
	if (y <= -1.95e+16) {
		tmp = t_1;
	} else if (y <= 7.8e+30) {
		tmp = x - (z * t);
	} else if (y <= 9.5e+209) {
		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 - (x * y)
    if (y <= (-1.95d+16)) then
        tmp = t_1
    else if (y <= 7.8d+30) then
        tmp = x - (z * t)
    else if (y <= 9.5d+209) 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 - (x * y);
	double tmp;
	if (y <= -1.95e+16) {
		tmp = t_1;
	} else if (y <= 7.8e+30) {
		tmp = x - (z * t);
	} else if (y <= 9.5e+209) {
		tmp = t_1;
	} else {
		tmp = x + (y * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (x * y)
	tmp = 0
	if y <= -1.95e+16:
		tmp = t_1
	elif y <= 7.8e+30:
		tmp = x - (z * t)
	elif y <= 9.5e+209:
		tmp = t_1
	else:
		tmp = x + (y * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(x * y))
	tmp = 0.0
	if (y <= -1.95e+16)
		tmp = t_1;
	elseif (y <= 7.8e+30)
		tmp = Float64(x - Float64(z * t));
	elseif (y <= 9.5e+209)
		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 - (x * y);
	tmp = 0.0;
	if (y <= -1.95e+16)
		tmp = t_1;
	elseif (y <= 7.8e+30)
		tmp = x - (z * t);
	elseif (y <= 9.5e+209)
		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[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.95e+16], t$95$1, If[LessEqual[y, 7.8e+30], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9.5e+209], t$95$1, N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - x \cdot y\\
\mathbf{if}\;y \leq -1.95 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.95e16 or 7.80000000000000021e30 < y < 9.50000000000000069e209

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x - x \cdot y} \]
      3. *-commutative47.6%

        \[\leadsto x - \color{blue}{y \cdot x} \]
    8. Simplified47.6%

      \[\leadsto \color{blue}{x - y \cdot x} \]

    if -1.95e16 < y < 7.80000000000000021e30

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative67.0%

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

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

    if 9.50000000000000069e209 < y

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+16}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;y \leq 7.8 \cdot 10^{+30}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+209}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 84.3% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6300000 \lor \neg \left(z \leq 0.024\right):\\
\;\;\;\;x + z \cdot \left(x - t\right)\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

    if -6.3e6 < z < 0.024

    1. Initial program 100.0%

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

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

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

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

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

Alternative 8: 81.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -9.00000000000000009e-32 or 3.0999999999999998e40 < t

    1. Initial program 100.0%

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

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

    if -9.00000000000000009e-32 < t < 3.0999999999999998e40

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 73.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -860000000000 \lor \neg \left(y \leq 0.0026\right):\\
\;\;\;\;x - y \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -8.6e11 or 0.0025999999999999999 < y

    1. Initial program 100.0%

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

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

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

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

    if -8.6e11 < y < 0.0025999999999999999

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

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

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

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

        \[\leadsto \color{blue}{x - t \cdot z} \]
      3. *-commutative68.5%

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

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

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

Alternative 10: 37.4% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified39.7%

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

    if -1.15e16 < z < 1

    1. Initial program 100.0%

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

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

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

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

Alternative 11: 18.4% accurate, 9.0× speedup?

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

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

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

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

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

Developer target: 96.3% accurate, 0.6× speedup?

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

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

Reproduce

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