Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 79.9% → 90.8%
Time: 21.3s
Alternatives: 20
Speedup: 0.3×

Specification

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

\\
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
\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 20 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: 79.9% accurate, 1.0× speedup?

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

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

Alternative 1: 90.8% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t - x}{a - z}\\ t_2 := x + \left(y - z\right) \cdot t_1\\ \mathbf{if}\;t_2 \leq -1 \cdot 10^{-239} \lor \neg \left(t_2 \leq 4 \cdot 10^{-237}\right):\\ \;\;\;\;\mathsf{fma}\left(y - z, t_1, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ (- t x) (- a z))) (t_2 (+ x (* (- y z) t_1))))
   (if (or (<= t_2 -1e-239) (not (<= t_2 4e-237)))
     (fma (- y z) t_1 x)
     (+ t (/ (- x t) (/ z (- y a)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = (t - x) / (a - z);
	double t_2 = x + ((y - z) * t_1);
	double tmp;
	if ((t_2 <= -1e-239) || !(t_2 <= 4e-237)) {
		tmp = fma((y - z), t_1, x);
	} else {
		tmp = t + ((x - t) / (z / (y - a)));
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(Float64(t - x) / Float64(a - z))
	t_2 = Float64(x + Float64(Float64(y - z) * t_1))
	tmp = 0.0
	if ((t_2 <= -1e-239) || !(t_2 <= 4e-237))
		tmp = fma(Float64(y - z), t_1, x);
	else
		tmp = Float64(t + Float64(Float64(x - t) / Float64(z / Float64(y - a))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -1e-239], N[Not[LessEqual[t$95$2, 4e-237]], $MachinePrecision]], N[(N[(y - z), $MachinePrecision] * t$95$1 + x), $MachinePrecision], N[(t + N[(N[(x - t), $MachinePrecision] / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \frac{t - x}{a - z}\\
t_2 := x + \left(y - z\right) \cdot t_1\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{-239} \lor \neg \left(t_2 \leq 4 \cdot 10^{-237}\right):\\
\;\;\;\;\mathsf{fma}\left(y - z, t_1, x\right)\\

\mathbf{else}:\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.0000000000000001e-239 or 4e-237 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. +-commutative91.9%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    3. Simplified91.9%

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

    if -1.0000000000000001e-239 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e-237

    1. Initial program 7.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 80.5%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--80.8%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*97.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -1 \cdot 10^{-239} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 4 \cdot 10^{-237}\right):\\ \;\;\;\;\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \]

Alternative 2: 90.8% accurate, 0.3× speedup?

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

\\
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{-239} \lor \neg \left(t_1 \leq 4 \cdot 10^{-237}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.0000000000000001e-239 or 4e-237 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]

    if -1.0000000000000001e-239 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 4e-237

    1. Initial program 7.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 80.5%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--80.8%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*97.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -1 \cdot 10^{-239} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 4 \cdot 10^{-237}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \]

Alternative 3: 57.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a - z}\\ t_2 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;z \leq -0.0128:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-86}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-192}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{+48}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.9 \cdot 10^{+167}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) (- a z)))) (t_2 (* t (/ (- y z) (- a z)))))
   (if (<= z -0.0128)
     t_2
     (if (<= z -2.8e-86)
       t_1
       (if (<= z 1.4e-192)
         (* x (- (- -1.0) (/ y a)))
         (if (<= z 1.28e+48)
           t_1
           (if (or (<= z 5.5e+142) (not (<= z 2.9e+167)))
             t_2
             (* (- y a) (/ x z)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double t_2 = t * ((y - z) / (a - z));
	double tmp;
	if (z <= -0.0128) {
		tmp = t_2;
	} else if (z <= -2.8e-86) {
		tmp = t_1;
	} else if (z <= 1.4e-192) {
		tmp = x * (-(-1.0) - (y / a));
	} else if (z <= 1.28e+48) {
		tmp = t_1;
	} else if ((z <= 5.5e+142) || !(z <= 2.9e+167)) {
		tmp = t_2;
	} else {
		tmp = (y - a) * (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * ((t - x) / (a - z))
    t_2 = t * ((y - z) / (a - z))
    if (z <= (-0.0128d0)) then
        tmp = t_2
    else if (z <= (-2.8d-86)) then
        tmp = t_1
    else if (z <= 1.4d-192) then
        tmp = x * (-(-1.0d0) - (y / a))
    else if (z <= 1.28d+48) then
        tmp = t_1
    else if ((z <= 5.5d+142) .or. (.not. (z <= 2.9d+167))) then
        tmp = t_2
    else
        tmp = (y - a) * (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / (a - z));
	double t_2 = t * ((y - z) / (a - z));
	double tmp;
	if (z <= -0.0128) {
		tmp = t_2;
	} else if (z <= -2.8e-86) {
		tmp = t_1;
	} else if (z <= 1.4e-192) {
		tmp = x * (-(-1.0) - (y / a));
	} else if (z <= 1.28e+48) {
		tmp = t_1;
	} else if ((z <= 5.5e+142) || !(z <= 2.9e+167)) {
		tmp = t_2;
	} else {
		tmp = (y - a) * (x / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / (a - z))
	t_2 = t * ((y - z) / (a - z))
	tmp = 0
	if z <= -0.0128:
		tmp = t_2
	elif z <= -2.8e-86:
		tmp = t_1
	elif z <= 1.4e-192:
		tmp = x * (-(-1.0) - (y / a))
	elif z <= 1.28e+48:
		tmp = t_1
	elif (z <= 5.5e+142) or not (z <= 2.9e+167):
		tmp = t_2
	else:
		tmp = (y - a) * (x / z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / Float64(a - z)))
	t_2 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
	tmp = 0.0
	if (z <= -0.0128)
		tmp = t_2;
	elseif (z <= -2.8e-86)
		tmp = t_1;
	elseif (z <= 1.4e-192)
		tmp = Float64(x * Float64(Float64(-(-1.0)) - Float64(y / a)));
	elseif (z <= 1.28e+48)
		tmp = t_1;
	elseif ((z <= 5.5e+142) || !(z <= 2.9e+167))
		tmp = t_2;
	else
		tmp = Float64(Float64(y - a) * Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / (a - z));
	t_2 = t * ((y - z) / (a - z));
	tmp = 0.0;
	if (z <= -0.0128)
		tmp = t_2;
	elseif (z <= -2.8e-86)
		tmp = t_1;
	elseif (z <= 1.4e-192)
		tmp = x * (-(-1.0) - (y / a));
	elseif (z <= 1.28e+48)
		tmp = t_1;
	elseif ((z <= 5.5e+142) || ~((z <= 2.9e+167)))
		tmp = t_2;
	else
		tmp = (y - a) * (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -0.0128], t$95$2, If[LessEqual[z, -2.8e-86], t$95$1, If[LessEqual[z, 1.4e-192], N[(x * N[((--1.0) - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.28e+48], t$95$1, If[Or[LessEqual[z, 5.5e+142], N[Not[LessEqual[z, 2.9e+167]], $MachinePrecision]], t$95$2, N[(N[(y - a), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := y \cdot \frac{t - x}{a - z}\\
t_2 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -0.0128:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-86}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-192}:\\
\;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\

\mathbf{elif}\;z \leq 1.28 \cdot 10^{+48}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 5.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.9 \cdot 10^{+167}\right):\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -0.0128000000000000006 or 1.28e48 < z < 5.50000000000000035e142 or 2.89999999999999975e167 < z

    1. Initial program 67.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in x around 0 45.3%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified68.7%

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. div-inv68.6%

        \[\leadsto \color{blue}{t \cdot \frac{1}{\frac{a - z}{y - z}}} \]
      2. *-commutative68.6%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num68.7%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr68.7%

      \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot t} \]

    if -0.0128000000000000006 < z < -2.80000000000000009e-86 or 1.40000000000000002e-192 < z < 1.28e48

    1. Initial program 88.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 66.0%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub66.0%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified66.0%

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

    if -2.80000000000000009e-86 < z < 1.40000000000000002e-192

    1. Initial program 95.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 84.8%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified86.1%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]
    5. Taylor expanded in x around -inf 71.3%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y}{a} - 1\right) \]
      3. sub-neg71.3%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(\frac{y}{a} + \left(-1\right)\right)} \]
      4. metadata-eval71.3%

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

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

    if 5.50000000000000035e142 < z < 2.89999999999999975e167

    1. Initial program 34.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 84.5%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--84.5%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*84.1%

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

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in t around 0 65.1%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \left(y - a\right)} \]
      2. *-commutative80.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -0.0128:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-86}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-192}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.28 \cdot 10^{+48}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{+142} \lor \neg \left(z \leq 2.9 \cdot 10^{+167}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]

Alternative 4: 40.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+84}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+121}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+167}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1e+84)
   t
   (if (<= z -1.9e-179)
     x
     (if (<= z 9e+62)
       (* y (/ (- t x) a))
       (if (<= z 5.8e+121) t (if (<= z 6.4e+167) (* (- y a) (/ x z)) t))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+84) {
		tmp = t;
	} else if (z <= -1.9e-179) {
		tmp = x;
	} else if (z <= 9e+62) {
		tmp = y * ((t - x) / a);
	} else if (z <= 5.8e+121) {
		tmp = t;
	} else if (z <= 6.4e+167) {
		tmp = (y - a) * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-1d+84)) then
        tmp = t
    else if (z <= (-1.9d-179)) then
        tmp = x
    else if (z <= 9d+62) then
        tmp = y * ((t - x) / a)
    else if (z <= 5.8d+121) then
        tmp = t
    else if (z <= 6.4d+167) then
        tmp = (y - a) * (x / z)
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1e+84) {
		tmp = t;
	} else if (z <= -1.9e-179) {
		tmp = x;
	} else if (z <= 9e+62) {
		tmp = y * ((t - x) / a);
	} else if (z <= 5.8e+121) {
		tmp = t;
	} else if (z <= 6.4e+167) {
		tmp = (y - a) * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1e+84:
		tmp = t
	elif z <= -1.9e-179:
		tmp = x
	elif z <= 9e+62:
		tmp = y * ((t - x) / a)
	elif z <= 5.8e+121:
		tmp = t
	elif z <= 6.4e+167:
		tmp = (y - a) * (x / z)
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1e+84)
		tmp = t;
	elseif (z <= -1.9e-179)
		tmp = x;
	elseif (z <= 9e+62)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (z <= 5.8e+121)
		tmp = t;
	elseif (z <= 6.4e+167)
		tmp = Float64(Float64(y - a) * Float64(x / z));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1e+84)
		tmp = t;
	elseif (z <= -1.9e-179)
		tmp = x;
	elseif (z <= 9e+62)
		tmp = y * ((t - x) / a);
	elseif (z <= 5.8e+121)
		tmp = t;
	elseif (z <= 6.4e+167)
		tmp = (y - a) * (x / z);
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1e+84], t, If[LessEqual[z, -1.9e-179], x, If[LessEqual[z, 9e+62], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+121], t, If[LessEqual[z, 6.4e+167], N[(N[(y - a), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+84}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq -1.9 \cdot 10^{-179}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 9 \cdot 10^{+62}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+121}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{+167}:\\
\;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.00000000000000006e84 or 8.99999999999999997e62 < z < 5.7999999999999998e121 or 6.39999999999999962e167 < z

    1. Initial program 63.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 58.2%

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

    if -1.00000000000000006e84 < z < -1.89999999999999987e-179

    1. Initial program 89.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 37.6%

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

    if -1.89999999999999987e-179 < z < 8.99999999999999997e62

    1. Initial program 92.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 59.6%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub60.5%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified60.5%

      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
    5. Taylor expanded in a around inf 49.6%

      \[\leadsto y \cdot \color{blue}{\frac{t - x}{a}} \]

    if 5.7999999999999998e121 < z < 6.39999999999999962e167

    1. Initial program 51.2%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 64.2%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--64.2%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*64.0%

        \[\leadsto t + \left(-\color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) \]
    4. Simplified64.0%

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in t around 0 49.6%

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

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

        \[\leadsto \color{blue}{\left(y - a\right) \cdot \frac{x}{z}} \]
    7. Simplified61.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+84}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.9 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 9 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+121}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+167}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 5: 64.7% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{+88}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+142} \lor \neg \left(z \leq 1.9 \cdot 10^{+167}\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- y z) (- a z)))))
   (if (<= z -2.1e+88)
     t_1
     (if (<= z 1.75e+64)
       (+ x (/ y (/ a (- t x))))
       (if (or (<= z 6.4e+142) (not (<= z 1.9e+167)))
         t_1
         (* (- y a) (/ x z)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (z <= -2.1e+88) {
		tmp = t_1;
	} else if (z <= 1.75e+64) {
		tmp = x + (y / (a / (t - x)));
	} else if ((z <= 6.4e+142) || !(z <= 1.9e+167)) {
		tmp = t_1;
	} else {
		tmp = (y - a) * (x / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = t * ((y - z) / (a - z))
    if (z <= (-2.1d+88)) then
        tmp = t_1
    else if (z <= 1.75d+64) then
        tmp = x + (y / (a / (t - x)))
    else if ((z <= 6.4d+142) .or. (.not. (z <= 1.9d+167))) then
        tmp = t_1
    else
        tmp = (y - a) * (x / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((y - z) / (a - z));
	double tmp;
	if (z <= -2.1e+88) {
		tmp = t_1;
	} else if (z <= 1.75e+64) {
		tmp = x + (y / (a / (t - x)));
	} else if ((z <= 6.4e+142) || !(z <= 1.9e+167)) {
		tmp = t_1;
	} else {
		tmp = (y - a) * (x / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((y - z) / (a - z))
	tmp = 0
	if z <= -2.1e+88:
		tmp = t_1
	elif z <= 1.75e+64:
		tmp = x + (y / (a / (t - x)))
	elif (z <= 6.4e+142) or not (z <= 1.9e+167):
		tmp = t_1
	else:
		tmp = (y - a) * (x / z)
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(y - z) / Float64(a - z)))
	tmp = 0.0
	if (z <= -2.1e+88)
		tmp = t_1;
	elseif (z <= 1.75e+64)
		tmp = Float64(x + Float64(y / Float64(a / Float64(t - x))));
	elseif ((z <= 6.4e+142) || !(z <= 1.9e+167))
		tmp = t_1;
	else
		tmp = Float64(Float64(y - a) * Float64(x / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((y - z) / (a - z));
	tmp = 0.0;
	if (z <= -2.1e+88)
		tmp = t_1;
	elseif (z <= 1.75e+64)
		tmp = x + (y / (a / (t - x)));
	elseif ((z <= 6.4e+142) || ~((z <= 1.9e+167)))
		tmp = t_1;
	else
		tmp = (y - a) * (x / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+88], t$95$1, If[LessEqual[z, 1.75e+64], N[(x + N[(y / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 6.4e+142], N[Not[LessEqual[z, 1.9e+167]], $MachinePrecision]], t$95$1, N[(N[(y - a), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+88}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{+64}:\\
\;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\

\mathbf{elif}\;z \leq 6.4 \cdot 10^{+142} \lor \neg \left(z \leq 1.9 \cdot 10^{+167}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.1e88 or 1.7499999999999999e64 < z < 6.40000000000000011e142 or 1.89999999999999997e167 < z

    1. Initial program 63.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in x around 0 46.5%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified74.7%

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. div-inv74.7%

        \[\leadsto \color{blue}{t \cdot \frac{1}{\frac{a - z}{y - z}}} \]
      2. *-commutative74.7%

        \[\leadsto \color{blue}{\frac{1}{\frac{a - z}{y - z}} \cdot t} \]
      3. clear-num74.7%

        \[\leadsto \color{blue}{\frac{y - z}{a - z}} \cdot t \]
    6. Applied egg-rr74.7%

      \[\leadsto \color{blue}{\frac{y - z}{a - z} \cdot t} \]

    if -2.1e88 < z < 1.7499999999999999e64

    1. Initial program 92.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 67.7%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified71.5%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]

    if 6.40000000000000011e142 < z < 1.89999999999999997e167

    1. Initial program 34.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 84.5%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--84.5%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*84.1%

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

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in t around 0 65.1%

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

        \[\leadsto \color{blue}{\frac{x}{z} \cdot \left(y - a\right)} \]
      2. *-commutative80.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+88}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{+64}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq 6.4 \cdot 10^{+142} \lor \neg \left(z \leq 1.9 \cdot 10^{+167}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]

Alternative 6: 51.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \frac{t}{\frac{-z}{y - z}}\\ t_2 := x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{if}\;a \leq -7.5 \cdot 10^{+78}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-219}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{+30}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (/ t (/ (- z) (- y z)))) (t_2 (* x (- (- -1.0) (/ y a)))))
   (if (<= a -7.5e+78)
     t_2
     (if (<= a -2.4e-172)
       t_1
       (if (<= a 9e-219) (* y (/ (- x t) z)) (if (<= a 6.2e+30) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t / (-z / (y - z));
	double t_2 = x * (-(-1.0) - (y / a));
	double tmp;
	if (a <= -7.5e+78) {
		tmp = t_2;
	} else if (a <= -2.4e-172) {
		tmp = t_1;
	} else if (a <= 9e-219) {
		tmp = y * ((x - t) / z);
	} else if (a <= 6.2e+30) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t / (-z / (y - z))
    t_2 = x * (-(-1.0d0) - (y / a))
    if (a <= (-7.5d+78)) then
        tmp = t_2
    else if (a <= (-2.4d-172)) then
        tmp = t_1
    else if (a <= 9d-219) then
        tmp = y * ((x - t) / z)
    else if (a <= 6.2d+30) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t / (-z / (y - z));
	double t_2 = x * (-(-1.0) - (y / a));
	double tmp;
	if (a <= -7.5e+78) {
		tmp = t_2;
	} else if (a <= -2.4e-172) {
		tmp = t_1;
	} else if (a <= 9e-219) {
		tmp = y * ((x - t) / z);
	} else if (a <= 6.2e+30) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t / (-z / (y - z))
	t_2 = x * (-(-1.0) - (y / a))
	tmp = 0
	if a <= -7.5e+78:
		tmp = t_2
	elif a <= -2.4e-172:
		tmp = t_1
	elif a <= 9e-219:
		tmp = y * ((x - t) / z)
	elif a <= 6.2e+30:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t / Float64(Float64(-z) / Float64(y - z)))
	t_2 = Float64(x * Float64(Float64(-(-1.0)) - Float64(y / a)))
	tmp = 0.0
	if (a <= -7.5e+78)
		tmp = t_2;
	elseif (a <= -2.4e-172)
		tmp = t_1;
	elseif (a <= 9e-219)
		tmp = Float64(y * Float64(Float64(x - t) / z));
	elseif (a <= 6.2e+30)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t / (-z / (y - z));
	t_2 = x * (-(-1.0) - (y / a));
	tmp = 0.0;
	if (a <= -7.5e+78)
		tmp = t_2;
	elseif (a <= -2.4e-172)
		tmp = t_1;
	elseif (a <= 9e-219)
		tmp = y * ((x - t) / z);
	elseif (a <= 6.2e+30)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t / N[((-z) / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[((--1.0) - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.5e+78], t$95$2, If[LessEqual[a, -2.4e-172], t$95$1, If[LessEqual[a, 9e-219], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e+30], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -2.4 \cdot 10^{-172}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;a \leq 6.2 \cdot 10^{+30}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.49999999999999934e78 or 6.1999999999999995e30 < a

    1. Initial program 88.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 64.2%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified73.1%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]
    5. Taylor expanded in x around -inf 62.4%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y}{a} - 1\right) \]
      3. sub-neg62.4%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(\frac{y}{a} + \left(-1\right)\right)} \]
      4. metadata-eval62.4%

        \[\leadsto \left(-x\right) \cdot \left(\frac{y}{a} + \color{blue}{-1}\right) \]
    7. Simplified62.4%

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

    if -7.49999999999999934e78 < a < -2.4000000000000001e-172 or 9.00000000000000029e-219 < a < 6.1999999999999995e30

    1. Initial program 71.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in x around 0 50.2%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified66.2%

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Taylor expanded in a around 0 59.6%

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{z}{y - z}}} \]
    6. Step-by-step derivation
      1. mul-1-neg59.6%

        \[\leadsto \frac{t}{\color{blue}{-\frac{z}{y - z}}} \]
      2. distribute-neg-frac59.6%

        \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
    7. Simplified59.6%

      \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]

    if -2.4000000000000001e-172 < a < 9.00000000000000029e-219

    1. Initial program 81.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 76.4%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub78.6%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified78.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.5 \cdot 10^{+78}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-172}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;a \leq 9 \cdot 10^{-219}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{+30}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \end{array} \]

Alternative 7: 53.8% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{+79}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -5.2 \cdot 10^{-168}:\\
\;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{-215}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{+29}:\\
\;\;\;\;\frac{t}{\frac{-z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -8.2e79 or 4.5000000000000002e29 < a

    1. Initial program 88.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 64.2%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified73.1%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]
    5. Taylor expanded in x around -inf 62.4%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y}{a} - 1\right) \]
      3. sub-neg62.4%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(\frac{y}{a} + \left(-1\right)\right)} \]
      4. metadata-eval62.4%

        \[\leadsto \left(-x\right) \cdot \left(\frac{y}{a} + \color{blue}{-1}\right) \]
    7. Simplified62.4%

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

    if -8.2e79 < a < -5.2000000000000002e-168

    1. Initial program 67.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in x around 0 42.7%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified61.8%

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Step-by-step derivation
      1. associate-/r/58.1%

        \[\leadsto \color{blue}{\frac{t}{a - z} \cdot \left(y - z\right)} \]
    6. Applied egg-rr58.1%

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

    if -5.2000000000000002e-168 < a < 1.70000000000000001e-215

    1. Initial program 81.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 76.4%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub78.6%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified78.6%

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

    if 1.70000000000000001e-215 < a < 4.5000000000000002e29

    1. Initial program 74.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in x around 0 57.8%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified70.5%

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Taylor expanded in a around 0 64.9%

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{z}{y - z}}} \]
    6. Step-by-step derivation
      1. mul-1-neg64.9%

        \[\leadsto \frac{t}{\color{blue}{-\frac{z}{y - z}}} \]
      2. distribute-neg-frac64.9%

        \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
    7. Simplified64.9%

      \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.2 \cdot 10^{+79}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -5.2 \cdot 10^{-168}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{-215}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{+29}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \end{array} \]

