Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.0% → 94.9%
Time: 25.5s
Alternatives: 19
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 19 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: 80.0% 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: 94.9% accurate, 0.1× 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 -2 \cdot 10^{-296} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t - x}{\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 -2e-296) (not (<= t_1 0.0)))
     (fma (/ (- y z) (- a z)) (- t x) x)
     (- t (/ (- t x) (/ 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 <= -2e-296) || !(t_1 <= 0.0)) {
		tmp = fma(((y - z) / (a - z)), (t - x), x);
	} else {
		tmp = t - ((t - x) / (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 <= -2e-296) || !(t_1 <= 0.0))
		tmp = fma(Float64(Float64(y - z) / Float64(a - z)), Float64(t - x), x);
	else
		tmp = Float64(t - Float64(Float64(t - x) / Float64(z / Float64(y - a))));
	end
	return 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, -2e-296], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[(t - x), $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 -2 \cdot 10^{-296} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, x\right)\\

\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{\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)))) < -2e-296 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.5%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{y - z}{\frac{a - z}{t - x}}} - \left(-x\right) \]
      6. associate-/r/93.6%

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y - z}{a - z}, t - x, -\left(-x\right)\right)} \]
      8. remove-double-neg93.6%

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

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

    if -2e-296 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.9% 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 -2 \cdot 10^{-296} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;x + \frac{1}{\frac{\frac{a - z}{y - z}}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t - x}{\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 -2e-296) (not (<= t_1 0.0)))
     (+ x (/ 1.0 (/ (/ (- a z) (- y z)) (- t x))))
     (- t (/ (- t x) (/ 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 <= -2e-296) || !(t_1 <= 0.0)) {
		tmp = x + (1.0 / (((a - z) / (y - z)) / (t - x)));
	} else {
		tmp = t - ((t - x) / (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 <= (-2d-296)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = x + (1.0d0 / (((a - z) / (y - z)) / (t - x)))
    else
        tmp = t - ((t - x) / (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 <= -2e-296) || !(t_1 <= 0.0)) {
		tmp = x + (1.0 / (((a - z) / (y - z)) / (t - x)));
	} else {
		tmp = t - ((t - x) / (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 <= -2e-296) or not (t_1 <= 0.0):
		tmp = x + (1.0 / (((a - z) / (y - z)) / (t - x)))
	else:
		tmp = t - ((t - x) / (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 <= -2e-296) || !(t_1 <= 0.0))
		tmp = Float64(x + Float64(1.0 / Float64(Float64(Float64(a - z) / Float64(y - z)) / Float64(t - x))));
	else
		tmp = Float64(t - Float64(Float64(t - x) / 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 <= -2e-296) || ~((t_1 <= 0.0)))
		tmp = x + (1.0 / (((a - z) / (y - z)) / (t - x)));
	else
		tmp = t - ((t - x) / (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, -2e-296], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(1.0 / N[(N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t - N[(N[(t - x), $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 -2 \cdot 10^{-296} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;x + \frac{1}{\frac{\frac{a - z}{y - z}}{t - x}}\\

\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{\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)))) < -2e-296 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.5%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/75.5%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr93.6%

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

    if -2e-296 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 3.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.6% 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 -5 \cdot 10^{-227} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t - \frac{t - x}{\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 -5e-227) (not (<= t_1 0.0)))
     t_1
     (- t (/ (- t x) (/ 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 <= -5e-227) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - ((t - x) / (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 <= (-5d-227)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = t_1
    else
        tmp = t - ((t - x) / (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 <= -5e-227) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - ((t - x) / (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 <= -5e-227) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t - ((t - x) / (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 <= -5e-227) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t - Float64(Float64(t - x) / 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 <= -5e-227) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t - ((t - x) / (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, -5e-227], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t - N[(N[(t - x), $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 -5 \cdot 10^{-227} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t - \frac{t - x}{\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)))) < -4.99999999999999961e-227 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.6%

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

    if -4.99999999999999961e-227 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0

    1. Initial program 7.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 38.0% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -6.3 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{-292}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-155}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 8.6 \cdot 10^{-51}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{+61}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -6.3e-12)
   x
   (if (<= a -3.2e-292)
     t
     (if (<= a 1.8e-155)
       (/ x (/ z y))
       (if (<= a 8.6e-51) t (if (<= a 1.8e+61) (* t (/ (- y z) a)) x))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -6.3e-12) {
		tmp = x;
	} else if (a <= -3.2e-292) {
		tmp = t;
	} else if (a <= 1.8e-155) {
		tmp = x / (z / y);
	} else if (a <= 8.6e-51) {
		tmp = t;
	} else if (a <= 1.8e+61) {
		tmp = t * ((y - z) / a);
	} 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 <= (-6.3d-12)) then
        tmp = x
    else if (a <= (-3.2d-292)) then
        tmp = t
    else if (a <= 1.8d-155) then
        tmp = x / (z / y)
    else if (a <= 8.6d-51) then
        tmp = t
    else if (a <= 1.8d+61) then
        tmp = t * ((y - z) / a)
    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 <= -6.3e-12) {
		tmp = x;
	} else if (a <= -3.2e-292) {
		tmp = t;
	} else if (a <= 1.8e-155) {
		tmp = x / (z / y);
	} else if (a <= 8.6e-51) {
		tmp = t;
	} else if (a <= 1.8e+61) {
		tmp = t * ((y - z) / a);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -6.3e-12:
		tmp = x
	elif a <= -3.2e-292:
		tmp = t
	elif a <= 1.8e-155:
		tmp = x / (z / y)
	elif a <= 8.6e-51:
		tmp = t
	elif a <= 1.8e+61:
		tmp = t * ((y - z) / a)
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -6.3e-12)
		tmp = x;
	elseif (a <= -3.2e-292)
		tmp = t;
	elseif (a <= 1.8e-155)
		tmp = Float64(x / Float64(z / y));
	elseif (a <= 8.6e-51)
		tmp = t;
	elseif (a <= 1.8e+61)
		tmp = Float64(t * Float64(Float64(y - z) / a));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -6.3e-12)
		tmp = x;
	elseif (a <= -3.2e-292)
		tmp = t;
	elseif (a <= 1.8e-155)
		tmp = x / (z / y);
	elseif (a <= 8.6e-51)
		tmp = t;
	elseif (a <= 1.8e+61)
		tmp = t * ((y - z) / a);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -6.3e-12], x, If[LessEqual[a, -3.2e-292], t, If[LessEqual[a, 1.8e-155], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.6e-51], t, If[LessEqual[a, 1.8e+61], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.3 \cdot 10^{-12}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -3.2 \cdot 10^{-292}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 8.6 \cdot 10^{-51}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -6.3000000000000002e-12 or 1.80000000000000005e61 < a

    1. Initial program 89.2%

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

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

    if -6.3000000000000002e-12 < a < -3.2000000000000002e-292 or 1.79999999999999994e-155 < a < 8.5999999999999995e-51

    1. Initial program 75.4%

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

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

    if -3.2000000000000002e-292 < a < 1.79999999999999994e-155

    1. Initial program 71.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Simplified49.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]

    if 8.5999999999999995e-51 < a < 1.80000000000000005e61

    1. Initial program 76.7%

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\frac{y - z}{a}} \]
    7. Simplified40.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.3 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -3.2 \cdot 10^{-292}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-155}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 8.6 \cdot 10^{-51}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{+61}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 5: 37.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -8.5 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -3.4 \cdot 10^{-293}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-156}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-50}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{+57}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -8.5e-12)
   x
   (if (<= a -3.4e-293)
     t
     (if (<= a 1.65e-156)
       (* x (/ y z))
       (if (<= a 1.6e-50)
         t
         (if (<= a 5.7e+57) (/ t (/ a y)) (if (<= a 2.5e+81) t x)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -8.5e-12) {
		tmp = x;
	} else if (a <= -3.4e-293) {
		tmp = t;
	} else if (a <= 1.65e-156) {
		tmp = x * (y / z);
	} else if (a <= 1.6e-50) {
		tmp = t;
	} else if (a <= 5.7e+57) {
		tmp = t / (a / y);
	} else if (a <= 2.5e+81) {
		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 <= (-8.5d-12)) then
        tmp = x
    else if (a <= (-3.4d-293)) then
        tmp = t
    else if (a <= 1.65d-156) then
        tmp = x * (y / z)
    else if (a <= 1.6d-50) then
        tmp = t
    else if (a <= 5.7d+57) then
        tmp = t / (a / y)
    else if (a <= 2.5d+81) 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 <= -8.5e-12) {
		tmp = x;
	} else if (a <= -3.4e-293) {
		tmp = t;
	} else if (a <= 1.65e-156) {
		tmp = x * (y / z);
	} else if (a <= 1.6e-50) {
		tmp = t;
	} else if (a <= 5.7e+57) {
		tmp = t / (a / y);
	} else if (a <= 2.5e+81) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -8.5e-12:
		tmp = x
	elif a <= -3.4e-293:
		tmp = t
	elif a <= 1.65e-156:
		tmp = x * (y / z)
	elif a <= 1.6e-50:
		tmp = t
	elif a <= 5.7e+57:
		tmp = t / (a / y)
	elif a <= 2.5e+81:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -8.5e-12)
		tmp = x;
	elseif (a <= -3.4e-293)
		tmp = t;
	elseif (a <= 1.65e-156)
		tmp = Float64(x * Float64(y / z));
	elseif (a <= 1.6e-50)
		tmp = t;
	elseif (a <= 5.7e+57)
		tmp = Float64(t / Float64(a / y));
	elseif (a <= 2.5e+81)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -8.5e-12)
		tmp = x;
	elseif (a <= -3.4e-293)
		tmp = t;
	elseif (a <= 1.65e-156)
		tmp = x * (y / z);
	elseif (a <= 1.6e-50)
		tmp = t;
	elseif (a <= 5.7e+57)
		tmp = t / (a / y);
	elseif (a <= 2.5e+81)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -8.5e-12], x, If[LessEqual[a, -3.4e-293], t, If[LessEqual[a, 1.65e-156], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e-50], t, If[LessEqual[a, 5.7e+57], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e+81], t, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-12}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -3.4 \cdot 10^{-293}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 1.6 \cdot 10^{-50}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 5.7 \cdot 10^{+57}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+81}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -8.4999999999999997e-12 or 2.4999999999999999e81 < a

    1. Initial program 88.7%

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

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

    if -8.4999999999999997e-12 < a < -3.4e-293 or 1.6499999999999999e-156 < a < 1.6e-50 or 5.6999999999999998e57 < a < 2.4999999999999999e81

    1. Initial program 77.1%

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

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

    if -3.4e-293 < a < 1.6499999999999999e-156

    1. Initial program 71.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Simplified49.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    8. Step-by-step derivation
      1. div-inv49.5%

        \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{z}{y}}} \]
      2. clear-num49.5%

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
    9. Applied egg-rr49.5%

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

    if 1.6e-50 < a < 5.6999999999999998e57

    1. Initial program 76.7%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/77.0%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr79.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -8.5 \cdot 10^{-12}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -3.4 \cdot 10^{-293}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-156}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 1.6 \cdot 10^{-50}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 5.7 \cdot 10^{+57}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 6: 37.3% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.7 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.95 \cdot 10^{-292}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-157}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-50}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+58}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -4.7e-15)
   x
   (if (<= a -2.95e-292)
     t
     (if (<= a 9.8e-157)
       (/ x (/ z y))
       (if (<= a 1.1e-50)
         t
         (if (<= a 6e+58) (/ t (/ a y)) (if (<= a 2.5e+81) t x)))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.7e-15) {
		tmp = x;
	} else if (a <= -2.95e-292) {
		tmp = t;
	} else if (a <= 9.8e-157) {
		tmp = x / (z / y);
	} else if (a <= 1.1e-50) {
		tmp = t;
	} else if (a <= 6e+58) {
		tmp = t / (a / y);
	} else if (a <= 2.5e+81) {
		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 <= (-4.7d-15)) then
        tmp = x
    else if (a <= (-2.95d-292)) then
        tmp = t
    else if (a <= 9.8d-157) then
        tmp = x / (z / y)
    else if (a <= 1.1d-50) then
        tmp = t
    else if (a <= 6d+58) then
        tmp = t / (a / y)
    else if (a <= 2.5d+81) 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 <= -4.7e-15) {
		tmp = x;
	} else if (a <= -2.95e-292) {
		tmp = t;
	} else if (a <= 9.8e-157) {
		tmp = x / (z / y);
	} else if (a <= 1.1e-50) {
		tmp = t;
	} else if (a <= 6e+58) {
		tmp = t / (a / y);
	} else if (a <= 2.5e+81) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -4.7e-15:
		tmp = x
	elif a <= -2.95e-292:
		tmp = t
	elif a <= 9.8e-157:
		tmp = x / (z / y)
	elif a <= 1.1e-50:
		tmp = t
	elif a <= 6e+58:
		tmp = t / (a / y)
	elif a <= 2.5e+81:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -4.7e-15)
		tmp = x;
	elseif (a <= -2.95e-292)
		tmp = t;
	elseif (a <= 9.8e-157)
		tmp = Float64(x / Float64(z / y));
	elseif (a <= 1.1e-50)
		tmp = t;
	elseif (a <= 6e+58)
		tmp = Float64(t / Float64(a / y));
	elseif (a <= 2.5e+81)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -4.7e-15)
		tmp = x;
	elseif (a <= -2.95e-292)
		tmp = t;
	elseif (a <= 9.8e-157)
		tmp = x / (z / y);
	elseif (a <= 1.1e-50)
		tmp = t;
	elseif (a <= 6e+58)
		tmp = t / (a / y);
	elseif (a <= 2.5e+81)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.7e-15], x, If[LessEqual[a, -2.95e-292], t, If[LessEqual[a, 9.8e-157], N[(x / N[(z / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.1e-50], t, If[LessEqual[a, 6e+58], N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.5e+81], t, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{-15}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -2.95 \cdot 10^{-292}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 1.1 \cdot 10^{-50}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 6 \cdot 10^{+58}:\\
\;\;\;\;\frac{t}{\frac{a}{y}}\\

\mathbf{elif}\;a \leq 2.5 \cdot 10^{+81}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -4.6999999999999999e-15 or 2.4999999999999999e81 < a

    1. Initial program 88.7%

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

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

    if -4.6999999999999999e-15 < a < -2.95e-292 or 9.7999999999999995e-157 < a < 1.0999999999999999e-50 or 6.0000000000000005e58 < a < 2.4999999999999999e81

    1. Initial program 77.1%

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

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

    if -2.95e-292 < a < 9.7999999999999995e-157

    1. Initial program 71.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Simplified49.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]

    if 1.0999999999999999e-50 < a < 6.0000000000000005e58

    1. Initial program 76.7%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/77.0%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr79.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.7 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -2.95 \cdot 10^{-292}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-157}:\\ \;\;\;\;\frac{x}{\frac{z}{y}}\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-50}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 6 \cdot 10^{+58}:\\ \;\;\;\;\frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 2.5 \cdot 10^{+81}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 7: 70.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+177} \lor \neg \left(y \leq 1.75 \cdot 10^{+115}\right):\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999998e177 or 1.75000000000000003e115 < y

    1. Initial program 88.1%

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

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

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

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

    if -4.5999999999999998e177 < y < 1.75000000000000003e115

    1. Initial program 79.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. Recombined 2 regimes into one program.
  4. Final simplification73.9%

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

Alternative 8: 75.2% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+64} \lor \neg \left(z \leq 4.1 \cdot 10^{+44}\right):\\
\;\;\;\;t - \frac{t - x}{\frac{z}{y - a}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.64999999999999994e64 or 4.09999999999999965e44 < z

    1. Initial program 61.5%

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

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

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

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

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

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

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

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

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

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

    if -1.64999999999999994e64 < z < 4.09999999999999965e44

    1. Initial program 92.7%

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

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

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

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

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

Alternative 9: 51.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+134}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+148}:\\ \;\;\;\;\frac{x}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -2e+134)
   t
   (if (<= z 7e+47)
     (+ x (/ t (/ a y)))
     (if (<= z 1.6e+148) (/ x (/ z (- y a))) t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -2e+134) {
		tmp = t;
	} else if (z <= 7e+47) {
		tmp = x + (t / (a / y));
	} else if (z <= 1.6e+148) {
		tmp = x / (z / (y - 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 <= (-2d+134)) then
        tmp = t
    else if (z <= 7d+47) then
        tmp = x + (t / (a / y))
    else if (z <= 1.6d+148) then
        tmp = x / (z / (y - 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 <= -2e+134) {
		tmp = t;
	} else if (z <= 7e+47) {
		tmp = x + (t / (a / y));
	} else if (z <= 1.6e+148) {
		tmp = x / (z / (y - a));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -2e+134:
		tmp = t
	elif z <= 7e+47:
		tmp = x + (t / (a / y))
	elif z <= 1.6e+148:
		tmp = x / (z / (y - a))
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -2e+134)
		tmp = t;
	elseif (z <= 7e+47)
		tmp = Float64(x + Float64(t / Float64(a / y)));
	elseif (z <= 1.6e+148)
		tmp = Float64(x / Float64(z / Float64(y - a)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -2e+134)
		tmp = t;
	elseif (z <= 7e+47)
		tmp = x + (t / (a / y));
	elseif (z <= 1.6e+148)
		tmp = x / (z / (y - a));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+134], t, If[LessEqual[z, 7e+47], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+148], N[(x / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.99999999999999984e134 or 1.6e148 < z

    1. Initial program 60.6%

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

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

    if -1.99999999999999984e134 < z < 7.00000000000000031e47

    1. Initial program 90.4%

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    5. Simplified59.8%

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

    if 7.00000000000000031e47 < z < 1.6e148

    1. Initial program 62.0%

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

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

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

        \[\leadsto -\color{blue}{\left(\frac{y}{a - z} - \left(1 + \frac{z}{a - z}\right)\right) \cdot x} \]
      3. distribute-rgt-neg-in51.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
    7. Simplified47.9%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification60.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+134}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 7 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{+148}:\\ \;\;\;\;\frac{x}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 10: 52.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+133}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+152}:\\ \;\;\;\;\frac{x}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -3.8e+133)
   (/ t (/ (- z) (- y z)))
   (if (<= z 3.5e+47)
     (+ x (/ t (/ a y)))
     (if (<= z 1.8e+152) (/ x (/ z (- y a))) t))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -3.8e+133) {
		tmp = t / (-z / (y - z));
	} else if (z <= 3.5e+47) {
		tmp = x + (t / (a / y));
	} else if (z <= 1.8e+152) {
		tmp = x / (z / (y - 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 <= (-3.8d+133)) then
        tmp = t / (-z / (y - z))
    else if (z <= 3.5d+47) then
        tmp = x + (t / (a / y))
    else if (z <= 1.8d+152) then
        tmp = x / (z / (y - 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 <= -3.8e+133) {
		tmp = t / (-z / (y - z));
	} else if (z <= 3.5e+47) {
		tmp = x + (t / (a / y));
	} else if (z <= 1.8e+152) {
		tmp = x / (z / (y - a));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -3.8e+133:
		tmp = t / (-z / (y - z))
	elif z <= 3.5e+47:
		tmp = x + (t / (a / y))
	elif z <= 1.8e+152:
		tmp = x / (z / (y - a))
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -3.8e+133)
		tmp = Float64(t / Float64(Float64(-z) / Float64(y - z)));
	elseif (z <= 3.5e+47)
		tmp = Float64(x + Float64(t / Float64(a / y)));
	elseif (z <= 1.8e+152)
		tmp = Float64(x / Float64(z / Float64(y - a)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -3.8e+133)
		tmp = t / (-z / (y - z));
	elseif (z <= 3.5e+47)
		tmp = x + (t / (a / y));
	elseif (z <= 1.8e+152)
		tmp = x / (z / (y - a));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e+133], N[(t / N[((-z) / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+47], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e+152], N[(x / N[(z / N[(y - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{+133}:\\
\;\;\;\;\frac{t}{\frac{-z}{y - z}}\\

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

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

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


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

    1. Initial program 55.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/36.5%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr59.9%

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

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

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

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

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

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

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

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

    if -3.8000000000000002e133 < z < 3.50000000000000015e47

    1. Initial program 90.4%

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    5. Simplified59.8%

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

    if 3.50000000000000015e47 < z < 1.7999999999999999e152

    1. Initial program 62.0%

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

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

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

        \[\leadsto -\color{blue}{\left(\frac{y}{a - z} - \left(1 + \frac{z}{a - z}\right)\right) \cdot x} \]
      3. distribute-rgt-neg-in51.1%

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y - a}}} \]
    7. Simplified47.9%

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

    if 1.7999999999999999e152 < z

    1. Initial program 68.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+133}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+47}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{+152}:\\ \;\;\;\;\frac{x}{\frac{z}{y - a}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 11: 64.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{+104} \lor \neg \left(z \leq 2.35 \cdot 10^{-33}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.6e104 or 2.3500000000000001e-33 < z

    1. Initial program 65.4%

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

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

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

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

    if -9.6e104 < z < 2.3500000000000001e-33

    1. Initial program 91.6%

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

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

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

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

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

Alternative 12: 57.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.4 \cdot 10^{+44}:\\ \;\;\;\;x \cdot \left(-\frac{y}{a - z}\right)\\ \mathbf{elif}\;x \leq 1300000000:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= x -2.4e+44)
   (* x (- (/ y (- a z))))
   (if (<= x 1300000000.0) (* t (/ (- y z) (- a z))) (* x (- 1.0 (/ y a))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (x <= -2.4e+44) {
		tmp = x * -(y / (a - z));
	} else if (x <= 1300000000.0) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = x * (1.0 - (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 (x <= (-2.4d+44)) then
        tmp = x * -(y / (a - z))
    else if (x <= 1300000000.0d0) then
        tmp = t * ((y - z) / (a - z))
    else
        tmp = x * (1.0d0 - (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 (x <= -2.4e+44) {
		tmp = x * -(y / (a - z));
	} else if (x <= 1300000000.0) {
		tmp = t * ((y - z) / (a - z));
	} else {
		tmp = x * (1.0 - (y / a));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if x <= -2.4e+44:
		tmp = x * -(y / (a - z))
	elif x <= 1300000000.0:
		tmp = t * ((y - z) / (a - z))
	else:
		tmp = x * (1.0 - (y / a))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (x <= -2.4e+44)
		tmp = Float64(x * Float64(-Float64(y / Float64(a - z))));
	elseif (x <= 1300000000.0)
		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
	else
		tmp = Float64(x * Float64(1.0 - Float64(y / a)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (x <= -2.4e+44)
		tmp = x * -(y / (a - z));
	elseif (x <= 1300000000.0)
		tmp = t * ((y - z) / (a - z));
	else
		tmp = x * (1.0 - (y / a));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[x, -2.4e+44], N[(x * (-N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[x, 1300000000.0], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+44}:\\
\;\;\;\;x \cdot \left(-\frac{y}{a - z}\right)\\

\mathbf{elif}\;x \leq 1300000000:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.40000000000000013e44

    1. Initial program 69.8%

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

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

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

        \[\leadsto -\color{blue}{\left(\frac{y}{a - z} - \left(1 + \frac{z}{a - z}\right)\right) \cdot x} \]
      3. distribute-rgt-neg-in81.6%

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

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

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

    if -2.40000000000000013e44 < x < 1.3e9

    1. Initial program 85.7%

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

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

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

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

    if 1.3e9 < x

    1. Initial program 81.0%

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

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

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

        \[\leadsto -\color{blue}{\left(\frac{y}{a - z} - \left(1 + \frac{z}{a - z}\right)\right) \cdot x} \]
      3. distribute-rgt-neg-in70.3%

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

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

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

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

Alternative 13: 64.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -8.4 \cdot 10^{+104}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -8.4e+104)
   (* t (/ (- y z) (- a z)))
   (if (<= z 2.4e-42) (+ x (/ y (/ a (- t x)))) (/ t (/ (- a z) (- y z))))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -8.4e+104) {
		tmp = t * ((y - z) / (a - z));
	} else if (z <= 2.4e-42) {
		tmp = x + (y / (a / (t - x)));
	} else {
		tmp = t / ((a - z) / (y - 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) :: tmp
    if (z <= (-8.4d+104)) then
        tmp = t * ((y - z) / (a - z))
    else if (z <= 2.4d-42) then
        tmp = x + (y / (a / (t - x)))
    else
        tmp = t / ((a - z) / (y - z))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -8.4e+104) {
		tmp = t * ((y - z) / (a - z));
	} else if (z <= 2.4e-42) {
		tmp = x + (y / (a / (t - x)));
	} else {
		tmp = t / ((a - z) / (y - z));
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -8.4e+104:
		tmp = t * ((y - z) / (a - z))
	elif z <= 2.4e-42:
		tmp = x + (y / (a / (t - x)))
	else:
		tmp = t / ((a - z) / (y - z))
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -8.4e+104)
		tmp = Float64(t * Float64(Float64(y - z) / Float64(a - z)));
	elseif (z <= 2.4e-42)
		tmp = Float64(x + Float64(y / Float64(a / Float64(t - x))));
	else
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -8.4e+104)
		tmp = t * ((y - z) / (a - z));
	elseif (z <= 2.4e-42)
		tmp = x + (y / (a / (t - x)));
	else
		tmp = t / ((a - z) / (y - z));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -8.4e+104], N[(t * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.4e-42], N[(x + N[(y / N[(a / N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.4 \cdot 10^{+104}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.3999999999999994e104

    1. Initial program 58.4%

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

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

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

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

    if -8.3999999999999994e104 < z < 2.40000000000000003e-42

    1. Initial program 91.6%

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

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

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

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

    if 2.40000000000000003e-42 < z

    1. Initial program 69.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/53.2%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr76.3%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    6. Simplified58.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.4 \cdot 10^{+104}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-42}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \end{array} \]

Alternative 14: 37.8% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -6.6 \cdot 10^{-295}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-155}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+80}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -4.5e-15)
   x
   (if (<= a -6.6e-295)
     t
     (if (<= a 5e-155) (* x (/ y z)) (if (<= a 3.3e+80) t x)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.5e-15) {
		tmp = x;
	} else if (a <= -6.6e-295) {
		tmp = t;
	} else if (a <= 5e-155) {
		tmp = x * (y / z);
	} else if (a <= 3.3e+80) {
		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 <= (-4.5d-15)) then
        tmp = x
    else if (a <= (-6.6d-295)) then
        tmp = t
    else if (a <= 5d-155) then
        tmp = x * (y / z)
    else if (a <= 3.3d+80) 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 <= -4.5e-15) {
		tmp = x;
	} else if (a <= -6.6e-295) {
		tmp = t;
	} else if (a <= 5e-155) {
		tmp = x * (y / z);
	} else if (a <= 3.3e+80) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -4.5e-15:
		tmp = x
	elif a <= -6.6e-295:
		tmp = t
	elif a <= 5e-155:
		tmp = x * (y / z)
	elif a <= 3.3e+80:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -4.5e-15)
		tmp = x;
	elseif (a <= -6.6e-295)
		tmp = t;
	elseif (a <= 5e-155)
		tmp = Float64(x * Float64(y / z));
	elseif (a <= 3.3e+80)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -4.5e-15)
		tmp = x;
	elseif (a <= -6.6e-295)
		tmp = t;
	elseif (a <= 5e-155)
		tmp = x * (y / z);
	elseif (a <= 3.3e+80)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.5e-15], x, If[LessEqual[a, -6.6e-295], t, If[LessEqual[a, 5e-155], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+80], t, x]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-15}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -6.6 \cdot 10^{-295}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 3.3 \cdot 10^{+80}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.4999999999999998e-15 or 3.29999999999999991e80 < a

    1. Initial program 88.7%

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

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

    if -4.4999999999999998e-15 < a < -6.5999999999999997e-295 or 4.9999999999999999e-155 < a < 3.29999999999999991e80

    1. Initial program 77.0%

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

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

    if -6.5999999999999997e-295 < a < 4.9999999999999999e-155

    1. Initial program 71.6%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    7. Simplified49.6%

      \[\leadsto \color{blue}{\frac{x}{\frac{z}{y}}} \]
    8. Step-by-step derivation
      1. div-inv49.5%

        \[\leadsto \color{blue}{x \cdot \frac{1}{\frac{z}{y}}} \]
      2. clear-num49.5%

        \[\leadsto x \cdot \color{blue}{\frac{y}{z}} \]
    9. Applied egg-rr49.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.5 \cdot 10^{-15}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -6.6 \cdot 10^{-295}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 5 \cdot 10^{-155}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 3.3 \cdot 10^{+80}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 15: 40.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+54}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-59}:\\ \;\;\;\;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+54) t (if (<= z 1.6e-59) (* y (/ (- t x) a)) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -6.5e+54) {
		tmp = t;
	} else if (z <= 1.6e-59) {
		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+54)) then
        tmp = t
    else if (z <= 1.6d-59) 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+54) {
		tmp = t;
	} else if (z <= 1.6e-59) {
		tmp = y * ((t - x) / a);
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -6.5e+54:
		tmp = t
	elif z <= 1.6e-59:
		tmp = y * ((t - x) / a)
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -6.5e+54)
		tmp = t;
	elseif (z <= 1.6e-59)
		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+54)
		tmp = t;
	elseif (z <= 1.6e-59)
		tmp = y * ((t - x) / a);
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.5e+54], t, If[LessEqual[z, 1.6e-59], 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^{+54}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.5e54 or 1.6e-59 < z

    1. Initial program 65.8%

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

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

    if -6.5e54 < z < 1.6e-59

    1. Initial program 93.7%

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

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

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a}} \]
    7. Simplified49.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+54}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.6 \cdot 10^{-59}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 16: 52.1% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+135}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -1.25e+135) t (if (<= z 4.7e+50) (+ x (/ t (/ a y))) t)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -1.25e+135) {
		tmp = t;
	} else if (z <= 4.7e+50) {
		tmp = x + (t / (a / y));
	} 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 <= (-1.25d+135)) then
        tmp = t
    else if (z <= 4.7d+50) then
        tmp = x + (t / (a / y))
    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 <= -1.25e+135) {
		tmp = t;
	} else if (z <= 4.7e+50) {
		tmp = x + (t / (a / y));
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -1.25e+135:
		tmp = t
	elif z <= 4.7e+50:
		tmp = x + (t / (a / y))
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -1.25e+135)
		tmp = t;
	elseif (z <= 4.7e+50)
		tmp = Float64(x + Float64(t / Float64(a / y)));
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -1.25e+135)
		tmp = t;
	elseif (z <= 4.7e+50)
		tmp = x + (t / (a / y));
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.25e+135], t, If[LessEqual[z, 4.7e+50], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000007e135 or 4.69999999999999974e50 < z

    1. Initial program 60.6%

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

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

    if -1.25000000000000007e135 < z < 4.69999999999999974e50

    1. Initial program 90.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    5. Simplified59.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+135}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 17: 54.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+133}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= z -4.5e+133)
   (/ t (/ (- z) (- y z)))
   (if (<= z 1.15e+50) (+ x (/ t (/ a y))) (/ t (/ (- z a) z)))))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (z <= -4.5e+133) {
		tmp = t / (-z / (y - z));
	} else if (z <= 1.15e+50) {
		tmp = x + (t / (a / y));
	} else {
		tmp = t / ((z - a) / 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) :: tmp
    if (z <= (-4.5d+133)) then
        tmp = t / (-z / (y - z))
    else if (z <= 1.15d+50) then
        tmp = x + (t / (a / y))
    else
        tmp = t / ((z - a) / z)
    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+133) {
		tmp = t / (-z / (y - z));
	} else if (z <= 1.15e+50) {
		tmp = x + (t / (a / y));
	} else {
		tmp = t / ((z - a) / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if z <= -4.5e+133:
		tmp = t / (-z / (y - z))
	elif z <= 1.15e+50:
		tmp = x + (t / (a / y))
	else:
		tmp = t / ((z - a) / z)
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (z <= -4.5e+133)
		tmp = Float64(t / Float64(Float64(-z) / Float64(y - z)));
	elseif (z <= 1.15e+50)
		tmp = Float64(x + Float64(t / Float64(a / y)));
	else
		tmp = Float64(t / Float64(Float64(z - a) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (z <= -4.5e+133)
		tmp = t / (-z / (y - z));
	elseif (z <= 1.15e+50)
		tmp = x + (t / (a / y));
	else
		tmp = t / ((z - a) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.5e+133], N[(t / N[((-z) / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.15e+50], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t / N[(N[(z - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.49999999999999985e133

    1. Initial program 55.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/36.5%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr59.9%

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

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

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

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

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

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

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

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

    if -4.49999999999999985e133 < z < 1.14999999999999998e50

    1. Initial program 90.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{t}{\frac{a}{y}}} \]
    5. Simplified59.6%

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

    if 1.14999999999999998e50 < z

    1. Initial program 64.3%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Step-by-step derivation
      1. associate-*r/40.4%

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

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

        \[\leadsto x + \frac{1}{\color{blue}{\frac{\frac{a - z}{y - z}}{t - x}}} \]
    3. Applied egg-rr71.7%

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

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

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

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

      \[\leadsto \frac{t}{\color{blue}{-1 \cdot \frac{a - z}{z}}} \]
    8. Step-by-step derivation
      1. associate-*r/61.1%

        \[\leadsto \frac{t}{\color{blue}{\frac{-1 \cdot \left(a - z\right)}{z}}} \]
      2. sub-neg61.1%

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

        \[\leadsto \frac{t}{\frac{-1 \cdot \left(a + \color{blue}{-1 \cdot z}\right)}{z}} \]
      4. distribute-lft-in61.1%

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

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

        \[\leadsto \frac{t}{\frac{\left(-a\right) + \color{blue}{\left(--1 \cdot z\right)}}{z}} \]
      7. mul-1-neg61.1%

        \[\leadsto \frac{t}{\frac{\left(-a\right) + \left(-\color{blue}{\left(-z\right)}\right)}{z}} \]
      8. remove-double-neg61.1%

        \[\leadsto \frac{t}{\frac{\left(-a\right) + \color{blue}{z}}{z}} \]
    9. Simplified61.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{+133}:\\ \;\;\;\;\frac{t}{\frac{-z}{y - z}}\\ \mathbf{elif}\;z \leq 1.15 \cdot 10^{+50}:\\ \;\;\;\;x + \frac{t}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;\frac{t}{\frac{z - a}{z}}\\ \end{array} \]

Alternative 18: 38.5% accurate, 2.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+87}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (if (<= a -4.6e-16) x (if (<= a 1.7e+87) t x)))
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (a <= -4.6e-16) {
		tmp = x;
	} else if (a <= 1.7e+87) {
		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 <= (-4.6d-16)) then
        tmp = x
    else if (a <= 1.7d+87) 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 <= -4.6e-16) {
		tmp = x;
	} else if (a <= 1.7e+87) {
		tmp = t;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	tmp = 0
	if a <= -4.6e-16:
		tmp = x
	elif a <= 1.7e+87:
		tmp = t
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	tmp = 0.0
	if (a <= -4.6e-16)
		tmp = x;
	elseif (a <= 1.7e+87)
		tmp = t;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	tmp = 0.0;
	if (a <= -4.6e-16)
		tmp = x;
	elseif (a <= 1.7e+87)
		tmp = t;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -4.6e-16], x, If[LessEqual[a, 1.7e+87], t, x]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.6 \cdot 10^{-16}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq 1.7 \cdot 10^{+87}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.5999999999999998e-16 or 1.7000000000000001e87 < a

    1. Initial program 88.7%

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

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

    if -4.5999999999999998e-16 < a < 1.7000000000000001e87

    1. Initial program 75.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.6 \cdot 10^{-16}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 1.7 \cdot 10^{+87}:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]

Alternative 19: 24.9% 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 81.0%

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

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

    \[\leadsto t \]

Reproduce

?
herbie shell --seed 2023279 
(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)))))