Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

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

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 67.8% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := \left(y - z\right) \cdot t\\ t_3 := z \cdot \left(x - t\right)\\ t_4 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;y \leq -5.9 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{+17}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-84}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-111}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-193}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-259}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{-62}:\\ \;\;\;\;t\_4\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+21}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x)))
        (t_2 (* (- y z) t))
        (t_3 (* z (- x t)))
        (t_4 (* x (+ z 1.0))))
   (if (<= y -5.9e+54)
     t_1
     (if (<= y -1.5e+17)
       t_3
       (if (<= y -5.2e-84)
         (+ x (* y t))
         (if (<= y -4.8e-111)
           t_2
           (if (<= y -7.8e-193)
             t_4
             (if (<= y 1.2e-259)
               t_3
               (if (<= y 8.6e-62) t_4 (if (<= y 2.3e+21) t_2 t_1))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = (y - z) * t;
	double t_3 = z * (x - t);
	double t_4 = x * (z + 1.0);
	double tmp;
	if (y <= -5.9e+54) {
		tmp = t_1;
	} else if (y <= -1.5e+17) {
		tmp = t_3;
	} else if (y <= -5.2e-84) {
		tmp = x + (y * t);
	} else if (y <= -4.8e-111) {
		tmp = t_2;
	} else if (y <= -7.8e-193) {
		tmp = t_4;
	} else if (y <= 1.2e-259) {
		tmp = t_3;
	} else if (y <= 8.6e-62) {
		tmp = t_4;
	} else if (y <= 2.3e+21) {
		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) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = y * (t - x)
    t_2 = (y - z) * t
    t_3 = z * (x - t)
    t_4 = x * (z + 1.0d0)
    if (y <= (-5.9d+54)) then
        tmp = t_1
    else if (y <= (-1.5d+17)) then
        tmp = t_3
    else if (y <= (-5.2d-84)) then
        tmp = x + (y * t)
    else if (y <= (-4.8d-111)) then
        tmp = t_2
    else if (y <= (-7.8d-193)) then
        tmp = t_4
    else if (y <= 1.2d-259) then
        tmp = t_3
    else if (y <= 8.6d-62) then
        tmp = t_4
    else if (y <= 2.3d+21) 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 = y * (t - x);
	double t_2 = (y - z) * t;
	double t_3 = z * (x - t);
	double t_4 = x * (z + 1.0);
	double tmp;
	if (y <= -5.9e+54) {
		tmp = t_1;
	} else if (y <= -1.5e+17) {
		tmp = t_3;
	} else if (y <= -5.2e-84) {
		tmp = x + (y * t);
	} else if (y <= -4.8e-111) {
		tmp = t_2;
	} else if (y <= -7.8e-193) {
		tmp = t_4;
	} else if (y <= 1.2e-259) {
		tmp = t_3;
	} else if (y <= 8.6e-62) {
		tmp = t_4;
	} else if (y <= 2.3e+21) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = (y - z) * t
	t_3 = z * (x - t)
	t_4 = x * (z + 1.0)
	tmp = 0
	if y <= -5.9e+54:
		tmp = t_1
	elif y <= -1.5e+17:
		tmp = t_3
	elif y <= -5.2e-84:
		tmp = x + (y * t)
	elif y <= -4.8e-111:
		tmp = t_2
	elif y <= -7.8e-193:
		tmp = t_4
	elif y <= 1.2e-259:
		tmp = t_3
	elif y <= 8.6e-62:
		tmp = t_4
	elif y <= 2.3e+21:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	t_2 = Float64(Float64(y - z) * t)
	t_3 = Float64(z * Float64(x - t))
	t_4 = Float64(x * Float64(z + 1.0))
	tmp = 0.0
	if (y <= -5.9e+54)
		tmp = t_1;
	elseif (y <= -1.5e+17)
		tmp = t_3;
	elseif (y <= -5.2e-84)
		tmp = Float64(x + Float64(y * t));
	elseif (y <= -4.8e-111)
		tmp = t_2;
	elseif (y <= -7.8e-193)
		tmp = t_4;
	elseif (y <= 1.2e-259)
		tmp = t_3;
	elseif (y <= 8.6e-62)
		tmp = t_4;
	elseif (y <= 2.3e+21)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	t_2 = (y - z) * t;
	t_3 = z * (x - t);
	t_4 = x * (z + 1.0);
	tmp = 0.0;
	if (y <= -5.9e+54)
		tmp = t_1;
	elseif (y <= -1.5e+17)
		tmp = t_3;
	elseif (y <= -5.2e-84)
		tmp = x + (y * t);
	elseif (y <= -4.8e-111)
		tmp = t_2;
	elseif (y <= -7.8e-193)
		tmp = t_4;
	elseif (y <= 1.2e-259)
		tmp = t_3;
	elseif (y <= 8.6e-62)
		tmp = t_4;
	elseif (y <= 2.3e+21)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$3 = N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.9e+54], t$95$1, If[LessEqual[y, -1.5e+17], t$95$3, If[LessEqual[y, -5.2e-84], N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.8e-111], t$95$2, If[LessEqual[y, -7.8e-193], t$95$4, If[LessEqual[y, 1.2e-259], t$95$3, If[LessEqual[y, 8.6e-62], t$95$4, If[LessEqual[y, 2.3e+21], t$95$2, t$95$1]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.5 \cdot 10^{+17}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -5.2 \cdot 10^{-84}:\\
\;\;\;\;x + y \cdot t\\

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-111}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -7.8 \cdot 10^{-193}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-259}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 8.6 \cdot 10^{-62}:\\
\;\;\;\;t\_4\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{+21}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.8999999999999997e54 or 2.3e21 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.9%

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

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

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

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

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

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

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

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

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

    if -5.8999999999999997e54 < y < -1.5e17 or -7.7999999999999997e-193 < y < 1.2e-259

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-97.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+97.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in97.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in97.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+97.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-97.0%

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

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

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

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

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

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

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

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

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

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

    if -1.5e17 < y < -5.2e-84

    1. Initial program 99.9%

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

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

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

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

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

    if -5.2e-84 < y < -4.8000000000000001e-111 or 8.5999999999999993e-62 < y < 2.3e21

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

    if -4.8000000000000001e-111 < y < -7.7999999999999997e-193 or 1.2e-259 < y < 8.5999999999999993e-62

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification80.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.9 \cdot 10^{+54}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{+17}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-84}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-111}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -7.8 \cdot 10^{-193}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-259}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 8.6 \cdot 10^{-62}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{+21}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 66.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + 1\right)\\ t_2 := y \cdot \left(t - x\right)\\ t_3 := \left(y - z\right) \cdot t\\ \mathbf{if}\;y \leq -1.85 \cdot 10^{+55}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{-110}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-191}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-275}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-61}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))) (t_3 (* (- y z) t)))
   (if (<= y -1.85e+55)
     t_2
     (if (<= y -3.6e-110)
       t_3
       (if (<= y -4.8e-191)
         t_1
         (if (<= y 1.3e-275)
           t_3
           (if (<= y 7.4e-61) t_1 (if (<= y 1.3e+15) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double t_3 = (y - z) * t;
	double tmp;
	if (y <= -1.85e+55) {
		tmp = t_2;
	} else if (y <= -3.6e-110) {
		tmp = t_3;
	} else if (y <= -4.8e-191) {
		tmp = t_1;
	} else if (y <= 1.3e-275) {
		tmp = t_3;
	} else if (y <= 7.4e-61) {
		tmp = t_1;
	} else if (y <= 1.3e+15) {
		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 * (z + 1.0d0)
    t_2 = y * (t - x)
    t_3 = (y - z) * t
    if (y <= (-1.85d+55)) then
        tmp = t_2
    else if (y <= (-3.6d-110)) then
        tmp = t_3
    else if (y <= (-4.8d-191)) then
        tmp = t_1
    else if (y <= 1.3d-275) then
        tmp = t_3
    else if (y <= 7.4d-61) then
        tmp = t_1
    else if (y <= 1.3d+15) 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 * (z + 1.0);
	double t_2 = y * (t - x);
	double t_3 = (y - z) * t;
	double tmp;
	if (y <= -1.85e+55) {
		tmp = t_2;
	} else if (y <= -3.6e-110) {
		tmp = t_3;
	} else if (y <= -4.8e-191) {
		tmp = t_1;
	} else if (y <= 1.3e-275) {
		tmp = t_3;
	} else if (y <= 7.4e-61) {
		tmp = t_1;
	} else if (y <= 1.3e+15) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + 1.0)
	t_2 = y * (t - x)
	t_3 = (y - z) * t
	tmp = 0
	if y <= -1.85e+55:
		tmp = t_2
	elif y <= -3.6e-110:
		tmp = t_3
	elif y <= -4.8e-191:
		tmp = t_1
	elif y <= 1.3e-275:
		tmp = t_3
	elif y <= 7.4e-61:
		tmp = t_1
	elif y <= 1.3e+15:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + 1.0))
	t_2 = Float64(y * Float64(t - x))
	t_3 = Float64(Float64(y - z) * t)
	tmp = 0.0
	if (y <= -1.85e+55)
		tmp = t_2;
	elseif (y <= -3.6e-110)
		tmp = t_3;
	elseif (y <= -4.8e-191)
		tmp = t_1;
	elseif (y <= 1.3e-275)
		tmp = t_3;
	elseif (y <= 7.4e-61)
		tmp = t_1;
	elseif (y <= 1.3e+15)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z + 1.0);
	t_2 = y * (t - x);
	t_3 = (y - z) * t;
	tmp = 0.0;
	if (y <= -1.85e+55)
		tmp = t_2;
	elseif (y <= -3.6e-110)
		tmp = t_3;
	elseif (y <= -4.8e-191)
		tmp = t_1;
	elseif (y <= 1.3e-275)
		tmp = t_3;
	elseif (y <= 7.4e-61)
		tmp = t_1;
	elseif (y <= 1.3e+15)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[y, -1.85e+55], t$95$2, If[LessEqual[y, -3.6e-110], t$95$3, If[LessEqual[y, -4.8e-191], t$95$1, If[LessEqual[y, 1.3e-275], t$95$3, If[LessEqual[y, 7.4e-61], t$95$1, If[LessEqual[y, 1.3e+15], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -3.6 \cdot 10^{-110}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -4.8 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{-275}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 7.4 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.8500000000000001e55 or 1.3e15 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.9%

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

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

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

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

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

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

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

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

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

    if -1.8500000000000001e55 < y < -3.59999999999999995e-110 or -4.7999999999999998e-191 < y < 1.29999999999999996e-275 or 7.3999999999999999e-61 < y < 1.3e15

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-98.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+98.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in98.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in98.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+98.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-98.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub098.5%

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

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

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

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

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

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

    if -3.59999999999999995e-110 < y < -4.7999999999999998e-191 or 1.29999999999999996e-275 < y < 7.3999999999999999e-61

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - -1 \cdot z\right)} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-inv71.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.85 \cdot 10^{+55}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -3.6 \cdot 10^{-110}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{-191}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{-275}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 7.4 \cdot 10^{-61}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 1.3 \cdot 10^{+15}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq -5.2 \cdot 10^{-111}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq -2 \cdot 10^{-207}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;y \leq 5.2 \cdot 10^{-61}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 2.5 \cdot 10^{+24}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.89999999999999998e56 or 2.50000000000000023e24 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.9%

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

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

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

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

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

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

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

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

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

    if -1.89999999999999998e56 < y < -5.19999999999999965e-111 or 5.20000000000000021e-61 < y < 2.50000000000000023e24

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

    if -5.19999999999999965e-111 < y < -1.99999999999999985e-207 or 2.95e-260 < y < 5.20000000000000021e-61

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

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

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

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

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

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

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

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

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

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

    if -1.99999999999999985e-207 < y < 2.95e-260

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.9 \cdot 10^{+56}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{-111}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -2 \cdot 10^{-207}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.95 \cdot 10^{-260}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq 5.2 \cdot 10^{-61}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{+24}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 38.7% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -56000000000000:\\
\;\;\;\;t \cdot \left(-z\right)\\

\mathbf{elif}\;z \leq -4.1 \cdot 10^{-32}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-291}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-206}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.05 \cdot 10^{+57}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.6e13

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.6e13 < z < -4.09999999999999975e-32

    1. Initial program 99.9%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-x \cdot y} \]
      2. distribute-rgt-neg-in50.2%

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

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

    if -4.09999999999999975e-32 < z < 4.49999999999999974e-291 or 9.49999999999999979e-206 < z < 3.04999999999999988e57

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-97.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+97.4%

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(1 + z\right)}\right)\right)\right) \]
      8. neg-sub097.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in97.4%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in97.4%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+97.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-97.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub097.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified48.5%

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

    if 4.49999999999999974e-291 < z < 9.49999999999999979e-206

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

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

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

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

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

    if 3.04999999999999988e57 < 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 75.6%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(--1\right) \cdot z\right)} \]
      2. metadata-eval47.7%

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
    9. Taylor expanded in z around inf 47.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -56000000000000:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq -4.1 \cdot 10^{-32}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-291}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-206}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.05 \cdot 10^{+57}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 61.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{-20} \lor \neg \left(x \leq 1.05 \cdot 10^{-110} \lor \neg \left(x \leq 1.9 \cdot 10^{-45}\right) \land x \leq 8.2 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot \left(1 - y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -8.3999999999999996e-20 or 1.05000000000000001e-110 < x < 1.89999999999999999e-45 or 8.2000000000000002e47 < x

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

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

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

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

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

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

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

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

    if -8.3999999999999996e-20 < x < 1.05000000000000001e-110 or 1.89999999999999999e-45 < x < 8.2000000000000002e47

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.4 \cdot 10^{-20} \lor \neg \left(x \leq 1.05 \cdot 10^{-110} \lor \neg \left(x \leq 1.9 \cdot 10^{-45}\right) \land x \leq 8.2 \cdot 10^{+47}\right):\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 71.5% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq -4 \cdot 10^{-96}:\\
\;\;\;\;x + y \cdot t\\

\mathbf{elif}\;y \leq 55000000000000:\\
\;\;\;\;x - z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -6.1999999999999999e54 or 5.5e13 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.9%

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

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

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

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

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

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

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

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

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

    if -6.1999999999999999e54 < y < -1.85e12

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in100.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+100.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-100.0%

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

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

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

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

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

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

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

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

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

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

    if -1.85e12 < y < -3.9999999999999996e-96

    1. Initial program 99.9%

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

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

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

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

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

    if -3.9999999999999996e-96 < y < 5.5e13

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+54}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -1850000000000:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-96}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;y \leq 55000000000000:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 38.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.16 \cdot 10^{+61}:\\
\;\;\;\;t \cdot \left(-z\right)\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{-293}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-205}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+56}:\\
\;\;\;\;y \cdot t\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.16e61 < z < 2.5999999999999998e-293 or 1.60000000000000005e-205 < z < 8.4999999999999998e56

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-98.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+98.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in98.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in98.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+98.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-98.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified44.7%

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

    if 2.5999999999999998e-293 < z < 1.60000000000000005e-205

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

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

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

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

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

    if 8.4999999999999998e56 < 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 75.6%

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

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 + \left(--1\right) \cdot z\right)} \]
      2. metadata-eval47.7%

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
    9. Taylor expanded in z around inf 47.7%

      \[\leadsto \color{blue}{x \cdot z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification48.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.16 \cdot 10^{+61}:\\ \;\;\;\;t \cdot \left(-z\right)\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{-293}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-205}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+56}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 81.8% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq -2.6 \cdot 10^{-58}:\\