Alternative 8: 53.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+84}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+64}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+121}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+167}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4.5e+84)
   t
   (if (<= z 2.1e+64)
     (+ x (* t (/ y a)))
     (if (<= z 1.5e+121) t (if (<= z 4.5e+167) (* (- y a) (/ x z)) t)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.5e+84) {
		tmp = t;
	} else if (z <= 2.1e+64) {
		tmp = x + (t * (y / a));
	} else if (z <= 1.5e+121) {
		tmp = t;
	} else if (z <= 4.5e+167) {
		tmp = (y - a) * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (z <= (-4.5d+84)) then
        tmp = t
    else if (z <= 2.1d+64) then
        tmp = x + (t * (y / a))
    else if (z <= 1.5d+121) then
        tmp = t
    else if (z <= 4.5d+167) then
        tmp = (y - a) * (x / z)
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.5e+84) {
		tmp = t;
	} else if (z <= 2.1e+64) {
		tmp = x + (t * (y / a));
	} else if (z <= 1.5e+121) {
		tmp = t;
	} else if (z <= 4.5e+167) {
		tmp = (y - a) * (x / z);
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.5e+84:
		tmp = t
	elif z <= 2.1e+64:
		tmp = x + (t * (y / a))
	elif z <= 1.5e+121:
		tmp = t
	elif z <= 4.5e+167:
		tmp = (y - a) * (x / z)
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.5e+84)
		tmp = t;
	elseif (z <= 2.1e+64)
		tmp = Float64(x + Float64(t * Float64(y / a)));
	elseif (z <= 1.5e+121)
		tmp = t;
	elseif (z <= 4.5e+167)
		tmp = Float64(Float64(y - a) * Float64(x / z));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4.5e+84)
		tmp = t;
	elseif (z <= 2.1e+64)
		tmp = x + (t * (y / a));
	elseif (z <= 1.5e+121)
		tmp = t;
	elseif (z <= 4.5e+167)
		tmp = (y - a) * (x / z);
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+84], t, If[LessEqual[z, 2.1e+64], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.5e+121], t, If[LessEqual[z, 4.5e+167], N[(N[(y - a), $MachinePrecision] * N[(x / z), $MachinePrecision]), $MachinePrecision], t]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+84}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{+64}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

