Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.4% → 93.1%
Time: 26.2s
Alternatives: 21
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 21 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 80.4% 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.1% accurate, 0.1× speedup?

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

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

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

    1. Initial program 85.5%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.0%

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

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

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

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

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

        \[\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-sub87.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-neg87.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--87.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/87.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.2% accurate, 0.3× speedup?

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

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

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

    1. Initial program 87.2%

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

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

    1. Initial program 8.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 82.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+82.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/82.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/82.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-neg82.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-sub82.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-neg82.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--82.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/82.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 89.2% accurate, 0.3× speedup?

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

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

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

    1. Initial program 87.2%

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

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

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

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

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

    1. Initial program 8.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 82.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+82.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/82.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/82.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-neg82.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-sub82.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-neg82.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--82.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/82.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 38.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a}\\ t_2 := x \cdot \left(\frac{z}{a} + 1\right)\\ \mathbf{if}\;a \leq -4.1 \cdot 10^{+160}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-75}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{-181}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.48 \cdot 10^{-213}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-138}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+176}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) a))) (t_2 (* x (+ (/ z a) 1.0))))
   (if (<= a -4.1e+160)
     t_2
     (if (<= a -5.8e-75)
       t_1
       (if (<= a -1.35e-181)
         t
         (if (<= a 1.48e-213)
           (* x (/ y z))
           (if (<= a 6.2e-138)
             t
             (if (<= a 2.9e+17)
               (* x (/ (- y a) z))
               (if (<= a 1.5e+176) t_1 t_2)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / a);
	double t_2 = x * ((z / a) + 1.0);
	double tmp;
	if (a <= -4.1e+160) {
		tmp = t_2;
	} else if (a <= -5.8e-75) {
		tmp = t_1;
	} else if (a <= -1.35e-181) {
		tmp = t;
	} else if (a <= 1.48e-213) {
		tmp = x * (y / z);
	} else if (a <= 6.2e-138) {
		tmp = t;
	} else if (a <= 2.9e+17) {
		tmp = x * ((y - a) / z);
	} else if (a <= 1.5e+176) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = y * ((t - x) / a)
    t_2 = x * ((z / a) + 1.0d0)
    if (a <= (-4.1d+160)) then
        tmp = t_2
    else if (a <= (-5.8d-75)) then
        tmp = t_1
    else if (a <= (-1.35d-181)) then
        tmp = t
    else if (a <= 1.48d-213) then
        tmp = x * (y / z)
    else if (a <= 6.2d-138) then
        tmp = t
    else if (a <= 2.9d+17) then
        tmp = x * ((y - a) / z)
    else if (a <= 1.5d+176) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / a);
	double t_2 = x * ((z / a) + 1.0);
	double tmp;
	if (a <= -4.1e+160) {
		tmp = t_2;
	} else if (a <= -5.8e-75) {
		tmp = t_1;
	} else if (a <= -1.35e-181) {
		tmp = t;
	} else if (a <= 1.48e-213) {
		tmp = x * (y / z);
	} else if (a <= 6.2e-138) {
		tmp = t;
	} else if (a <= 2.9e+17) {
		tmp = x * ((y - a) / z);
	} else if (a <= 1.5e+176) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / a)
	t_2 = x * ((z / a) + 1.0)
	tmp = 0
	if a <= -4.1e+160:
		tmp = t_2
	elif a <= -5.8e-75:
		tmp = t_1
	elif a <= -1.35e-181:
		tmp = t
	elif a <= 1.48e-213:
		tmp = x * (y / z)
	elif a <= 6.2e-138:
		tmp = t
	elif a <= 2.9e+17:
		tmp = x * ((y - a) / z)
	elif a <= 1.5e+176:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / a))
	t_2 = Float64(x * Float64(Float64(z / a) + 1.0))
	tmp = 0.0
	if (a <= -4.1e+160)
		tmp = t_2;
	elseif (a <= -5.8e-75)
		tmp = t_1;
	elseif (a <= -1.35e-181)
		tmp = t;
	elseif (a <= 1.48e-213)
		tmp = Float64(x * Float64(y / z));
	elseif (a <= 6.2e-138)
		tmp = t;
	elseif (a <= 2.9e+17)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (a <= 1.5e+176)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / a);
	t_2 = x * ((z / a) + 1.0);
	tmp = 0.0;
	if (a <= -4.1e+160)
		tmp = t_2;
	elseif (a <= -5.8e-75)
		tmp = t_1;
	elseif (a <= -1.35e-181)
		tmp = t;
	elseif (a <= 1.48e-213)
		tmp = x * (y / z);
	elseif (a <= 6.2e-138)
		tmp = t;
	elseif (a <= 2.9e+17)
		tmp = x * ((y - a) / z);
	elseif (a <= 1.5e+176)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(z / a), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.1e+160], t$95$2, If[LessEqual[a, -5.8e-75], t$95$1, If[LessEqual[a, -1.35e-181], t, If[LessEqual[a, 1.48e-213], N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.2e-138], t, If[LessEqual[a, 2.9e+17], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e+176], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;a \leq -1.35 \cdot 10^{-181}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 6.2 \cdot 10^{-138}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 1.5 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -4.09999999999999998e160 or 1.5e176 < a

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

    if -4.09999999999999998e160 < a < -5.8000000000000003e-75 or 2.9e17 < a < 1.5e176

    1. Initial program 87.2%

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

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

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

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

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

    if -5.8000000000000003e-75 < a < -1.35e-181 or 1.4800000000000001e-213 < a < 6.1999999999999996e-138

    1. Initial program 46.2%

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

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

    if -1.35e-181 < a < 1.4800000000000001e-213

    1. Initial program 65.3%

      \[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}{-1 \cdot \left(x \cdot \left(\frac{y}{a - z} - \left(1 + \frac{z}{a - z}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg59.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    9. Simplified54.5%

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

    if 6.1999999999999996e-138 < a < 2.9e17

    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 -inf 40.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{+160}:\\ \;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-75}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -1.35 \cdot 10^{-181}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.48 \cdot 10^{-213}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 6.2 \cdot 10^{-138}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+17}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+176}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 49.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + t \cdot \frac{y}{a}\\ \mathbf{if}\;a \leq -6.1 \cdot 10^{+54}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.08 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-182}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-214}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 1.16 \cdot 10^{-139}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-15}:\\ \;\;\;\;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 (* t (/ y a)))))
   (if (<= a -6.1e+54)
     t_1
     (if (<= a -1.08e-74)
       (* y (/ (- t x) a))
       (if (<= a -5e-182)
         t
         (if (<= a 3.2e-214)
           (* y (/ (- x t) z))
           (if (<= a 1.16e-139)
             t
             (if (<= a 1.8e-15) (* x (/ (- y a) z)) t_1))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + (t * (y / a));
	double tmp;
	if (a <= -6.1e+54) {
		tmp = t_1;
	} else if (a <= -1.08e-74) {
		tmp = y * ((t - x) / a);
	} else if (a <= -5e-182) {
		tmp = t;
	} else if (a <= 3.2e-214) {
		tmp = y * ((x - t) / z);
	} else if (a <= 1.16e-139) {
		tmp = t;
	} else if (a <= 1.8e-15) {
		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 + (t * (y / a))
    if (a <= (-6.1d+54)) then
        tmp = t_1
    else if (a <= (-1.08d-74)) then
        tmp = y * ((t - x) / a)
    else if (a <= (-5d-182)) then
        tmp = t
    else if (a <= 3.2d-214) then
        tmp = y * ((x - t) / z)
    else if (a <= 1.16d-139) then
        tmp = t
    else if (a <= 1.8d-15) 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 + (t * (y / a));
	double tmp;
	if (a <= -6.1e+54) {
		tmp = t_1;
	} else if (a <= -1.08e-74) {
		tmp = y * ((t - x) / a);
	} else if (a <= -5e-182) {
		tmp = t;
	} else if (a <= 3.2e-214) {
		tmp = y * ((x - t) / z);
	} else if (a <= 1.16e-139) {
		tmp = t;
	} else if (a <= 1.8e-15) {
		tmp = x * ((y - a) / z);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + (t * (y / a))
	tmp = 0
	if a <= -6.1e+54:
		tmp = t_1
	elif a <= -1.08e-74:
		tmp = y * ((t - x) / a)
	elif a <= -5e-182:
		tmp = t
	elif a <= 3.2e-214:
		tmp = y * ((x - t) / z)
	elif a <= 1.16e-139:
		tmp = t
	elif a <= 1.8e-15:
		tmp = x * ((y - a) / z)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x + Float64(t * Float64(y / a)))
	tmp = 0.0
	if (a <= -6.1e+54)
		tmp = t_1;
	elseif (a <= -1.08e-74)
		tmp = Float64(y * Float64(Float64(t - x) / a));
	elseif (a <= -5e-182)
		tmp = t;
	elseif (a <= 3.2e-214)
		tmp = Float64(y * Float64(Float64(x - t) / z));
	elseif (a <= 1.16e-139)
		tmp = t;
	elseif (a <= 1.8e-15)
		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 + (t * (y / a));
	tmp = 0.0;
	if (a <= -6.1e+54)
		tmp = t_1;
	elseif (a <= -1.08e-74)
		tmp = y * ((t - x) / a);
	elseif (a <= -5e-182)
		tmp = t;
	elseif (a <= 3.2e-214)
		tmp = y * ((x - t) / z);
	elseif (a <= 1.16e-139)
		tmp = t;
	elseif (a <= 1.8e-15)
		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[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.1e+54], t$95$1, If[LessEqual[a, -1.08e-74], N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5e-182], t, If[LessEqual[a, 3.2e-214], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.16e-139], t, If[LessEqual[a, 1.8e-15], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.08 \cdot 10^{-74}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

\mathbf{elif}\;a \leq -5 \cdot 10^{-182}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 1.16 \cdot 10^{-139}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -6.0999999999999998e54 or 1.8000000000000001e-15 < a

    1. Initial program 89.9%

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

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

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

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

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

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

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

    if -6.0999999999999998e54 < a < -1.0799999999999999e-74

    1. Initial program 82.4%

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

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

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

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

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

    if -1.0799999999999999e-74 < a < -5.00000000000000024e-182 or 3.20000000000000013e-214 < a < 1.15999999999999999e-139

    1. Initial program 46.2%

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

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

    if -5.00000000000000024e-182 < a < 3.20000000000000013e-214

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15999999999999999e-139 < a < 1.8000000000000001e-15

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.1 \cdot 10^{+54}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -1.08 \cdot 10^{-74}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-182}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 3.2 \cdot 10^{-214}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 1.16 \cdot 10^{-139}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.8 \cdot 10^{-15}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 47.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -6.4 \cdot 10^{-76}:\\
\;\;\;\;y \cdot \frac{t - x}{a}\\

\mathbf{elif}\;a \leq -1.28 \cdot 10^{-189}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 1.45 \cdot 10^{-136}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if a < -1.3e41

    1. Initial program 86.5%

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

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

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

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

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

    if -1.3e41 < a < -6.3999999999999995e-76

    1. Initial program 80.3%

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

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

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

        \[\leadsto y \cdot \color{blue}{\frac{t - x}{a}} \]
    6. Simplified57.0%

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

    if -6.3999999999999995e-76 < a < -1.28e-189 or 1.10000000000000002e-212 < a < 1.44999999999999997e-136

    1. Initial program 46.2%

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

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

    if -1.28e-189 < a < 1.10000000000000002e-212

    1. Initial program 65.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.44999999999999997e-136 < a < 1e-13

    1. Initial program 55.9%

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

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

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

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

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

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

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

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

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

    if 1e-13 < a

    1. Initial program 93.3%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+41}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -6.4 \cdot 10^{-76}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -1.28 \cdot 10^{-189}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.1 \cdot 10^{-212}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 1.45 \cdot 10^{-136}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 10^{-13}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 57.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq -1.76 \cdot 10^{-50}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 4.1 \cdot 10^{-43}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 7.5 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -6.00000000000000046e107

    1. Initial program 68.0%

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

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

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

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

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

    if -6.00000000000000046e107 < x < -1.76e-50 or 4.0999999999999998e-43 < x < 7.50000000000000014e55

    1. Initial program 83.7%

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

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

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

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

    if -1.76e-50 < x < 4.0999999999999998e-43 or 7.50000000000000014e55 < x < 2.90000000000000011e68

    1. Initial program 80.2%

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

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

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

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

    if 2.90000000000000011e68 < x < 9.9999999999999997e199

    1. Initial program 76.8%

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

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

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\left(-\frac{x}{a}\right)} \]
      2. distribute-neg-frac260.8%

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

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

    if 9.9999999999999997e199 < x

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6 \cdot 10^{+107}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq -1.76 \cdot 10^{-50}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-43}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{+55}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+68}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq 10^{+200}:\\ \;\;\;\;x - y \cdot \frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 59.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.25 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq -1.65 \cdot 10^{-19} \lor \neg \left(z \leq 3.9 \cdot 10^{+21}\right):\\
\;\;\;\;t\_1\\

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

    if -8.59999999999999967e175 < z < -1.24999999999999995e87 or -3.35e9 < z < -1.6499999999999999e-19 or 3.9e21 < z

    1. Initial program 62.0%

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

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

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

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

    if -1.24999999999999995e87 < z < -3.35e9

    1. Initial program 87.1%

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

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

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

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

    if -1.6499999999999999e-19 < z < 3.9e21

    1. Initial program 88.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8.6 \cdot 10^{+175}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1.25 \cdot 10^{+87}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;z \leq -3350000000:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq -1.65 \cdot 10^{-19} \lor \neg \left(z \leq 3.9 \cdot 10^{+21}\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 9: 37.9% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;a \leq -2 \cdot 10^{+25}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -8.5 \cdot 10^{-184}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 1.26 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 7 \cdot 10^{-133}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -2.00000000000000018e25

    1. Initial program 85.7%

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

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

    if -2.00000000000000018e25 < a < -8.50000000000000036e-184 or 1.26000000000000009e-211 < a < 7.00000000000000006e-133

    1. Initial program 58.3%

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

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

    if -8.50000000000000036e-184 < a < 1.26000000000000009e-211 or 7.00000000000000006e-133 < a < 7.5e-12

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

    if 7.5e-12 < a

    1. Initial program 93.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{+25}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -8.5 \cdot 10^{-184}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.26 \cdot 10^{-211}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 7 \cdot 10^{-133}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-12}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 38.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;a \leq -1.05 \cdot 10^{-188}:\\
