Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 8.5s
Alternatives: 14
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 14 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: 36.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -2.95 \cdot 10^{+106}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{-116}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-283}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-240}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{-92}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+30}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= y -2.95e+106)
     (* y t)
     (if (<= y -4.5e-116)
       (* z x)
       (if (<= y -7e-283)
         t_1
         (if (<= y 6e-240)
           (* z x)
           (if (<= y 5.1e-92) t_1 (if (<= y 4.2e+30) (* z x) (* y t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -2.95e+106) {
		tmp = y * t;
	} else if (y <= -4.5e-116) {
		tmp = z * x;
	} else if (y <= -7e-283) {
		tmp = t_1;
	} else if (y <= 6e-240) {
		tmp = z * x;
	} else if (y <= 5.1e-92) {
		tmp = t_1;
	} else if (y <= 4.2e+30) {
		tmp = z * x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (y <= (-2.95d+106)) then
        tmp = y * t
    else if (y <= (-4.5d-116)) then
        tmp = z * x
    else if (y <= (-7d-283)) then
        tmp = t_1
    else if (y <= 6d-240) then
        tmp = z * x
    else if (y <= 5.1d-92) then
        tmp = t_1
    else if (y <= 4.2d+30) then
        tmp = z * x
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (y <= -2.95e+106) {
		tmp = y * t;
	} else if (y <= -4.5e-116) {
		tmp = z * x;
	} else if (y <= -7e-283) {
		tmp = t_1;
	} else if (y <= 6e-240) {
		tmp = z * x;
	} else if (y <= 5.1e-92) {
		tmp = t_1;
	} else if (y <= 4.2e+30) {
		tmp = z * x;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if y <= -2.95e+106:
		tmp = y * t
	elif y <= -4.5e-116:
		tmp = z * x
	elif y <= -7e-283:
		tmp = t_1
	elif y <= 6e-240:
		tmp = z * x
	elif y <= 5.1e-92:
		tmp = t_1
	elif y <= 4.2e+30:
		tmp = z * x
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -2.95e+106)
		tmp = Float64(y * t);
	elseif (y <= -4.5e-116)
		tmp = Float64(z * x);
	elseif (y <= -7e-283)
		tmp = t_1;
	elseif (y <= 6e-240)
		tmp = Float64(z * x);
	elseif (y <= 5.1e-92)
		tmp = t_1;
	elseif (y <= 4.2e+30)
		tmp = Float64(z * x);
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (y <= -2.95e+106)
		tmp = y * t;
	elseif (y <= -4.5e-116)
		tmp = z * x;
	elseif (y <= -7e-283)
		tmp = t_1;
	elseif (y <= 6e-240)
		tmp = z * x;
	elseif (y <= 5.1e-92)
		tmp = t_1;
	elseif (y <= 4.2e+30)
		tmp = z * x;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -2.95e+106], N[(y * t), $MachinePrecision], If[LessEqual[y, -4.5e-116], N[(z * x), $MachinePrecision], If[LessEqual[y, -7e-283], t$95$1, If[LessEqual[y, 6e-240], N[(z * x), $MachinePrecision], If[LessEqual[y, 5.1e-92], t$95$1, If[LessEqual[y, 4.2e+30], N[(z * x), $MachinePrecision], N[(y * t), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -4.5 \cdot 10^{-116}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq -7 \cdot 10^{-283}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-240}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq 5.1 \cdot 10^{-92}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.95000000000000014e106 or 4.2e30 < y

    1. Initial program 100.0%

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    6. Simplified58.1%

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

    if -2.95000000000000014e106 < y < -4.50000000000000012e-116 or -6.9999999999999997e-283 < y < 5.99999999999999982e-240 or 5.09999999999999972e-92 < y < 4.2e30

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)\right)} \]
      2. +-commutative99.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-neg99.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(-\left(y - z\right)\right)} + 1\right)\right) \]
      4. neg-sub099.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-99.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+99.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(y - \left(z + 1\right)\right)}\right)\right) \]
      7. +-commutative99.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-sub099.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-in99.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      10. mul-1-neg99.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-neg99.0%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(y - \left(1 + z\right)\right)\right)}\right) \]
      14. +-commutative99.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+99.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-99.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-sub099.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-neg99.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{-1 \cdot \left(y - z\right)} + 1\right)\right) \]
      19. +-commutative99.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-neg99.0%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right)\right) \]
    5. Simplified99.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 71.3%

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

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

    if -4.50000000000000012e-116 < y < -6.9999999999999997e-283 or 5.99999999999999982e-240 < y < 5.09999999999999972e-92

    1. Initial program 100.0%

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(t \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*53.7%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.95 \cdot 10^{+106}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -4.5 \cdot 10^{-116}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq -7 \cdot 10^{-283}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-240}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.1 \cdot 10^{-92}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 4.2 \cdot 10^{+30}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 60.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \left(y - z\right)\\ t_2 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;t \leq -6.8 \cdot 10^{-142}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-299}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-255}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-33}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+32}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* t (- y z))) (t_2 (* x (- 1.0 y))))
   (if (<= t -6.8e-142)
     t_1
     (if (<= t -1.45e-299)
       t_2
       (if (<= t 3.4e-255)
         (* z x)
         (if (<= t 9.2e-33) t_2 (if (<= t 3.2e+32) (* z x) t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = t * (y - z);
	double t_2 = x * (1.0 - y);
	double tmp;
	if (t <= -6.8e-142) {
		tmp = t_1;
	} else if (t <= -1.45e-299) {
		tmp = t_2;
	} else if (t <= 3.4e-255) {
		tmp = z * x;
	} else if (t <= 9.2e-33) {
		tmp = t_2;
	} else if (t <= 3.2e+32) {
		tmp = z * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * (y - z)
    t_2 = x * (1.0d0 - y)
    if (t <= (-6.8d-142)) then
        tmp = t_1
    else if (t <= (-1.45d-299)) then
        tmp = t_2
    else if (t <= 3.4d-255) then
        tmp = z * x
    else if (t <= 9.2d-33) then
        tmp = t_2
    else if (t <= 3.2d+32) then
        tmp = z * x
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = t * (y - z);
	double t_2 = x * (1.0 - y);
	double tmp;
	if (t <= -6.8e-142) {
		tmp = t_1;
	} else if (t <= -1.45e-299) {
		tmp = t_2;
	} else if (t <= 3.4e-255) {
		tmp = z * x;
	} else if (t <= 9.2e-33) {
		tmp = t_2;
	} else if (t <= 3.2e+32) {
		tmp = z * x;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = t * (y - z)
	t_2 = x * (1.0 - y)
	tmp = 0
	if t <= -6.8e-142:
		tmp = t_1
	elif t <= -1.45e-299:
		tmp = t_2
	elif t <= 3.4e-255:
		tmp = z * x
	elif t <= 9.2e-33:
		tmp = t_2
	elif t <= 3.2e+32:
		tmp = z * x
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(t * Float64(y - z))
	t_2 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (t <= -6.8e-142)
		tmp = t_1;
	elseif (t <= -1.45e-299)
		tmp = t_2;
	elseif (t <= 3.4e-255)
		tmp = Float64(z * x);
	elseif (t <= 9.2e-33)
		tmp = t_2;
	elseif (t <= 3.2e+32)
		tmp = Float64(z * x);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = t * (y - z);
	t_2 = x * (1.0 - y);
	tmp = 0.0;
	if (t <= -6.8e-142)
		tmp = t_1;
	elseif (t <= -1.45e-299)
		tmp = t_2;
	elseif (t <= 3.4e-255)
		tmp = z * x;
	elseif (t <= 9.2e-33)
		tmp = t_2;
	elseif (t <= 3.2e+32)
		tmp = z * x;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e-142], t$95$1, If[LessEqual[t, -1.45e-299], t$95$2, If[LessEqual[t, 3.4e-255], N[(z * x), $MachinePrecision], If[LessEqual[t, 9.2e-33], t$95$2, If[LessEqual[t, 3.2e+32], N[(z * x), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.45 \cdot 10^{-299}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 3.4 \cdot 10^{-255}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;t \leq 9.2 \cdot 10^{-33}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 3.2 \cdot 10^{+32}:\\
\;\;\;\;z \cdot x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -6.80000000000000057e-142 or 3.1999999999999999e32 < 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.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-def94.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)\right)} \]
      2. +-commutative94.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-neg94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(-\left(y - z\right)\right)} + 1\right)\right) \]
      4. neg-sub094.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-94.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+94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(y - \left(z + 1\right)\right)}\right)\right) \]
      7. +-commutative94.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-sub094.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-in94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      10. mul-1-neg94.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-neg94.4%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(y - \left(1 + z\right)\right)\right)}\right) \]
      14. +-commutative94.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+94.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-94.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-sub094.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-neg94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{-1 \cdot \left(y - z\right)} + 1\right)\right) \]
      19. +-commutative94.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-neg94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right)\right) \]
    5. Simplified94.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 t around inf 78.1%

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

    if -6.80000000000000057e-142 < t < -1.45000000000000013e-299 or 3.39999999999999983e-255 < t < 9.19999999999999942e-33

    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 99.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-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)\right)} \]
      2. +-commutative99.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-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(-\left(y - z\right)\right)} + 1\right)\right) \]
      4. neg-sub099.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-99.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+99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(y - \left(z + 1\right)\right)}\right)\right) \]
      7. +-commutative99.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-sub099.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-in99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      10. mul-1-neg99.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-neg99.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(y - \left(1 + z\right)\right)\right)}\right) \]
      14. +-commutative99.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+99.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-99.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-sub099.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-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{-1 \cdot \left(y - z\right)} + 1\right)\right) \]
      19. +-commutative99.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-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right)\right) \]
    5. Simplified99.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 z around 0 63.3%

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

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

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

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

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

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

    if -1.45000000000000013e-299 < t < 3.39999999999999983e-255 or 9.19999999999999942e-33 < t < 3.1999999999999999e32

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -6.8 \cdot 10^{-142}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{elif}\;t \leq -1.45 \cdot 10^{-299}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 3.4 \cdot 10^{-255}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 9.2 \cdot 10^{-33}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+32}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.2% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;t \leq -7 \cdot 10^{-142} \lor \neg \left(t \leq 1.25 \cdot 10^{+33}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.42e10 or -2.60000000000000002e-54 < t < -7.00000000000000029e-142 or 1.24999999999999993e33 < 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 87.0%

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

    if -1.42e10 < t < -2.60000000000000002e-54

    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 z around inf 92.0%

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

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

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

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

    if -7.00000000000000029e-142 < t < 1.24999999999999993e33

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto x + x \cdot \left(0 - \color{blue}{\left(\left(-z\right) + y\right)}\right) \]
      6. associate--r+85.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -14200000000:\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{elif}\;t \leq -2.6 \cdot 10^{-54}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;t \leq -7 \cdot 10^{-142} \lor \neg \left(t \leq 1.25 \cdot 10^{+33}\right):\\ \;\;\;\;x + t \cdot \left(y - z\right)\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.8% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-305}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+45}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e-8 or 7.50000000000000058e45 < 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 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.7%

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

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

        \[\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.7%

        \[\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.7%

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

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

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

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

    if -1.7e-8 < z < -1.99999999999999999e-305 or 9.9999999999999991e-255 < z < 7.50000000000000058e45

    1. Initial program 100.0%

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

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

    if -1.99999999999999999e-305 < z < 9.9999999999999991e-255

    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 y around inf 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-305}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;z \leq 10^{-254}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+45}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 53.4% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \left(y - z\right)\\