\mathbf{elif}\;z \leq 1.5 \cdot 10^{+121}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{+167}:\\
\;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4999999999999997e84 or 2.1e64 < z < 1.5000000000000001e121 or 4.4999999999999999e167 < z

    1. Initial program 62.5%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 58.4%

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

    if -4.4999999999999997e84 < z < 2.1e64

    1. Initial program 92.0%

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

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/54.0%

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    5. Simplified54.0%

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

    if 1.5000000000000001e121 < z < 4.4999999999999999e167

    1. Initial program 51.2%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 64.2%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--64.2%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*64.0%

        \[\leadsto t + \left(-\color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) \]
    4. Simplified64.0%

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in t around 0 49.6%

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

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

        \[\leadsto \color{blue}{\left(y - a\right) \cdot \frac{x}{z}} \]
    7. Simplified61.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+84}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{+64}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 1.5 \cdot 10^{+121}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{+167}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 9: 47.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\
\mathbf{if}\;a \leq -3.15 \cdot 10^{-27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{-150}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\

\mathbf{elif}\;a \leq 1.25 \cdot 10^{+32}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.15000000000000005e-27 or 1.2499999999999999e32 < a

    1. Initial program 86.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 61.4%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified69.1%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]
    5. Taylor expanded in x around -inf 59.1%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y}{a} - 1\right) \]
      3. sub-neg59.1%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(\frac{y}{a} + \left(-1\right)\right)} \]
      4. metadata-eval59.1%

        \[\leadsto \left(-x\right) \cdot \left(\frac{y}{a} + \color{blue}{-1}\right) \]
    7. Simplified59.1%

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

    if -3.15000000000000005e-27 < a < 1.24999999999999997e-150

    1. Initial program 75.5%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 62.3%

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified63.4%

      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
    5. Taylor expanded in a around 0 51.7%

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

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

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

    if 1.24999999999999997e-150 < a < 1.2499999999999999e32

    1. Initial program 73.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 52.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.15 \cdot 10^{-27}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{-150}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 1.25 \cdot 10^{+32}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \end{array} \]

