Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 10 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 70.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot y\\ t_2 := z \cdot \left(x - t\right)\\ t_3 := x + y \cdot t\\ \mathbf{if}\;z \leq -0.84:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-59}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-234}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-106}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 1.06 \cdot 10^{+26}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* x y))) (t_2 (* z (- x t))) (t_3 (+ x (* y t))))
   (if (<= z -0.84)
     t_2
     (if (<= z -3.6e-59)
       t_3
       (if (<= z -1.95e-234)
         t_1
         (if (<= z 6.4e-106) t_3 (if (<= z 1.06e+26) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (x * y);
	double t_2 = z * (x - t);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -0.84) {
		tmp = t_2;
	} else if (z <= -3.6e-59) {
		tmp = t_3;
	} else if (z <= -1.95e-234) {
		tmp = t_1;
	} else if (z <= 6.4e-106) {
		tmp = t_3;
	} else if (z <= 1.06e+26) {
		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) :: t_3
    real(8) :: tmp
    t_1 = x - (x * y)
    t_2 = z * (x - t)
    t_3 = x + (y * t)
    if (z <= (-0.84d0)) then
        tmp = t_2
    else if (z <= (-3.6d-59)) then
        tmp = t_3
    else if (z <= (-1.95d-234)) then
        tmp = t_1
    else if (z <= 6.4d-106) then
        tmp = t_3
    else if (z <= 1.06d+26) 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 = x - (x * y);
	double t_2 = z * (x - t);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -0.84) {
		tmp = t_2;
	} else if (z <= -3.6e-59) {
		tmp = t_3;
	} else if (z <= -1.95e-234) {
		tmp = t_1;
	} else if (z <= 6.4e-106) {
		tmp = t_3;
	} else if (z <= 1.06e+26) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (x * y)
	t_2 = z * (x - t)
	t_3 = x + (y * t)
	tmp = 0
	if z <= -0.84:
		tmp = t_2
	elif z <= -3.6e-59:
		tmp = t_3
	elif z <= -1.95e-234:
		tmp = t_1
	elif z <= 6.4e-106:
		tmp = t_3
	elif z <= 1.06e+26:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(x * y))
	t_2 = Float64(z * Float64(x - t))
	t_3 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (z <= -0.84)
		tmp = t_2;
	elseif (z <= -3.6e-59)
		tmp = t_3;
	elseif (z <= -1.95e-234)
		tmp = t_1;
	elseif (z <= 6.4e-106)
		tmp = t_3;
	elseif (z <= 1.06e+26)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (x * y);
	t_2 = z * (x - t);
	t_3 = x + (y * t);
	tmp = 0.0;
	if (z <= -0.84)
		tmp = t_2;
	elseif (z <= -3.6e-59)
		tmp = t_3;
	elseif (z <= -1.95e-234)
		tmp = t_1;
	elseif (z <= 6.4e-106)
		tmp = t_3;
	elseif (z <= 1.06e+26)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.84], t$95$2, If[LessEqual[z, -3.6e-59], t$95$3, If[LessEqual[z, -1.95e-234], t$95$1, If[LessEqual[z, 6.4e-106], t$95$3, If[LessEqual[z, 1.06e+26], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-59}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq -1.95 \cdot 10^{-234}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-106}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.06 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.839999999999999969 or 1.05999999999999997e26 < 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.6%

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

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

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

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

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

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

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

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

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

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

    if -0.839999999999999969 < z < -3.6e-59 or -1.9500000000000001e-234 < z < 6.4e-106

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

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

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

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

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

        \[\leadsto x + \color{blue}{y \cdot t} \]
    8. Simplified75.8%

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

    if -3.6e-59 < z < -1.9500000000000001e-234 or 6.4e-106 < z < 1.05999999999999997e26

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.84:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-59}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{-234}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-106}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 1.06 \cdot 10^{+26}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 74.3% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-63}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -6.1 \cdot 10^{-235}:\\
\;\;\;\;x - x \cdot y\\

