Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.6% → 93.2%
Time: 16.4s
Alternatives: 18
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 18 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.6% 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.2% 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 -5 \cdot 10^{-284} \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(y - a\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 -5e-284) (not (<= t_1 0.0)))
     (fma (- t x) (/ (- y z) (- a z)) x)
     (- t (/ (* (- t x) (- y a)) 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 <= -5e-284) || !(t_1 <= 0.0)) {
		tmp = fma((t - x), ((y - z) / (a - z)), x);
	} else {
		tmp = t - (((t - x) * (y - a)) / 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 <= -5e-284) || !(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(y - a)) / 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, -5e-284], 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[(y - a), $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 -5 \cdot 10^{-284} \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(y - a\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)))) < -4.99999999999999973e-284 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.8%

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

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

        \[\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/99.8%

        \[\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/99.8%

        \[\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-neg99.8%

        \[\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-sub99.8%

        \[\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-neg99.8%

        \[\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--99.8%

        \[\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/99.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-284} \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(y - a\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 93.2% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-284} \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(y - a\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 -5e-284) (not (<= t_1 0.0)))
     (+ x (/ (- t x) (/ (- a z) (- y z))))
     (- t (/ (* (- t x) (- y a)) 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 <= -5e-284) || !(t_1 <= 0.0)) {
		tmp = x + ((t - x) / ((a - z) / (y - z)));
	} else {
		tmp = t - (((t - x) * (y - a)) / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-5d-284)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = x + ((t - x) / ((a - z) / (y - z)))
    else
        tmp = t - (((t - x) * (y - a)) / 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 <= -5e-284) || !(t_1 <= 0.0)) {
		tmp = x + ((t - x) / ((a - z) / (y - z)));
	} else {
		tmp = t - (((t - x) * (y - a)) / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -5e-284) or not (t_1 <= 0.0):
		tmp = x + ((t - x) / ((a - z) / (y - z)))
	else:
		tmp = t - (((t - x) * (y - a)) / 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 <= -5e-284) || !(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(y - a)) / 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 <= -5e-284) || ~((t_1 <= 0.0)))
		tmp = x + ((t - x) / ((a - z) / (y - z)));
	else
		tmp = t - (((t - x) * (y - a)) / 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, -5e-284], 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[(y - a), $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 -5 \cdot 10^{-284} \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(y - a\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)))) < -4.99999999999999973e-284 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 86.8%

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

      \[\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. +-commutative74.0%

        \[\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.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-neg74.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*85.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-out85.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-out86.8%

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

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

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

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

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

    1. Initial program 3.8%

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

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

        \[\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/99.8%

        \[\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/99.8%

        \[\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-neg99.8%

        \[\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-sub99.8%

        \[\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-neg99.8%

        \[\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--99.8%

        \[\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/99.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-284} \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(y - a\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-284} \lor \neg \left(t\_1 \leq 0\right):\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\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 -5e-284) (not (<= t_1 0.0)))
     t_1
     (- t (/ (* (- t x) (- y a)) 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 <= -5e-284) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - (((t - x) * (y - a)) / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if ((t_1 <= (-5d-284)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = t_1
    else
        tmp = t - (((t - x) * (y - a)) / 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 <= -5e-284) || !(t_1 <= 0.0)) {
		tmp = t_1;
	} else {
		tmp = t - (((t - x) * (y - a)) / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -5e-284) or not (t_1 <= 0.0):
		tmp = t_1
	else:
		tmp = t - (((t - x) * (y - a)) / 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 <= -5e-284) || !(t_1 <= 0.0))
		tmp = t_1;
	else
		tmp = Float64(t - Float64(Float64(Float64(t - x) * Float64(y - a)) / 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 <= -5e-284) || ~((t_1 <= 0.0)))
		tmp = t_1;
	else
		tmp = t - (((t - x) * (y - a)) / 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, -5e-284], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], t$95$1, N[(t - N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $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 -5 \cdot 10^{-284} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;t\_1\\

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

    1. Initial program 86.8%

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

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

    1. Initial program 3.8%

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

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

        \[\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/99.8%

        \[\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/99.8%

        \[\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-neg99.8%

        \[\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-sub99.8%

        \[\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-neg99.8%

        \[\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--99.8%

        \[\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/99.8%

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

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

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

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

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

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

Alternative 4: 68.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \leq -5.8 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 950000000:\\
\;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\

\mathbf{elif}\;a \leq 1.75 \cdot 10^{+221}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.6000000000000003e169 or -4.4999999999999999e78 < a < -5.8e15 or 9.5e8 < a < 1.7500000000000001e221

    1. Initial program 89.5%

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

      \[\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.9%

        \[\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.9%

        \[\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.9%

        \[\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*89.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-out89.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-out89.5%

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

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

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

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

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

    if -5.6000000000000003e169 < a < -4.4999999999999999e78

    1. Initial program 86.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
    7. Step-by-step derivation
      1. *-rgt-identity56.6%

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

        \[\leadsto \color{blue}{\frac{t}{a - z} \cdot \frac{y - z}{1}} \]
      3. /-rgt-identity73.2%

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

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

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

    if -5.8e15 < a < 9.5e8

    1. Initial program 68.3%

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

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

        \[\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/75.8%

        \[\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/75.8%

        \[\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-neg75.8%

        \[\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-sub75.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-neg75.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--75.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/75.9%

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

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

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

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

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

    if 1.7500000000000001e221 < a

    1. Initial program 95.1%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{+169}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq -4.5 \cdot 10^{+78}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{+15}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq 950000000:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\ \mathbf{elif}\;a \leq 1.75 \cdot 10^{+221}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{t - x}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 68.6% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;a \leq -2.6 \cdot 10^{+14} \lor \neg \left(a \leq 70000000000\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.6000000000000003e169 or -9.60000000000000009e73 < a < -2.6e14 or 7e10 < a

    1. Initial program 90.6%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 81.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. +-commutative81.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-sub81.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-neg81.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*90.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-out90.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-out90.6%

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

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

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

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

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

    if -5.6000000000000003e169 < a < -9.60000000000000009e73

    1. Initial program 86.8%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
    7. Step-by-step derivation
      1. *-rgt-identity56.6%

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

        \[\leadsto \color{blue}{\frac{t}{a - z} \cdot \frac{y - z}{1}} \]
      3. /-rgt-identity73.2%

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

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

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

    if -2.6e14 < a < 7e10

    1. Initial program 68.3%

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

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

        \[\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/75.8%

        \[\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/75.8%

        \[\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-neg75.8%

        \[\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-sub75.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-neg75.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--75.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/75.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{+169}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq -9.6 \cdot 10^{+73}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq -2.6 \cdot 10^{+14} \lor \neg \left(a \leq 70000000000\right):\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 67.1% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{if}\;a \leq -5.6 \cdot 10^{+169}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-79}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 6.6 \cdot 10^{-159}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{elif}\;a \leq 1250000000:\\ \;\;\;\;t - x \cdot \frac{a - y}{z}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (/ (- t x) (/ a y)))))
   (if (<= a -5.6e+169)
     t_1
     (if (<= a -8e-79)
       (/ t (/ (- a z) (- y z)))
       (if (<= a 6.6e-159)
         (- t (/ (* y (- t x)) z))
         (if (<= a 1250000000.0) (- t (* x (/ (- a y) z))) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((t - x) / (a / y));
	double tmp;
	if (a <= -5.6e+169) {
		tmp = t_1;
	} else if (a <= -8e-79) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= 6.6e-159) {
		tmp = t - ((y * (t - x)) / z);
	} else if (a <= 1250000000.0) {
		tmp = t - (x * ((a - 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 + ((t - x) / (a / y))
    if (a <= (-5.6d+169)) then
        tmp = t_1
    else if (a <= (-8d-79)) then
        tmp = t / ((a - z) / (y - z))
    else if (a <= 6.6d-159) then
        tmp = t - ((y * (t - x)) / z)
    else if (a <= 1250000000.0d0) then
        tmp = t - (x * ((a - 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 + ((t - x) / (a / y));
	double tmp;
	if (a <= -5.6e+169) {
		tmp = t_1;
	} else if (a <= -8e-79) {
		tmp = t / ((a - z) / (y - z));
	} else if (a <= 6.6e-159) {
		tmp = t - ((y * (t - x)) / z);
	} else if (a <= 1250000000.0) {
		tmp = t - (x * ((a - y) / z));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((t - x) / (a / y))
	tmp = 0
	if a <= -5.6e+169:
		tmp = t_1
	elif a <= -8e-79:
		tmp = t / ((a - z) / (y - z))
	elif a <= 6.6e-159:
		tmp = t - ((y * (t - x)) / z)
	elif a <= 1250000000.0:
		tmp = t - (x * ((a - y) / z))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(Float64(t - x) / Float64(a / y)))
	tmp = 0.0
	if (a <= -5.6e+169)
		tmp = t_1;
	elseif (a <= -8e-79)
		tmp = Float64(t / Float64(Float64(a - z) / Float64(y - z)));
	elseif (a <= 6.6e-159)
		tmp = Float64(t - Float64(Float64(y * Float64(t - x)) / z));
	elseif (a <= 1250000000.0)
		tmp = Float64(t - Float64(x * Float64(Float64(a - y) / z)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x + ((t - x) / (a / y));
	tmp = 0.0;
	if (a <= -5.6e+169)
		tmp = t_1;
	elseif (a <= -8e-79)
		tmp = t / ((a - z) / (y - z));
	elseif (a <= 6.6e-159)
		tmp = t - ((y * (t - x)) / z);
	elseif (a <= 1250000000.0)
		tmp = t - (x * ((a - y) / z));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(t - x), $MachinePrecision] / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.6e+169], t$95$1, If[LessEqual[a, -8e-79], N[(t / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-159], N[(t - N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1250000000.0], N[(t - N[(x * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -8 \cdot 10^{-79}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -5.6000000000000003e169 or 1.25e9 < a

    1. Initial program 90.6%

      \[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-sub79.7%

        \[\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-neg79.7%

        \[\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*90.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-out90.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-out90.6%

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

        \[\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}}} \]
    6. Taylor expanded in z around 0 76.5%

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

    if -5.6000000000000003e169 < a < -8e-79

    1. Initial program 78.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
    7. Step-by-step derivation
      1. *-rgt-identity50.9%

        \[\leadsto \frac{t \cdot \left(y - z\right)}{\color{blue}{\left(a - z\right) \cdot 1}} \]
      2. times-frac53.7%

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

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

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

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

    if -8e-79 < a < 6.6000000000000003e-159

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

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

        \[\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/89.2%

        \[\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/89.2%

        \[\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-neg89.2%

        \[\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-sub89.2%

        \[\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-neg89.2%

        \[\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--89.2%

        \[\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/89.2%

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

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

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

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

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

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

    if 6.6000000000000003e-159 < a < 1.25e9

    1. Initial program 59.7%

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

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

        \[\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/61.4%

        \[\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/61.4%

        \[\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-neg61.4%

        \[\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-sub61.5%

        \[\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-neg61.5%

        \[\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--61.5%

        \[\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/61.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{+169}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq -8 \cdot 10^{-79}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 6.6 \cdot 10^{-159}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{elif}\;a \leq 1250000000:\\ \;\;\;\;t - x \cdot \frac{a - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -5.8 \cdot 10^{-81}:\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.6000000000000003e169 or 1.0999999999999999e-101 < a

    1. Initial program 82.5%

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

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

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

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

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

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

        \[\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-out82.5%

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

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

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

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

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

    if -5.6000000000000003e169 < a < -5.79999999999999978e-81

    1. Initial program 78.5%

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

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

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

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

      \[\leadsto \color{blue}{\frac{t \cdot \left(y - z\right)}{a - z}} \]
    7. Step-by-step derivation
      1. *-rgt-identity50.9%

        \[\leadsto \frac{t \cdot \left(y - z\right)}{\color{blue}{\left(a - z\right) \cdot 1}} \]
      2. times-frac53.7%

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

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

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

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

    if -5.79999999999999978e-81 < a < 1.0999999999999999e-101

    1. Initial program 75.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 86.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}} \]
    4. Step-by-step derivation
      1. associate--l+86.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/86.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/86.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-neg86.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-sub86.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-neg86.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--86.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/86.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.6 \cdot 10^{+169}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-81}:\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-101}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.8% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;a \leq -4.8 \cdot 10^{-80}:\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -5.9e169 or 6.89999999999999999e-102 < a

    1. Initial program 82.5%

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

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

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

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

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

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

        \[\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-out82.5%

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

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

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

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

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

    if -5.9e169 < a < -4.7999999999999998e-80

    1. Initial program 78.5%

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

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

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

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

    if -4.7999999999999998e-80 < a < 6.89999999999999999e-102

    1. Initial program 75.1%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 86.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}} \]
    4. Step-by-step derivation
      1. associate--l+86.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/86.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/86.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-neg86.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-sub86.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-neg86.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--86.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/86.9%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.9 \cdot 10^{+169}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-80}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq 6.9 \cdot 10^{-102}:\\ \;\;\;\;t - \frac{y \cdot \left(t - x\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 51.3% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;z \leq 1.05 \cdot 10^{+165}:\\
\;\;\;\;y \cdot \frac{x - t}{z}\\

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


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

    1. Initial program 58.5%

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

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

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

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

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

        \[\leadsto t \cdot \frac{y - z}{\color{blue}{-z}} \]
    8. Simplified63.6%

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

    if -4.9999999999999998e81 < z < 3.39999999999999988e-62

    1. Initial program 88.9%

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

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

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

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

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

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

    if 3.39999999999999988e-62 < z < 1.05e165

    1. Initial program 85.3%

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

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

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

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

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

        \[\leadsto t \cdot \frac{y - z}{\color{blue}{-z}} \]
    8. Simplified43.0%

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

    if 1.05e165 < z

    1. Initial program 59.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5 \cdot 10^{+81}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;z \leq 3.4 \cdot 10^{-62}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq 1.05 \cdot 10^{+165}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 51.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;a \leq 5.2 \cdot 10^{-71}:\\
\;\;\;\;t \cdot \frac{z - y}{z}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.65000000000000008e-70 or 2.15e-48 < a

    1. Initial program 85.7%

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

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

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

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

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

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

    if -1.65000000000000008e-70 < a < 5.1999999999999997e-71

    1. Initial program 72.3%

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

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

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

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

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

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

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

    if 5.1999999999999997e-71 < a < 2.15e-48

    1. Initial program 35.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 70.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}} \]
    4. Step-by-step derivation
      1. associate--l+70.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/70.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/70.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-neg70.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-sub70.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-neg70.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--70.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/70.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    8. Simplified79.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.65 \cdot 10^{-70}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq 5.2 \cdot 10^{-71}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;a \leq 2.15 \cdot 10^{-48}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 66.5% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.66000000000000001e81 or 6.00000000000000038e-60 < z

    1. Initial program 70.6%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified59.8%

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

    if -1.66000000000000001e81 < z < 6.00000000000000038e-60

    1. Initial program 89.0%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0 88.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. +-commutative88.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-sub88.9%

        \[\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-neg88.9%

        \[\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*87.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-out87.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-out89.0%

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

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

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

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

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

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

Alternative 12: 63.5% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3000000000000002e79 or 6.19999999999999976e-60 < z

    1. Initial program 70.6%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified59.8%

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

    if -3.3000000000000002e79 < z < 6.19999999999999976e-60

    1. Initial program 89.0%

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

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

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

Alternative 13: 59.8% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.3 \cdot 10^{-14} \lor \neg \left(t \leq 9.2 \cdot 10^{-32}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.29999999999999998e-14 or 9.2000000000000002e-32 < t

    1. Initial program 88.3%

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y - z}{a - z}} \]
    5. Simplified72.3%

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

    if -1.29999999999999998e-14 < t < 9.2000000000000002e-32

    1. Initial program 69.2%

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

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

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

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

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

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

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

Alternative 14: 51.6% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+80} \lor \neg \left(z \leq 4.5 \cdot 10^{+125}\right):\\
\;\;\;\;t \cdot \frac{z}{z - a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.79999999999999984e80 or 4.5e125 < z

    1. Initial program 61.2%

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

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

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

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

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

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

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

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

    if -2.79999999999999984e80 < z < 4.5e125

    1. Initial program 88.2%

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

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

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

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

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

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

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

Alternative 15: 43.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{+125} \lor \neg \left(y \leq 6.9 \cdot 10^{+124}\right):\\
\;\;\;\;t \cdot \frac{y}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.9000000000000002e125 or 6.9e124 < y

    1. Initial program 88.1%

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

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

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

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

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

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

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

    if -3.9000000000000002e125 < y < 6.9e124

    1. Initial program 75.1%

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

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

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

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

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

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

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

Alternative 16: 49.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq 5.6 \cdot 10^{+125}:\\
\;\;\;\;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 < -2.50000000000000014e83 or 5.6000000000000002e125 < z

    1. Initial program 61.2%

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

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

    if -2.50000000000000014e83 < z < 5.6000000000000002e125

    1. Initial program 88.2%

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

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

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

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

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

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

Alternative 17: 37.6% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.79999999999999993e139 or 8.60000000000000053e-67 < a

    1. Initial program 87.5%

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

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

    if -1.79999999999999993e139 < a < 8.60000000000000053e-67

    1. Initial program 73.1%

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

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

Alternative 18: 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 79.0%

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

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

Reproduce

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