Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 20.5s
Alternatives: 10
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 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: 84.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-7} \lor \neg \left(z \leq 2.4 \cdot 10^{-8}\right):\\
\;\;\;\;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 < -1.4499999999999999e-7 or 2.39999999999999998e-8 < 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 83.5%

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

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

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

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

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

    if -1.4499999999999999e-7 < z < 2.39999999999999998e-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 94.5%

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

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

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

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

Alternative 3: 84.2% accurate, 0.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.85000000000000002e-7

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

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

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

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

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

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

    if -1.85000000000000002e-7 < z < 1.6999999999999999e-9

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

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

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

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

    if 1.6999999999999999e-9 < 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 85.5%

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

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

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

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

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

Alternative 4: 71.6% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{-7} \lor \neg \left(z \leq 1.3 \cdot 10^{-8}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.74999999999999992e-7 or 1.3000000000000001e-8 < 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 83.5%

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

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

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

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

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

    if -1.74999999999999992e-7 < z < 1.3000000000000001e-8

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

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

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

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

Alternative 5: 66.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.6 \cdot 10^{-8} \lor \neg \left(z \leq 2.75 \cdot 10^{-65}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.60000000000000056e-8 or 2.7499999999999999e-65 < 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 81.6%

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

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

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

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

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

    if -7.60000000000000056e-8 < z < 2.7499999999999999e-65

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 48.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-19}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-65}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.25e-19)
   (* z x)
   (if (<= z 2.75e-65) (* x (- 1.0 y)) (* z (- t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.25e-19) {
		tmp = z * x;
	} else if (z <= 2.75e-65) {
		tmp = x * (1.0 - y);
	} else {
		tmp = 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 (z <= (-1.25d-19)) then
        tmp = z * x
    else if (z <= 2.75d-65) then
        tmp = x * (1.0d0 - y)
    else
        tmp = z * -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.25e-19) {
		tmp = z * x;
	} else if (z <= 2.75e-65) {
		tmp = x * (1.0 - y);
	} else {
		tmp = z * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.25e-19:
		tmp = z * x
	elif z <= 2.75e-65:
		tmp = x * (1.0 - y)
	else:
		tmp = z * -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.25e-19)
		tmp = Float64(z * x);
	elseif (z <= 2.75e-65)
		tmp = Float64(x * Float64(1.0 - y));
	else
		tmp = Float64(z * Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.25e-19)
		tmp = z * x;
	elseif (z <= 2.75e-65)
		tmp = x * (1.0 - y);
	else
		tmp = z * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e-19], N[(z * x), $MachinePrecision], If[LessEqual[z, 2.75e-65], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], N[(z * (-t)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-19}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-65}:\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2500000000000001e-19

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    9. Simplified43.4%

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

    if -1.2500000000000001e-19 < z < 2.7499999999999999e-65

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7499999999999999e-65 < 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 82.2%

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

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

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

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

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

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

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

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

Alternative 7: 36.6% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{-19}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-91}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.25e-19) (* z x) (if (<= z 1.45e-91) x (* z (- t)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.25e-19) {
		tmp = z * x;
	} else if (z <= 1.45e-91) {
		tmp = x;
	} else {
		tmp = 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 (z <= (-1.25d-19)) then
        tmp = z * x
    else if (z <= 1.45d-91) then
        tmp = x
    else
        tmp = z * -t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.25e-19) {
		tmp = z * x;
	} else if (z <= 1.45e-91) {
		tmp = x;
	} else {
		tmp = z * -t;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.25e-19:
		tmp = z * x
	elif z <= 1.45e-91:
		tmp = x
	else:
		tmp = z * -t
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.25e-19)
		tmp = Float64(z * x);
	elseif (z <= 1.45e-91)
		tmp = x;
	else
		tmp = Float64(z * Float64(-t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (z <= -1.25e-19)
		tmp = z * x;
	elseif (z <= 1.45e-91)
		tmp = x;
	else
		tmp = z * -t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.25e-19], N[(z * x), $MachinePrecision], If[LessEqual[z, 1.45e-91], x, N[(z * (-t)), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{-19}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-91}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2500000000000001e-19

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    9. Simplified43.4%

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

    if -1.2500000000000001e-19 < z < 1.45e-91

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

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

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

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

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

    if 1.45e-91 < 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 79.3%

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

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

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

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

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

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

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

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

Alternative 8: 36.4% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.2500000000000001e-19 or 2.1000000000000001e-16 < 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 82.3%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    9. Simplified36.2%

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

    if -1.2500000000000001e-19 < z < 2.1000000000000001e-16

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

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

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

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

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

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

Alternative 9: 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 10: 17.7% accurate, 9.0× speedup?

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

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

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

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

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

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

    \[\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 2024143 
(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))))