Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.3% → 93.0%
Time: 15.3s
Alternatives: 21
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 21 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.3% 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: 93.0% 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 -1 \cdot 10^{-294} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\ \mathbf{else}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (or (<= t_1 -1e-294) (not (<= t_1 0.0)))
     (fma (- t x) (/ (- y z) (- a z)) x)
     (+ t (/ (* (- t x) (- a y)) z)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -1e-294) || !(t_1 <= 0.0)) {
		tmp = fma((t - x), ((y - z) / (a - z)), x);
	} else {
		tmp = t + (((t - x) * (a - y)) / z);
	}
	return tmp;
}
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z))))
	tmp = 0.0
	if ((t_1 <= -1e-294) || !(t_1 <= 0.0))
		tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x);
	else
		tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / z));
	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, -1e-294], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

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

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


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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 84.6%

      \[\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}} \]
    6. Step-by-step derivation
      1. associate--l+84.6%

        \[\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. associate-*r/84.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 93.0% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 88.4%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.6%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 84.6%

      \[\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}} \]
    6. Step-by-step derivation
      1. associate--l+84.6%

        \[\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. associate-*r/84.6%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 88.7% accurate, 0.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -1.00000000000000002e-294 or 1.00000000000000008e-217 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 89.9%

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

    if -1.00000000000000002e-294 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000008e-217

    1. Initial program 6.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 81.9%

      \[\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}} \]
    6. Step-by-step derivation
      1. associate--l+81.9%

        \[\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. associate-*r/81.9%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 62.9% accurate, 0.5× speedup?

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

\\
\begin{array}{l}
t_1 := t - a \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -8.00000000000000046e63 or 3.5e141 < z

    1. Initial program 55.0%

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified64.6%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    9. Taylor expanded in t around 0 59.7%

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg59.7%

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

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

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

        \[\leadsto t + a \cdot \color{blue}{\frac{-x}{z}} \]
    11. Simplified64.7%

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

    if -8.00000000000000046e63 < z < -8.1999999999999998e-178

    1. Initial program 87.7%

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

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

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

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

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

        \[\leadsto x + \left(y \cdot \frac{t - x}{a - z} + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right)\right) \]
      5. distribute-lft-neg-out84.8%

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

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

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

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

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

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

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

    if -8.1999999999999998e-178 < z < 3.5e141

    1. Initial program 88.2%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+63}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-178}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+141}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 60.3% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.1000000000000002e63 or 2.45e144 < z

    1. Initial program 55.0%

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified64.6%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    9. Taylor expanded in t around 0 59.7%

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg59.7%

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

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

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

        \[\leadsto t + a \cdot \color{blue}{\frac{-x}{z}} \]
    11. Simplified64.7%

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

    if -2.1000000000000002e63 < z < 4.2000000000000004e-273

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.2000000000000004e-273 < z < 2.45e144

    1. Initial program 88.7%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{+63}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-273}:\\ \;\;\;\;x + \frac{t}{\frac{a - z}{y}}\\ \mathbf{elif}\;z \leq 2.45 \cdot 10^{+144}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 60.5% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.00000000000000037e34 or 5.8000000000000003e-23 < a

    1. Initial program 84.6%

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

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

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

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

    if -6.00000000000000037e34 < a < -7.5000000000000004e-151

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000004e-151 < a < 5.8000000000000003e-23

    1. Initial program 63.9%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 54.4%

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac254.4%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified54.4%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in t around -inf 64.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6 \cdot 10^{+34}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -7.5 \cdot 10^{-151}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{-23}:\\ \;\;\;\;t \cdot \left(\left(--1\right) - \frac{y}{z}\right)\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 55.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t - a \cdot \frac{x}{z}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.5000000000000001e64 or 2.8e21 < z

    1. Initial program 60.4%

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

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

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

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

        \[\leadsto x + \frac{-\color{blue}{\left(t - x\right) \cdot z}}{a - z} \]
      4. distribute-rgt-neg-out28.6%

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified58.4%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    9. Taylor expanded in t around 0 55.6%

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg55.6%

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

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

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

        \[\leadsto t + a \cdot \color{blue}{\frac{-x}{z}} \]
    11. Simplified58.7%

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

    if -1.5000000000000001e64 < z < -1.01999999999999998e-103

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg42.5%

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*42.5%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    10. Simplified42.5%

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

    if -1.01999999999999998e-103 < z < 2.8e21

    1. Initial program 91.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified63.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.5 \cdot 10^{+64}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-103}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 2.8 \cdot 10^{+21}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 54.2% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_1 := t - \frac{x \cdot a}{z}\\
