Data.Metrics.Snapshot:quantile from metrics-0.3.0.2

Percentage Accurate: 100.0% → 100.0%
Time: 9.7s
Alternatives: 16
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 16 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. Final simplification100.0%

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

Alternative 2: 38.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ \mathbf{if}\;z \leq -6.8 \cdot 10^{-12}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-280}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-224}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-56}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+52} \lor \neg \left(z \leq 1.92 \cdot 10^{+146}\right) \land z \leq 1.2 \cdot 10^{+229}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))))
   (if (<= z -6.8e-12)
     t_1
     (if (<= z 4.4e-280)
       x
       (if (<= z 1.45e-224)
         (* y t)
         (if (<= z 8.5e-217)
           x
           (if (<= z 9.5e-56)
             (* y t)
             (if (or (<= z 3.9e+52)
                     (and (not (<= z 1.92e+146)) (<= z 1.2e+229)))
               t_1
               (* z x)))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -6.8e-12) {
		tmp = t_1;
	} else if (z <= 4.4e-280) {
		tmp = x;
	} else if (z <= 1.45e-224) {
		tmp = y * t;
	} else if (z <= 8.5e-217) {
		tmp = x;
	} else if (z <= 9.5e-56) {
		tmp = y * t;
	} else if ((z <= 3.9e+52) || (!(z <= 1.92e+146) && (z <= 1.2e+229))) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = z * -t
    if (z <= (-6.8d-12)) then
        tmp = t_1
    else if (z <= 4.4d-280) then
        tmp = x
    else if (z <= 1.45d-224) then
        tmp = y * t
    else if (z <= 8.5d-217) then
        tmp = x
    else if (z <= 9.5d-56) then
        tmp = y * t
    else if ((z <= 3.9d+52) .or. (.not. (z <= 1.92d+146)) .and. (z <= 1.2d+229)) then
        tmp = t_1
    else
        tmp = z * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double tmp;
	if (z <= -6.8e-12) {
		tmp = t_1;
	} else if (z <= 4.4e-280) {
		tmp = x;
	} else if (z <= 1.45e-224) {
		tmp = y * t;
	} else if (z <= 8.5e-217) {
		tmp = x;
	} else if (z <= 9.5e-56) {
		tmp = y * t;
	} else if ((z <= 3.9e+52) || (!(z <= 1.92e+146) && (z <= 1.2e+229))) {
		tmp = t_1;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	tmp = 0
	if z <= -6.8e-12:
		tmp = t_1
	elif z <= 4.4e-280:
		tmp = x
	elif z <= 1.45e-224:
		tmp = y * t
	elif z <= 8.5e-217:
		tmp = x
	elif z <= 9.5e-56:
		tmp = y * t
	elif (z <= 3.9e+52) or (not (z <= 1.92e+146) and (z <= 1.2e+229)):
		tmp = t_1
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	tmp = 0.0
	if (z <= -6.8e-12)
		tmp = t_1;
	elseif (z <= 4.4e-280)
		tmp = x;
	elseif (z <= 1.45e-224)
		tmp = Float64(y * t);
	elseif (z <= 8.5e-217)
		tmp = x;
	elseif (z <= 9.5e-56)
		tmp = Float64(y * t);
	elseif ((z <= 3.9e+52) || (!(z <= 1.92e+146) && (z <= 1.2e+229)))
		tmp = t_1;
	else
		tmp = Float64(z * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	tmp = 0.0;
	if (z <= -6.8e-12)
		tmp = t_1;
	elseif (z <= 4.4e-280)
		tmp = x;
	elseif (z <= 1.45e-224)
		tmp = y * t;
	elseif (z <= 8.5e-217)
		tmp = x;
	elseif (z <= 9.5e-56)
		tmp = y * t;
	elseif ((z <= 3.9e+52) || (~((z <= 1.92e+146)) && (z <= 1.2e+229)))
		tmp = t_1;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, If[LessEqual[z, -6.8e-12], t$95$1, If[LessEqual[z, 4.4e-280], x, If[LessEqual[z, 1.45e-224], N[(y * t), $MachinePrecision], If[LessEqual[z, 8.5e-217], x, If[LessEqual[z, 9.5e-56], N[(y * t), $MachinePrecision], If[Or[LessEqual[z, 3.9e+52], And[N[Not[LessEqual[z, 1.92e+146]], $MachinePrecision], LessEqual[z, 1.2e+229]]], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 4.4 \cdot 10^{-280}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{-224}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-217}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9.5 \cdot 10^{-56}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 3.9 \cdot 10^{+52} \lor \neg \left(z \leq 1.92 \cdot 10^{+146}\right) \land z \leq 1.2 \cdot 10^{+229}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.8000000000000001e-12 or 9.4999999999999991e-56 < z < 3.9e52 or 1.91999999999999993e146 < z < 1.2e229

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -6.8000000000000001e-12 < z < 4.4000000000000002e-280 or 1.45e-224 < z < 8.4999999999999994e-217

    1. Initial program 100.0%

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

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

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

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

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

    if 4.4000000000000002e-280 < z < 1.45e-224 or 8.4999999999999994e-217 < z < 9.4999999999999991e-56

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

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

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
      3. distribute-lft-in91.0%

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

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

        \[\leadsto \color{blue}{\left(x + y \cdot t\right) + y \cdot \left(-x\right)} \]
      2. distribute-rgt-neg-out91.0%

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

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

        \[\leadsto \left(x + \color{blue}{t \cdot y}\right) - y \cdot x \]
    9. Applied egg-rr91.0%

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

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

    if 3.9e52 < z < 1.91999999999999993e146 or 1.2e229 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-12}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 4.4 \cdot 10^{-280}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{-224}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-217}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-56}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 3.9 \cdot 10^{+52} \lor \neg \left(z \leq 1.92 \cdot 10^{+146}\right) \land z \leq 1.2 \cdot 10^{+229}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := z \cdot \left(-t\right)\\ t_2 := x \cdot \left(1 - y\right)\\ \mathbf{if}\;z \leq -1.3 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-278}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-233}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{-213}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-116}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+51}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+148}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+228}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (* z (- t))) (t_2 (* x (- 1.0 y))))
   (if (<= z -1.3e+91)
     t_1
     (if (<= z 4.2e-278)
       t_2
       (if (<= z 2.1e-233)
         (* y t)
         (if (<= z 2.45e-213)
           t_2
           (if (<= z 2.7e-116)
             (* y t)
             (if (<= z 2e+51)
               t_2
               (if (<= z 1.45e+148)
                 (* x (+ z 1.0))
                 (if (<= z 4.6e+228) t_1 (* z x)))))))))))
