Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 10.6s
Alternatives: 13
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 13 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: 61.7% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(z + 1\right)\\ t_2 := y \cdot \left(t - x\right)\\ t_3 := z \cdot \left(-t\right)\\ \mathbf{if}\;y \leq -8.2 \cdot 10^{+39}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-129}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.34 \cdot 10^{-188}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-266}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-180}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{-49}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq 1.2:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (+ z 1.0))) (t_2 (* y (- t x))) (t_3 (* z (- t))))
   (if (<= y -8.2e+39)
     t_2
     (if (<= y -6.5e-129)
       t_3
       (if (<= y -1.34e-188)
         t_1
         (if (<= y -3.2e-266)
           t_3
           (if (<= y 2.3e-180)
             t_1
             (if (<= y 9.5e-98)
               t_3
               (if (<= y 6.6e-56)
                 t_1
                 (if (<= y 3.15e-49) t_3 (if (<= y 1.2) t_1 t_2)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double t_3 = z * -t;
	double tmp;
	if (y <= -8.2e+39) {
		tmp = t_2;
	} else if (y <= -6.5e-129) {
		tmp = t_3;
	} else if (y <= -1.34e-188) {
		tmp = t_1;
	} else if (y <= -3.2e-266) {
		tmp = t_3;
	} else if (y <= 2.3e-180) {
		tmp = t_1;
	} else if (y <= 9.5e-98) {
		tmp = t_3;
	} else if (y <= 6.6e-56) {
		tmp = t_1;
	} else if (y <= 3.15e-49) {
		tmp = t_3;
	} else if (y <= 1.2) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = x * (z + 1.0d0)
    t_2 = y * (t - x)
    t_3 = z * -t
    if (y <= (-8.2d+39)) then
        tmp = t_2
    else if (y <= (-6.5d-129)) then
        tmp = t_3
    else if (y <= (-1.34d-188)) then
        tmp = t_1
    else if (y <= (-3.2d-266)) then
        tmp = t_3
    else if (y <= 2.3d-180) then
        tmp = t_1
    else if (y <= 9.5d-98) then
        tmp = t_3
    else if (y <= 6.6d-56) then
        tmp = t_1
    else if (y <= 3.15d-49) then
        tmp = t_3
    else if (y <= 1.2d0) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (z + 1.0);
	double t_2 = y * (t - x);
	double t_3 = z * -t;
	double tmp;
	if (y <= -8.2e+39) {
		tmp = t_2;
	} else if (y <= -6.5e-129) {
		tmp = t_3;
	} else if (y <= -1.34e-188) {
		tmp = t_1;
	} else if (y <= -3.2e-266) {
		tmp = t_3;
	} else if (y <= 2.3e-180) {
		tmp = t_1;
	} else if (y <= 9.5e-98) {
		tmp = t_3;
	} else if (y <= 6.6e-56) {
		tmp = t_1;
	} else if (y <= 3.15e-49) {
		tmp = t_3;
	} else if (y <= 1.2) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (z + 1.0)
	t_2 = y * (t - x)
	t_3 = z * -t
	tmp = 0
	if y <= -8.2e+39:
		tmp = t_2
	elif y <= -6.5e-129:
		tmp = t_3
	elif y <= -1.34e-188:
		tmp = t_1
	elif y <= -3.2e-266:
		tmp = t_3
	elif y <= 2.3e-180:
		tmp = t_1
	elif y <= 9.5e-98:
		tmp = t_3
	elif y <= 6.6e-56:
		tmp = t_1
	elif y <= 3.15e-49:
		tmp = t_3
	elif y <= 1.2:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(z + 1.0))
	t_2 = Float64(y * Float64(t - x))
	t_3 = Float64(z * Float64(-t))
	tmp = 0.0
	if (y <= -8.2e+39)
		tmp = t_2;
	elseif (y <= -6.5e-129)
		tmp = t_3;
	elseif (y <= -1.34e-188)
		tmp = t_1;
	elseif (y <= -3.2e-266)
		tmp = t_3;
	elseif (y <= 2.3e-180)
		tmp = t_1;
	elseif (y <= 9.5e-98)
		tmp = t_3;
	elseif (y <= 6.6e-56)
		tmp = t_1;
	elseif (y <= 3.15e-49)
		tmp = t_3;
	elseif (y <= 1.2)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (z + 1.0);
	t_2 = y * (t - x);
	t_3 = z * -t;
	tmp = 0.0;
	if (y <= -8.2e+39)
		tmp = t_2;
	elseif (y <= -6.5e-129)
		tmp = t_3;
	elseif (y <= -1.34e-188)
		tmp = t_1;
	elseif (y <= -3.2e-266)
		tmp = t_3;
	elseif (y <= 2.3e-180)
		tmp = t_1;
	elseif (y <= 9.5e-98)
		tmp = t_3;
	elseif (y <= 6.6e-56)
		tmp = t_1;
	elseif (y <= 3.15e-49)
		tmp = t_3;
	elseif (y <= 1.2)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[y, -8.2e+39], t$95$2, If[LessEqual[y, -6.5e-129], t$95$3, If[LessEqual[y, -1.34e-188], t$95$1, If[LessEqual[y, -3.2e-266], t$95$3, If[LessEqual[y, 2.3e-180], t$95$1, If[LessEqual[y, 9.5e-98], t$95$3, If[LessEqual[y, 6.6e-56], t$95$1, If[LessEqual[y, 3.15e-49], t$95$3, If[LessEqual[y, 1.2], t$95$1, t$95$2]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -6.5 \cdot 10^{-129}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -1.34 \cdot 10^{-188}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -3.2 \cdot 10^{-266}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 2.3 \cdot 10^{-180}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 6.6 \cdot 10^{-56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 3.15 \cdot 10^{-49}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq 1.2:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.20000000000000008e39 or 1.19999999999999996 < 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 79.5%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
      4. sub-neg73.9%

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

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

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

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

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

    if -8.20000000000000008e39 < y < -6.49999999999999952e-129 or -1.34e-188 < y < -3.2e-266 or 2.29999999999999996e-180 < y < 9.5000000000000001e-98 or 6.59999999999999967e-56 < y < 3.1499999999999998e-49

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -6.49999999999999952e-129 < y < -1.34e-188 or -3.2e-266 < y < 2.29999999999999996e-180 or 9.5000000000000001e-98 < y < 6.59999999999999967e-56 or 3.1499999999999998e-49 < y < 1.19999999999999996

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.2 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{-129}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -1.34 \cdot 10^{-188}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{-266}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 2.3 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{-98}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 6.6 \cdot 10^{-56}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 3.15 \cdot 10^{-49}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 1.2:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 45.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{-102}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-139}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-292}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{-255}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.16 \cdot 10^{-93}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+84} \lor \neg \left(x \leq 1.2 \cdot 10^{+135}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* x (+ z 1.0))))
   (if (<= x -2.5e-102)
     t_2
     (if (<= x -2.6e-139)
       (* y t)
       (if (<= x 6.2e-292)
         t_1
         (if (<= x 4.3e-255)
           (* y t)
           (if (<= x 1.16e-93)
             t_1
             (if (or (<= x 4.1e+84) (not (<= x 1.2e+135)))
               t_2
               (* y (- x))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (x <= -2.5e-102) {
		tmp = t_2;
	} else if (x <= -2.6e-139) {
		tmp = y * t;
	} else if (x <= 6.2e-292) {
		tmp = t_1;
	} else if (x <= 4.3e-255) {
		tmp = y * t;
	} else if (x <= 1.16e-93) {
		tmp = t_1;
	} else if ((x <= 4.1e+84) || !(x <= 1.2e+135)) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * -t
    t_2 = x * (z + 1.0d0)
    if (x <= (-2.5d-102)) then
        tmp = t_2
    else if (x <= (-2.6d-139)) then
        tmp = y * t
    else if (x <= 6.2d-292) then
        tmp = t_1
    else if (x <= 4.3d-255) then
        tmp = y * t
    else if (x <= 1.16d-93) then
        tmp = t_1
    else if ((x <= 4.1d+84) .or. (.not. (x <= 1.2d+135))) then
        tmp = t_2
    else
        tmp = y * -x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (x <= -2.5e-102) {
		tmp = t_2;
	} else if (x <= -2.6e-139) {
		tmp = y * t;
	} else if (x <= 6.2e-292) {
		tmp = t_1;
	} else if (x <= 4.3e-255) {
		tmp = y * t;
	} else if (x <= 1.16e-93) {
		tmp = t_1;
	} else if ((x <= 4.1e+84) || !(x <= 1.2e+135)) {
		tmp = t_2;
	} else {
		tmp = y * -x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = x * (z + 1.0)
	tmp = 0
	if x <= -2.5e-102:
		tmp = t_2
	elif x <= -2.6e-139:
		tmp = y * t
	elif x <= 6.2e-292:
		tmp = t_1
	elif x <= 4.3e-255:
		tmp = y * t
	elif x <= 1.16e-93:
		tmp = t_1
	elif (x <= 4.1e+84) or not (x <= 1.2e+135):
		tmp = t_2
	else:
		tmp = y * -x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(x * Float64(z + 1.0))
	tmp = 0.0
	if (x <= -2.5e-102)
		tmp = t_2;
	elseif (x <= -2.6e-139)
		tmp = Float64(y * t);
	elseif (x <= 6.2e-292)
		tmp = t_1;
	elseif (x <= 4.3e-255)
		tmp = Float64(y * t);
	elseif (x <= 1.16e-93)
		tmp = t_1;
	elseif ((x <= 4.1e+84) || !(x <= 1.2e+135))
		tmp = t_2;
	else
		tmp = Float64(y * Float64(-x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = x * (z + 1.0);
	tmp = 0.0;
	if (x <= -2.5e-102)
		tmp = t_2;
	elseif (x <= -2.6e-139)
		tmp = y * t;
	elseif (x <= 6.2e-292)
		tmp = t_1;
	elseif (x <= 4.3e-255)
		tmp = y * t;
	elseif (x <= 1.16e-93)
		tmp = t_1;
	elseif ((x <= 4.1e+84) || ~((x <= 1.2e+135)))
		tmp = t_2;
	else
		tmp = y * -x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-102], t$95$2, If[LessEqual[x, -2.6e-139], N[(y * t), $MachinePrecision], If[LessEqual[x, 6.2e-292], t$95$1, If[LessEqual[x, 4.3e-255], N[(y * t), $MachinePrecision], If[LessEqual[x, 1.16e-93], t$95$1, If[Or[LessEqual[x, 4.1e+84], N[Not[LessEqual[x, 1.2e+135]], $MachinePrecision]], t$95$2, N[(y * (-x)), $MachinePrecision]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -2.6 \cdot 10^{-139}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq 6.2 \cdot 10^{-292}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 4.3 \cdot 10^{-255}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;x \leq 1.16 \cdot 10^{-93}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{+84} \lor \neg \left(x \leq 1.2 \cdot 10^{+135}\right):\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.50000000000000013e-102 or 1.15999999999999998e-93 < x < 4.1000000000000003e84 or 1.19999999999999999e135 < 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 68.5%

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000013e-102 < x < -2.5999999999999998e-139 or 6.1999999999999999e-292 < x < 4.29999999999999989e-255

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5999999999999998e-139 < x < 6.1999999999999999e-292 or 4.29999999999999989e-255 < x < 1.15999999999999998e-93

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

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

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

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

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

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

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

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

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

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

    if 4.1000000000000003e84 < x < 1.19999999999999999e135

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-y \cdot x} \]
      3. distribute-rgt-neg-in51.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-102}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;x \leq -2.6 \cdot 10^{-139}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-292}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;x \leq 4.3 \cdot 10^{-255}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;x \leq 1.16 \cdot 10^{-93}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{+84} \lor \neg \left(x \leq 1.2 \cdot 10^{+135}\right):\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 46.7% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - y\right)\\ t_2 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -4 \cdot 10^{+198}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq -43000000000:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-267}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-185}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-159}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+31}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 y))) (t_2 (* z (- t))))
   (if (<= z -4e+198)
     (* x (+ z 1.0))
     (if (<= z -43000000000.0)
       t_2
       (if (<= z 6e-267)
         t_1
         (if (<= z 1.36e-185)
           (* y t)
           (if (<= z 4.8e-159) t_1 (if (<= z 2.9e+31) (* y t) t_2))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = z * -t;
	double tmp;
	if (z <= -4e+198) {
		tmp = x * (z + 1.0);
	} else if (z <= -43000000000.0) {
		tmp = t_2;
	} else if (z <= 6e-267) {
		tmp = t_1;
	} else if (z <= 1.36e-185) {
		tmp = y * t;
	} else if (z <= 4.8e-159) {
		tmp = t_1;
	} else if (z <= 2.9e+31) {
		tmp = y * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - y)
    t_2 = z * -t
    if (z <= (-4d+198)) then
        tmp = x * (z + 1.0d0)
    else if (z <= (-43000000000.0d0)) then
        tmp = t_2
    else if (z <= 6d-267) then
        tmp = t_1
    else if (z <= 1.36d-185) then
        tmp = y * t
    else if (z <= 4.8d-159) then
        tmp = t_1
    else if (z <= 2.9d+31) then
        tmp = y * t
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x * (1.0 - y);
	double t_2 = z * -t;
	double tmp;
	if (z <= -4e+198) {
		tmp = x * (z + 1.0);
	} else if (z <= -43000000000.0) {
		tmp = t_2;
	} else if (z <= 6e-267) {
		tmp = t_1;
	} else if (z <= 1.36e-185) {
		tmp = y * t;
	} else if (z <= 4.8e-159) {
		tmp = t_1;
	} else if (z <= 2.9e+31) {
		tmp = y * t;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x * (1.0 - y)
	t_2 = z * -t
	tmp = 0
	if z <= -4e+198:
		tmp = x * (z + 1.0)
	elif z <= -43000000000.0:
		tmp = t_2
	elif z <= 6e-267:
		tmp = t_1
	elif z <= 1.36e-185:
		tmp = y * t
	elif z <= 4.8e-159:
		tmp = t_1
	elif z <= 2.9e+31:
		tmp = y * t
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x * Float64(1.0 - y))
	t_2 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -4e+198)
		tmp = Float64(x * Float64(z + 1.0));
	elseif (z <= -43000000000.0)
		tmp = t_2;
	elseif (z <= 6e-267)
		tmp = t_1;
	elseif (z <= 1.36e-185)
		tmp = Float64(y * t);
	elseif (z <= 4.8e-159)
		tmp = t_1;
	elseif (z <= 2.9e+31)
		tmp = Float64(y * t);
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x * (1.0 - y);
	t_2 = z * -t;
	tmp = 0.0;
	if (z <= -4e+198)
		tmp = x * (z + 1.0);
	elseif (z <= -43000000000.0)
		tmp = t_2;
	elseif (z <= 6e-267)
		tmp = t_1;
	elseif (z <= 1.36e-185)
		tmp = y * t;
	elseif (z <= 4.8e-159)
		tmp = t_1;
	elseif (z <= 2.9e+31)
		tmp = y * t;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -4e+198], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -43000000000.0], t$95$2, If[LessEqual[z, 6e-267], t$95$1, If[LessEqual[z, 1.36e-185], N[(y * t), $MachinePrecision], If[LessEqual[z, 4.8e-159], t$95$1, If[LessEqual[z, 2.9e+31], N[(y * t), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -43000000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 6 \cdot 10^{-267}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.36 \cdot 10^{-185}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 4.8 \cdot 10^{-159}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 2.9 \cdot 10^{+31}:\\
\;\;\;\;y \cdot t\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000007e198 < z < -4.3e10 or 2.9e31 < z

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

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

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

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

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

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

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

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

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

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

    if -4.3e10 < z < 5.9999999999999999e-267 or 1.36e-185 < z < 4.79999999999999995e-159

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

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

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

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

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

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

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

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

    if 5.9999999999999999e-267 < z < 1.36e-185 or 4.79999999999999995e-159 < z < 2.9e31

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified60.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4 \cdot 10^{+198}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq -43000000000:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-267}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{-185}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{-159}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 2.9 \cdot 10^{+31}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 64.9% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;x \leq 3.3 \cdot 10^{-292}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 3.2 \cdot 10^{-30}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.5e-102 or 3.2e-30 < 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 80.0%

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

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

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

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

    if -1.5e-102 < x < -2.6499999999999998e-139

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
      4. sub-neg75.7%

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

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

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

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

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

    if -2.6499999999999998e-139 < x < 3.29999999999999995e-292 or 4.05e-255 < x < 3.2e-30

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

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

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

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

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

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

    if 3.29999999999999995e-292 < x < 4.05e-255

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.5 \cdot 10^{-102}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;x \leq -2.65 \cdot 10^{-139}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;x \leq 3.3 \cdot 10^{-292}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;x \leq 4.05 \cdot 10^{-255}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;x \leq 3.2 \cdot 10^{-30}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 54.5% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;z \leq -175000000:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 2.25 \cdot 10^{-268}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3000000000000001e198 < z < -1.75e8 or 9.5000000000000003e29 < z

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

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

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

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

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

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

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

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

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

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

    if -1.75e8 < z < 2.2500000000000001e-268 or 2.85000000000000011e-164 < z < 9.5000000000000003e29

    1. Initial program 100.0%

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

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

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

    if 2.2500000000000001e-268 < z < 2.85000000000000011e-164

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
      4. sub-neg93.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+198}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq -175000000:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{-268}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq 2.85 \cdot 10^{-164}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+29}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 70.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(t - x\right)\\ t_2 := x - z \cdot t\\ \mathbf{if}\;y \leq -7 \cdot 10^{+39}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-225}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-185}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{-8}:\\ \;\;\;\;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 (- x (* z t))))
   (if (<= y -7e+39)
     t_1
     (if (<= y 3.5e-225)
       t_2
       (if (<= y 2.4e-185) (* x (+ z 1.0)) (if (<= y 5.7e-8) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * (t - x);
	double t_2 = x - (z * t);
	double tmp;
	if (y <= -7e+39) {
		tmp = t_1;
	} else if (y <= 3.5e-225) {
		tmp = t_2;
	} else if (y <= 2.4e-185) {
		tmp = x * (z + 1.0);
	} else if (y <= 5.7e-8) {
		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 = x - (z * t)
    if (y <= (-7d+39)) then
        tmp = t_1
    else if (y <= 3.5d-225) then
        tmp = t_2
    else if (y <= 2.4d-185) then
        tmp = x * (z + 1.0d0)
    else if (y <= 5.7d-8) 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 = x - (z * t);
	double tmp;
	if (y <= -7e+39) {
		tmp = t_1;
	} else if (y <= 3.5e-225) {
		tmp = t_2;
	} else if (y <= 2.4e-185) {
		tmp = x * (z + 1.0);
	} else if (y <= 5.7e-8) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * (t - x)
	t_2 = x - (z * t)
	tmp = 0
	if y <= -7e+39:
		tmp = t_1
	elif y <= 3.5e-225:
		tmp = t_2
	elif y <= 2.4e-185:
		tmp = x * (z + 1.0)
	elif y <= 5.7e-8:
		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(x - Float64(z * t))
	tmp = 0.0
	if (y <= -7e+39)
		tmp = t_1;
	elseif (y <= 3.5e-225)
		tmp = t_2;
	elseif (y <= 2.4e-185)
		tmp = Float64(x * Float64(z + 1.0));
	elseif (y <= 5.7e-8)
		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 = x - (z * t);
	tmp = 0.0;
	if (y <= -7e+39)
		tmp = t_1;
	elseif (y <= 3.5e-225)
		tmp = t_2;
	elseif (y <= 2.4e-185)
		tmp = x * (z + 1.0);
	elseif (y <= 5.7e-8)
		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[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7e+39], t$95$1, If[LessEqual[y, 3.5e-225], t$95$2, If[LessEqual[y, 2.4e-185], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.7e-8], t$95$2, t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq 3.5 \cdot 10^{-225}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;y \leq 5.7 \cdot 10^{-8}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -7.0000000000000003e39 or 5.70000000000000009e-8 < 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 78.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.0000000000000003e39 < y < 3.4999999999999997e-225 or 2.4000000000000001e-185 < y < 5.70000000000000009e-8

    1. Initial program 100.0%

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

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

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

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

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

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

    if 3.4999999999999997e-225 < y < 2.4000000000000001e-185

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -7 \cdot 10^{+39}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 3.5 \cdot 10^{-225}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 2.4 \cdot 10^{-185}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 5.7 \cdot 10^{-8}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 80.1% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 3.2 \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 -1.2e-74) (not (<= x 3.2e+66)))
   (* x (+ (- z y) 1.0))
   (+ x (* (- y z) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x <= -1.2e-74) || !(x <= 3.2e+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 <= (-1.2d-74)) .or. (.not. (x <= 3.2d+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 <= -1.2e-74) || !(x <= 3.2e+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 <= -1.2e-74) or not (x <= 3.2e+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 <= -1.2e-74) || !(x <= 3.2e+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 <= -1.2e-74) || ~((x <= 3.2e+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, -1.2e-74], N[Not[LessEqual[x, 3.2e+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 -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 3.2 \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 < -1.1999999999999999e-74 or 3.2e66 < 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 84.3%

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

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

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

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

    if -1.1999999999999999e-74 < x < 3.2e66

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 3.2 \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 9: 85.0% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5e3 or 5.5e29 < 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 86.0%

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

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

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

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

    if -5e3 < z < 5.5e29

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

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

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

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

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

Alternative 10: 39.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -180000000 \lor \neg \left(z \leq 6.6 \cdot 10^{+29}\right):\\
\;\;\;\;z \cdot \left(-t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8e8 or 6.59999999999999968e29 < z

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

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

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

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

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

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

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

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

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

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

    if -1.8e8 < z < 6.59999999999999968e29

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot y - x \cdot \left(y - 1\right)} \]
      4. sub-neg86.0%

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified41.0%

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

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

Alternative 11: 37.1% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -5.4999999999999998e-110 or 1.3600000000000001e-18 < 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 68.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{y \cdot t} \]
    11. Simplified36.8%

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

    if -5.4999999999999998e-110 < y < 1.3600000000000001e-18

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

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

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

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

Alternative 12: 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 13: 17.8% 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 67.3%

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

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

    \[\leadsto x \]
  6. Add Preprocessing

Developer target: 95.9% 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 2024020 
(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))))