Alternative 10: 53.1% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{+32}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 1.52 \cdot 10^{-218}:\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\

\mathbf{elif}\;a \leq 2.45 \cdot 10^{+29}:\\
\;\;\;\;\frac{t}{\frac{-z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.2000000000000004e32 or 2.4500000000000001e29 < a

    1. Initial program 86.6%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 62.5%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified70.9%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]
    5. Taylor expanded in x around -inf 60.9%

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

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

        \[\leadsto \color{blue}{\left(-x\right)} \cdot \left(\frac{y}{a} - 1\right) \]
      3. sub-neg60.9%

        \[\leadsto \left(-x\right) \cdot \color{blue}{\left(\frac{y}{a} + \left(-1\right)\right)} \]
      4. metadata-eval60.9%

        \[\leadsto \left(-x\right) \cdot \left(\frac{y}{a} + \color{blue}{-1}\right) \]
    7. Simplified60.9%

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

    if -5.2000000000000004e32 < a < 1.5200000000000001e-218

    1. Initial program 75.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 62.8%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub63.9%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified63.9%

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

    if 1.5200000000000001e-218 < a < 2.4500000000000001e29

    1. Initial program 74.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in x around 0 57.8%

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified70.5%

      \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    5. Taylor expanded in a around 0 64.9%

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{z}{y - z}}} \]
    6. Step-by-step derivation
      1. mul-1-neg64.9%

        \[\leadsto \frac{t}{\color{blue}{-\frac{z}{y - z}}} \]
      2. distribute-neg-frac64.9%

        \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
    7. Simplified64.9%

      \[\leadsto \frac{t}{\color{blue}{\frac{-z}{y - z}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification62.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.2 \cdot 10^{+32}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq 1.52 \cdot 10^{-218}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 2.45 \cdot 10^{+29}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\left(--1\right) - \frac{y}{a}\right)\\ \end{array} \]

Alternative 11: 40.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+83}:\\
\;\;\;\;t\\

