Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.1s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

Alternative 2: 37.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := -y \cdot x\\ \mathbf{if}\;y \leq -3.6 \cdot 10^{+159}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -9.4 \cdot 10^{+52}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-65}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-283}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+136}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (- (* y x))))
   (if (<= y -3.6e+159)
     t_2
     (if (<= y -9.4e+52)
       (* y t)
       (if (<= y -7e-65)
         t_1
         (if (<= y -1.4e-283) x (if (<= y 1.05e+136) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = -(y * x);
	double tmp;
	if (y <= -3.6e+159) {
		tmp = t_2;
	} else if (y <= -9.4e+52) {
		tmp = y * t;
	} else if (y <= -7e-65) {
		tmp = t_1;
	} else if (y <= -1.4e-283) {
		tmp = x;
	} else if (y <= 1.05e+136) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * -t
    t_2 = -(y * x)
    if (y <= (-3.6d+159)) then
        tmp = t_2
    else if (y <= (-9.4d+52)) then
        tmp = y * t
    else if (y <= (-7d-65)) then
        tmp = t_1
    else if (y <= (-1.4d-283)) then
        tmp = x
    else if (y <= 1.05d+136) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = -(y * x);
	double tmp;
	if (y <= -3.6e+159) {
		tmp = t_2;
	} else if (y <= -9.4e+52) {
		tmp = y * t;
	} else if (y <= -7e-65) {
		tmp = t_1;
	} else if (y <= -1.4e-283) {
		tmp = x;
	} else if (y <= 1.05e+136) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = -(y * x)
	tmp = 0
	if y <= -3.6e+159:
		tmp = t_2
	elif y <= -9.4e+52:
		tmp = y * t
	elif y <= -7e-65:
		tmp = t_1
	elif y <= -1.4e-283:
		tmp = x
	elif y <= 1.05e+136:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(-Float64(y * x))
	tmp = 0.0
	if (y <= -3.6e+159)
		tmp = t_2;
	elseif (y <= -9.4e+52)
		tmp = Float64(y * t);
	elseif (y <= -7e-65)
		tmp = t_1;
	elseif (y <= -1.4e-283)
		tmp = x;
	elseif (y <= 1.05e+136)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = -(y * x);
	tmp = 0.0;
	if (y <= -3.6e+159)
		tmp = t_2;
	elseif (y <= -9.4e+52)
		tmp = y * t;
	elseif (y <= -7e-65)
		tmp = t_1;
	elseif (y <= -1.4e-283)
		tmp = x;
	elseif (y <= 1.05e+136)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = (-N[(y * x), $MachinePrecision])}, If[LessEqual[y, -3.6e+159], t$95$2, If[LessEqual[y, -9.4e+52], N[(y * t), $MachinePrecision], If[LessEqual[y, -7e-65], t$95$1, If[LessEqual[y, -1.4e-283], x, If[LessEqual[y, 1.05e+136], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -9.4 \cdot 10^{+52}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -7 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-283}:\\
\;\;\;\;x\\

\mathbf{elif}\;y \leq 1.05 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -3.60000000000000037e159 or 1.05e136 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -3.60000000000000037e159 < y < -9.3999999999999999e52

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

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

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

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

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

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

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

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

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

    if -9.3999999999999999e52 < y < -7.00000000000000009e-65 or -1.3999999999999999e-283 < y < 1.05e136

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out39.7%

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

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

    if -7.00000000000000009e-65 < y < -1.3999999999999999e-283

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.6 \cdot 10^{+159}:\\ \;\;\;\;-y \cdot x\\ \mathbf{elif}\;y \leq -9.4 \cdot 10^{+52}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-65}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-283}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.05 \cdot 10^{+136}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;-y \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 36.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -9 \cdot 10^{+72}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+55}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+191}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -9e+72)
     (* z x)
     (if (<= z -4.6e-39)
       t_1
       (if (<= z 1.85e-45)
         x
         (if (<= z 2.1e+55) (* y t) (if (<= z 1.16e+191) (* z x) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -9e+72) {
		tmp = z * x;
	} else if (z <= -4.6e-39) {
		tmp = t_1;
	} else if (z <= 1.85e-45) {
		tmp = x;
	} else if (z <= 2.1e+55) {
		tmp = y * t;
	} else if (z <= 1.16e+191) {
		tmp = z * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (z <= (-9d+72)) then
        tmp = z * x
    else if (z <= (-4.6d-39)) then
        tmp = t_1
    else if (z <= 1.85d-45) then
        tmp = x
    else if (z <= 2.1d+55) then
        tmp = y * t
    else if (z <= 1.16d+191) then
        tmp = z * x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -9e+72) {
		tmp = z * x;
	} else if (z <= -4.6e-39) {
		tmp = t_1;
	} else if (z <= 1.85e-45) {
		tmp = x;
	} else if (z <= 2.1e+55) {
		tmp = y * t;
	} else if (z <= 1.16e+191) {
		tmp = z * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -9e+72:
		tmp = z * x
	elif z <= -4.6e-39:
		tmp = t_1
	elif z <= 1.85e-45:
		tmp = x
	elif z <= 2.1e+55:
		tmp = y * t
	elif z <= 1.16e+191:
		tmp = z * x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -9e+72)
		tmp = Float64(z * x);
	elseif (z <= -4.6e-39)
		tmp = t_1;
	elseif (z <= 1.85e-45)
		tmp = x;
	elseif (z <= 2.1e+55)
		tmp = Float64(y * t);
	elseif (z <= 1.16e+191)
		tmp = Float64(z * x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (z <= -9e+72)
		tmp = z * x;
	elseif (z <= -4.6e-39)
		tmp = t_1;
	elseif (z <= 1.85e-45)
		tmp = x;
	elseif (z <= 2.1e+55)
		tmp = y * t;
	elseif (z <= 1.16e+191)
		tmp = z * x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -9e+72], N[(z * x), $MachinePrecision], If[LessEqual[z, -4.6e-39], t$95$1, If[LessEqual[z, 1.85e-45], x, If[LessEqual[z, 2.1e+55], N[(y * t), $MachinePrecision], If[LessEqual[z, 1.16e+191], N[(z * x), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.6 \cdot 10^{-39}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{-45}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+55}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 1.16 \cdot 10^{+191}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.9999999999999997e72 or 2.1000000000000001e55 < z < 1.15999999999999996e191

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

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

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

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

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

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

    if -8.9999999999999997e72 < z < -4.60000000000000016e-39 or 1.15999999999999996e191 < 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 71.4%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-t \cdot z} \]
      2. distribute-rgt-neg-out57.2%

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

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

    if -4.60000000000000016e-39 < z < 1.85e-45

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

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

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

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

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

    if 1.85e-45 < z < 2.1000000000000001e55

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+72}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-39}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-45}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+55}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.16 \cdot 10^{+191}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 84.7% accurate, 0.5× speedup?

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

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

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

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

    if -2.1499999999999999e51 < y < 52000

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

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

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

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

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

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

Alternative 5: 79.4% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.50000000000000012e-97 or 8e12 < 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.3%

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

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

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

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

    if -1.50000000000000012e-97 < x < 8e12

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

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

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

Alternative 6: 75.2% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.4000000000000001e-97 or 5.9e12 < 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.3%

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

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

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

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

    if -1.4000000000000001e-97 < x < 5.9e12

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--77.0%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    10. Simplified77.0%

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

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

Alternative 7: 61.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{-70} \lor \neg \left(x \leq 9 \cdot 10^{+37}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.30000000000000016e-70 or 8.99999999999999923e37 < 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 88.4%

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

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

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

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

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

    if -3.30000000000000016e-70 < x < 8.99999999999999923e37

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--73.6%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    10. Simplified73.6%

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

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

Alternative 8: 62.4% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.7e5 or 6.5e11 < 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 90.5%

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

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

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

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

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

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

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

    if -4.7e5 < x < 6.5e11

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--70.7%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    10. Simplified70.7%

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

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

Alternative 9: 52.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.9 \cdot 10^{+16} \lor \neg \left(x \leq 3.2 \cdot 10^{+63}\right):\\
\;\;\;\;-y \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.9e16 or 3.20000000000000011e63 < 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 91.4%

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

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

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

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

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

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

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

    if -5.9e16 < x < 3.20000000000000011e63

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--67.8%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    10. Simplified67.8%

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

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

Alternative 10: 61.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-70}:\\
\;\;\;\;x - y \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.8000000000000002e-70

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

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

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

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

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

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

      \[\leadsto x + \color{blue}{\left(-x\right)} \cdot y \]
    9. Step-by-step derivation
      1. distribute-lft-neg-out62.3%

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

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

        \[\leadsto x - \color{blue}{y \cdot x} \]
    10. Applied egg-rr62.3%

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

    if -4.8000000000000002e-70 < x < 2.64999999999999989e39

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{t \cdot y - t \cdot z} \]
    9. Step-by-step derivation
      1. distribute-lft-out--73.6%

        \[\leadsto \color{blue}{t \cdot \left(y - z\right)} \]
    10. Simplified73.6%

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

    if 2.64999999999999989e39 < 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 92.4%

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

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

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

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

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

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

Alternative 11: 37.7% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-17} \lor \neg \left(y \leq 6.6 \cdot 10^{-8}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.60000000000000003e-17 or 6.59999999999999954e-8 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    if -2.60000000000000003e-17 < y < 6.59999999999999954e-8

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

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

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

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

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

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

Alternative 12: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 13: 18.1% accurate, 9.0× speedup?

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

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

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

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

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

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

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

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

  :alt
  (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))

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