\;\;\;\;t\\

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

\mathbf{elif}\;a \leq 5.5 \cdot 10^{-136}:\\
\;\;\;\;t\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if a < -9.6e23

    1. Initial program 85.7%

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

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

    if -9.6e23 < a < -1.05e-188 or 1.6499999999999999e-214 < a < 5.4999999999999999e-136

    1. Initial program 59.4%

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

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

    if -1.05e-188 < a < 1.6499999999999999e-214

    1. Initial program 65.3%

      \[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}{-1 \cdot \left(x \cdot \left(\frac{y}{a - z} - \left(1 + \frac{z}{a - z}\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg59.0%

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y}{z}} \]
    9. Simplified54.5%

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

    if 5.4999999999999999e-136 < a < 7e18

    1. Initial program 59.9%

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

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

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

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

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

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

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

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

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

    if 7e18 < a

    1. Initial program 94.3%

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

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

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

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

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

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

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

      \[\leadsto x \cdot \color{blue}{\left(1 + \frac{z}{a}\right)} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification46.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -9.6 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -1.05 \cdot 10^{-188}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-214}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 5.5 \cdot 10^{-136}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 7 \cdot 10^{+18}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(\frac{z}{a} + 1\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 58.4% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;x \leq -6 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq -1.32 \cdot 10^{-55}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 2.9 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.2000000000000001e69 or -6e-34 < x < -1.31999999999999993e-55

    1. Initial program 72.2%

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

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

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

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

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

    if -1.2000000000000001e69 < x < -6e-34 or -1.31999999999999993e-55 < x < 2.9e19

    1. Initial program 80.8%

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

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

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

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

    if 2.9e19 < x < 9.9999999999999997e199

    1. Initial program 78.9%

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

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

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

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

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

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

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

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

    if 9.9999999999999997e199 < x

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.2 \cdot 10^{+69}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-34}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq -1.32 \cdot 10^{-55}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;x \leq 2.9 \cdot 10^{+19}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;x \leq 10^{+200}:\\ \;\;\;\;x - y \cdot \frac{x}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 37.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \frac{y}{z}\\ \mathbf{if}\;a \leq -1.3 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-190}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-214}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-133}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (/ y z))))
   (if (<= a -1.3e+23)
     x
     (if (<= a -5e-190)
       t
       (if (<= a 1.65e-214)
         t_1
         (if (<= a 3.8e-133) t (if (<= a 3.9e-13) t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (y / z);
	double tmp;
	if (a <= -1.3e+23) {
		tmp = x;
	} else if (a <= -5e-190) {
		tmp = t;
	} else if (a <= 1.65e-214) {
		tmp = t_1;
	} else if (a <= 3.8e-133) {
		tmp = t;
	} else if (a <= 3.9e-13) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = x * (y / z)
    if (a <= (-1.3d+23)) then
        tmp = x
    else if (a <= (-5d-190)) then
        tmp = t
    else if (a <= 1.65d-214) then
        tmp = t_1
    else if (a <= 3.8d-133) then
        tmp = t
    else if (a <= 3.9d-13) then
        tmp = t_1
    else
        tmp = x
    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);
	double tmp;
	if (a <= -1.3e+23) {
		tmp = x;
	} else if (a <= -5e-190) {
		tmp = t;
	} else if (a <= 1.65e-214) {
		tmp = t_1;
	} else if (a <= 3.8e-133) {
		tmp = t;
	} else if (a <= 3.9e-13) {
		tmp = t_1;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (y / z)
	tmp = 0
	if a <= -1.3e+23:
		tmp = x
	elif a <= -5e-190:
		tmp = t
	elif a <= 1.65e-214:
		tmp = t_1
	elif a <= 3.8e-133:
		tmp = t
	elif a <= 3.9e-13:
		tmp = t_1
	else:
		tmp = x
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(y / z))
	tmp = 0.0
	if (a <= -1.3e+23)
		tmp = x;
	elseif (a <= -5e-190)
		tmp = t;
	elseif (a <= 1.65e-214)
		tmp = t_1;
	elseif (a <= 3.8e-133)
		tmp = t;
	elseif (a <= 3.9e-13)
		tmp = t_1;
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (y / z);
	tmp = 0.0;
	if (a <= -1.3e+23)
		tmp = x;
	elseif (a <= -5e-190)
		tmp = t;
	elseif (a <= 1.65e-214)
		tmp = t_1;
	elseif (a <= 3.8e-133)
		tmp = t;
	elseif (a <= 3.9e-13)
		tmp = t_1;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.3e+23], x, If[LessEqual[a, -5e-190], t, If[LessEqual[a, 1.65e-214], t$95$1, If[LessEqual[a, 3.8e-133], t, If[LessEqual[a, 3.9e-13], t$95$1, x]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot \frac{y}{z}\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+23}:\\
\;\;\;\;x\\

\mathbf{elif}\;a \leq -5 \cdot 10^{-190}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 1.65 \cdot 10^{-214}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 3.8 \cdot 10^{-133}:\\
\;\;\;\;t\\

\mathbf{elif}\;a \leq 3.9 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.29999999999999996e23 or 3.90000000000000004e-13 < a

    1. Initial program 89.7%

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

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

    if -1.29999999999999996e23 < a < -5.00000000000000034e-190 or 1.6499999999999999e-214 < a < 3.8000000000000003e-133

    1. Initial program 58.3%

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

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

    if -5.00000000000000034e-190 < a < 1.6499999999999999e-214 or 3.8000000000000003e-133 < a < 3.90000000000000004e-13

    1. Initial program 62.7%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.3 \cdot 10^{+23}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq -5 \cdot 10^{-190}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 1.65 \cdot 10^{-214}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 3.8 \cdot 10^{-133}:\\ \;\;\;\;t\\ \mathbf{elif}\;a \leq 3.9 \cdot 10^{-13}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 63.7% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t \cdot \frac{y - z}{a - z}\\
t_2 := x + y \cdot \frac{t - x}{a}\\
\mathbf{if}\;a \leq -3 \cdot 10^{+16}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \leq -3.9 \cdot 10^{-192}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 10000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3e16 or 1e7 < a

    1. Initial program 90.4%

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

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

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

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

    if -3e16 < a < -3.9000000000000003e-192 or -2.39999999999999993e-222 < a < 1e7

    1. Initial program 60.5%

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

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

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

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

    if -3.9000000000000003e-192 < a < -2.39999999999999993e-222

    1. Initial program 56.7%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 90.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+90.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/90.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/90.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-neg90.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-sub90.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3 \cdot 10^{+16}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq -3.9 \cdot 10^{-192}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;a \leq -2.4 \cdot 10^{-222}:\\ \;\;\;\;\left(y - a\right) \cdot \frac{x}{z}\\ \mathbf{elif}\;a \leq 10000000:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 69.3% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := t + y \cdot \frac{x - t}{z}\\
t_2 := x + y \cdot \frac{t - x}{a}\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{-22}:\\
\;\;\;\;t\_2\\

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

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

\mathbf{elif}\;a \leq 140000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.2999999999999998e-22 or 1.4e8 < a

    1. Initial program 89.5%

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

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

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

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

    if -2.2999999999999998e-22 < a < 3.40000000000000006e-133 or 2.1000000000000001e-89 < a < 1.4e8

    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 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.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-neg75.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--75.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/75.8%

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

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

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

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

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

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

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

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

    if 3.40000000000000006e-133 < a < 2.1000000000000001e-89

    1. Initial program 57.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.3 \cdot 10^{-22}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;a \leq 3.4 \cdot 10^{-133}:\\ \;\;\;\;t + y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 2.1 \cdot 10^{-89}:\\ \;\;\;\;\frac{y \cdot \left(t - x\right)}{a - z}\\ \mathbf{elif}\;a \leq 140000000:\\ \;\;\;\;t + y \cdot \frac{x - t}{z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 64.6% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 48.6%

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

      \[\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+73.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.75e130 < z < -1.5e23

    1. Initial program 88.4%

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

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

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

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

    if -1.5e23 < z < 165

    1. Initial program 88.9%

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

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

    if 165 < z

    1. Initial program 60.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 50.0% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+177}:\\
\;\;\;\;x \cdot \frac{y - a}{z}\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{+91}:\\
\;\;\;\;t\\

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

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


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

    1. Initial program 45.6%

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

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

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

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

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

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

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

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

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

    if -1.05000000000000006e177 < z < -2.90000000000000014e91 or 3.5e76 < z

    1. Initial program 55.6%

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

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

    if -2.90000000000000014e91 < z < 3.5e76

    1. Initial program 87.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+177}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{+91}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 3.5 \cdot 10^{+76}:\\ \;\;\;\;x + t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 17: 70.2% accurate, 0.6× speedup?

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

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

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

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


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

    1. Initial program 49.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 71.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+71.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/71.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/71.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-neg71.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-sub71.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.24999999999999997e101 < z < 1.95e43

    1. Initial program 88.3%

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

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

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

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

    if 1.95e43 < z

    1. Initial program 56.4%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 63.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+63.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/63.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/63.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-neg63.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-sub63.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-neg63.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--63.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/63.2%

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

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

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

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

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

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

        \[\leadsto t - \color{blue}{y \cdot \frac{t - x}{z}} \]
    8. Simplified68.3%

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

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

Alternative 18: 73.9% accurate, 0.6× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.39999999999999997e-22

    1. Initial program 84.8%

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

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

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

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

    if -1.39999999999999997e-22 < a < 12500

    1. Initial program 59.5%

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

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

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

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

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

        \[\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-sub73.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-neg73.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--73.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/73.5%

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

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

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

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

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

    if 12500 < a

    1. Initial program 94.4%

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

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

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

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

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

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

Alternative 19: 69.9% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.6999999999999999e-22 or 5.6e15 < a

    1. Initial program 89.5%

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

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

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

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

    if -1.6999999999999999e-22 < a < 5.6e15

    1. Initial program 59.5%

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

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

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

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

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

        \[\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-sub73.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-neg73.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--73.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/73.5%

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

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

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

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

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

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

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

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

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

Alternative 20: 39.0% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 22000000000000:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.3e20 or 2.2e13 < a

    1. Initial program 90.2%

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

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

    if -5.3e20 < a < 2.2e13

    1. Initial program 60.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.3 \cdot 10^{+20}:\\ \;\;\;\;x\\ \mathbf{elif}\;a \leq 22000000000000:\\ \;\;\;\;t\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 21: 24.7% accurate, 13.0× speedup?

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

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

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

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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