\mathbf{elif}\;z \leq -2.55 \cdot 10^{-179}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 7.8 \cdot 10^{+62}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.5000000000000003e83 or 7.8e62 < z

    1. Initial program 62.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 54.4%

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

    if -6.5000000000000003e83 < z < -2.55000000000000014e-179

    1. Initial program 89.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 37.6%

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

    if -2.55000000000000014e-179 < z < 7.8e62

    1. Initial program 92.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 59.6%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub60.5%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified60.5%

      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
    5. Taylor expanded in a around inf 49.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+83}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -2.55 \cdot 10^{-179}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 7.8 \cdot 10^{+62}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 12: 50.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := x + t \cdot \frac{y}{a}\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq 4.5 \cdot 10^{-151}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\

\mathbf{elif}\;a \leq 5.7 \cdot 10^{+28}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.2000000000000001e-66 or 5.7000000000000003e28 < a

    1. Initial program 85.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in t around inf 70.9%

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

      \[\leadsto x + \color{blue}{\frac{t \cdot y}{a}} \]
    4. Step-by-step derivation
      1. associate-*r/57.3%

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    5. Simplified57.3%

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

    if -4.2000000000000001e-66 < a < 4.5000000000000002e-151

    1. Initial program 76.6%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around inf 63.8%

      \[\leadsto \color{blue}{y \cdot \left(\frac{t}{a - z} - \frac{x}{a - z}\right)} \]
    3. Step-by-step derivation
      1. div-sub64.9%

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a - z}} \]
    4. Simplified64.9%

      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
    5. Taylor expanded in a around 0 52.8%

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

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

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

    if 4.5000000000000002e-151 < a < 5.7000000000000003e28

    1. Initial program 72.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 53.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.2 \cdot 10^{-66}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq 4.5 \cdot 10^{-151}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{+28}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]