\;\;\;\;x - y \cdot \left(x - t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -0.78000000000000003 or 200 < 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 91.7%

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

    if -0.78000000000000003 < t < -2.60000000000000007e-58

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

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

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

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

    if -2.60000000000000007e-58 < t < 200

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 10: 82.8% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.1499999999999999e57 or 1.84999999999999996e86 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.6%

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e57 < y < -2.5999999999999999e-110

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

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

    if -2.5999999999999999e-110 < y < 1.84999999999999996e86

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

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

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

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

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

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

Alternative 11: 56.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y - z \leq -1 \cdot 10^{-60} \lor \neg \left(y - z \leq 10^{-13}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 y z) < -9.9999999999999997e-61 or 1e-13 < (-.f64 y z)

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-96.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+96.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in96.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in96.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+96.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-96.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub096.6%

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

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

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

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

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

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

    if -9.9999999999999997e-61 < (-.f64 y z) < 1e-13

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 12: 76.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.149999999999999994 or 25500 < t

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-94.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+94.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in94.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in94.5%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+94.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-94.5%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub094.5%

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

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

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

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

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

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

    if -0.149999999999999994 < t < 25500

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 13: 81.9% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -0.095000000000000001 or 115 < 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 91.7%

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

    if -0.095000000000000001 < t < 115

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 14: 63.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.65 \cdot 10^{-54} \lor \neg \left(t \leq 5600000\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.64999999999999996e-54 or 5.6e6 < t

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-95.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+95.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in95.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in95.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+95.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-95.0%

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

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

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

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

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

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

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

    if -1.64999999999999996e-54 < t < 5.6e6

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - -1 \cdot z\right)} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-inv52.4%

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

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

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

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

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