\mathbf{if}\;z \leq -5.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.20000000000000016e60 or 4.8e21 < z

    1. Initial program 60.4%

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

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

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

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

        \[\leadsto x + \frac{-\color{blue}{\left(t - x\right) \cdot z}}{a - z} \]
      4. distribute-rgt-neg-out28.6%

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified58.4%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    9. Taylor expanded in t around 0 55.6%

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg55.6%

        \[\leadsto t + \color{blue}{\left(-\frac{a \cdot x}{z}\right)} \]
    11. Simplified55.6%

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

    if -5.20000000000000016e60 < z < -1.01999999999999998e-103

    1. Initial program 85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg42.5%

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*42.5%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    10. Simplified42.5%

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

    if -1.01999999999999998e-103 < z < 4.8e21

    1. Initial program 91.9%

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

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

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

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified63.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.2 \cdot 10^{+60}:\\ \;\;\;\;t - \frac{x \cdot a}{z}\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-103}:\\ \;\;\;\;x - t \cdot \frac{y}{z}\\ \mathbf{elif}\;z \leq 4.8 \cdot 10^{+21}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{x \cdot a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 52.3% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.4000000000000001e156 or 4.50000000000000036e100 < z

    1. Initial program 55.1%

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

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

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

    if -5.4000000000000001e156 < z < -1.01999999999999998e-103

    1. Initial program 77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{t \cdot y}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg38.3%

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

        \[\leadsto \color{blue}{x - \frac{t \cdot y}{z}} \]
      3. associate-/l*37.1%

        \[\leadsto x - \color{blue}{t \cdot \frac{y}{z}} \]
    10. Simplified37.1%

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

    if -1.01999999999999998e-103 < z < 4.50000000000000036e100

    1. Initial program 88.8%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified74.1%

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

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

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

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

Alternative 10: 75.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{-96} \lor \neg \left(a \leq 1.8 \cdot 10^{-11}\right):\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.7e-96 or 1.79999999999999992e-11 < a

    1. Initial program 85.1%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified77.2%

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

    if -2.7e-96 < a < 1.79999999999999992e-11

    1. Initial program 63.8%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 83.7%

      \[\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}} \]
    6. Step-by-step derivation
      1. associate--l+83.7%

        \[\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. associate-*r/83.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.7 \cdot 10^{-96} \lor \neg \left(a \leq 1.8 \cdot 10^{-11}\right):\\ \;\;\;\;x + t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 75.7% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-96} \lor \neg \left(a \leq 5 \cdot 10^{-16}\right):\\
\;\;\;\;x + t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.0999999999999999e-96 or 5.0000000000000004e-16 < a

    1. Initial program 84.6%

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

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

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

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

    if -1.0999999999999999e-96 < a < 5.0000000000000004e-16

    1. Initial program 64.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 54.8%

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac254.8%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified54.8%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 76.5%

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

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

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

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

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

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

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

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

Alternative 12: 53.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.06e-10 or 2.80000000000000019e43 < y

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.06e-10 < y < 2.80000000000000019e43

    1. Initial program 67.9%

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

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

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

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

        \[\leadsto x + \frac{-\color{blue}{\left(t - x\right) \cdot z}}{a - z} \]
      4. distribute-rgt-neg-out46.6%

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified54.1%

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

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