Alternative 13: 38.1% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-169}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-218}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+38}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -1.05e+96)
   x
   (if (<= a -2e-169)
     t
     (if (<= a 9.2e-218) (* y (/ x z)) (if (<= a 2.9e+38) t x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.05e+96) {
		tmp = x;
	} else if (a <= -2e-169) {
		tmp = t;
	} else if (a <= 9.2e-218) {
		tmp = y * (x / z);
	} else if (a <= 2.9e+38) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-1.05d+96)) then
        tmp = x
    else if (a <= (-2d-169)) then
        tmp = t
    else if (a <= 9.2d-218) then
        tmp = y * (x / z)
    else if (a <= 2.9d+38) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.05e+96) {
		tmp = x;
	} else if (a <= -2e-169) {
		tmp = t;
	} else if (a <= 9.2e-218) {
		tmp = y * (x / z);
	} else if (a <= 2.9e+38) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -1.05e+96:
		tmp = x
	elif a <= -2e-169:
		tmp = t
	elif a <= 9.2e-218:
		tmp = y * (x / z)
	elif a <= 2.9e+38:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -1.05e+96)
		tmp = x;
	elseif (a <= -2e-169)
		tmp = t;
	elseif (a <= 9.2e-218)
		tmp = Float64(y * Float64(x / z));
	elseif (a <= 2.9e+38)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -1.05e+96)
		tmp = x;
	elseif (a <= -2e-169)
		tmp = t;
	elseif (a <= 9.2e-218)
		tmp = y * (x / z);
	elseif (a <= 2.9e+38)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.05e+96], x, If[LessEqual[a, -2e-169], t, If[LessEqual[a, 9.2e-218], N[(y * N[(x / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.9e+38], t, x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.05 \cdot 10^{+96}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -2 \cdot 10^{-169}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 9.2 \cdot 10^{-218}:\\
\;\;\;\;y \cdot \frac{x}{z}\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{+38}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.0500000000000001e96 or 2.90000000000000007e38 < a

    1. Initial program 88.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 48.9%

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

    if -1.0500000000000001e96 < a < -2.00000000000000004e-169 or 9.19999999999999979e-218 < a < 2.90000000000000007e38

    1. Initial program 72.2%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 40.7%

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

    if -2.00000000000000004e-169 < a < 9.19999999999999979e-218

    1. Initial program 81.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around -inf 76.5%

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{a - z} \]
      2. distribute-lft-neg-out54.3%

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot y}}{a - z} \]
      3. *-commutative54.3%

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

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

      \[\leadsto \color{blue}{\frac{x \cdot y}{z}} \]
    7. Step-by-step derivation
      1. associate-/l*45.9%

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
      2. associate-/r/47.8%

        \[\leadsto \color{blue}{\frac{x}{z} \cdot y} \]
    8. Simplified47.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.05 \cdot 10^{+96}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2 \cdot 10^{-169}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 9.2 \cdot 10^{-218}:\\ \;\;\;\;y \cdot \frac{x}{z}\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+38}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 14: 37.7% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+115}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.55 \cdot 10^{-173}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 10^{-219}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;a \leq 10^{+33}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -1.55e+115)
   x
   (if (<= a -2.55e-173)
     t
     (if (<= a 1e-219) (/ (* x y) z) (if (<= a 1e+33) t x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.55e+115) {
		tmp = x;
	} else if (a <= -2.55e-173) {
		tmp = t;
	} else if (a <= 1e-219) {
		tmp = (x * y) / z;
	} else if (a <= 1e+33) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-1.55d+115)) then
        tmp = x
    else if (a <= (-2.55d-173)) then
        tmp = t
    else if (a <= 1d-219) then
        tmp = (x * y) / z
    else if (a <= 1d+33) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -1.55e+115) {
		tmp = x;
	} else if (a <= -2.55e-173) {
		tmp = t;
	} else if (a <= 1e-219) {
		tmp = (x * y) / z;
	} else if (a <= 1e+33) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -1.55e+115:
		tmp = x
	elif a <= -2.55e-173:
		tmp = t
	elif a <= 1e-219:
		tmp = (x * y) / z
	elif a <= 1e+33:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -1.55e+115)
		tmp = x;
	elseif (a <= -2.55e-173)
		tmp = t;
	elseif (a <= 1e-219)
		tmp = Float64(Float64(x * y) / z);
	elseif (a <= 1e+33)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -1.55e+115)
		tmp = x;
	elseif (a <= -2.55e-173)
		tmp = t;
	elseif (a <= 1e-219)
		tmp = (x * y) / z;
	elseif (a <= 1e+33)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.55e+115], x, If[LessEqual[a, -2.55e-173], t, If[LessEqual[a, 1e-219], N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 1e+33], t, x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+115}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -2.55 \cdot 10^{-173}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 10^{-219}:\\
