Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.1s
Alternatives: 18
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

      \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(t - x\right) + x} \]
    2. fma-define100.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. Add Preprocessing

Alternative 2: 72.4% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+65} \lor \neg \left(t \leq -4800000000000 \lor \neg \left(t \leq -3.35 \cdot 10^{-100}\right) \land t \leq 1.75 \cdot 10^{-39}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.04999999999999996e65 or -4.8e12 < t < -3.34999999999999986e-100 or 1.75e-39 < t

    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-define100.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. Taylor expanded in t around inf 87.4%

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

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

    if -1.04999999999999996e65 < t < -4.8e12 or -3.34999999999999986e-100 < t < 1.75e-39

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.05 \cdot 10^{+65} \lor \neg \left(t \leq -4800000000000 \lor \neg \left(t \leq -3.35 \cdot 10^{-100}\right) \land t \leq 1.75 \cdot 10^{-39}\right):\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 71.0% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -7.80000000000000039e87 or 6e9 < 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.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+90.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      4. mul-1-neg90.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} - \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      6. div-sub90.0%

        \[\leadsto y \cdot \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} + \left(t - x\right)\right) \]
      7. unsub-neg90.0%

        \[\leadsto y \cdot \left(\frac{\color{blue}{x + \left(-z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      8. mul-1-neg90.0%

        \[\leadsto y \cdot \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      9. +-commutative90.0%

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

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

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

    if -7.80000000000000039e87 < y < -1.99999999999999992e28

    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-define100.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. Taylor expanded in t around inf 88.5%

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

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

    if -1.99999999999999992e28 < y < -8.0000000000000003e-61

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

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

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

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

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

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

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

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

    if -8.0000000000000003e-61 < y < 6e9

    1. Initial program 99.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.8 \cdot 10^{+87}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+28}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq -8 \cdot 10^{-61}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 6000000000:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 68.0% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.35000000000000008e88 or 8.8e11 < 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.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+90.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      4. mul-1-neg90.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} - \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      6. div-sub90.0%

        \[\leadsto y \cdot \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} + \left(t - x\right)\right) \]
      7. unsub-neg90.0%

        \[\leadsto y \cdot \left(\frac{\color{blue}{x + \left(-z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      8. mul-1-neg90.0%

        \[\leadsto y \cdot \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      9. +-commutative90.0%

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

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

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

    if -1.35000000000000008e88 < y < -4.79999999999999995e27

    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-define100.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. Taylor expanded in t around inf 88.5%

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

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

    if -4.79999999999999995e27 < y < 4.3000000000000003e-297

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

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

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

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

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

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

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

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

    if 4.3000000000000003e-297 < y < 8.8e11

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.35 \cdot 10^{+88}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4.8 \cdot 10^{+27}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-297}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 880000000000:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.7% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.70000000000000031e87 or 1.45e14 < 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.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+90.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      4. mul-1-neg90.0%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} - \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      6. div-sub90.0%

        \[\leadsto y \cdot \left(\color{blue}{\frac{x - z \cdot \left(t - x\right)}{y}} + \left(t - x\right)\right) \]
      7. unsub-neg90.0%

        \[\leadsto y \cdot \left(\frac{\color{blue}{x + \left(-z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      8. mul-1-neg90.0%

        \[\leadsto y \cdot \left(\frac{x + \color{blue}{-1 \cdot \left(z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      9. +-commutative90.0%

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

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

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

    if -7.70000000000000031e87 < y < -7.19999999999999966e27 or 2.50000000000000015e-296 < y < 1.45e14

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(t - x\right) + x} \]
      2. fma-define100.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. Taylor expanded in t around inf 84.1%

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

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

    if -7.19999999999999966e27 < y < 2.50000000000000015e-296

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7.7 \cdot 10^{+87}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -7.2 \cdot 10^{+27}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{elif}\;y \leq 2.5 \cdot 10^{-296}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 1.45 \cdot 10^{+14}:\\ \;\;\;\;\left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 39.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 1.25 \cdot 10^{-277}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 2 \cdot 10^{-17}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.2e63 or 2.00000000000000014e-17 < z

    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-define100.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. Taylor expanded in t around inf 58.0%

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

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

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

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

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

    if -1.2e63 < z < 1.25e-277

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

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+83.8%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      4. mul-1-neg83.8%

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

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

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

        \[\leadsto y \cdot \left(\frac{\color{blue}{x + \left(-z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      8. mul-1-neg85.4%

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

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

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

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

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

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

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

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

    if 1.25e-277 < z < 2.00000000000000014e-17

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.2 \cdot 10^{+63}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 1.25 \cdot 10^{-277}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2 \cdot 10^{-17}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 38.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-279}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.9999999999999996e50 or 6.5000000000000001e-14 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -5.9999999999999996e50 < z < 6.8000000000000003e-279

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

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+84.7%

        \[\leadsto y \cdot \color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + \left(t - x\right)\right)} \]
      3. +-commutative84.7%

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} + -1 \cdot \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      4. mul-1-neg84.7%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} - \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      6. div-sub85.1%

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(1 - \frac{z}{y}\right)}\right) \]
    8. Simplified49.0%

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

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

    if 6.8000000000000003e-279 < z < 6.5000000000000001e-14

    1. Initial program 99.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+50}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-279}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 84.1% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+70} \lor \neg \left(y \leq 1.08 \cdot 10^{+15}\right):\\
\;\;\;\;y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.3e70 or 1.08e15 < 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.2%

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+90.2%

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

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

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\frac{x}{y} - \frac{z \cdot \left(t - x\right)}{y}\right)} + \left(t - x\right)\right) \]
      6. div-sub90.2%

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

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

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

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

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

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

    if -1.3e70 < y < 1.08e15

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 9: 80.2% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.22 \cdot 10^{-100} \lor \neg \left(t \leq 4.9 \cdot 10^{-54}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.2199999999999999e-100 or 4.90000000000000021e-54 < t

    1. Initial program 100.0%

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

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

    if -2.2199999999999999e-100 < t < 4.90000000000000021e-54

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 10: 83.4% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+51} \lor \neg \left(z \leq 4 \cdot 10^{+44}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.02e51 or 4.0000000000000004e44 < 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 81.6%

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

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

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

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

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

    if -1.02e51 < z < 4.0000000000000004e44

    1. Initial program 99.9%

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

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

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

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

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

Alternative 11: 70.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+51} \lor \neg \left(z \leq 2.1 \cdot 10^{-15}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5e51 or 2.09999999999999981e-15 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -5e51 < z < 2.09999999999999981e-15

    1. Initial program 99.9%

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

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

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

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

Alternative 12: 62.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.22 \cdot 10^{-100} \lor \neg \left(t \leq 3.7 \cdot 10^{-61}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.2199999999999999e-100 or 3.7e-61 < t

    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-define100.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. Taylor expanded in t around inf 84.1%

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

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

    if -2.2199999999999999e-100 < t < 3.7e-61

    1. Initial program 99.9%

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

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

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

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

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

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

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

Alternative 13: 62.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.2 \cdot 10^{-100} \lor \neg \left(t \leq 7.4 \cdot 10^{-38}\right):\\
\;\;\;\;\left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -3.20000000000000017e-100 or 7.4e-38 < t

    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-define100.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. Taylor expanded in t around inf 84.4%

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

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

    if -3.20000000000000017e-100 < t < 7.4e-38

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

Alternative 14: 54.7% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.0999999999999996e149

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

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

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

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

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

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

    if -4.0999999999999996e149 < x < 1.2499999999999999e32

    1. Initial program 99.9%

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

        \[\leadsto \color{blue}{\left(y - z\right) \cdot \left(t - x\right) + x} \]
      2. fma-define100.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. Taylor expanded in t around inf 80.5%

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

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

    if 1.2499999999999999e32 < 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 92.8%

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

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

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

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

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

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

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

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

Alternative 15: 35.5% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \leq 1.45 \cdot 10^{+20}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.64999999999999998e91

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

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

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

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

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

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

    if -2.64999999999999998e91 < x < 1.45e20

    1. Initial program 99.9%

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

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

        \[\leadsto y \cdot \left(\color{blue}{\left(\left(-1 \cdot \frac{z \cdot \left(t - x\right)}{y} + \frac{x}{y}\right) + t\right)} - x\right) \]
      2. associate--l+86.4%

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

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

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

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

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

        \[\leadsto y \cdot \left(\frac{\color{blue}{x + \left(-z \cdot \left(t - x\right)\right)}}{y} + \left(t - x\right)\right) \]
      8. mul-1-neg86.4%

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

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

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

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

        \[\leadsto y \cdot \left(t \cdot \left(1 + \color{blue}{\left(-\frac{z}{y}\right)}\right)\right) \]
      2. sub-neg58.6%

        \[\leadsto y \cdot \left(t \cdot \color{blue}{\left(1 - \frac{z}{y}\right)}\right) \]
    8. Simplified58.6%

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

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

    if 1.45e20 < 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 91.1%

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

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

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

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

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

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

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

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

Alternative 16: 36.7% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -1 < z < 6.5000000000000001e-14

    1. Initial program 99.9%

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

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

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

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

Alternative 17: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 18: 17.5% accurate, 9.0× speedup?

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

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

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

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

    \[\leadsto \color{blue}{x} \]
  5. Add Preprocessing

Developer Target 1: 96.1% accurate, 0.6× speedup?

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

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

Reproduce

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

  :alt
  (! :herbie-platform default (+ x (+ (* t (- y z)) (* (- x) (- y z)))))

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