Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.2s
Alternatives: 14
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

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

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

Alternative 2: 49.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := y \cdot \left(-x\right)\\ t_3 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;y \leq -9.5 \cdot 10^{+162}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{+77}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+24}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1650:\\ \;\;\;\;t_2\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-15}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-215}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-236}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+14}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* y (- x))) (t_3 (* x (+ z 1.0))))
   (if (<= y -9.5e+162)
     (* y t)
     (if (<= y -1.9e+77)
       t_2
       (if (<= y -9.5e+24)
         (* y t)
         (if (<= y -1650.0)
           t_2
           (if (<= y -1.4e-15)
             t_1
             (if (<= y -2.05e-215)
               t_3
               (if (<= y -1.05e-236)
                 t_1
                 (if (<= y 8.5e+14) t_3 (* y t)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = y * -x;
	double t_3 = x * (z + 1.0);
	double tmp;
	if (y <= -9.5e+162) {
		tmp = y * t;
	} else if (y <= -1.9e+77) {
		tmp = t_2;
	} else if (y <= -9.5e+24) {
		tmp = y * t;
	} else if (y <= -1650.0) {
		tmp = t_2;
	} else if (y <= -1.4e-15) {
		tmp = t_1;
	} else if (y <= -2.05e-215) {
		tmp = t_3;
	} else if (y <= -1.05e-236) {
		tmp = t_1;
	} else if (y <= 8.5e+14) {
		tmp = t_3;
	} else {
		tmp = y * t;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = z * -t
    t_2 = y * -x
    t_3 = x * (z + 1.0d0)
    if (y <= (-9.5d+162)) then
        tmp = y * t
    else if (y <= (-1.9d+77)) then
        tmp = t_2
    else if (y <= (-9.5d+24)) then
        tmp = y * t
    else if (y <= (-1650.0d0)) then
        tmp = t_2
    else if (y <= (-1.4d-15)) then
        tmp = t_1
    else if (y <= (-2.05d-215)) then
        tmp = t_3
    else if (y <= (-1.05d-236)) then
        tmp = t_1
    else if (y <= 8.5d+14) then
        tmp = t_3
    else
        tmp = y * t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = y * -x;
	double t_3 = x * (z + 1.0);
	double tmp;
	if (y <= -9.5e+162) {
		tmp = y * t;
	} else if (y <= -1.9e+77) {
		tmp = t_2;
	} else if (y <= -9.5e+24) {
		tmp = y * t;
	} else if (y <= -1650.0) {
		tmp = t_2;
	} else if (y <= -1.4e-15) {
		tmp = t_1;
	} else if (y <= -2.05e-215) {
		tmp = t_3;
	} else if (y <= -1.05e-236) {
		tmp = t_1;
	} else if (y <= 8.5e+14) {
		tmp = t_3;
	} else {
		tmp = y * t;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = y * -x
	t_3 = x * (z + 1.0)
	tmp = 0
	if y <= -9.5e+162:
		tmp = y * t
	elif y <= -1.9e+77:
		tmp = t_2
	elif y <= -9.5e+24:
		tmp = y * t
	elif y <= -1650.0:
		tmp = t_2
	elif y <= -1.4e-15:
		tmp = t_1
	elif y <= -2.05e-215:
		tmp = t_3
	elif y <= -1.05e-236:
		tmp = t_1
	elif y <= 8.5e+14:
		tmp = t_3
	else:
		tmp = y * t
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(y * Float64(-x))
	t_3 = Float64(x * Float64(z + 1.0))
	tmp = 0.0
	if (y <= -9.5e+162)
		tmp = Float64(y * t);
	elseif (y <= -1.9e+77)
		tmp = t_2;
	elseif (y <= -9.5e+24)
		tmp = Float64(y * t);
	elseif (y <= -1650.0)
		tmp = t_2;
	elseif (y <= -1.4e-15)
		tmp = t_1;
	elseif (y <= -2.05e-215)
		tmp = t_3;
	elseif (y <= -1.05e-236)
		tmp = t_1;
	elseif (y <= 8.5e+14)
		tmp = t_3;
	else
		tmp = Float64(y * t);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = y * -x;
	t_3 = x * (z + 1.0);
	tmp = 0.0;
	if (y <= -9.5e+162)
		tmp = y * t;
	elseif (y <= -1.9e+77)
		tmp = t_2;
	elseif (y <= -9.5e+24)
		tmp = y * t;
	elseif (y <= -1650.0)
		tmp = t_2;
	elseif (y <= -1.4e-15)
		tmp = t_1;
	elseif (y <= -2.05e-215)
		tmp = t_3;
	elseif (y <= -1.05e-236)
		tmp = t_1;
	elseif (y <= 8.5e+14)
		tmp = t_3;
	else
		tmp = y * t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(y * (-x)), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.5e+162], N[(y * t), $MachinePrecision], If[LessEqual[y, -1.9e+77], t$95$2, If[LessEqual[y, -9.5e+24], N[(y * t), $MachinePrecision], If[LessEqual[y, -1650.0], t$95$2, If[LessEqual[y, -1.4e-15], t$95$1, If[LessEqual[y, -2.05e-215], t$95$3, If[LessEqual[y, -1.05e-236], t$95$1, If[LessEqual[y, 8.5e+14], t$95$3, N[(y * t), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.9 \cdot 10^{+77}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -9.5 \cdot 10^{+24}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -1650:\\
\;\;\;\;t_2\\

\mathbf{elif}\;y \leq -1.4 \cdot 10^{-15}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq -2.05 \cdot 10^{-215}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;y \leq -1.05 \cdot 10^{-236}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;y \leq 8.5 \cdot 10^{+14}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.50000000000000021e162 or -1.9000000000000001e77 < y < -9.5000000000000001e24 or 8.5e14 < y

    1. Initial program 100.0%

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

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

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

    if -9.50000000000000021e162 < y < -1.9000000000000001e77 or -9.5000000000000001e24 < y < -1650

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--75.4%

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

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

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

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

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

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

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

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

    if -1650 < y < -1.40000000000000007e-15 or -2.04999999999999992e-215 < y < -1.04999999999999989e-236

    1. Initial program 100.0%

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

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

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

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

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

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

    if -1.40000000000000007e-15 < y < -2.04999999999999992e-215 or -1.04999999999999989e-236 < y < 8.5e14

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -9.5 \cdot 10^{+162}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1.9 \cdot 10^{+77}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -9.5 \cdot 10^{+24}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -1650:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq -1.4 \cdot 10^{-15}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq -2.05 \cdot 10^{-215}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq -1.05 \cdot 10^{-236}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 8.5 \cdot 10^{+14}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 3: 37.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+210}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+159}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-89}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-184}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-301}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+21}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -2.1e+210)
     t_1
     (if (<= z -8e+159)
       (* z x)
       (if (<= z -2.2e-28)
         t_1
         (if (<= z -1.52e-89)
           (* y t)
           (if (<= z -3.2e-184)
             (* y (- x))
             (if (<= z 2.95e-301) x (if (<= z 1.65e+21) (* y t) t_1)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -2.1e+210) {
		tmp = t_1;
	} else if (z <= -8e+159) {
		tmp = z * x;
	} else if (z <= -2.2e-28) {
		tmp = t_1;
	} else if (z <= -1.52e-89) {
		tmp = y * t;
	} else if (z <= -3.2e-184) {
		tmp = y * -x;
	} else if (z <= 2.95e-301) {
		tmp = x;
	} else if (z <= 1.65e+21) {
		tmp = y * 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 = z * -t
    if (z <= (-2.1d+210)) then
        tmp = t_1
    else if (z <= (-8d+159)) then
        tmp = z * x
    else if (z <= (-2.2d-28)) then
        tmp = t_1
    else if (z <= (-1.52d-89)) then
        tmp = y * t
    else if (z <= (-3.2d-184)) then
        tmp = y * -x
    else if (z <= 2.95d-301) then
        tmp = x
    else if (z <= 1.65d+21) then
        tmp = y * 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 = z * -t;
	double tmp;
	if (z <= -2.1e+210) {
		tmp = t_1;
	} else if (z <= -8e+159) {
		tmp = z * x;
	} else if (z <= -2.2e-28) {
		tmp = t_1;
	} else if (z <= -1.52e-89) {
		tmp = y * t;
	} else if (z <= -3.2e-184) {
		tmp = y * -x;
	} else if (z <= 2.95e-301) {
		tmp = x;
	} else if (z <= 1.65e+21) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -2.1e+210:
		tmp = t_1
	elif z <= -8e+159:
		tmp = z * x
	elif z <= -2.2e-28:
		tmp = t_1
	elif z <= -1.52e-89:
		tmp = y * t
	elif z <= -3.2e-184:
		tmp = y * -x
	elif z <= 2.95e-301:
		tmp = x
	elif z <= 1.65e+21:
		tmp = y * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -2.1e+210)
		tmp = t_1;
	elseif (z <= -8e+159)
		tmp = Float64(z * x);
	elseif (z <= -2.2e-28)
		tmp = t_1;
	elseif (z <= -1.52e-89)
		tmp = Float64(y * t);
	elseif (z <= -3.2e-184)
		tmp = Float64(y * Float64(-x));
	elseif (z <= 2.95e-301)
		tmp = x;
	elseif (z <= 1.65e+21)
		tmp = Float64(y * t);
	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 <= -2.1e+210)
		tmp = t_1;
	elseif (z <= -8e+159)
		tmp = z * x;
	elseif (z <= -2.2e-28)
		tmp = t_1;
	elseif (z <= -1.52e-89)
		tmp = y * t;
	elseif (z <= -3.2e-184)
		tmp = y * -x;
	elseif (z <= 2.95e-301)
		tmp = x;
	elseif (z <= 1.65e+21)
		tmp = y * t;
	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, -2.1e+210], t$95$1, If[LessEqual[z, -8e+159], N[(z * x), $MachinePrecision], If[LessEqual[z, -2.2e-28], t$95$1, If[LessEqual[z, -1.52e-89], N[(y * t), $MachinePrecision], If[LessEqual[z, -3.2e-184], N[(y * (-x)), $MachinePrecision], If[LessEqual[z, 2.95e-301], x, If[LessEqual[z, 1.65e+21], N[(y * t), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -8 \cdot 10^{+159}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.52 \cdot 10^{-89}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;z \leq 2.95 \cdot 10^{-301}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.65 \cdot 10^{+21}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.0999999999999999e210 or -7.9999999999999994e159 < z < -2.19999999999999996e-28 or 1.65e21 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.0999999999999999e210 < z < -7.9999999999999994e159

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--59.4%

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

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

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

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

    if -2.19999999999999996e-28 < z < -1.52e-89 or 2.9499999999999999e-301 < z < 1.65e21

    1. Initial program 100.0%

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

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

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

    if -1.52e-89 < z < -3.2e-184

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--83.6%

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

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

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

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

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

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

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

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

    if -3.2e-184 < z < 2.9499999999999999e-301

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+210}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -8 \cdot 10^{+159}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-28}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.52 \cdot 10^{-89}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq -3.2 \cdot 10^{-184}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;z \leq 2.95 \cdot 10^{-301}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.65 \cdot 10^{+21}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]

Alternative 4: 53.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot t\\ t_2 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -6.5 \cdot 10^{+210}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{+171}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+43}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-87}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-184}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+19}:\\ \;\;\;\;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 -6.5e+210)
     t_2
     (if (<= z -6.4e+171)
       (* z x)
       (if (<= z -1.95e+43)
         t_2
         (if (<= z -4.5e-87)
           t_1
           (if (<= z -4.3e-184)
             (- x (* y x))
             (if (<= z 1.35e+19) 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 <= -6.5e+210) {
		tmp = t_2;
	} else if (z <= -6.4e+171) {
		tmp = z * x;
	} else if (z <= -1.95e+43) {
		tmp = t_2;
	} else if (z <= -4.5e-87) {
		tmp = t_1;
	} else if (z <= -4.3e-184) {
		tmp = x - (y * x);
	} else if (z <= 1.35e+19) {
		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 <= (-6.5d+210)) then
        tmp = t_2
    else if (z <= (-6.4d+171)) then
        tmp = z * x
    else if (z <= (-1.95d+43)) then
        tmp = t_2
    else if (z <= (-4.5d-87)) then
        tmp = t_1
    else if (z <= (-4.3d-184)) then
        tmp = x - (y * x)
    else if (z <= 1.35d+19) 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 <= -6.5e+210) {
		tmp = t_2;
	} else if (z <= -6.4e+171) {
		tmp = z * x;
	} else if (z <= -1.95e+43) {
		tmp = t_2;
	} else if (z <= -4.5e-87) {
		tmp = t_1;
	} else if (z <= -4.3e-184) {
		tmp = x - (y * x);
	} else if (z <= 1.35e+19) {
		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 <= -6.5e+210:
		tmp = t_2
	elif z <= -6.4e+171:
		tmp = z * x
	elif z <= -1.95e+43:
		tmp = t_2
	elif z <= -4.5e-87:
		tmp = t_1
	elif z <= -4.3e-184:
		tmp = x - (y * x)
	elif z <= 1.35e+19:
		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 <= -6.5e+210)
		tmp = t_2;
	elseif (z <= -6.4e+171)
		tmp = Float64(z * x);
	elseif (z <= -1.95e+43)
		tmp = t_2;
	elseif (z <= -4.5e-87)
		tmp = t_1;
	elseif (z <= -4.3e-184)
		tmp = Float64(x - Float64(y * x));
	elseif (z <= 1.35e+19)
		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 <= -6.5e+210)
		tmp = t_2;
	elseif (z <= -6.4e+171)
		tmp = z * x;
	elseif (z <= -1.95e+43)
		tmp = t_2;
	elseif (z <= -4.5e-87)
		tmp = t_1;
	elseif (z <= -4.3e-184)
		tmp = x - (y * x);
	elseif (z <= 1.35e+19)
		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, -6.5e+210], t$95$2, If[LessEqual[z, -6.4e+171], N[(z * x), $MachinePrecision], If[LessEqual[z, -1.95e+43], t$95$2, If[LessEqual[z, -4.5e-87], t$95$1, If[LessEqual[z, -4.3e-184], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+19], 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 -6.5 \cdot 10^{+210}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq -1.95 \cdot 10^{+43}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -4.5 \cdot 10^{-87}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.3 \cdot 10^{-184}:\\
\;\;\;\;x - y \cdot x\\

\mathbf{elif}\;z \leq 1.35 \cdot 10^{+19}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.4999999999999996e210 or -6.40000000000000022e171 < z < -1.95e43 or 1.35e19 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -6.4999999999999996e210 < z < -6.40000000000000022e171

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--59.4%

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

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

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

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

    if -1.95e43 < z < -4.49999999999999958e-87 or -4.30000000000000007e-184 < z < 1.35e19

    1. Initial program 100.0%

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

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

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

    if -4.49999999999999958e-87 < z < -4.30000000000000007e-184

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
    5. Simplified83.6%

      \[\leadsto \color{blue}{x - y \cdot x} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification66.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+210}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{+171}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -1.95 \cdot 10^{+43}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -4.5 \cdot 10^{-87}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-184}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{+19}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]

Alternative 5: 53.5% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - z \cdot t\\ t_2 := x + y \cdot t\\ \mathbf{if}\;z \leq -2.3 \cdot 10^{+216}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+153}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-188}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (* z t))) (t_2 (+ x (* y t))))
   (if (<= z -2.3e+216)
     (* z (- t))
     (if (<= z -1.1e+153)
       (* z x)
       (if (<= z -3.5e-28)
         t_1
         (if (<= z -5.8e-91)
           t_2
           (if (<= z -6e-188) (- x (* y x)) (if (<= z 1.4e+19) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (z * t);
	double t_2 = x + (y * t);
	double tmp;
	if (z <= -2.3e+216) {
		tmp = z * -t;
	} else if (z <= -1.1e+153) {
		tmp = z * x;
	} else if (z <= -3.5e-28) {
		tmp = t_1;
	} else if (z <= -5.8e-91) {
		tmp = t_2;
	} else if (z <= -6e-188) {
		tmp = x - (y * x);
	} else if (z <= 1.4e+19) {
		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 = x - (z * t)
    t_2 = x + (y * t)
    if (z <= (-2.3d+216)) then
        tmp = z * -t
    else if (z <= (-1.1d+153)) then
        tmp = z * x
    else if (z <= (-3.5d-28)) then
        tmp = t_1
    else if (z <= (-5.8d-91)) then
        tmp = t_2
    else if (z <= (-6d-188)) then
        tmp = x - (y * x)
    else if (z <= 1.4d+19) 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 = x - (z * t);
	double t_2 = x + (y * t);
	double tmp;
	if (z <= -2.3e+216) {
		tmp = z * -t;
	} else if (z <= -1.1e+153) {
		tmp = z * x;
	} else if (z <= -3.5e-28) {
		tmp = t_1;
	} else if (z <= -5.8e-91) {
		tmp = t_2;
	} else if (z <= -6e-188) {
		tmp = x - (y * x);
	} else if (z <= 1.4e+19) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (z * t)
	t_2 = x + (y * t)
	tmp = 0
	if z <= -2.3e+216:
		tmp = z * -t
	elif z <= -1.1e+153:
		tmp = z * x
	elif z <= -3.5e-28:
		tmp = t_1
	elif z <= -5.8e-91:
		tmp = t_2
	elif z <= -6e-188:
		tmp = x - (y * x)
	elif z <= 1.4e+19:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(z * t))
	t_2 = Float64(x + Float64(y * t))
	tmp = 0.0
	if (z <= -2.3e+216)
		tmp = Float64(z * Float64(-t));
	elseif (z <= -1.1e+153)
		tmp = Float64(z * x);
	elseif (z <= -3.5e-28)
		tmp = t_1;
	elseif (z <= -5.8e-91)
		tmp = t_2;
	elseif (z <= -6e-188)
		tmp = Float64(x - Float64(y * x));
	elseif (z <= 1.4e+19)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (z * t);
	t_2 = x + (y * t);
	tmp = 0.0;
	if (z <= -2.3e+216)
		tmp = z * -t;
	elseif (z <= -1.1e+153)
		tmp = z * x;
	elseif (z <= -3.5e-28)
		tmp = t_1;
	elseif (z <= -5.8e-91)
		tmp = t_2;
	elseif (z <= -6e-188)
		tmp = x - (y * x);
	elseif (z <= 1.4e+19)
		tmp = t_2;
	else
		tmp = t_1;
	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[(y * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.3e+216], N[(z * (-t)), $MachinePrecision], If[LessEqual[z, -1.1e+153], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.5e-28], t$95$1, If[LessEqual[z, -5.8e-91], t$95$2, If[LessEqual[z, -6e-188], N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+19], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{+153}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+19}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -2.29999999999999996e216 < z < -1.1e153

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--59.4%

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

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

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

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

    if -1.1e153 < z < -3.5e-28 or 1.4e19 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -3.5e-28 < z < -5.8000000000000001e-91 or -6.00000000000000033e-188 < z < 1.4e19

    1. Initial program 100.0%

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

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

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

    if -5.8000000000000001e-91 < z < -6.00000000000000033e-188

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
    5. Simplified83.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+216}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{+153}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-188}:\\ \;\;\;\;x - y \cdot x\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+19}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]

Alternative 6: 38.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -4.5 \cdot 10^{+213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+164}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-235}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{-302}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+20}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -4.5e+213)
     t_1
     (if (<= z -2.15e+164)
       (* z x)
       (if (<= z -3.5e-28)
         t_1
         (if (<= z -1.2e-235)
           (* y t)
           (if (<= z 8.6e-302) x (if (<= z 1.4e+20) (* y t) t_1))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -4.5e+213) {
		tmp = t_1;
	} else if (z <= -2.15e+164) {
		tmp = z * x;
	} else if (z <= -3.5e-28) {
		tmp = t_1;
	} else if (z <= -1.2e-235) {
		tmp = y * t;
	} else if (z <= 8.6e-302) {
		tmp = x;
	} else if (z <= 1.4e+20) {
		tmp = y * 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 = z * -t
    if (z <= (-4.5d+213)) then
        tmp = t_1
    else if (z <= (-2.15d+164)) then
        tmp = z * x
    else if (z <= (-3.5d-28)) then
        tmp = t_1
    else if (z <= (-1.2d-235)) then
        tmp = y * t
    else if (z <= 8.6d-302) then
        tmp = x
    else if (z <= 1.4d+20) then
        tmp = y * 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 = z * -t;
	double tmp;
	if (z <= -4.5e+213) {
		tmp = t_1;
	} else if (z <= -2.15e+164) {
		tmp = z * x;
	} else if (z <= -3.5e-28) {
		tmp = t_1;
	} else if (z <= -1.2e-235) {
		tmp = y * t;
	} else if (z <= 8.6e-302) {
		tmp = x;
	} else if (z <= 1.4e+20) {
		tmp = y * t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -4.5e+213:
		tmp = t_1
	elif z <= -2.15e+164:
		tmp = z * x
	elif z <= -3.5e-28:
		tmp = t_1
	elif z <= -1.2e-235:
		tmp = y * t
	elif z <= 8.6e-302:
		tmp = x
	elif z <= 1.4e+20:
		tmp = y * t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -4.5e+213)
		tmp = t_1;
	elseif (z <= -2.15e+164)
		tmp = Float64(z * x);
	elseif (z <= -3.5e-28)
		tmp = t_1;
	elseif (z <= -1.2e-235)
		tmp = Float64(y * t);
	elseif (z <= 8.6e-302)
		tmp = x;
	elseif (z <= 1.4e+20)
		tmp = Float64(y * t);
	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 <= -4.5e+213)
		tmp = t_1;
	elseif (z <= -2.15e+164)
		tmp = z * x;
	elseif (z <= -3.5e-28)
		tmp = t_1;
	elseif (z <= -1.2e-235)
		tmp = y * t;
	elseif (z <= 8.6e-302)
		tmp = x;
	elseif (z <= 1.4e+20)
		tmp = y * t;
	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, -4.5e+213], t$95$1, If[LessEqual[z, -2.15e+164], N[(z * x), $MachinePrecision], If[LessEqual[z, -3.5e-28], t$95$1, If[LessEqual[z, -1.2e-235], N[(y * t), $MachinePrecision], If[LessEqual[z, 8.6e-302], x, If[LessEqual[z, 1.4e+20], N[(y * t), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -2.15 \cdot 10^{+164}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -1.2 \cdot 10^{-235}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 8.6 \cdot 10^{-302}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+20}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.5000000000000002e213 or -2.15e164 < z < -3.5e-28 or 1.4e20 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -4.5000000000000002e213 < z < -2.15e164

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--59.4%

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

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

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

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

    if -3.5e-28 < z < -1.20000000000000005e-235 or 8.60000000000000041e-302 < z < 1.4e20

    1. Initial program 100.0%

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

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

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

    if -1.20000000000000005e-235 < z < 8.60000000000000041e-302

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+213}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{+164}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-28}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -1.2 \cdot 10^{-235}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 8.6 \cdot 10^{-302}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+20}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \end{array} \]

Alternative 7: 69.2% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot t\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{-64}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-110}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-200} \lor \neg \left(t \leq 2.6 \cdot 10^{-35}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) t))))
   (if (<= t -1.35e-64)
     t_1
     (if (<= t -1.25e-110)
       (+ x (* z x))
       (if (or (<= t -1.4e-200) (not (<= t 2.6e-35))) t_1 (- x (* y x)))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((y - z) * t);
	double tmp;
	if (t <= -1.35e-64) {
		tmp = t_1;
	} else if (t <= -1.25e-110) {
		tmp = x + (z * x);
	} else if ((t <= -1.4e-200) || !(t <= 2.6e-35)) {
		tmp = t_1;
	} else {
		tmp = x - (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) :: tmp
    t_1 = x + ((y - z) * t)
    if (t <= (-1.35d-64)) then
        tmp = t_1
    else if (t <= (-1.25d-110)) then
        tmp = x + (z * x)
    else if ((t <= (-1.4d-200)) .or. (.not. (t <= 2.6d-35))) then
        tmp = t_1
    else
        tmp = x - (y * x)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + ((y - z) * t);
	double tmp;
	if (t <= -1.35e-64) {
		tmp = t_1;
	} else if (t <= -1.25e-110) {
		tmp = x + (z * x);
	} else if ((t <= -1.4e-200) || !(t <= 2.6e-35)) {
		tmp = t_1;
	} else {
		tmp = x - (y * x);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + ((y - z) * t)
	tmp = 0
	if t <= -1.35e-64:
		tmp = t_1
	elif t <= -1.25e-110:
		tmp = x + (z * x)
	elif (t <= -1.4e-200) or not (t <= 2.6e-35):
		tmp = t_1
	else:
		tmp = x - (y * x)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(y - z) * t))
	tmp = 0.0
	if (t <= -1.35e-64)
		tmp = t_1;
	elseif (t <= -1.25e-110)
		tmp = Float64(x + Float64(z * x));
	elseif ((t <= -1.4e-200) || !(t <= 2.6e-35))
		tmp = t_1;
	else
		tmp = Float64(x - Float64(y * x));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + ((y - z) * t);
	tmp = 0.0;
	if (t <= -1.35e-64)
		tmp = t_1;
	elseif (t <= -1.25e-110)
		tmp = x + (z * x);
	elseif ((t <= -1.4e-200) || ~((t <= 2.6e-35)))
		tmp = t_1;
	else
		tmp = x - (y * x);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-64], t$95$1, If[LessEqual[t, -1.25e-110], N[(x + N[(z * x), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -1.4e-200], N[Not[LessEqual[t, 2.6e-35]], $MachinePrecision]], t$95$1, N[(x - N[(y * x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq -1.25 \cdot 10^{-110}:\\
\;\;\;\;x + z \cdot x\\

\mathbf{elif}\;t \leq -1.4 \cdot 10^{-200} \lor \neg \left(t \leq 2.6 \cdot 10^{-35}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x - y \cdot x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.34999999999999993e-64 or -1.25e-110 < t < -1.40000000000000003e-200 or 2.60000000000000005e-35 < t

    1. Initial program 100.0%

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

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

    if -1.34999999999999993e-64 < t < -1.25e-110

    1. Initial program 100.0%

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

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

        \[\leadsto x + \left(t - x\right) \cdot \color{blue}{\frac{y \cdot y - z \cdot z}{y + z}} \]
      3. associate-*r/57.2%

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{y + z}{y \cdot y - z \cdot z}}} \]
      2. difference-of-squares73.9%

        \[\leadsto x + \frac{t - x}{\frac{y + z}{\color{blue}{\left(y + z\right) \cdot \left(y - z\right)}}} \]
      3. associate-/r*100.0%

        \[\leadsto x + \frac{t - x}{\color{blue}{\frac{\frac{y + z}{y + z}}{y - z}}} \]
      4. *-inverses100.0%

        \[\leadsto x + \frac{t - x}{\frac{\color{blue}{1}}{y - z}} \]
    5. Simplified100.0%

      \[\leadsto x + \color{blue}{\frac{t - x}{\frac{1}{y - z}}} \]
    6. Taylor expanded in y around 0 64.7%

      \[\leadsto x + \frac{t - x}{\color{blue}{\frac{-1}{z}}} \]
    7. Taylor expanded in t around 0 64.8%

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

    if -1.40000000000000003e-200 < t < 2.60000000000000005e-35

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \color{blue}{x - y \cdot x} \]
    5. Simplified63.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-64}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{elif}\;t \leq -1.25 \cdot 10^{-110}:\\ \;\;\;\;x + z \cdot x\\ \mathbf{elif}\;t \leq -1.4 \cdot 10^{-200} \lor \neg \left(t \leq 2.6 \cdot 10^{-35}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x - y \cdot x\\ \end{array} \]

Alternative 8: 54.3% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{+213}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{+168}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{+49} \lor \neg \left(z \leq 6.2 \cdot 10^{+21}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -6.8e+213)
     t_1
     (if (<= z -4.7e+168)
       (* z x)
       (if (or (<= z -4.3e+49) (not (<= z 6.2e+21))) t_1 (+ x (* y t)))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -6.8e+213) {
		tmp = t_1;
	} else if (z <= -4.7e+168) {
		tmp = z * x;
	} else if ((z <= -4.3e+49) || !(z <= 6.2e+21)) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (z <= (-6.8d+213)) then
        tmp = t_1
    else if (z <= (-4.7d+168)) then
        tmp = z * x
    else if ((z <= (-4.3d+49)) .or. (.not. (z <= 6.2d+21))) then
        tmp = t_1
    else
        tmp = x + (y * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -6.8e+213) {
		tmp = t_1;
	} else if (z <= -4.7e+168) {
		tmp = z * x;
	} else if ((z <= -4.3e+49) || !(z <= 6.2e+21)) {
		tmp = t_1;
	} else {
		tmp = x + (y * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -6.8e+213:
		tmp = t_1
	elif z <= -4.7e+168:
		tmp = z * x
	elif (z <= -4.3e+49) or not (z <= 6.2e+21):
		tmp = t_1
	else:
		tmp = x + (y * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -6.8e+213)
		tmp = t_1;
	elseif (z <= -4.7e+168)
		tmp = Float64(z * x);
	elseif ((z <= -4.3e+49) || !(z <= 6.2e+21))
		tmp = t_1;
	else
		tmp = Float64(x + Float64(y * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (z <= -6.8e+213)
		tmp = t_1;
	elseif (z <= -4.7e+168)
		tmp = z * x;
	elseif ((z <= -4.3e+49) || ~((z <= 6.2e+21)))
		tmp = t_1;
	else
		tmp = x + (y * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -6.8e+213], t$95$1, If[LessEqual[z, -4.7e+168], N[(z * x), $MachinePrecision], If[Or[LessEqual[z, -4.3e+49], N[Not[LessEqual[z, 6.2e+21]], $MachinePrecision]], t$95$1, N[(x + N[(y * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -4.7 \cdot 10^{+168}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq -4.3 \cdot 10^{+49} \lor \neg \left(z \leq 6.2 \cdot 10^{+21}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.79999999999999983e213 or -4.69999999999999961e168 < z < -4.2999999999999999e49 or 6.2e21 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -6.79999999999999983e213 < z < -4.69999999999999961e168

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--59.4%

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

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

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

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

    if -4.2999999999999999e49 < z < 6.2e21

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+213}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{+168}:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{+49} \lor \neg \left(z \leq 6.2 \cdot 10^{+21}\right):\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot t\\ \end{array} \]

Alternative 9: 76.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-5} \lor \neg \left(y \leq 5.1 \cdot 10^{+35}\right):\\
\;\;\;\;x + y \cdot \left(t - x\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.19999999999999986e-5 or 5.10000000000000017e35 < y

    1. Initial program 100.0%

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

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

    if -3.19999999999999986e-5 < y < 5.10000000000000017e35

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.2 \cdot 10^{-5} \lor \neg \left(y \leq 5.1 \cdot 10^{+35}\right):\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \end{array} \]

Alternative 10: 82.0% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{-63} \lor \neg \left(t \leq 2.8 \cdot 10^{-33}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.59999999999999994e-63 or 2.8e-33 < t

    1. Initial program 100.0%

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

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

    if -1.59999999999999994e-63 < t < 2.8e-33

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto x \cdot \color{blue}{\left(1 - \left(y - z\right)\right)} \]
      4. distribute-lft-out--83.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.6 \cdot 10^{-63} \lor \neg \left(t \leq 2.8 \cdot 10^{-33}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + x \cdot \left(z - y\right)\\ \end{array} \]

Alternative 11: 84.4% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0134999999999999998 or 1.0499999999999999e35 < y

    1. Initial program 100.0%

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

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

    if -0.0134999999999999998 < y < 1.0499999999999999e35

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.0135 \lor \neg \left(y \leq 1.05 \cdot 10^{+35}\right):\\ \;\;\;\;x + y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot \left(t - x\right)\\ \end{array} \]

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

    \[\leadsto x + \left(y - z\right) \cdot \left(t - x\right) \]

Alternative 13: 37.2% accurate, 1.3× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -0.0539999999999999994 or 1.50000000000000009e-106 < y

    1. Initial program 100.0%

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

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

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

    if -0.0539999999999999994 < y < 1.50000000000000009e-106

    1. Initial program 100.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -0.054:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{-106}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;y \cdot t\\ \end{array} \]

Alternative 14: 18.0% 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. Taylor expanded in t around inf 70.3%

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

    \[\leadsto \color{blue}{x} \]
  4. Final simplification20.5%

    \[\leadsto x \]

Developer target: 96.4% 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 2023214 
(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))))