Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 6.9s
Alternatives: 12
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 12 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 0.1× speedup?

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

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

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

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

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, t - x, x\right)} \]
  4. Add Preprocessing
  5. Add Preprocessing

Alternative 2: 63.3% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + y \cdot t\\ t_2 := x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{if}\;t \leq -2 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-83}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 0.00078:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+54}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+162}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* y t))) (t_2 (* x (+ (- z y) 1.0))))
   (if (<= t -2e+41)
     t_1
     (if (<= t 5.2e-83)
       t_2
       (if (<= t 0.00078)
         (* y (- t x))
         (if (<= t 5.5e+54) t_2 (if (<= t 3.2e+162) t_1 (- x (* z t)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + (y * t);
	double t_2 = x * ((z - y) + 1.0);
	double tmp;
	if (t <= -2e+41) {
		tmp = t_1;
	} else if (t <= 5.2e-83) {
		tmp = t_2;
	} else if (t <= 0.00078) {
		tmp = y * (t - x);
	} else if (t <= 5.5e+54) {
		tmp = t_2;
	} else if (t <= 3.2e+162) {
		tmp = t_1;
	} else {
		tmp = x - (z * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x + (y * t)
    t_2 = x * ((z - y) + 1.0d0)
    if (t <= (-2d+41)) then
        tmp = t_1
    else if (t <= 5.2d-83) then
        tmp = t_2
    else if (t <= 0.00078d0) then
        tmp = y * (t - x)
    else if (t <= 5.5d+54) then
        tmp = t_2
    else if (t <= 3.2d+162) then
        tmp = t_1
    else
        tmp = x - (z * t)
    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 = x * ((z - y) + 1.0);
	double tmp;
	if (t <= -2e+41) {
		tmp = t_1;
	} else if (t <= 5.2e-83) {
		tmp = t_2;
	} else if (t <= 0.00078) {
		tmp = y * (t - x);
	} else if (t <= 5.5e+54) {
		tmp = t_2;
	} else if (t <= 3.2e+162) {
		tmp = t_1;
	} else {
		tmp = x - (z * t);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + (y * t)
	t_2 = x * ((z - y) + 1.0)
	tmp = 0
	if t <= -2e+41:
		tmp = t_1
	elif t <= 5.2e-83:
		tmp = t_2
	elif t <= 0.00078:
		tmp = y * (t - x)
	elif t <= 5.5e+54:
		tmp = t_2
	elif t <= 3.2e+162:
		tmp = t_1
	else:
		tmp = x - (z * t)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(y * t))
	t_2 = Float64(x * Float64(Float64(z - y) + 1.0))
	tmp = 0.0
	if (t <= -2e+41)
		tmp = t_1;
	elseif (t <= 5.2e-83)
		tmp = t_2;
	elseif (t <= 0.00078)
		tmp = Float64(y * Float64(t - x));
	elseif (t <= 5.5e+54)
		tmp = t_2;
	elseif (t <= 3.2e+162)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + (y * t);
	t_2 = x * ((z - y) + 1.0);
	tmp = 0.0;
	if (t <= -2e+41)
		tmp = t_1;
	elseif (t <= 5.2e-83)
		tmp = t_2;
	elseif (t <= 0.00078)
		tmp = y * (t - x);
	elseif (t <= 5.5e+54)
		tmp = t_2;
	elseif (t <= 3.2e+162)
		tmp = t_1;
	else
		tmp = x - (z * t);
	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[(x * N[(N[(z - y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2e+41], t$95$1, If[LessEqual[t, 5.2e-83], t$95$2, If[LessEqual[t, 0.00078], N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e+54], t$95$2, If[LessEqual[t, 3.2e+162], t$95$1, N[(x - N[(z * t), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t \leq 5.2 \cdot 10^{-83}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;t \leq 5.5 \cdot 10^{+54}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t \leq 3.2 \cdot 10^{+162}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -2.00000000000000001e41 or 5.50000000000000026e54 < t < 3.2000000000000001e162

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

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

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

    if -2.00000000000000001e41 < t < 5.20000000000000018e-83 or 7.79999999999999986e-4 < t < 5.50000000000000026e54

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

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

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

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

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

    if 5.20000000000000018e-83 < t < 7.79999999999999986e-4

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

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

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

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

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

    if 3.2000000000000001e162 < t

    1. Initial program 100.0%

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

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

      \[\leadsto x + \color{blue}{-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. distribute-rgt-neg-out58.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2 \cdot 10^{+41}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{elif}\;t \leq 5.2 \cdot 10^{-83}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;t \leq 0.00078:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;t \leq 5.5 \cdot 10^{+54}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;t \leq 3.2 \cdot 10^{+162}:\\ \;\;\;\;x + y \cdot t\\ \mathbf{else}:\\ \;\;\;\;x - z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 48.1% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \left(-x\right)\\ t_2 := x \cdot \left(z + 1\right)\\ \mathbf{if}\;y \leq -9.2 \cdot 10^{+188}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.15 \cdot 10^{+138}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -4 \cdot 10^{+25}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;y \leq -3100000:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;y \leq 5.6 \cdot 10^{+109}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* y (- x))) (t_2 (* x (+ z 1.0))))
   (if (<= y -9.2e+188)
     t_1
     (if (<= y -1.15e+138)
       t_2
       (if (<= y -4e+25)
         (* y t)
         (if (<= y -3100000.0)
           (* x (- 1.0 y))
           (if (<= y 5.6e+109) t_2 t_1)))))))
double code(double x, double y, double z, double t) {
	double t_1 = y * -x;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -9.2e+188) {
		tmp = t_1;
	} else if (y <= -1.15e+138) {
		tmp = t_2;
	} else if (y <= -4e+25) {
		tmp = y * t;
	} else if (y <= -3100000.0) {
		tmp = x * (1.0 - y);
	} else if (y <= 5.6e+109) {
		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 * -x
    t_2 = x * (z + 1.0d0)
    if (y <= (-9.2d+188)) then
        tmp = t_1
    else if (y <= (-1.15d+138)) then
        tmp = t_2
    else if (y <= (-4d+25)) then
        tmp = y * t
    else if (y <= (-3100000.0d0)) then
        tmp = x * (1.0d0 - y)
    else if (y <= 5.6d+109) 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 * -x;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -9.2e+188) {
		tmp = t_1;
	} else if (y <= -1.15e+138) {
		tmp = t_2;
	} else if (y <= -4e+25) {
		tmp = y * t;
	} else if (y <= -3100000.0) {
		tmp = x * (1.0 - y);
	} else if (y <= 5.6e+109) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = y * -x
	t_2 = x * (z + 1.0)
	tmp = 0
	if y <= -9.2e+188:
		tmp = t_1
	elif y <= -1.15e+138:
		tmp = t_2
	elif y <= -4e+25:
		tmp = y * t
	elif y <= -3100000.0:
		tmp = x * (1.0 - y)
	elif y <= 5.6e+109:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(y * Float64(-x))
	t_2 = Float64(x * Float64(z + 1.0))
	tmp = 0.0
	if (y <= -9.2e+188)
		tmp = t_1;
	elseif (y <= -1.15e+138)
		tmp = t_2;
	elseif (y <= -4e+25)
		tmp = Float64(y * t);
	elseif (y <= -3100000.0)
		tmp = Float64(x * Float64(1.0 - y));
	elseif (y <= 5.6e+109)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = y * -x;
	t_2 = x * (z + 1.0);
	tmp = 0.0;
	if (y <= -9.2e+188)
		tmp = t_1;
	elseif (y <= -1.15e+138)
		tmp = t_2;
	elseif (y <= -4e+25)
		tmp = y * t;
	elseif (y <= -3100000.0)
		tmp = x * (1.0 - y);
	elseif (y <= 5.6e+109)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * (-x)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -9.2e+188], t$95$1, If[LessEqual[y, -1.15e+138], t$95$2, If[LessEqual[y, -4e+25], N[(y * t), $MachinePrecision], If[LessEqual[y, -3100000.0], N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.6e+109], t$95$2, t$95$1]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;y \leq -4 \cdot 10^{+25}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq -3100000:\\
\;\;\;\;x \cdot \left(1 - y\right)\\

\mathbf{elif}\;y \leq 5.6 \cdot 10^{+109}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -9.20000000000000046e188 or 5.6000000000000004e109 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -9.20000000000000046e188 < y < -1.15000000000000004e138 or -3.1e6 < y < 5.6000000000000004e109

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

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

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

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

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

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

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

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

    if -1.15000000000000004e138 < y < -4.00000000000000036e25

    1. Initial program 100.0%

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    5. Taylor expanded in x around 0 67.9%

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

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

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

    if -4.00000000000000036e25 < y < -3.1e6

    1. Initial program 99.5%

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

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

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

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

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

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

Alternative 4: 80.3% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+39} \lor \neg \left(t \leq 8 \cdot 10^{-57}\right) \land \left(t \leq 0.026 \lor \neg \left(t \leq 1.7 \cdot 10^{+58}\right)\right):\\
\;\;\;\;x + \left(y - z\right) \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.1999999999999997e39 or 7.99999999999999964e-57 < t < 0.0259999999999999988 or 1.7e58 < t

    1. Initial program 100.0%

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

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

    if -4.1999999999999997e39 < t < 7.99999999999999964e-57 or 0.0259999999999999988 < t < 1.7e58

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -4.2 \cdot 10^{+39} \lor \neg \left(t \leq 8 \cdot 10^{-57}\right) \land \left(t \leq 0.026 \lor \neg \left(t \leq 1.7 \cdot 10^{+58}\right)\right):\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.9% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;y \leq 9.5 \cdot 10^{+44}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.59999999999999994e-33 or 9.5000000000000004e44 < y

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

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

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

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

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

    if -2.59999999999999994e-33 < y < 1.14999999999999993e-201

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

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

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

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

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

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

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

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

    if 1.14999999999999993e-201 < y < 22500

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

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

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

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

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

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

    if 22500 < y < 9.5000000000000004e44

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    8. Simplified51.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.6 \cdot 10^{-33}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 1.15 \cdot 10^{-201}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 22500:\\ \;\;\;\;x - z \cdot t\\ \mathbf{elif}\;y \leq 9.5 \cdot 10^{+44}:\\ \;\;\;\;z \cdot x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 47.8% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq -1.28 \cdot 10^{-26}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 4.5 \cdot 10^{+109}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.29999999999999985e188 or 4.4999999999999996e109 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -4.29999999999999985e188 < y < -4.79999999999999995e141 or -1.27999999999999996e-26 < y < 4.4999999999999996e109

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

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

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

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

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

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

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

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

    if -4.79999999999999995e141 < y < -1.27999999999999996e-26

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    5. Taylor expanded in x around 0 54.2%

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

        \[\leadsto \color{blue}{y \cdot t} \]
    7. Simplified54.2%

      \[\leadsto \color{blue}{y \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 7: 32.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq -9.2 \cdot 10^{+120}:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;y \leq -1.6 \cdot 10^{-33}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;y \leq 1.1 \cdot 10^{+110}:\\
\;\;\;\;z \cdot x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.1e188 or 1.09999999999999996e110 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -4.1e188 < y < -9.1999999999999997e120 or -1.59999999999999988e-33 < y < 1.09999999999999996e110

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot z} \]
    7. Step-by-step derivation
      1. *-commutative40.3%

        \[\leadsto \color{blue}{z \cdot x} \]
    8. Simplified40.3%

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

    if -9.1999999999999997e120 < y < -1.59999999999999988e-33

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    5. Taylor expanded in x around 0 55.6%

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

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

      \[\leadsto \color{blue}{y \cdot t} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 8: 67.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.59999999999999994e-33 or 1.65000000000000007e44 < y

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

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

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

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

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

    if -2.59999999999999994e-33 < y < 1.65000000000000007e44

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

Alternative 9: 34.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{+30} \lor \neg \left(t \leq 2.25 \cdot 10^{-57}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -4.7999999999999999e30 or 2.24999999999999986e-57 < t

    1. Initial program 100.0%

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    5. Taylor expanded in x around 0 43.5%

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

        \[\leadsto \color{blue}{y \cdot t} \]
    7. Simplified43.5%

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

    if -4.7999999999999999e30 < t < 2.24999999999999986e-57

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{z \cdot x} \]
    8. Simplified42.7%

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

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

Alternative 10: 37.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{-27} \lor \neg \left(y \leq 17500\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.05e-27 or 17500 < y

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    5. Taylor expanded in x around 0 39.9%

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

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

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

    if -3.05e-27 < y < 17500

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

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

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

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

Alternative 11: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 12: 18.1% 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 56.4%

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

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

Developer target: 96.1% accurate, 0.6× speedup?

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

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

Reproduce

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

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

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