double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (1.0 - y);
	double tmp;
	if (z <= -1.3e+91) {
		tmp = t_1;
	} else if (z <= 4.2e-278) {
		tmp = t_2;
	} else if (z <= 2.1e-233) {
		tmp = y * t;
	} else if (z <= 2.45e-213) {
		tmp = t_2;
	} else if (z <= 2.7e-116) {
		tmp = y * t;
	} else if (z <= 2e+51) {
		tmp = t_2;
	} else if (z <= 1.45e+148) {
		tmp = x * (z + 1.0);
	} else if (z <= 4.6e+228) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = z * -t
    t_2 = x * (1.0d0 - y)
    if (z <= (-1.3d+91)) then
        tmp = t_1
    else if (z <= 4.2d-278) then
        tmp = t_2
    else if (z <= 2.1d-233) then
        tmp = y * t
    else if (z <= 2.45d-213) then
        tmp = t_2
    else if (z <= 2.7d-116) then
        tmp = y * t
    else if (z <= 2d+51) then
        tmp = t_2
    else if (z <= 1.45d+148) then
        tmp = x * (z + 1.0d0)
    else if (z <= 4.6d+228) then
        tmp = t_1
    else
        tmp = z * x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = z * -t;
	double t_2 = x * (1.0 - y);
	double tmp;
	if (z <= -1.3e+91) {
		tmp = t_1;
	} else if (z <= 4.2e-278) {
		tmp = t_2;
	} else if (z <= 2.1e-233) {
		tmp = y * t;
	} else if (z <= 2.45e-213) {
		tmp = t_2;
	} else if (z <= 2.7e-116) {
		tmp = y * t;
	} else if (z <= 2e+51) {
		tmp = t_2;
	} else if (z <= 1.45e+148) {
		tmp = x * (z + 1.0);
	} else if (z <= 4.6e+228) {
		tmp = t_1;
	} else {
		tmp = z * x;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = z * -t
	t_2 = x * (1.0 - y)
	tmp = 0
	if z <= -1.3e+91:
		tmp = t_1
	elif z <= 4.2e-278:
		tmp = t_2
	elif z <= 2.1e-233:
		tmp = y * t
	elif z <= 2.45e-213:
		tmp = t_2
	elif z <= 2.7e-116:
		tmp = y * t
	elif z <= 2e+51:
		tmp = t_2
	elif z <= 1.45e+148:
		tmp = x * (z + 1.0)
	elif z <= 4.6e+228:
		tmp = t_1
	else:
		tmp = z * x
	return tmp
function code(x, y, z, t)
	t_1 = Float64(z * Float64(-t))
	t_2 = Float64(x * Float64(1.0 - y))
	tmp = 0.0
	if (z <= -1.3e+91)
		tmp = t_1;
	elseif (z <= 4.2e-278)
		tmp = t_2;
	elseif (z <= 2.1e-233)
		tmp = Float64(y * t);
	elseif (z <= 2.45e-213)
		tmp = t_2;
	elseif (z <= 2.7e-116)
		tmp = Float64(y * t);
	elseif (z <= 2e+51)
		tmp = t_2;
	elseif (z <= 1.45e+148)
		tmp = Float64(x * Float64(z + 1.0));
	elseif (z <= 4.6e+228)
		tmp = t_1;
	else
		tmp = Float64(z * x);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = z * -t;
	t_2 = x * (1.0 - y);
	tmp = 0.0;
	if (z <= -1.3e+91)
		tmp = t_1;
	elseif (z <= 4.2e-278)
		tmp = t_2;
	elseif (z <= 2.1e-233)
		tmp = y * t;
	elseif (z <= 2.45e-213)
		tmp = t_2;
	elseif (z <= 2.7e-116)
		tmp = y * t;
	elseif (z <= 2e+51)
		tmp = t_2;
	elseif (z <= 1.45e+148)
		tmp = x * (z + 1.0);
	elseif (z <= 4.6e+228)
		tmp = t_1;
	else
		tmp = z * x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * (-t)), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.3e+91], t$95$1, If[LessEqual[z, 4.2e-278], t$95$2, If[LessEqual[z, 2.1e-233], N[(y * t), $MachinePrecision], If[LessEqual[z, 2.45e-213], t$95$2, If[LessEqual[z, 2.7e-116], N[(y * t), $MachinePrecision], If[LessEqual[z, 2e+51], t$95$2, If[LessEqual[z, 1.45e+148], N[(x * N[(z + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.6e+228], t$95$1, N[(z * x), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-278}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-233}:\\
\;\;\;\;y \cdot t\\

\mathbf{elif}\;z \leq 2.45 \cdot 10^{-213}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;z \leq 2 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 1.45 \cdot 10^{+148}:\\
\;\;\;\;x \cdot \left(z + 1\right)\\

\mathbf{elif}\;z \leq 4.6 \cdot 10^{+228}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.3e91 or 1.45e148 < z < 4.60000000000000026e228

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if -1.3e91 < z < 4.20000000000000027e-278 or 2.0999999999999999e-233 < z < 2.4499999999999999e-213 or 2.7e-116 < z < 2e51

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

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

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

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

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

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

    if 4.20000000000000027e-278 < z < 2.0999999999999999e-233 or 2.4499999999999999e-213 < z < 2.7e-116

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x + y \cdot t\right) + y \cdot \left(-x\right)} \]
      2. distribute-rgt-neg-out88.8%

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

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

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

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

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

    if 2e51 < z < 1.45e148

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

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

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

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

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

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

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

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

    if 4.60000000000000026e228 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.3 \cdot 10^{+91}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-278}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-233}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{-213}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 2.7 \cdot 10^{-116}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+51}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+148}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;z \leq 4.6 \cdot 10^{+228}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 48.5% 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 -2.15 \cdot 10^{+41}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-182}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-126}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 0.00162:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+216} \lor \neg \left(y \leq 9 \cdot 10^{+257}\right):\\ \;\;\;\;y \cdot t\\ \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 -2.15e+41)
     t_1
     (if (<= y 7e-182)
       t_2
       (if (<= y 8.2e-126)
         (* z (- t))
         (if (<= y 0.00162)
           t_2
           (if (or (<= y 3e+216) (not (<= y 9e+257))) (* y t) 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 <= -2.15e+41) {
		tmp = t_1;
	} else if (y <= 7e-182) {
		tmp = t_2;
	} else if (y <= 8.2e-126) {
		tmp = z * -t;
	} else if (y <= 0.00162) {
		tmp = t_2;
	} else if ((y <= 3e+216) || !(y <= 9e+257)) {
		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) :: t_2
    real(8) :: tmp
    t_1 = y * -x
    t_2 = x * (z + 1.0d0)
    if (y <= (-2.15d+41)) then
        tmp = t_1
    else if (y <= 7d-182) then
        tmp = t_2
    else if (y <= 8.2d-126) then
        tmp = z * -t
    else if (y <= 0.00162d0) then
        tmp = t_2
    else if ((y <= 3d+216) .or. (.not. (y <= 9d+257))) 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 = y * -x;
	double t_2 = x * (z + 1.0);
	double tmp;
	if (y <= -2.15e+41) {
		tmp = t_1;
	} else if (y <= 7e-182) {
		tmp = t_2;
	} else if (y <= 8.2e-126) {
		tmp = z * -t;
	} else if (y <= 0.00162) {
		tmp = t_2;
	} else if ((y <= 3e+216) || !(y <= 9e+257)) {
		tmp = y * t;
	} 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 <= -2.15e+41:
		tmp = t_1
	elif y <= 7e-182:
		tmp = t_2
	elif y <= 8.2e-126:
		tmp = z * -t
	elif y <= 0.00162:
		tmp = t_2
	elif (y <= 3e+216) or not (y <= 9e+257):
		tmp = y * t
	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 <= -2.15e+41)
		tmp = t_1;
	elseif (y <= 7e-182)
		tmp = t_2;
	elseif (y <= 8.2e-126)
		tmp = Float64(z * Float64(-t));
	elseif (y <= 0.00162)
		tmp = t_2;
	elseif ((y <= 3e+216) || !(y <= 9e+257))
		tmp = Float64(y * t);
	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 <= -2.15e+41)
		tmp = t_1;
	elseif (y <= 7e-182)
		tmp = t_2;
	elseif (y <= 8.2e-126)
		tmp = z * -t;
	elseif (y <= 0.00162)
		tmp = t_2;
	elseif ((y <= 3e+216) || ~((y <= 9e+257)))
		tmp = y * t;
	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, -2.15e+41], t$95$1, If[LessEqual[y, 7e-182], t$95$2, If[LessEqual[y, 8.2e-126], N[(z * (-t)), $MachinePrecision], If[LessEqual[y, 0.00162], t$95$2, If[Or[LessEqual[y, 3e+216], N[Not[LessEqual[y, 9e+257]], $MachinePrecision]], N[(y * t), $MachinePrecision], 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 -2.15 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 7 \cdot 10^{-182}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 0.00162:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 3 \cdot 10^{+216} \lor \neg \left(y \leq 9 \cdot 10^{+257}\right):\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -2.15000000000000012e41 or 2.9999999999999998e216 < y < 8.9999999999999999e257

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

    if -2.15000000000000012e41 < y < 6.99999999999999966e-182 or 8.1999999999999995e-126 < y < 0.0016199999999999999

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

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

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

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

    if 6.99999999999999966e-182 < y < 8.1999999999999995e-126

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    if 0.0016199999999999999 < y < 2.9999999999999998e216 or 8.9999999999999999e257 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.15 \cdot 10^{+41}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \mathbf{elif}\;y \leq 7 \cdot 10^{-182}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 8.2 \cdot 10^{-126}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 0.00162:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 3 \cdot 10^{+216} \lor \neg \left(y \leq 9 \cdot 10^{+257}\right):\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(-x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 67.9% accurate, 0.3× speedup?

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

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

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

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-224}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.2 \cdot 10^{-218}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.2e12 or 7.0000000000000004e-46 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -7.2e12 < z < 4.6999999999999997e-278

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

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

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

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

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

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

    if 4.6999999999999997e-278 < z < 4.5000000000000004e-224 or 2.20000000000000007e-218 < z < 7.0000000000000004e-46

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.5000000000000004e-224 < z < 2.20000000000000007e-218

    1. Initial program 100.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7200000000000:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-278}:\\ \;\;\;\;x \cdot \left(1 - y\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-224}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;z \leq 2.2 \cdot 10^{-218}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-46}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 38.2% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -29000000:\\
\;\;\;\;z \cdot x\\

\mathbf{elif}\;z \leq 3.8 \cdot 10^{-280}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-231}:\\
\;\;\;\;y \cdot t\\

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

\mathbf{elif}\;z \leq 7.5 \cdot 10^{+52}:\\
\;\;\;\;y \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.9e7 or 7.49999999999999995e52 < z

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2.9e7 < z < 3.8000000000000001e-280 or 1.79999999999999987e-231 < z < 8.0000000000000003e-216

    1. Initial program 100.0%

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

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

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

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

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

    if 3.8000000000000001e-280 < z < 1.79999999999999987e-231 or 8.0000000000000003e-216 < z < 7.49999999999999995e52

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x + y \cdot t\right) + y \cdot \left(-x\right)} \]
      2. distribute-rgt-neg-out79.1%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -29000000:\\ \;\;\;\;z \cdot x\\ \mathbf{elif}\;z \leq 3.8 \cdot 10^{-280}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-231}:\\ \;\;\;\;y \cdot t\\ \mathbf{elif}\;z \leq 8 \cdot 10^{-216}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.5 \cdot 10^{+52}:\\ \;\;\;\;y \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 66.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;y \leq 4.6 \cdot 10^{-180}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;y \leq 0.00102:\\