\mathbf{if}\;t \leq -1 \cdot 10^{-142}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3.6 \cdot 10^{-109}:\\
\;\;\;\;z \cdot x\\

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

\mathbf{elif}\;t \leq 1.8 \cdot 10^{+34}:\\
\;\;\;\;z \cdot x\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1e-142 or 1.8e34 < 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.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-def94.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)\right)} \]
      2. +-commutative94.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-neg94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(-\left(y - z\right)\right)} + 1\right)\right) \]
      4. neg-sub094.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-94.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+94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(y - \left(z + 1\right)\right)}\right)\right) \]
      7. +-commutative94.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-sub094.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-in94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      10. mul-1-neg94.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-neg94.4%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(y - \left(1 + z\right)\right)\right)}\right) \]
      14. +-commutative94.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+94.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-94.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-sub094.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-neg94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{-1 \cdot \left(y - z\right)} + 1\right)\right) \]
      19. +-commutative94.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-neg94.4%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right)\right) \]
    5. Simplified94.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 t around inf 77.6%

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

    if -1e-142 < t < 3.6000000000000001e-109 or 1.15000000000000006e-34 < t < 1.8e34

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

      \[\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 61.6%

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

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

    if 3.6000000000000001e-109 < t < 1.15000000000000006e-34

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

      \[\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-def99.8%

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

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

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

        \[\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-99.8%

        \[\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+99.8%

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

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

        \[\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-in99.8%

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

        \[\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-neg99.8%

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

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

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

        \[\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+99.8%

        \[\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-99.8%

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

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

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

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

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

      \[\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 70.8%

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \left(x \cdot y\right)} \]
    10. Step-by-step derivation
      1. associate-*r*56.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1 \cdot 10^{-142}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \mathbf{elif}\;t \leq 3.6 \cdot 10^{-109}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{-34}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq 1.8 \cdot 10^{+34}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y - z\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 70.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{-305}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 3.6 \cdot 10^{+48}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e-8 or 3.59999999999999983e48 < 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 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.7%

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

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

        \[\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.7%

        \[\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.7%

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

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

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

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

    if -1.7e-8 < z < -3.0000000000000001e-305 or 1.02000000000000002e-252 < z < 3.59999999999999983e48

    1. Initial program 100.0%

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

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

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

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

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

    if -3.0000000000000001e-305 < z < 1.02000000000000002e-252

    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 y around inf 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-305}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 1.02 \cdot 10^{-252}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 3.6 \cdot 10^{+48}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 68.2% accurate, 0.4× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -0.71999999999999997 or 3.1000000000000002e43 < 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 93.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-def95.7%

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

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

        \[\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.7%

        \[\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.7%

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

      \[\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 86.6%

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

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

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

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

    if -0.71999999999999997 < z < -3e-102

    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 99.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-def99.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(t, y - z, x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)\right)} \]
      2. +-commutative99.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-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{\left(-\left(y - z\right)\right)} + 1\right)\right) \]
      4. neg-sub099.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-99.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+99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(0 - \color{blue}{\left(y - \left(z + 1\right)\right)}\right)\right) \]
      7. +-commutative99.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-sub099.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-in99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, \color{blue}{-x \cdot \left(y - \left(1 + z\right)\right)}\right) \]
      10. mul-1-neg99.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-neg99.9%

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

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

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \color{blue}{\left(0 - \left(y - \left(1 + z\right)\right)\right)}\right) \]
      14. +-commutative99.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+99.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-99.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-sub099.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-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(\color{blue}{-1 \cdot \left(y - z\right)} + 1\right)\right) \]
      19. +-commutative99.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-neg99.9%

        \[\leadsto \mathsf{fma}\left(t, y - z, x \cdot \left(1 + \color{blue}{\left(-\left(y - z\right)\right)}\right)\right) \]
    5. Simplified99.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 z around 0 82.2%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(x, 1 - y, t \cdot y\right)} \]
      3. *-commutative82.2%

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

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

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

    if -3e-102 < z < 3.1000000000000002e43

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.72:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -3 \cdot 10^{-102}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 3.1 \cdot 10^{+43}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 39.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-99}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+46}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -1.7e-8)
   (* z x)
   (if (<= z -1.4e-99) x (if (<= z 3.2e+46) (* y t) (* z x)))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -1.7e-8) {
		tmp = z * x;
	} else if (z <= -1.4e-99) {
		tmp = x;
	} else if (z <= 3.2e+46) {
		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.7d-8)) then
        tmp = z * x
    else if (z <= (-1.4d-99)) then
        tmp = x
    else if (z <= 3.2d+46) 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.7e-8) {
		tmp = z * x;
	} else if (z <= -1.4e-99) {
		tmp = x;
	} else if (z <= 3.2e+46) {
		tmp = y * t;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -1.7e-8:
		tmp = z * x
	elif z <= -1.4e-99:
		tmp = x
	elif z <= 3.2e+46:
		tmp = y * t
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -1.7e-8)
		tmp = Float64(z * x);
	elseif (z <= -1.4e-99)
		tmp = x;
	elseif (z <= 3.2e+46)
		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.7e-8)
		tmp = z * x;
	elseif (z <= -1.4e-99)
		tmp = x;
	elseif (z <= 3.2e+46)
		tmp = y * t;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.7e-8], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.4e-99], x, If[LessEqual[z, 3.2e+46], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.4 \cdot 10^{-99}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 3.2 \cdot 10^{+46}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7e-8 or 3.1999999999999998e46 < 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 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.7%

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

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

        \[\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.7%

        \[\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.7%

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

      \[\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 87.6%

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

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

    if -1.7e-8 < z < -1.4e-99

    1. Initial program 100.0%

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

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

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

    if -1.4e-99 < z < 3.1999999999999998e46

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    6. Simplified48.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.7 \cdot 10^{-8}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.4 \cdot 10^{-99}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{+46}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 83.1% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -250 or 1.08e43 < 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 93.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-def95.7%

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

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

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

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

        \[\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.7%

        \[\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.7%

        \[\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.7%

        \[\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.7%

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

        \[\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.7%

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

      \[\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 86.6%

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

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

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

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

    if -250 < z < 1.08e43

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

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

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

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

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

Alternative 11: 84.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -2.3 \cdot 10^{+47}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 4.8 \cdot 10^{+16}:\\ \;\;\;\;x + z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- t x))))
   (if (<= y -2.3e+47) t_1 (if (<= y 4.8e+16) (+ x (* z (- x t))) (+ x t_1)))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -2.3e+47) {
		tmp = t_1;
	} else if (y <= 4.8e+16) {
		tmp = x + (z * (x - t));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * (t - x)
    if (y <= (-2.3d+47)) then
        tmp = t_1
    else if (y <= 4.8d+16) then
        tmp = x + (z * (x - t))
    else
        tmp = x + t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double tmp;
	if (y <= -2.3e+47) {
		tmp = t_1;
	} else if (y <= 4.8e+16) {
		tmp = x + (z * (x - t));
	} else {
		tmp = x + t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	tmp = 0
	if y <= -2.3e+47:
		tmp = t_1
	elif y <= 4.8e+16:
		tmp = x + (z * (x - t))
	else:
		tmp = x + t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(t - x))
	tmp = 0.0
	if (y <= -2.3e+47)
		tmp = t_1;
	elseif (y <= 4.8e+16)
		tmp = Float64(x + Float64(z * Float64(x - t)));
	else
		tmp = Float64(x + t_1);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * (t - x);
	tmp = 0.0;
	if (y <= -2.3e+47)
		tmp = t_1;
	elseif (y <= 4.8e+16)
		tmp = x + (z * (x - t));
	else
		tmp = x + 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, -2.3e+47], t$95$1, If[LessEqual[y, 4.8e+16], N[(x + N[(z * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.2999999999999999e47

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

      \[\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.8%

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

        \[\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.8%

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

        \[\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.8%

        \[\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.8%

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

        \[\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.8%

        \[\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.8%

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

        \[\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.8%

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

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

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

        \[\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.8%

        \[\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.8%

        \[\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.8%

        \[\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.8%

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

        \[\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.8%

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

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

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

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

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

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

    if -2.2999999999999999e47 < y < 4.8e16

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

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

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

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

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

    if 4.8e16 < y

    1. Initial program 100.0%

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

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

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

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

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

Alternative 12: 37.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.7e-8 or 2.6000000000000001e-8 < 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 94.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-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 87.2%

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

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

    if -1.7e-8 < z < 2.6000000000000001e-8

    1. Initial program 100.0%

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

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

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

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

Alternative 13: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 14: 17.4% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification14.6%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.1% 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 2024019 
(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))))