\;\;\;\;\frac{x \cdot y}{z}\\

\mathbf{elif}\;a \leq 10^{+33}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.55000000000000002e115 or 9.9999999999999995e32 < a

    1. Initial program 88.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 48.9%

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

    if -1.55000000000000002e115 < a < -2.5499999999999999e-173 or 1e-219 < a < 9.9999999999999995e32

    1. Initial program 72.2%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 40.7%

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

    if -2.5499999999999999e-173 < a < 1e-219

    1. Initial program 81.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in y around -inf 76.5%

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

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

        \[\leadsto \frac{\color{blue}{-x \cdot y}}{a - z} \]
      2. distribute-lft-neg-out54.3%

        \[\leadsto \frac{\color{blue}{\left(-x\right) \cdot y}}{a - z} \]
      3. *-commutative54.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.55 \cdot 10^{+115}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.55 \cdot 10^{-173}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 10^{-219}:\\ \;\;\;\;\frac{x \cdot y}{z}\\ \mathbf{elif}\;a \leq 10^{+33}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 76.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{-27} \lor \neg \left(a \leq 3.7 \cdot 10^{-38}\right):\\
\;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.5999999999999999e-27 or 3.7e-38 < a

    1. Initial program 86.6%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in t around inf 72.0%

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

    if -5.5999999999999999e-27 < a < 3.7e-38

    1. Initial program 72.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 79.6%

      \[\leadsto \color{blue}{t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. mul-1-neg79.6%

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

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

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

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

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

        \[\leadsto t + \left(-\frac{y \cdot \left(t - x\right) + \color{blue}{\left(-a \cdot \left(t - x\right)\right)}}{z}\right) \]
      7. sub-neg79.6%

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--79.6%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*86.0%

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

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in a around 0 73.9%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      2. associate-/r/81.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{-27} \lor \neg \left(a \leq 3.7 \cdot 10^{-38}\right):\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \end{array} \]

Alternative 16: 74.3% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.22 \cdot 10^{-43} \lor \neg \left(a \leq 5.2 \cdot 10^{+29}\right):\\
\;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2199999999999999e-43 or 5.2e29 < a

    1. Initial program 85.5%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 67.5%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    4. Simplified80.2%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]

    if -1.2199999999999999e-43 < a < 5.2e29

    1. Initial program 75.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 77.4%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--77.4%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*84.0%

        \[\leadsto t + \left(-\color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) \]
    4. Simplified84.0%

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in a around 0 71.5%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      2. associate-/r/78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.22 \cdot 10^{-43} \lor \neg \left(a \leq 5.2 \cdot 10^{+29}\right):\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \end{array} \]

