Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

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

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 2: 52.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := x + x \cdot z\\ t_3 := x + y \cdot t\\ \mathbf{if}\;z \leq -2 \cdot 10^{+14}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-226}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-244}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-35}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 80000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+205} \lor \neg \left(z \leq 8.6 \cdot 10^{+231}\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* x z))) (t_3 (+ x (* y t))))
   (if (<= z -2e+14)
     t_2
     (if (<= z -1.1e-226)
       t_3
       (if (<= z 9e-244)
         t_1
         (if (<= z 3.2e-35)
           t_3
           (if (<= z 80000.0)
             t_1
             (if (or (<= z 9.5e+205) (not (<= z 8.6e+231)))
               (* z (- t))
               t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (x * z);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -2e+14) {
		tmp = t_2;
	} else if (z <= -1.1e-226) {
		tmp = t_3;
	} else if (z <= 9e-244) {
		tmp = t_1;
	} else if (z <= 3.2e-35) {
		tmp = t_3;
	} else if (z <= 80000.0) {
		tmp = t_1;
	} else if ((z <= 9.5e+205) || !(z <= 8.6e+231)) {
		tmp = z * -t;
	} 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 * (1.0d0 - y)
    t_2 = x + (x * z)
    t_3 = x + (y * t)
    if (z <= (-2d+14)) then
        tmp = t_2
    else if (z <= (-1.1d-226)) then
        tmp = t_3
    else if (z <= 9d-244) then
        tmp = t_1
    else if (z <= 3.2d-35) then
        tmp = t_3
    else if (z <= 80000.0d0) then
        tmp = t_1
    else if ((z <= 9.5d+205) .or. (.not. (z <= 8.6d+231))) then
        tmp = z * -t
    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 * (1.0 - y);
	double t_2 = x + (x * z);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -2e+14) {
		tmp = t_2;
	} else if (z <= -1.1e-226) {
		tmp = t_3;
	} else if (z <= 9e-244) {
		tmp = t_1;
	} else if (z <= 3.2e-35) {
		tmp = t_3;
	} else if (z <= 80000.0) {
		tmp = t_1;
	} else if ((z <= 9.5e+205) || !(z <= 8.6e+231)) {
		tmp = z * -t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = x + (x * z)
	t_3 = x + (y * t)
	tmp = 0
	if z <= -2e+14:
		tmp = t_2
	elif z <= -1.1e-226:
		tmp = t_3
	elif z <= 9e-244:
		tmp = t_1
	elif z <= 3.2e-35:
		tmp = t_3
	elif z <= 80000.0:
		tmp = t_1
	elif (z <= 9.5e+205) or not (z <= 8.6e+231):
		tmp = z * -t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	t_2 = Float64(x + Float64(x * z))
	t_3 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (z <= -2e+14)
		tmp = t_2;
	elseif (z <= -1.1e-226)
		tmp = t_3;
	elseif (z <= 9e-244)
		tmp = t_1;
	elseif (z <= 3.2e-35)
		tmp = t_3;
	elseif (z <= 80000.0)
		tmp = t_1;
	elseif ((z <= 9.5e+205) || !(z <= 8.6e+231))
		tmp = Float64(z * Float64(-t));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	t_2 = x + (x * z);
	t_3 = x + (y * t);
	tmp = 0.0;
	if (z <= -2e+14)
		tmp = t_2;
	elseif (z <= -1.1e-226)
		tmp = t_3;
	elseif (z <= 9e-244)
		tmp = t_1;
	elseif (z <= 3.2e-35)
		tmp = t_3;
	elseif (z <= 80000.0)
		tmp = t_1;
	elseif ((z <= 9.5e+205) || ~((z <= 8.6e+231)))
		tmp = z * -t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+14], t$95$2, If[LessEqual[z, -1.1e-226], t$95$3, If[LessEqual[z, 9e-244], t$95$1, If[LessEqual[z, 3.2e-35], t$95$3, If[LessEqual[z, 80000.0], t$95$1, If[Or[LessEqual[z, 9.5e+205], N[Not[LessEqual[z, 8.6e+231]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-226}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{-35}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 80000:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+205} \lor \neg \left(z \leq 8.6 \cdot 10^{+231}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2e14 or 9.4999999999999997e205 < z < 8.59999999999999952e231

    1. Initial program 99.9%

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

      \[\leadsto x + \color{blue}{-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. distribute-rgt-neg-in85.5%

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

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

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

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

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

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

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

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

    if -2e14 < z < -1.1e-226 or 9.0000000000000003e-244 < z < 3.1999999999999998e-35

    1. Initial program 100.0%

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

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

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

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

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

    if -1.1e-226 < z < 9.0000000000000003e-244 or 3.1999999999999998e-35 < z < 8e4

    1. Initial program 100.0%

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

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

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in100.0%

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    5. Taylor expanded in t around inf 100.0%

      \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-1 \cdot \left(t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-t \cdot z}\right) \]
      2. distribute-lft-neg-out100.0%

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

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

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

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

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

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

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

    if 8e4 < z < 9.4999999999999997e205 or 8.59999999999999952e231 < 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 x + \color{blue}{-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. distribute-rgt-neg-in83.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg81.5%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval81.5%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative81.5%

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

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg81.5%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified81.5%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in t around inf 56.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+14}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-226}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 9 \cdot 10^{-244}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-35}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 80000:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+205} \lor \neg \left(z \leq 8.6 \cdot 10^{+231}\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 73.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := z \cdot \left(x - t\right)\\ t_3 := x + t \cdot \left(y - z\right)\\ \mathbf{if}\;z \leq -1.12 \cdot 10^{+58}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-243}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-33}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-12}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+92}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))) (t_2 (* z (- x t))) (t_3 (+ x (* t (- y z)))))
   (if (<= z -1.12e+58)
     t_2
     (if (<= z -1e-226)
       t_3
       (if (<= z 1.02e-243)
         t_1
         (if (<= z 3.4e-33)
           t_3
           (if (<= z 6.8e-12) t_1 (if (<= z 2.4e+92) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = z * (x - t);
	double t_3 = x + (t * (y - z));
	double tmp;
	if (z <= -1.12e+58) {
		tmp = t_2;
	} else if (z <= -1e-226) {
		tmp = t_3;
	} else if (z <= 1.02e-243) {
		tmp = t_1;
	} else if (z <= 3.4e-33) {
		tmp = t_3;
	} else if (z <= 6.8e-12) {
		tmp = t_1;
	} else if (z <= 2.4e+92) {
		tmp = t_3;
	} 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 * (1.0d0 - y)
    t_2 = z * (x - t)
    t_3 = x + (t * (y - z))
    if (z <= (-1.12d+58)) then
        tmp = t_2
    else if (z <= (-1d-226)) then
        tmp = t_3
    else if (z <= 1.02d-243) then
        tmp = t_1
    else if (z <= 3.4d-33) then
        tmp = t_3
    else if (z <= 6.8d-12) then
        tmp = t_1
    else if (z <= 2.4d+92) then
        tmp = t_3
    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 * (1.0 - y);
	double t_2 = z * (x - t);
	double t_3 = x + (t * (y - z));
	double tmp;
	if (z <= -1.12e+58) {
		tmp = t_2;
	} else if (z <= -1e-226) {
		tmp = t_3;
	} else if (z <= 1.02e-243) {
		tmp = t_1;
	} else if (z <= 3.4e-33) {
		tmp = t_3;
	} else if (z <= 6.8e-12) {
		tmp = t_1;
	} else if (z <= 2.4e+92) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = z * (x - t)
	t_3 = x + (t * (y - z))
	tmp = 0
	if z <= -1.12e+58:
		tmp = t_2
	elif z <= -1e-226:
		tmp = t_3
	elif z <= 1.02e-243:
		tmp = t_1
	elif z <= 3.4e-33:
		tmp = t_3
	elif z <= 6.8e-12:
		tmp = t_1
	elif z <= 2.4e+92:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	t_2 = Float64(z * Float64(x - t))
	t_3 = Float64(x + Float64(t * Float64(y - z)))
	tmp = 0.0
	if (z <= -1.12e+58)
		tmp = t_2;
	elseif (z <= -1e-226)
		tmp = t_3;
	elseif (z <= 1.02e-243)
		tmp = t_1;
	elseif (z <= 3.4e-33)
		tmp = t_3;
	elseif (z <= 6.8e-12)
		tmp = t_1;
	elseif (z <= 2.4e+92)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	t_2 = z * (x - t);
	t_3 = x + (t * (y - z));
	tmp = 0.0;
	if (z <= -1.12e+58)
		tmp = t_2;
	elseif (z <= -1e-226)
		tmp = t_3;
	elseif (z <= 1.02e-243)
		tmp = t_1;
	elseif (z <= 3.4e-33)
		tmp = t_3;
	elseif (z <= 6.8e-12)
		tmp = t_1;
	elseif (z <= 2.4e+92)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.12e+58], t$95$2, If[LessEqual[z, -1e-226], t$95$3, If[LessEqual[z, 1.02e-243], t$95$1, If[LessEqual[z, 3.4e-33], t$95$3, If[LessEqual[z, 6.8e-12], t$95$1, If[LessEqual[z, 2.4e+92], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.02 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-33}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.4 \cdot 10^{+92}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.12e58 or 2.40000000000000005e92 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg86.6%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval86.6%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative86.6%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
      8. mul-1-neg86.6%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg86.6%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified86.6%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in z around inf 89.9%

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

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

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

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

    if -1.12e58 < z < -9.99999999999999921e-227 or 1.01999999999999996e-243 < z < 3.4000000000000001e-33 or 6.8000000000000001e-12 < z < 2.40000000000000005e92

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

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

    if -9.99999999999999921e-227 < z < 1.01999999999999996e-243 or 3.4000000000000001e-33 < z < 6.8000000000000001e-12

    1. Initial program 100.0%

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

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

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in100.0%

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    5. Taylor expanded in t around inf 100.0%

      \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-1 \cdot \left(t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-t \cdot z}\right) \]
      2. distribute-lft-neg-out100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.12 \cdot 10^{+58}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-243}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-33}:\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-12}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{+92}:\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 48.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + x \cdot z\\ t_2 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -0.0034:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-223}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-146}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 550000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+207} \lor \neg \left(z \leq 8.2 \cdot 10^{+231}\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* x z))) (t_2 (* x (- 1.0 y))))
   (if (<= z -0.0034)
     t_1
     (if (<= z 1.45e-223)
       t_2
       (if (<= z 7.6e-146)
         (* y t)
         (if (<= z 550000.0)
           t_2
           (if (or (<= z 5e+207) (not (<= z 8.2e+231))) (* z (- t)) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (x * z);
	double t_2 = x * (1.0 - y);
	double tmp;
	if (z <= -0.0034) {
		tmp = t_1;
	} else if (z <= 1.45e-223) {
		tmp = t_2;
	} else if (z <= 7.6e-146) {
		tmp = y * t;
	} else if (z <= 550000.0) {
		tmp = t_2;
	} else if ((z <= 5e+207) || !(z <= 8.2e+231)) {
		tmp = z * -t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (x * z)
    t_2 = x * (1.0d0 - y)
    if (z <= (-0.0034d0)) then
        tmp = t_1
    else if (z <= 1.45d-223) then
        tmp = t_2
    else if (z <= 7.6d-146) then
        tmp = y * t
    else if (z <= 550000.0d0) then
        tmp = t_2
    else if ((z <= 5d+207) .or. (.not. (z <= 8.2d+231))) then
        tmp = z * -t
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + (x * z);
	double t_2 = x * (1.0 - y);
	double tmp;
	if (z <= -0.0034) {
		tmp = t_1;
	} else if (z <= 1.45e-223) {
		tmp = t_2;
	} else if (z <= 7.6e-146) {
		tmp = y * t;
	} else if (z <= 550000.0) {
		tmp = t_2;
	} else if ((z <= 5e+207) || !(z <= 8.2e+231)) {
		tmp = z * -t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (x * z)
	t_2 = x * (1.0 - y)
	tmp = 0
	if z <= -0.0034:
		tmp = t_1
	elif z <= 1.45e-223:
		tmp = t_2
	elif z <= 7.6e-146:
		tmp = y * t
	elif z <= 550000.0:
		tmp = t_2
	elif (z <= 5e+207) or not (z <= 8.2e+231):
		tmp = z * -t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(x * z))
	t_2 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -0.0034)
		tmp = t_1;
	elseif (z <= 1.45e-223)
		tmp = t_2;
	elseif (z <= 7.6e-146)
		tmp = Float64(y * t);
	elseif (z <= 550000.0)
		tmp = t_2;
	elseif ((z <= 5e+207) || !(z <= 8.2e+231))
		tmp = Float64(z * Float64(-t));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (x * z);
	t_2 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -0.0034)
		tmp = t_1;
	elseif (z <= 1.45e-223)
		tmp = t_2;
	elseif (z <= 7.6e-146)
		tmp = y * t;
	elseif (z <= 550000.0)
		tmp = t_2;
	elseif ((z <= 5e+207) || ~((z <= 8.2e+231)))
		tmp = z * -t;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0034], t$95$1, If[LessEqual[z, 1.45e-223], t$95$2, If[LessEqual[z, 7.6e-146], N[(y * t), $MachinePrecision], If[LessEqual[z, 550000.0], t$95$2, If[Or[LessEqual[z, 5e+207], N[Not[LessEqual[z, 8.2e+231]], $MachinePrecision]], N[(z * (-t)), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-223}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 7.6 \cdot 10^{-146}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 550000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 5 \cdot 10^{+207} \lor \neg \left(z \leq 8.2 \cdot 10^{+231}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.00339999999999999981 or 4.9999999999999999e207 < z < 8.2000000000000006e231

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -0.00339999999999999981 < z < 1.45e-223 or 7.59999999999999989e-146 < z < 5.5e5

    1. Initial program 100.0%

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

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

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in100.0%

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    5. Taylor expanded in t around inf 100.0%

      \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-1 \cdot \left(t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-t \cdot z}\right) \]
      2. distribute-lft-neg-out100.0%

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

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

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

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

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

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

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

    if 1.45e-223 < z < 7.59999999999999989e-146

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    8. Simplified67.1%

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

    if 5.5e5 < z < 4.9999999999999999e207 or 8.2000000000000006e231 < 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 x + \color{blue}{-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. distribute-rgt-neg-in83.5%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg81.5%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval81.5%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative81.5%

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

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg81.5%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified81.5%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in t around inf 56.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0034:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-223}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 7.6 \cdot 10^{-146}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 550000:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 5 \cdot 10^{+207} \lor \neg \left(z \leq 8.2 \cdot 10^{+231}\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot z\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 54.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := x + y \cdot t\\ \mathbf{if}\;y \leq -1 \cdot 10^{+257}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+45}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-135}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-39}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+242}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+301}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))) (t_2 (+ x (* y t))))
   (if (<= y -1e+257)
     t_1
     (if (<= y -1.4e+45)
       t_2
       (if (<= y -1.1e-135)
         (+ x (* x z))
         (if (<= y 1.5e-39)
           (- x (* z t))
           (if (<= y 1.45e+242) t_2 (if (<= y 3.5e+301) t_1 (* y t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (y * t);
	double tmp;
	if (y <= -1e+257) {
		tmp = t_1;
	} else if (y <= -1.4e+45) {
		tmp = t_2;
	} else if (y <= -1.1e-135) {
		tmp = x + (x * z);
	} else if (y <= 1.5e-39) {
		tmp = x - (z * t);
	} else if (y <= 1.45e+242) {
		tmp = t_2;
	} else if (y <= 3.5e+301) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    t_2 = x + (y * t)
    if (y <= (-1d+257)) then
        tmp = t_1
    else if (y <= (-1.4d+45)) then
        tmp = t_2
    else if (y <= (-1.1d-135)) then
        tmp = x + (x * z)
    else if (y <= 1.5d-39) then
        tmp = x - (z * t)
    else if (y <= 1.45d+242) then
        tmp = t_2
    else if (y <= 3.5d+301) then
        tmp = t_1
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = x + (y * t);
	double tmp;
	if (y <= -1e+257) {
		tmp = t_1;
	} else if (y <= -1.4e+45) {
		tmp = t_2;
	} else if (y <= -1.1e-135) {
		tmp = x + (x * z);
	} else if (y <= 1.5e-39) {
		tmp = x - (z * t);
	} else if (y <= 1.45e+242) {
		tmp = t_2;
	} else if (y <= 3.5e+301) {
		tmp = t_1;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = x + (y * t)
	tmp = 0
	if y <= -1e+257:
		tmp = t_1
	elif y <= -1.4e+45:
		tmp = t_2
	elif y <= -1.1e-135:
		tmp = x + (x * z)
	elif y <= 1.5e-39:
		tmp = x - (z * t)
	elif y <= 1.45e+242:
		tmp = t_2
	elif y <= 3.5e+301:
		tmp = t_1
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	t_2 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (y <= -1e+257)
		tmp = t_1;
	elseif (y <= -1.4e+45)
		tmp = t_2;
	elseif (y <= -1.1e-135)
		tmp = Float64(x + Float64(x * z));
	elseif (y <= 1.5e-39)
		tmp = Float64(x - Float64(z * t));
	elseif (y <= 1.45e+242)
		tmp = t_2;
	elseif (y <= 3.5e+301)
		tmp = t_1;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	t_2 = x + (y * t);
	tmp = 0.0;
	if (y <= -1e+257)
		tmp = t_1;
	elseif (y <= -1.4e+45)
		tmp = t_2;
	elseif (y <= -1.1e-135)
		tmp = x + (x * z);
	elseif (y <= 1.5e-39)
		tmp = x - (z * t);
	elseif (y <= 1.45e+242)
		tmp = t_2;
	elseif (y <= 3.5e+301)
		tmp = t_1;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e+257], t$95$1, If[LessEqual[y, -1.4e+45], t$95$2, If[LessEqual[y, -1.1e-135], N[(x + N[(x * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.5e-39], N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.45e+242], t$95$2, If[LessEqual[y, 3.5e+301], t$95$1, N[(y * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.4 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -1.1 \cdot 10^{-135}:\\
\;\;\;\;x + x \cdot z\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{-39}:\\
\;\;\;\;x - z \cdot t\\

\mathbf{elif}\;y \leq 1.45 \cdot 10^{+242}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 3.5 \cdot 10^{+301}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -1.00000000000000003e257 or 1.44999999999999999e242 < y < 3.4999999999999999e301

    1. Initial program 99.9%

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

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

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

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr86.1%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    5. Taylor expanded in t around inf 93.0%

      \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-1 \cdot \left(t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg93.0%

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-t \cdot z}\right) \]
      2. distribute-lft-neg-out93.0%

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

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{z \cdot \left(-t\right)}\right) \]
    7. Simplified93.0%

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

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

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

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

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

    if -1.00000000000000003e257 < y < -1.4e45 or 1.50000000000000014e-39 < y < 1.44999999999999999e242

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

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

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

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

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

    if -1.4e45 < y < -1.1e-135

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-135 < y < 1.50000000000000014e-39

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if 3.4999999999999999e301 < 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 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1 \cdot 10^{+257}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{+45}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-135}:\\ \;\;\;\;x + x \cdot z\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-39}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+242}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{+301}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 70.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := z \cdot \left(x - t\right)\\ t_3 := x + y \cdot t\\ \mathbf{if}\;z \leq -160:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-239}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-32}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;z \leq 90000:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))) (t_2 (* z (- x t))) (t_3 (+ x (* y t))))
   (if (<= z -160.0)
     t_2
     (if (<= z -1e-226)
       t_3
       (if (<= z 4.4e-239)
         t_1
         (if (<= z 1.55e-32) t_3 (if (<= z 90000.0) t_1 t_2)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = z * (x - t);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -160.0) {
		tmp = t_2;
	} else if (z <= -1e-226) {
		tmp = t_3;
	} else if (z <= 4.4e-239) {
		tmp = t_1;
	} else if (z <= 1.55e-32) {
		tmp = t_3;
	} else if (z <= 90000.0) {
		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 * (1.0d0 - y)
    t_2 = z * (x - t)
    t_3 = x + (y * t)
    if (z <= (-160.0d0)) then
        tmp = t_2
    else if (z <= (-1d-226)) then
        tmp = t_3
    else if (z <= 4.4d-239) then
        tmp = t_1
    else if (z <= 1.55d-32) then
        tmp = t_3
    else if (z <= 90000.0d0) 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 * (1.0 - y);
	double t_2 = z * (x - t);
	double t_3 = x + (y * t);
	double tmp;
	if (z <= -160.0) {
		tmp = t_2;
	} else if (z <= -1e-226) {
		tmp = t_3;
	} else if (z <= 4.4e-239) {
		tmp = t_1;
	} else if (z <= 1.55e-32) {
		tmp = t_3;
	} else if (z <= 90000.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = z * (x - t)
	t_3 = x + (y * t)
	tmp = 0
	if z <= -160.0:
		tmp = t_2
	elif z <= -1e-226:
		tmp = t_3
	elif z <= 4.4e-239:
		tmp = t_1
	elif z <= 1.55e-32:
		tmp = t_3
	elif z <= 90000.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	t_2 = Float64(z * Float64(x - t))
	t_3 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (z <= -160.0)
		tmp = t_2;
	elseif (z <= -1e-226)
		tmp = t_3;
	elseif (z <= 4.4e-239)
		tmp = t_1;
	elseif (z <= 1.55e-32)
		tmp = t_3;
	elseif (z <= 90000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	t_2 = z * (x - t);
	t_3 = x + (y * t);
	tmp = 0.0;
	if (z <= -160.0)
		tmp = t_2;
	elseif (z <= -1e-226)
		tmp = t_3;
	elseif (z <= 4.4e-239)
		tmp = t_1;
	elseif (z <= 1.55e-32)
		tmp = t_3;
	elseif (z <= 90000.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -160.0], t$95$2, If[LessEqual[z, -1e-226], t$95$3, If[LessEqual[z, 4.4e-239], t$95$1, If[LessEqual[z, 1.55e-32], t$95$3, If[LessEqual[z, 90000.0], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-239}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-32}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 90000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -160 or 9e4 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
      8. mul-1-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in z around inf 84.6%

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

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

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

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

    if -160 < z < -9.99999999999999921e-227 or 4.39999999999999965e-239 < z < 1.55000000000000005e-32

    1. Initial program 100.0%

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

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

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

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

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

    if -9.99999999999999921e-227 < z < 4.39999999999999965e-239 or 1.55000000000000005e-32 < z < 9e4

    1. Initial program 100.0%

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

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

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in100.0%

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    5. Taylor expanded in t around inf 100.0%

      \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-1 \cdot \left(t \cdot z\right)}\right) \]
    6. Step-by-step derivation
      1. mul-1-neg100.0%

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-t \cdot z}\right) \]
      2. distribute-lft-neg-out100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -160:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1 \cdot 10^{-226}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-239}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-32}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 90000:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 49.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq 2.3 \cdot 10^{-221}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 3.4 \cdot 10^{-144}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 760000:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.00700000000000000015 or 7.6e5 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg80.8%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval80.8%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative80.8%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
      8. mul-1-neg80.8%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg80.8%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified80.8%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in t around inf 47.6%

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

    if -0.00700000000000000015 < z < 2.3e-221 or 3.40000000000000017e-144 < z < 7.6e5

    1. Initial program 100.0%

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

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

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\left(y + \left(-z\right)\right)} \]
      3. distribute-lft-in100.0%

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

        \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    4. Applied egg-rr100.0%

      \[\leadsto x + \color{blue}{\mathsf{fma}\left(t - x, y, \left(t - x\right) \cdot \left(-z\right)\right)} \]
    5. Taylor expanded in t around inf 99.4%

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

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{-t \cdot z}\right) \]
      2. distribute-lft-neg-out99.4%

        \[\leadsto x + \mathsf{fma}\left(t - x, y, \color{blue}{\left(-t\right) \cdot z}\right) \]
      3. *-commutative99.4%

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

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

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

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

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

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

    if 2.3e-221 < z < 3.40000000000000017e-144

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    8. Simplified67.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.007:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-221}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-144}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 760000:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 81.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.6 \cdot 10^{-37} \lor \neg \left(t \leq 3.05 \cdot 10^{-55}\right):\\
\;\;\;\;x + t \cdot \left(y - z\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -8.59999999999999936e-37 or 3.0500000000000001e-55 < 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 85.7%

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

    if -8.59999999999999936e-37 < t < 3.0500000000000001e-55

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 84.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(x - t\right)\\ \mathbf{if}\;z \leq -7200:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 28000:\\ \;\;\;\;x + y \cdot \left(t - x\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 -7200.0) t_1 (if (<= z 28000.0) (+ x (* y (- t x))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = z * (x - t);
	double tmp;
	if (z <= -7200.0) {
		tmp = t_1;
	} else if (z <= 28000.0) {
		tmp = x + (y * (t - x));
	} 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 <= (-7200.0d0)) then
        tmp = t_1
    else if (z <= 28000.0d0) then
        tmp = x + (y * (t - x))
    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 <= -7200.0) {
		tmp = t_1;
	} else if (z <= 28000.0) {
		tmp = x + (y * (t - x));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * (x - t)
	tmp = 0
	if z <= -7200.0:
		tmp = t_1
	elif z <= 28000.0:
		tmp = x + (y * (t - x))
	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 <= -7200.0)
		tmp = t_1;
	elseif (z <= 28000.0)
		tmp = Float64(x + Float64(y * Float64(t - x)));
	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 <= -7200.0)
		tmp = t_1;
	elseif (z <= 28000.0)
		tmp = x + (y * (t - x));
	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, -7200.0], t$95$1, If[LessEqual[z, 28000.0], N[(x + N[(y * N[(t - x), $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 -7200:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
      8. mul-1-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in z around inf 85.4%

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

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

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

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

    if -7200 < z < 28000

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

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

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

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

    if 28000 < 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.9%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2900000 \lor \neg \left(z \leq 220000\right):\\
\;\;\;\;z \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e6 or 2.2e5 < z

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z - 1\right)\right)} \]
      5. sub-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 \cdot z + \left(-1\right)\right)}\right) \]
      6. metadata-eval82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 \cdot z + \color{blue}{-1}\right)\right) \]
      7. +-commutative82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 + -1 \cdot z\right)}\right) \]
      8. mul-1-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \left(-1 + \color{blue}{\left(-z\right)}\right)\right) \]
      9. unsub-neg82.1%

        \[\leadsto -\mathsf{fma}\left(z, t, x \cdot \color{blue}{\left(-1 - z\right)}\right) \]
    8. Simplified82.1%

      \[\leadsto \color{blue}{-\mathsf{fma}\left(z, t, x \cdot \left(-1 - z\right)\right)} \]
    9. Taylor expanded in t around inf 48.3%

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

    if -2.9e6 < z < 2.2e5

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    8. Simplified40.7%

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

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

Alternative 11: 38.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{-95} \lor \neg \left(y \leq 1.1 \cdot 10^{-36}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.75000000000000001e-95 or 1.1e-36 < y

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    8. Simplified42.6%

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

    if -2.75000000000000001e-95 < y < 1.1e-36

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

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

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

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

Alternative 12: 18.4% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification18.4%

    \[\leadsto x \]
  6. Add Preprocessing

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

  :herbie-target
  (+ x (+ (* t (- y z)) (* (- x) (- y z))))

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