Alternative 13: 53.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{-14} \lor \neg \left(y \leq 6.2 \cdot 10^{+47}\right):\\
\;\;\;\;y \cdot \frac{t - x}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.4e-14 or 6.2000000000000001e47 < y

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.4e-14 < y < 6.2000000000000001e47

    1. Initial program 68.1%

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

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

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

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

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

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified53.7%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    9. Taylor expanded in t around 0 50.0%

      \[\leadsto t + \color{blue}{-1 \cdot \frac{a \cdot x}{z}} \]
    10. Step-by-step derivation
      1. mul-1-neg50.0%

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

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

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

        \[\leadsto t + a \cdot \color{blue}{\frac{-x}{z}} \]
    11. Simplified53.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{-14} \lor \neg \left(y \leq 6.2 \cdot 10^{+47}\right):\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t - a \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 68.3% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.79999999999999987e50

    1. Initial program 86.6%

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

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

        \[\leadsto x + \color{blue}{y \cdot \frac{t - x}{a}} \]
    5. Simplified68.1%

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

    if -3.79999999999999987e50 < a < 9.50000000000000058e-23

    1. Initial program 67.7%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 53.2%

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac253.2%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified53.2%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 72.7%

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

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

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

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

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

        \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    10. Simplified73.5%

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

    if 9.50000000000000058e-23 < a

    1. Initial program 84.3%

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

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

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

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

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

        \[\leadsto x + \left(y \cdot \frac{t - x}{a - z} + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right)\right) \]
      5. distribute-lft-neg-out82.8%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.8 \cdot 10^{+50}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-23}:\\ \;\;\;\;t + y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 55.6% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+49} \lor \neg \left(a \leq 4.9 \cdot 10^{-24}\right):\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.7999999999999999e49 or 4.9000000000000001e-24 < a

    1. Initial program 85.4%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified78.1%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified55.9%

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

    if -3.7999999999999999e49 < a < 4.9000000000000001e-24

    1. Initial program 67.4%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around 0 52.8%

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac252.8%

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in t around -inf 57.3%

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

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

Alternative 16: 44.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -160000000000 \lor \neg \left(a \leq 3.9 \cdot 10^{-20}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\

\mathbf{else}:\\
\;\;\;\;t + a \cdot \frac{t}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6e11 or 3.90000000000000007e-20 < a

    1. Initial program 84.8%

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

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

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

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

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

        \[\leadsto x + \left(y \cdot \frac{t - x}{a - z} + \left(-\color{blue}{z \cdot \frac{t - x}{a - z}}\right)\right) \]
      5. distribute-lft-neg-out84.8%

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

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

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

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

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

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

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

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

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

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

    if -1.6e11 < a < 3.90000000000000007e-20

    1. Initial program 66.7%

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

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

        \[\leadsto x + \color{blue}{\left(-\frac{z \cdot \left(t - x\right)}{a - z}\right)} \]
      2. distribute-neg-frac22.0%

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

        \[\leadsto x + \frac{-\color{blue}{\left(t - x\right) \cdot z}}{a - z} \]
      4. distribute-rgt-neg-out22.0%

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

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

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

        \[\leadsto t + \color{blue}{a \cdot \frac{t - x}{z}} \]
    8. Simplified52.3%

      \[\leadsto \color{blue}{t + a \cdot \frac{t - x}{z}} \]
    9. Taylor expanded in t around inf 41.8%

      \[\leadsto t + \color{blue}{\frac{a \cdot t}{z}} \]
    10. Step-by-step derivation
      1. associate-/l*44.8%

        \[\leadsto t + \color{blue}{a \cdot \frac{t}{z}} \]
    11. Simplified44.8%

      \[\leadsto t + \color{blue}{a \cdot \frac{t}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification46.2%

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

Alternative 17: 53.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.50000000000000027e156 or 3.4999999999999998e99 < z

    1. Initial program 55.1%

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

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

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

    if -6.50000000000000027e156 < z < 3.4999999999999998e99

    1. Initial program 84.2%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified70.2%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y}{a}} \]
    8. Simplified46.7%

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

Alternative 18: 48.6% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9500000000000001e161 or 1.3500000000000001e22 < z

    1. Initial program 60.4%

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

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

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

    if -1.9500000000000001e161 < z < 1.3500000000000001e22

    1. Initial program 85.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot \left(1 + \color{blue}{\left(-\frac{y}{a}\right)}\right) \]
      2. unsub-neg41.0%

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

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

Alternative 19: 38.2% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.49999999999999982e49

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 41.3%

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

    if -4.49999999999999982e49 < a < 2.35000000000000005e80

    1. Initial program 68.8%

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

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

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

    if 2.35000000000000005e80 < a

    1. Initial program 87.5%

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

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

        \[\leadsto x + \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified85.1%

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

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

Alternative 20: 39.6% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -4.49999999999999982e49 or 2.4999999999999998e80 < a

    1. Initial program 87.2%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in a around inf 43.6%

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

    if -4.49999999999999982e49 < a < 2.4999999999999998e80

    1. Initial program 68.8%

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

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

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

Alternative 21: 25.3% 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 75.8%

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

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

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

Reproduce

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