\mathbf{elif}\;z \leq 10^{+103}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.1499999999999999e26 or 1e103 < 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 86.3%

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

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

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

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

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

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

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

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

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

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

    if -2.1499999999999999e26 < z < -1.90000000000000009e-63 or -6.09999999999999988e-235 < z < 1e103

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

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

    if -1.90000000000000009e-63 < z < -6.09999999999999988e-235

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x - y \cdot x} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+26}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-63}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq -6.1 \cdot 10^{-235}:\\ \;\;\;\;x - x \cdot y\\ \mathbf{elif}\;z \leq 10^{+103}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 54.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -2.45 \cdot 10^{-198}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{-160}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+26}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.2000000000000001e-55 or 2.60000000000000002e26 < 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 76.9%

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

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

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

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

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

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

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

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

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

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

    if -3.2000000000000001e-55 < z < -2.4500000000000001e-198 or 2.8999999999999999e-160 < z < 2.60000000000000002e26

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{y \cdot x} \]
      3. distribute-lft-neg-in44.6%

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

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

    if -2.4500000000000001e-198 < z < 2.8999999999999999e-160

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{-55}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -2.45 \cdot 10^{-198}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{-160}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+26}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 36.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -7.5 \cdot 10^{-87}:\\
\;\;\;\;x \cdot z\\

\mathbf{elif}\;y \leq 3 \cdot 10^{-118}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9000000000000002e22 or 1.6e99 < 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 88.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot y} \]
      2. *-commutative49.2%

        \[\leadsto -\color{blue}{y \cdot x} \]
      3. distribute-lft-neg-in49.2%

        \[\leadsto \color{blue}{\left(-y\right) \cdot x} \]
    11. Simplified49.2%

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

    if -1.9000000000000002e22 < y < -7.5000000000000002e-87 or 3.00000000000000018e-118 < y < 1.6e99

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    9. Simplified42.1%

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

    if -7.5000000000000002e-87 < y < 3.00000000000000018e-118

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+22}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \mathbf{elif}\;y \leq -7.5 \cdot 10^{-87}:\\ \;\;\;\;x \cdot z\\ \mathbf{elif}\;y \leq 3 \cdot 10^{-118}:\\ \;\;\;\;x\\ \mathbf{elif}\;y \leq 1.6 \cdot 10^{+99}:\\ \;\;\;\;x \cdot z\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 81.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-28} \lor \neg \left(t \leq 7 \cdot 10^{+14}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.6999999999999999e-28 or 7e14 < t

    1. Initial program 100.0%

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

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

    if -2.6999999999999999e-28 < t < 7e14

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 83.3% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.49999999999999953e-4 or 4.50000000000000001e103 < 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 86.1%

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

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

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

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

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

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

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

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

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

    if -8.49999999999999953e-4 < z < 4.50000000000000001e103

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

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

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

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

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

Alternative 8: 70.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.55 \lor \neg \left(z \leq 1.35 \cdot 10^{+103}\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.55) (not (<= z 1.35e+103))) (* z (- x t)) (+ x (* y t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -1.55) || !(z <= 1.35e+103)) {
		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.55d0)) .or. (.not. (z <= 1.35d+103))) 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.55) || !(z <= 1.35e+103)) {
		tmp = z * (x - t);
	} else {
		tmp = x + (y * t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -1.55) or not (z <= 1.35e+103):
		tmp = z * (x - t)
	else:
		tmp = x + (y * t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -1.55) || !(z <= 1.35e+103))
		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.55) || ~((z <= 1.35e+103)))
		tmp = z * (x - t);
	else
		tmp = x + (y * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55], N[Not[LessEqual[z, 1.35e+103]], $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.55 \lor \neg \left(z \leq 1.35 \cdot 10^{+103}\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.55000000000000004 or 1.34999999999999996e103 < 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.3%

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

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

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

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

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

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

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

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

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

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

    if -1.55000000000000004 < z < 1.34999999999999996e103

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

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

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

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

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

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

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

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

Alternative 9: 37.2% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    9. Simplified40.6%

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

    if -190 < z < 1

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 17.4% accurate, 9.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  7. Final simplification17.7%

    \[\leadsto x \]
  8. Add Preprocessing

Developer target: 96.2% accurate, 0.6× speedup?

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

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

Reproduce

?
herbie shell --seed 2024071 
(FPCore (x y z t)
  :name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
  :precision binary64

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

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