Alternative 15: 36.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.45 \cdot 10^{-9} \lor \neg \left(z \leq 1.38 \cdot 10^{+29}\right):\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.44999999999999987e-9 or 1.38e29 < 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 69.8%

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

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 - -1 \cdot z\right)} \]
    7. Step-by-step derivation
      1. cancel-sign-sub-inv32.3%

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

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

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

      \[\leadsto \color{blue}{x \cdot \left(1 + z\right)} \]
    9. Taylor expanded in z around inf 31.5%

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

    if -3.44999999999999987e-9 < z < 1.38e29

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

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

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

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

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

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

Alternative 16: 37.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{-110} \lor \neg \left(y \leq 2.35 \cdot 10^{-23}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.10000000000000002e-110 or 2.35e-23 < y

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(0 - \left(y - z\right)\right)} + 1\right)\right) \]
      5. associate-+l-97.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(\left(y - z\right) - 1\right)\right)}\right) \]
      6. associate--r+97.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(-\left(y - \left(1 + z\right)\right)\right)}\right) \]
      9. distribute-rgt-neg-in97.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      12. distribute-rgt-neg-in97.6%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \left(y - \color{blue}{\left(z + 1\right)}\right)\right)\right) \]
      15. associate--r+97.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(\left(y - z\right) - 1\right)}\right)\right) \]
      16. associate-+l-97.6%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(\left(0 - \left(y - z\right)\right) + 1\right)}\right) \]
      17. neg-sub097.6%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified47.9%

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

    if -2.10000000000000002e-110 < y < 2.35e-23

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

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

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

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

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

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

Alternative 17: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 18: 17.6% accurate, 9.0× speedup?

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

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

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

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Developer target: 96.2% accurate, 0.6× speedup?

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

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

Reproduce

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