Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.4s
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: 38.0% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+121}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+78}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-67}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-272}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-84}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-7}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -2.5e+121)
   (* z x)
   (if (<= z -2.7e+78)
     (* y t)
     (if (<= z -1.0)
       (* z x)
       (if (<= z -2.5e-67)
         x
         (if (<= z -1.05e-272)
           (* y t)
           (if (<= z 6.4e-84) x (if (<= z 1.85e-7) (* y t) (* z x)))))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -2.5e+121) {
		tmp = z * x;
	} else if (z <= -2.7e+78) {
		tmp = y * t;
	} else if (z <= -1.0) {
		tmp = z * x;
	} else if (z <= -2.5e-67) {
		tmp = x;
	} else if (z <= -1.05e-272) {
		tmp = y * t;
	} else if (z <= 6.4e-84) {
		tmp = x;
	} else if (z <= 1.85e-7) {
		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 <= (-2.5d+121)) then
        tmp = z * x
    else if (z <= (-2.7d+78)) then
        tmp = y * t
    else if (z <= (-1.0d0)) then
        tmp = z * x
    else if (z <= (-2.5d-67)) then
        tmp = x
    else if (z <= (-1.05d-272)) then
        tmp = y * t
    else if (z <= 6.4d-84) then
        tmp = x
    else if (z <= 1.85d-7) 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 <= -2.5e+121) {
		tmp = z * x;
	} else if (z <= -2.7e+78) {
		tmp = y * t;
	} else if (z <= -1.0) {
		tmp = z * x;
	} else if (z <= -2.5e-67) {
		tmp = x;
	} else if (z <= -1.05e-272) {
		tmp = y * t;
	} else if (z <= 6.4e-84) {
		tmp = x;
	} else if (z <= 1.85e-7) {
		tmp = y * t;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if z <= -2.5e+121:
		tmp = z * x
	elif z <= -2.7e+78:
		tmp = y * t
	elif z <= -1.0:
		tmp = z * x
	elif z <= -2.5e-67:
		tmp = x
	elif z <= -1.05e-272:
		tmp = y * t
	elif z <= 6.4e-84:
		tmp = x
	elif z <= 1.85e-7:
		tmp = y * t
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -2.5e+121)
		tmp = Float64(z * x);
	elseif (z <= -2.7e+78)
		tmp = Float64(y * t);
	elseif (z <= -1.0)
		tmp = Float64(z * x);
	elseif (z <= -2.5e-67)
		tmp = x;
	elseif (z <= -1.05e-272)
		tmp = Float64(y * t);
	elseif (z <= 6.4e-84)
		tmp = x;
	elseif (z <= 1.85e-7)
		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 <= -2.5e+121)
		tmp = z * x;
	elseif (z <= -2.7e+78)
		tmp = y * t;
	elseif (z <= -1.0)
		tmp = z * x;
	elseif (z <= -2.5e-67)
		tmp = x;
	elseif (z <= -1.05e-272)
		tmp = y * t;
	elseif (z <= 6.4e-84)
		tmp = x;
	elseif (z <= 1.85e-7)
		tmp = y * t;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.5e+121], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.7e+78], N[(y * t), $MachinePrecision], If[LessEqual[z, -1.0], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.5e-67], x, If[LessEqual[z, -1.05e-272], N[(y * t), $MachinePrecision], If[LessEqual[z, 6.4e-84], x, If[LessEqual[z, 1.85e-7], N[(y * t), $MachinePrecision], N[(z * x), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+121}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -2.7 \cdot 10^{+78}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq -1:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-67}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-272}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{-84}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.85 \cdot 10^{-7}:\\
\;\;\;\;y \cdot t\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified51.0%

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

    if -2.50000000000000004e121 < z < -2.70000000000000004e78 or -2.4999999999999999e-67 < z < -1.04999999999999993e-272 or 6.3999999999999999e-84 < z < 1.85000000000000002e-7

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified44.4%

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

    if -1 < z < -2.4999999999999999e-67 or -1.04999999999999993e-272 < z < 6.3999999999999999e-84

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.5 \cdot 10^{+121}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.7 \cdot 10^{+78}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq -1:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-67}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-272}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{-84}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{-7}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 68.1% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;y \leq 2.05 \cdot 10^{-278}:\\
\;\;\;\;t\_2\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7300 or 1e18 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7300 < y < 2.05000000000000001e-278 or 9.9999999999999993e-245 < y < 1.4000000000000001e-29

    1. Initial program 99.9%

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

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

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

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

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

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

        \[\leadsto x - \color{blue}{\left(z \cdot t + z \cdot \left(-x\right)\right)} \]
    7. Applied egg-rr88.8%

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

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

    if 2.05000000000000001e-278 < y < 9.9999999999999993e-245

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e-29 < y < 1e18

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7300:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 2.05 \cdot 10^{-278}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 10^{-244}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.4 \cdot 10^{-29}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 10^{+18}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 74.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.25 \cdot 10^{-102} \lor \neg \left(x \leq 1.5 \cdot 10^{-94} \lor \neg \left(x \leq 7.5 \cdot 10^{-30}\right) \land x \leq 8.5 \cdot 10^{+65}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.25e-102 or 1.5000000000000001e-94 < x < 7.5000000000000006e-30 or 8.50000000000000075e65 < x

    1. Initial program 100.0%

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

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

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

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

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

    if -2.25e-102 < x < 1.5000000000000001e-94 or 7.5000000000000006e-30 < x < 8.50000000000000075e65

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{-102} \lor \neg \left(x \leq 1.5 \cdot 10^{-94} \lor \neg \left(x \leq 7.5 \cdot 10^{-30}\right) \land x \leq 8.5 \cdot 10^{+65}\right):\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 83.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ \mathbf{if}\;y \leq -51000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+18}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+67}:\\ \;\;\;\;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 -51000000.0)
     t_1
     (if (<= y 3.6e+18)
       (- x (* z (- t x)))
       (if (<= y 2.1e+57)
         (* x (+ (- z y) 1.0))
         (if (<= y 6.6e+67) (* 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 <= -51000000.0) {
		tmp = t_1;
	} else if (y <= 3.6e+18) {
		tmp = x - (z * (t - x));
	} else if (y <= 2.1e+57) {
		tmp = x * ((z - y) + 1.0);
	} else if (y <= 6.6e+67) {
		tmp = 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 <= (-51000000.0d0)) then
        tmp = t_1
    else if (y <= 3.6d+18) then
        tmp = x - (z * (t - x))
    else if (y <= 2.1d+57) then
        tmp = x * ((z - y) + 1.0d0)
    else if (y <= 6.6d+67) then
        tmp = 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 <= -51000000.0) {
		tmp = t_1;
	} else if (y <= 3.6e+18) {
		tmp = x - (z * (t - x));
	} else if (y <= 2.1e+57) {
		tmp = x * ((z - y) + 1.0);
	} else if (y <= 6.6e+67) {
		tmp = 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 <= -51000000.0:
		tmp = t_1
	elif y <= 3.6e+18:
		tmp = x - (z * (t - x))
	elif y <= 2.1e+57:
		tmp = x * ((z - y) + 1.0)
	elif y <= 6.6e+67:
		tmp = 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 <= -51000000.0)
		tmp = t_1;
	elseif (y <= 3.6e+18)
		tmp = Float64(x - Float64(z * Float64(t - x)));
	elseif (y <= 2.1e+57)
		tmp = Float64(x * Float64(Float64(z - y) + 1.0));
	elseif (y <= 6.6e+67)
		tmp = 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 <= -51000000.0)
		tmp = t_1;
	elseif (y <= 3.6e+18)
		tmp = x - (z * (t - x));
	elseif (y <= 2.1e+57)
		tmp = x * ((z - y) + 1.0);
	elseif (y <= 6.6e+67)
		tmp = 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, -51000000.0], t$95$1, If[LessEqual[y, 3.6e+18], N[(x - N[(z * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+57], N[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+67], N[(z * N[(x - t), $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 -51000000:\\
\;\;\;\;t\_1\\

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -5.1e7

    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.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-def98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.1e7 < y < 3.6e18

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

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

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

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

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

    if 3.6e18 < y < 2.09999999999999991e57

    1. Initial program 100.0%

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

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

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

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

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

    if 2.09999999999999991e57 < y < 6.6000000000000006e67

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.6000000000000006e67 < 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 90.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -51000000:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 3.6 \cdot 10^{+18}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{+57}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{+67}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq -4.5 \cdot 10^{+186}:\\
\;\;\;\;y \cdot \left(-x\right)\\

\mathbf{elif}\;x \leq -1.8 \cdot 10^{+95} \lor \neg \left(x \leq 1.45 \cdot 10^{+110}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -3.5000000000000002e247 or -4.50000000000000045e186 < x < -1.79999999999999989e95 or 1.45e110 < x

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

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

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

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

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    6. Step-by-step derivation
      1. sub-neg72.2%

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

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

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

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

    if -3.5000000000000002e247 < x < -4.50000000000000045e186

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

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

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

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

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

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

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

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

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

    if -1.79999999999999989e95 < x < 1.45e110

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{+247}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -4.5 \cdot 10^{+186}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;x \leq -1.8 \cdot 10^{+95} \lor \neg \left(x \leq 1.45 \cdot 10^{+110}\right):\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 53.7% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t \leq 7.5 \cdot 10^{-230}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-212}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;t \leq 4 \cdot 10^{-31}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -5.40000000000000057e-138 or 4e-31 < 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 92.9%

      \[\leadsto \color{blue}{t \cdot \left(y - z\right) + x \cdot \left(1 + -1 \cdot \left(y - z\right)\right)} \]
    4. Step-by-step derivation
      1. fma-def96.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 t around inf 68.0%

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

    if -5.40000000000000057e-138 < t < 7.50000000000000006e-230 or 5.2e-212 < t < 4e-31

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

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

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

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

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

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

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

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

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

    if 7.50000000000000006e-230 < t < 5.2e-212

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

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

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

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

      \[\leadsto \color{blue}{x - z \cdot \left(t - x\right)} \]
    6. Step-by-step derivation
      1. sub-neg100.0%

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified86.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -5.4 \cdot 10^{-138}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq 7.5 \cdot 10^{-230}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-212}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;t \leq 4 \cdot 10^{-31}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 38.3% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -5200:\\
\;\;\;\;y \cdot t\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.80000000000000003e86 or 6e19 < y

    1. Initial program 100.0%

      \[x + \left(y - z\right) \cdot \left(t - x\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 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-def97.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.80000000000000003e86 < y < -5200

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified71.7%

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

    if -5200 < y < -1.5e-192

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified55.6%

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

    if -1.5e-192 < y < 6e19

    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.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 t around inf 49.0%

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot z} \]
      2. *-commutative41.9%

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot t\right)} \]
      3. mul-1-neg41.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+86}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -5200:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-192}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 6 \cdot 10^{+19}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.0% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -5200:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -3.3 \cdot 10^{-194}:\\
\;\;\;\;z \cdot x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -5200 or 5.50000000000000021e97 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified44.0%

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

    if -5200 < y < -3.2999999999999999e-194

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    11. Simplified55.6%

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

    if -3.2999999999999999e-194 < y < 5.50000000000000021e97

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(-1 \cdot t\right) \cdot z} \]
      2. *-commutative40.0%

        \[\leadsto \color{blue}{z \cdot \left(-1 \cdot t\right)} \]
      3. mul-1-neg40.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5200:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -3.3 \cdot 10^{-194}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;y \leq 5.5 \cdot 10^{+97}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 81.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.000205 \lor \neg \left(x \leq 2.7 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.05e-4 or 2.7e66 < x

    1. Initial program 100.0%

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

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

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

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

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

    if -2.05e-4 < x < 2.7e66

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

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

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

Alternative 11: 67.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -122000000 \lor \neg \left(y \leq 6.6 \cdot 10^{+67}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.22e8 or 6.6000000000000006e67 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.22e8 < y < 6.6000000000000006e67

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 37.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.10000000000000001e-44 or 1.65000000000000013e-32 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    9. Simplified37.0%

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

    if -2.10000000000000001e-44 < y < 1.65000000000000013e-32

    1. Initial program 100.0%

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

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

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

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

Alternative 13: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 14: 18.3% 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 60.3%

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

    \[\leadsto \color{blue}{x} \]
  5. Final simplification16.0%

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 96.6% accurate, 0.6× speedup?

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

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

Reproduce

?
herbie shell --seed 2024031 
(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))))