Alternative 17: 75.4% accurate, 0.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.5000000000000001e75 or 1.1500000000000001e29 < a

    1. Initial program 88.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 70.6%

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

        \[\leadsto x + \color{blue}{\frac{t - x}{\frac{a}{y - z}}} \]
    4. Simplified85.7%

      \[\leadsto \color{blue}{x + \frac{t - x}{\frac{a}{y - z}}} \]

    if -5.5000000000000001e75 < a < 1.1500000000000001e29

    1. Initial program 74.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 73.3%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--73.3%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*81.0%

        \[\leadsto t + \left(-\color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) \]
    4. Simplified81.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+75} \lor \neg \left(a \leq 1.15 \cdot 10^{+29}\right):\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{x - t}{\frac{z}{y - a}}\\ \end{array} \]

Alternative 18: 70.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.6 \cdot 10^{-45} \lor \neg \left(a \leq 1.08 \cdot 10^{+30}\right):\\
\;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.6000000000000003e-45 or 1.08e30 < a

    1. Initial program 85.5%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around 0 62.2%

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified69.1%

      \[\leadsto \color{blue}{x + \frac{y}{\frac{a}{t - x}}} \]

    if -5.6000000000000003e-45 < a < 1.08e30

    1. Initial program 75.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around -inf 77.4%

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

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

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

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

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

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

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

        \[\leadsto t + \left(-\frac{\color{blue}{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}}{z}\right) \]
      8. distribute-rgt-out--77.4%

        \[\leadsto t + \left(-\frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z}\right) \]
      9. associate-/l*84.0%

        \[\leadsto t + \left(-\color{blue}{\frac{t - x}{\frac{z}{y - a}}}\right) \]
    4. Simplified84.0%

      \[\leadsto \color{blue}{t + \left(-\frac{t - x}{\frac{z}{y - a}}\right)} \]
    5. Taylor expanded in a around 0 71.5%

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

        \[\leadsto t - \color{blue}{\frac{y}{\frac{z}{t - x}}} \]
      2. associate-/r/78.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{-45} \lor \neg \left(a \leq 1.08 \cdot 10^{+30}\right):\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \end{array} \]

Alternative 19: 38.4% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+100}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+32}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -5.5e+100) x (if (<= a 3.2e+32) t x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.5e+100) {
		tmp = x;
	} else if (a <= 3.2e+32) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: tmp
    if (a <= (-5.5d+100)) then
        tmp = x
    else if (a <= 3.2d+32) then
        tmp = t
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -5.5e+100) {
		tmp = x;
	} else if (a <= 3.2e+32) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -5.5e+100:
		tmp = x
	elif a <= 3.2e+32:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -5.5e+100)
		tmp = x;
	elseif (a <= 3.2e+32)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -5.5e+100)
		tmp = x;
	elseif (a <= 3.2e+32)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+100], x, If[LessEqual[a, 3.2e+32], t, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+100}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 3.2 \cdot 10^{+32}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.5000000000000002e100 or 3.1999999999999999e32 < a

    1. Initial program 88.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in a around inf 48.9%

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

    if -5.5000000000000002e100 < a < 3.1999999999999999e32

    1. Initial program 74.9%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Taylor expanded in z around inf 34.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.5 \cdot 10^{+100}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{+32}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 20: 24.4% accurate, 13.0× speedup?

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

\\
t
\end{array}
Derivation
  1. Initial program 80.3%

    \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
  2. Taylor expanded in z around inf 25.5%

    \[\leadsto \color{blue}{t} \]
  3. Final simplification25.5%

    \[\leadsto t \]

Reproduce

?
herbie shell --seed 2023336 
(FPCore (x y z t a)
  :name "Numeric.Signal:interpolate   from hsignal-0.2.7.1"
  :precision binary64
  (+ x (* (- y z) (/ (- t x) (- a z)))))