\;\;\;\;t\_2\\

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


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

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

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
      3. distribute-lft-in76.6%

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

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

        \[\leadsto \color{blue}{\left(x + y \cdot t\right) + y \cdot \left(-x\right)} \]
      2. distribute-rgt-neg-out76.6%

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

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

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

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

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

    if -16 < y < 4.59999999999999992e-180 or 4.29999999999999999e-135 < y < 0.00102

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

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

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

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

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

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

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

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

    if 4.59999999999999992e-180 < y < 4.29999999999999999e-135

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -16:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq 4.6 \cdot 10^{-180}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 4.3 \cdot 10^{-135}:\\ \;\;\;\;z \cdot \left(-t\right)\\ \mathbf{elif}\;y \leq 0.00102:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 84.2% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -7.2000000000000005e33 or 2.29999999999999997e50 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -7.2000000000000005e33 < z < 4.2000000000000002e-50

    1. Initial program 100.0%

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

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

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

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

    if 4.2000000000000002e-50 < z < 2.29999999999999997e50

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{+33}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-50}:\\ \;\;\;\;x - y \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{+50}:\\ \;\;\;\;x + \left(y - z\right) \cdot t\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(x - t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.7% accurate, 0.4× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2500 or 4.04999999999999997e-10 < 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 80.4%

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

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\left(t + \left(-x\right)\right)} \]
      3. distribute-lft-in75.4%

        \[\leadsto x + \color{blue}{\left(y \cdot t + y \cdot \left(-x\right)\right)} \]
    7. Applied egg-rr75.4%

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

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

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

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

        \[\leadsto \left(x + \color{blue}{t \cdot y}\right) - y \cdot x \]
    9. Applied egg-rr75.4%

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

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

    if -2500 < y < -4.40000000000000018e-231

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

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

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

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

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

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

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

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

    if -4.40000000000000018e-231 < y < 4.04999999999999997e-10

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2500:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -4.4 \cdot 10^{-231}:\\ \;\;\;\;x \cdot \left(z + 1\right)\\ \mathbf{elif}\;y \leq 4.05 \cdot 10^{-10}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.0% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;x - z \cdot t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -4.8e19 or 1.90000000000000006e-9 < y

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(x + y \cdot t\right) + y \cdot \left(-x\right)} \]
      2. distribute-rgt-neg-out74.8%

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

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

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

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

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

    if -4.8e19 < y < -6.8e-231

    1. Initial program 99.9%

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

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

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

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

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

    if -6.8e-231 < y < 1.90000000000000006e-9

    1. Initial program 100.0%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -4.8 \cdot 10^{+19}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \mathbf{elif}\;y \leq -6.8 \cdot 10^{-231}:\\ \;\;\;\;x \cdot \left(\left(z - y\right) + 1\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-9}:\\ \;\;\;\;x - z \cdot t\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(t - x\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 80.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -10500000 \lor \neg \left(t \leq 6 \cdot 10^{-87}\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 -10500000.0) (not (<= t 6e-87)))
   (+ x (* (- y z) t))
   (* x (+ (- z y) 1.0))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((t <= -10500000.0) || !(t <= 6e-87)) {
		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 <= (-10500000.0d0)) .or. (.not. (t <= 6d-87))) 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 <= -10500000.0) || !(t <= 6e-87)) {
		tmp = x + ((y - z) * t);
	} else {
		tmp = x * ((z - y) + 1.0);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (t <= -10500000.0) or not (t <= 6e-87):
		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 <= -10500000.0) || !(t <= 6e-87))
		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 <= -10500000.0) || ~((t <= 6e-87)))
		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, -10500000.0], N[Not[LessEqual[t, 6e-87]], $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 -10500000 \lor \neg \left(t \leq 6 \cdot 10^{-87}\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 < -1.05e7 or 6.00000000000000033e-87 < 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 85.3%

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

    if -1.05e7 < t < 6.00000000000000033e-87

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -10500000 \lor \neg \left(t \leq 6 \cdot 10^{-87}\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 12: 81.7% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.15 \cdot 10^{-99} \lor \neg \left(y \leq 0.00076\right):\\
\;\;\;\;x - y \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1499999999999999e-99 or 7.6000000000000004e-4 < 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 82.2%

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

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

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

    if -1.1499999999999999e-99 < y < 7.6000000000000004e-4

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 13: 70.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+33} \lor \neg \left(z \leq 7 \cdot 10^{-46}\right):\\
\;\;\;\;z \cdot \left(x - t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.80000000000000002e33 or 7.0000000000000004e-46 < z

    1. Initial program 100.0%

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

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

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

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

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

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

    if -3.80000000000000002e33 < z < 7.0000000000000004e-46

    1. Initial program 100.0%

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

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

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

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

      \[\leadsto x + \color{blue}{t \cdot y} \]
    7. Step-by-step derivation
      1. *-commutative73.4%

        \[\leadsto x + \color{blue}{y \cdot t} \]
    8. Simplified73.4%

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

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

Alternative 14: 37.0% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.1499999999999999e-13 or 1.15000000000000004e-10 < 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 80.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1499999999999999e-13 < y < 1.15000000000000004e-10

    1. Initial program 100.0%

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

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

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

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

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

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

Alternative 15: 100.0% accurate, 1.0× speedup?

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

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

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

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

Alternative 16: 17.2% 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 y around inf 63.7%

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

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

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

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

    \[\leadsto x \]
  8. Add Preprocessing

Developer target: 96.5% 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 2024055 
(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))))