Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.9% → 94.9%
Time: 20.4s
Alternatives: 19
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 80.9% accurate, 1.0× speedup?

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

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

Alternative 1: 94.9% accurate, 0.1× speedup?

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

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

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


\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)))) < -9.99999999999999966e-275 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.8%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
    3. Taylor expanded in z around inf 89.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+89.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. distribute-lft-out--89.8%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 89.9% accurate, 0.3× speedup?

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

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

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


\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.99999999999999977e-163 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 95.7%

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

    if -4.99999999999999977e-163 < (+.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 x around inf 19.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 46.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot \left(1 - \frac{y}{a}\right)\\ t_2 := y \cdot \frac{t - x}{a}\\ \mathbf{if}\;z \leq -6 \cdot 10^{+151}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-67}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-110}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-168}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-187}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-236}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* x (- 1.0 (/ y a)))) (t_2 (* y (/ (- t x) a))))
   (if (<= z -6e+151)
     t
     (if (<= z -4.9e+25)
       (* x (/ (- y a) z))
       (if (<= z -1.15e-67)
         t_1
         (if (<= z -2.4e-110)
           t_2
           (if (<= z -2.9e-168)
             t_1
             (if (<= z -4.4e-187)
               (* t (/ (- y z) a))
               (if (<= z -2.9e-236) t_2 (if (<= z 7.2e+25) t_1 t))))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double t_2 = y * ((t - x) / a);
	double tmp;
	if (z <= -6e+151) {
		tmp = t;
	} else if (z <= -4.9e+25) {
		tmp = x * ((y - a) / z);
	} else if (z <= -1.15e-67) {
		tmp = t_1;
	} else if (z <= -2.4e-110) {
		tmp = t_2;
	} else if (z <= -2.9e-168) {
		tmp = t_1;
	} else if (z <= -4.4e-187) {
		tmp = t * ((y - z) / a);
	} else if (z <= -2.9e-236) {
		tmp = t_2;
	} else if (z <= 7.2e+25) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x * (1.0d0 - (y / a))
    t_2 = y * ((t - x) / a)
    if (z <= (-6d+151)) then
        tmp = t
    else if (z <= (-4.9d+25)) then
        tmp = x * ((y - a) / z)
    else if (z <= (-1.15d-67)) then
        tmp = t_1
    else if (z <= (-2.4d-110)) then
        tmp = t_2
    else if (z <= (-2.9d-168)) then
        tmp = t_1
    else if (z <= (-4.4d-187)) then
        tmp = t * ((y - z) / a)
    else if (z <= (-2.9d-236)) then
        tmp = t_2
    else if (z <= 7.2d+25) then
        tmp = t_1
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x * (1.0 - (y / a));
	double t_2 = y * ((t - x) / a);
	double tmp;
	if (z <= -6e+151) {
		tmp = t;
	} else if (z <= -4.9e+25) {
		tmp = x * ((y - a) / z);
	} else if (z <= -1.15e-67) {
		tmp = t_1;
	} else if (z <= -2.4e-110) {
		tmp = t_2;
	} else if (z <= -2.9e-168) {
		tmp = t_1;
	} else if (z <= -4.4e-187) {
		tmp = t * ((y - z) / a);
	} else if (z <= -2.9e-236) {
		tmp = t_2;
	} else if (z <= 7.2e+25) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x * (1.0 - (y / a))
	t_2 = y * ((t - x) / a)
	tmp = 0
	if z <= -6e+151:
		tmp = t
	elif z <= -4.9e+25:
		tmp = x * ((y - a) / z)
	elif z <= -1.15e-67:
		tmp = t_1
	elif z <= -2.4e-110:
		tmp = t_2
	elif z <= -2.9e-168:
		tmp = t_1
	elif z <= -4.4e-187:
		tmp = t * ((y - z) / a)
	elif z <= -2.9e-236:
		tmp = t_2
	elif z <= 7.2e+25:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x * Float64(1.0 - Float64(y / a)))
	t_2 = Float64(y * Float64(Float64(t - x) / a))
	tmp = 0.0
	if (z <= -6e+151)
		tmp = t;
	elseif (z <= -4.9e+25)
		tmp = Float64(x * Float64(Float64(y - a) / z));
	elseif (z <= -1.15e-67)
		tmp = t_1;
	elseif (z <= -2.4e-110)
		tmp = t_2;
	elseif (z <= -2.9e-168)
		tmp = t_1;
	elseif (z <= -4.4e-187)
		tmp = Float64(t * Float64(Float64(y - z) / a));
	elseif (z <= -2.9e-236)
		tmp = t_2;
	elseif (z <= 7.2e+25)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x * (1.0 - (y / a));
	t_2 = y * ((t - x) / a);
	tmp = 0.0;
	if (z <= -6e+151)
		tmp = t;
	elseif (z <= -4.9e+25)
		tmp = x * ((y - a) / z);
	elseif (z <= -1.15e-67)
		tmp = t_1;
	elseif (z <= -2.4e-110)
		tmp = t_2;
	elseif (z <= -2.9e-168)
		tmp = t_1;
	elseif (z <= -4.4e-187)
		tmp = t * ((y - z) / a);
	elseif (z <= -2.9e-236)
		tmp = t_2;
	elseif (z <= 7.2e+25)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6e+151], t, If[LessEqual[z, -4.9e+25], N[(x * N[(N[(y - a), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.15e-67], t$95$1, If[LessEqual[z, -2.4e-110], t$95$2, If[LessEqual[z, -2.9e-168], t$95$1, If[LessEqual[z, -4.4e-187], N[(t * N[(N[(y - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.9e-236], t$95$2, If[LessEqual[z, 7.2e+25], t$95$1, t]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-67}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-110}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-168}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq -2.9 \cdot 10^{-236}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -5.9999999999999998e151 or 7.20000000000000031e25 < z

    1. Initial program 59.9%

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

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

    if -5.9999999999999998e151 < z < -4.9000000000000001e25

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    11. Simplified37.3%

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

    if -4.9000000000000001e25 < z < -1.15e-67 or -2.40000000000000006e-110 < z < -2.8999999999999998e-168 or -2.9e-236 < z < 7.20000000000000031e25

    1. Initial program 97.1%

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

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

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

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

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

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

    if -1.15e-67 < z < -2.40000000000000006e-110 or -4.40000000000000016e-187 < z < -2.9e-236

    1. Initial program 94.8%

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

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

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

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

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

    if -2.8999999999999998e-168 < z < -4.40000000000000016e-187

    1. Initial program 89.6%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+151}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -4.9 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-67}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-110}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-168}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -4.4 \cdot 10^{-187}:\\ \;\;\;\;t \cdot \frac{y - z}{a}\\ \mathbf{elif}\;z \leq -2.9 \cdot 10^{-236}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 90.9% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 94.5%

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

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

    1. Initial program 6.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 38.6% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;z \leq -1.05 \cdot 10^{+72}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-240}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-112}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+85}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y (- a z)))))
   (if (<= z -1.05e+72)
     t
     (if (<= z -1.02e-63)
       x
       (if (<= z -8.5e-240)
         t_1
         (if (<= z 7.4e-112) x (if (<= z 5.2e+85) t_1 t)))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double tmp;
	if (z <= -1.05e+72) {
		tmp = t;
	} else if (z <= -1.02e-63) {
		tmp = x;
	} else if (z <= -8.5e-240) {
		tmp = t_1;
	} else if (z <= 7.4e-112) {
		tmp = x;
	} else if (z <= 5.2e+85) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: tmp
    t_1 = t * (y / (a - z))
    if (z <= (-1.05d+72)) then
        tmp = t
    else if (z <= (-1.02d-63)) then
        tmp = x
    else if (z <= (-8.5d-240)) then
        tmp = t_1
    else if (z <= 7.4d-112) then
        tmp = x
    else if (z <= 5.2d+85) then
        tmp = t_1
    else
        tmp = t
    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 / (a - z));
	double tmp;
	if (z <= -1.05e+72) {
		tmp = t;
	} else if (z <= -1.02e-63) {
		tmp = x;
	} else if (z <= -8.5e-240) {
		tmp = t_1;
	} else if (z <= 7.4e-112) {
		tmp = x;
	} else if (z <= 5.2e+85) {
		tmp = t_1;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / (a - z))
	tmp = 0
	if z <= -1.05e+72:
		tmp = t
	elif z <= -1.02e-63:
		tmp = x
	elif z <= -8.5e-240:
		tmp = t_1
	elif z <= 7.4e-112:
		tmp = x
	elif z <= 5.2e+85:
		tmp = t_1
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / Float64(a - z)))
	tmp = 0.0
	if (z <= -1.05e+72)
		tmp = t;
	elseif (z <= -1.02e-63)
		tmp = x;
	elseif (z <= -8.5e-240)
		tmp = t_1;
	elseif (z <= 7.4e-112)
		tmp = x;
	elseif (z <= 5.2e+85)
		tmp = t_1;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / (a - z));
	tmp = 0.0;
	if (z <= -1.05e+72)
		tmp = t;
	elseif (z <= -1.02e-63)
		tmp = x;
	elseif (z <= -8.5e-240)
		tmp = t_1;
	elseif (z <= 7.4e-112)
		tmp = x;
	elseif (z <= 5.2e+85)
		tmp = t_1;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+72], t, If[LessEqual[z, -1.02e-63], x, If[LessEqual[z, -8.5e-240], t$95$1, If[LessEqual[z, 7.4e-112], x, If[LessEqual[z, 5.2e+85], t$95$1, t]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.02 \cdot 10^{-63}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -8.5 \cdot 10^{-240}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 7.4 \cdot 10^{-112}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 5.2 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.0500000000000001e72 or 5.20000000000000021e85 < z

    1. Initial program 59.9%

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

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

    if -1.0500000000000001e72 < z < -1.01999999999999997e-63 or -8.5e-240 < z < 7.3999999999999996e-112

    1. Initial program 93.1%

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

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

    if -1.01999999999999997e-63 < z < -8.5e-240 or 7.3999999999999996e-112 < z < 5.20000000000000021e85

    1. Initial program 93.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+72}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.02 \cdot 10^{-63}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -8.5 \cdot 10^{-240}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 7.4 \cdot 10^{-112}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 5.2 \cdot 10^{+85}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 47.4% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -4 \cdot 10^{-63}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -5.9999999999999998e151 or 2.00000000000000018e25 < z

    1. Initial program 59.9%

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

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

    if -5.9999999999999998e151 < z < -6.00000000000000011e25

    1. Initial program 74.7%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{x \cdot \frac{y - a}{z}} \]
    11. Simplified37.3%

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

    if -6.00000000000000011e25 < z < -4.00000000000000027e-63 or -1.05e-108 < z < 2.00000000000000018e25

    1. Initial program 96.5%

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

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

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

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

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

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

    if -4.00000000000000027e-63 < z < -1.05e-108

    1. Initial program 93.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{+151}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -6 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \frac{y - a}{z}\\ \mathbf{elif}\;z \leq -4 \cdot 10^{-63}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-108}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 37.5% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -1.3 \cdot 10^{-58}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -7 \cdot 10^{-236}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{-111}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.75 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 2.6 \cdot 10^{+14}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.4e72 or 2.6e14 < z

    1. Initial program 64.0%

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

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

    if -4.4e72 < z < -1.30000000000000003e-58 or -6.99999999999999988e-236 < z < 8.5000000000000003e-111 or 1.75e-28 < z < 2.6e14

    1. Initial program 93.5%

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

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

    if -1.30000000000000003e-58 < z < -6.99999999999999988e-236 or 8.5000000000000003e-111 < z < 1.75e-28

    1. Initial program 93.6%

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

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

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

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

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

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

        \[\leadsto \color{blue}{t \cdot \frac{y}{a}} \]
    9. Simplified45.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+72}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-58}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-236}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{-111}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.75 \cdot 10^{-28}:\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 2.6 \cdot 10^{+14}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 48.0% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 6 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.99999999999999989e72 or 6.00000000000000011e25 < z

    1. Initial program 62.4%

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

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

    if -1.99999999999999989e72 < z < -3.50000000000000005e-65 or -6.49999999999999974e-111 < z < 6.00000000000000011e25

    1. Initial program 93.8%

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

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

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

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

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

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

    if -3.50000000000000005e-65 < z < -6.49999999999999974e-111

    1. Initial program 93.6%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2 \cdot 10^{+72}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-65}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-111}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+25}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 51.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{z - y}{z}\\ t_2 := x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{if}\;a \leq -4.4 \cdot 10^{+38}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-177}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{-295}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{-29}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- z y) z))) (t_2 (* x (- 1.0 (/ y a)))))
   (if (<= a -4.4e+38)
     t_2
     (if (<= a -4e-177)
       t_1
       (if (<= a -1.65e-295)
         (* y (/ (- x t) z))
         (if (<= a 8.8e-29) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((z - y) / z);
	double t_2 = x * (1.0 - (y / a));
	double tmp;
	if (a <= -4.4e+38) {
		tmp = t_2;
	} else if (a <= -4e-177) {
		tmp = t_1;
	} else if (a <= -1.65e-295) {
		tmp = y * ((x - t) / z);
	} else if (a <= 8.8e-29) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * ((z - y) / z)
    t_2 = x * (1.0d0 - (y / a))
    if (a <= (-4.4d+38)) then
        tmp = t_2
    else if (a <= (-4d-177)) then
        tmp = t_1
    else if (a <= (-1.65d-295)) then
        tmp = y * ((x - t) / z)
    else if (a <= 8.8d-29) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((z - y) / z);
	double t_2 = x * (1.0 - (y / a));
	double tmp;
	if (a <= -4.4e+38) {
		tmp = t_2;
	} else if (a <= -4e-177) {
		tmp = t_1;
	} else if (a <= -1.65e-295) {
		tmp = y * ((x - t) / z);
	} else if (a <= 8.8e-29) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((z - y) / z)
	t_2 = x * (1.0 - (y / a))
	tmp = 0
	if a <= -4.4e+38:
		tmp = t_2
	elif a <= -4e-177:
		tmp = t_1
	elif a <= -1.65e-295:
		tmp = y * ((x - t) / z)
	elif a <= 8.8e-29:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(z - y) / z))
	t_2 = Float64(x * Float64(1.0 - Float64(y / a)))
	tmp = 0.0
	if (a <= -4.4e+38)
		tmp = t_2;
	elseif (a <= -4e-177)
		tmp = t_1;
	elseif (a <= -1.65e-295)
		tmp = Float64(y * Float64(Float64(x - t) / z));
	elseif (a <= 8.8e-29)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((z - y) / z);
	t_2 = x * (1.0 - (y / a));
	tmp = 0.0;
	if (a <= -4.4e+38)
		tmp = t_2;
	elseif (a <= -4e-177)
		tmp = t_1;
	elseif (a <= -1.65e-295)
		tmp = y * ((x - t) / z);
	elseif (a <= 8.8e-29)
		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[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.4e+38], t$95$2, If[LessEqual[a, -4e-177], t$95$1, If[LessEqual[a, -1.65e-295], N[(y * N[(N[(x - t), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8.8e-29], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -4 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 8.8 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.40000000000000013e38 or 8.79999999999999961e-29 < a

    1. Initial program 86.9%

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

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

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

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

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

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

    if -4.40000000000000013e38 < a < -3.99999999999999981e-177 or -1.6499999999999999e-295 < a < 8.79999999999999961e-29

    1. Initial program 74.1%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y - z}{z}} \]
      3. distribute-lft-neg-in67.1%

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

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

    if -3.99999999999999981e-177 < a < -1.6499999999999999e-295

    1. Initial program 71.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.4 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -4 \cdot 10^{-177}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;a \leq -1.65 \cdot 10^{-295}:\\ \;\;\;\;y \cdot \frac{x - t}{z}\\ \mathbf{elif}\;a \leq 8.8 \cdot 10^{-29}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 51.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{z - y}{z}\\ t_2 := x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{if}\;a \leq -4.1 \cdot 10^{+38}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1.04 \cdot 10^{-175}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -2.55 \cdot 10^{-259}:\\ \;\;\;\;\left(x - t\right) \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-32}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- z y) z))) (t_2 (* x (- 1.0 (/ y a)))))
   (if (<= a -4.1e+38)
     t_2
     (if (<= a -1.04e-175)
       t_1
       (if (<= a -2.55e-259)
         (* (- x t) (/ y z))
         (if (<= a 9.6e-32) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((z - y) / z);
	double t_2 = x * (1.0 - (y / a));
	double tmp;
	if (a <= -4.1e+38) {
		tmp = t_2;
	} else if (a <= -1.04e-175) {
		tmp = t_1;
	} else if (a <= -2.55e-259) {
		tmp = (x - t) * (y / z);
	} else if (a <= 9.6e-32) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * ((z - y) / z)
    t_2 = x * (1.0d0 - (y / a))
    if (a <= (-4.1d+38)) then
        tmp = t_2
    else if (a <= (-1.04d-175)) then
        tmp = t_1
    else if (a <= (-2.55d-259)) then
        tmp = (x - t) * (y / z)
    else if (a <= 9.6d-32) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((z - y) / z);
	double t_2 = x * (1.0 - (y / a));
	double tmp;
	if (a <= -4.1e+38) {
		tmp = t_2;
	} else if (a <= -1.04e-175) {
		tmp = t_1;
	} else if (a <= -2.55e-259) {
		tmp = (x - t) * (y / z);
	} else if (a <= 9.6e-32) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((z - y) / z)
	t_2 = x * (1.0 - (y / a))
	tmp = 0
	if a <= -4.1e+38:
		tmp = t_2
	elif a <= -1.04e-175:
		tmp = t_1
	elif a <= -2.55e-259:
		tmp = (x - t) * (y / z)
	elif a <= 9.6e-32:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(z - y) / z))
	t_2 = Float64(x * Float64(1.0 - Float64(y / a)))
	tmp = 0.0
	if (a <= -4.1e+38)
		tmp = t_2;
	elseif (a <= -1.04e-175)
		tmp = t_1;
	elseif (a <= -2.55e-259)
		tmp = Float64(Float64(x - t) * Float64(y / z));
	elseif (a <= 9.6e-32)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((z - y) / z);
	t_2 = x * (1.0 - (y / a));
	tmp = 0.0;
	if (a <= -4.1e+38)
		tmp = t_2;
	elseif (a <= -1.04e-175)
		tmp = t_1;
	elseif (a <= -2.55e-259)
		tmp = (x - t) * (y / z);
	elseif (a <= 9.6e-32)
		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[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.1e+38], t$95$2, If[LessEqual[a, -1.04e-175], t$95$1, If[LessEqual[a, -2.55e-259], N[(N[(x - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.6e-32], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;a \leq -1.04 \cdot 10^{-175}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;a \leq 9.6 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -4.1000000000000003e38 or 9.6000000000000005e-32 < a

    1. Initial program 86.9%

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

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

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

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

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

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

    if -4.1000000000000003e38 < a < -1.03999999999999997e-175 or -2.5499999999999999e-259 < a < 9.6000000000000005e-32

    1. Initial program 72.9%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y - z}{z}} \]
      3. distribute-lft-neg-in65.3%

        \[\leadsto \color{blue}{\left(-t\right) \cdot \frac{y - z}{z}} \]
    6. Simplified65.3%

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

    if -1.03999999999999997e-175 < a < -2.5499999999999999e-259

    1. Initial program 79.4%

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
    6. Step-by-step derivation
      1. clear-num73.8%

        \[\leadsto y \cdot \color{blue}{\frac{1}{\frac{a - z}{t - x}}} \]
      2. div-inv73.8%

        \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
    7. Applied egg-rr73.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -4.1 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -1.04 \cdot 10^{-175}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;a \leq -2.55 \cdot 10^{-259}:\\ \;\;\;\;\left(x - t\right) \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-32}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 51.8% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{z - y}{z}\\ t_2 := x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{if}\;a \leq -3.5 \cdot 10^{+38}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-217}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -9.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-29}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ (- z y) z))) (t_2 (* x (- 1.0 (/ y a)))))
   (if (<= a -3.5e+38)
     t_2
     (if (<= a -5.5e-217)
       t_1
       (if (<= a -9.2e-297)
         (/ (* y (- x t)) z)
         (if (<= a 7.5e-29) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((z - y) / z);
	double t_2 = x * (1.0 - (y / a));
	double tmp;
	if (a <= -3.5e+38) {
		tmp = t_2;
	} else if (a <= -5.5e-217) {
		tmp = t_1;
	} else if (a <= -9.2e-297) {
		tmp = (y * (x - t)) / z;
	} else if (a <= 7.5e-29) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * ((z - y) / z)
    t_2 = x * (1.0d0 - (y / a))
    if (a <= (-3.5d+38)) then
        tmp = t_2
    else if (a <= (-5.5d-217)) then
        tmp = t_1
    else if (a <= (-9.2d-297)) then
        tmp = (y * (x - t)) / z
    else if (a <= 7.5d-29) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = t * ((z - y) / z);
	double t_2 = x * (1.0 - (y / a));
	double tmp;
	if (a <= -3.5e+38) {
		tmp = t_2;
	} else if (a <= -5.5e-217) {
		tmp = t_1;
	} else if (a <= -9.2e-297) {
		tmp = (y * (x - t)) / z;
	} else if (a <= 7.5e-29) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * ((z - y) / z)
	t_2 = x * (1.0 - (y / a))
	tmp = 0
	if a <= -3.5e+38:
		tmp = t_2
	elif a <= -5.5e-217:
		tmp = t_1
	elif a <= -9.2e-297:
		tmp = (y * (x - t)) / z
	elif a <= 7.5e-29:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(Float64(z - y) / z))
	t_2 = Float64(x * Float64(1.0 - Float64(y / a)))
	tmp = 0.0
	if (a <= -3.5e+38)
		tmp = t_2;
	elseif (a <= -5.5e-217)
		tmp = t_1;
	elseif (a <= -9.2e-297)
		tmp = Float64(Float64(y * Float64(x - t)) / z);
	elseif (a <= 7.5e-29)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * ((z - y) / z);
	t_2 = x * (1.0 - (y / a));
	tmp = 0.0;
	if (a <= -3.5e+38)
		tmp = t_2;
	elseif (a <= -5.5e-217)
		tmp = t_1;
	elseif (a <= -9.2e-297)
		tmp = (y * (x - t)) / z;
	elseif (a <= 7.5e-29)
		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[(z - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(1.0 - N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.5e+38], t$95$2, If[LessEqual[a, -5.5e-217], t$95$1, If[LessEqual[a, -9.2e-297], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[a, 7.5e-29], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.50000000000000002e38 or 7.50000000000000006e-29 < a

    1. Initial program 86.9%

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

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

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

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

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

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

    if -3.50000000000000002e38 < a < -5.49999999999999975e-217 or -9.1999999999999996e-297 < a < 7.50000000000000006e-29

    1. Initial program 75.0%

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

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

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

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

        \[\leadsto -\color{blue}{t \cdot \frac{y - z}{z}} \]
      3. distribute-lft-neg-in66.5%

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

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

    if -5.49999999999999975e-217 < a < -9.1999999999999996e-297

    1. Initial program 66.8%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.5 \cdot 10^{+38}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \mathbf{elif}\;a \leq -5.5 \cdot 10^{-217}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{elif}\;a \leq -9.2 \cdot 10^{-297}:\\ \;\;\;\;\frac{y \cdot \left(x - t\right)}{z}\\ \mathbf{elif}\;a \leq 7.5 \cdot 10^{-29}:\\ \;\;\;\;t \cdot \frac{z - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 66.1% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.56e72 or 2.5e21 < z

    1. Initial program 63.4%

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

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

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

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

    if -1.56e72 < z < -9.50000000000000038e23

    1. Initial program 73.9%

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

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

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

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

    if -9.50000000000000038e23 < z < 2.5e21

    1. Initial program 96.1%

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

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

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

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

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

Alternative 13: 66.1% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 63.4%

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

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

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

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

    if -4.19999999999999978e71 < z < -1.15e24

    1. Initial program 73.9%

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

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

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

      \[\leadsto \color{blue}{y \cdot \frac{t - x}{a - z}} \]
    6. Step-by-step derivation
      1. clear-num74.7%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t - x}{\frac{a - z}{y}}} \]
    11. Applied egg-rr75.0%

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

    if -1.15e24 < z < 2.8e21

    1. Initial program 96.1%

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

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

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

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

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

Alternative 14: 46.5% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.8999999999999999e38 or 4.79999999999999957e-7 < a

    1. Initial program 87.1%

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

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

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

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

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

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

    if -1.8999999999999999e38 < a < -4.99999999999999995e-96

    1. Initial program 61.7%

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

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

    if -4.99999999999999995e-96 < a < 4.79999999999999957e-7

    1. Initial program 76.8%

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

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

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

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

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

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

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

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

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

Alternative 15: 72.9% accurate, 0.6× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

    if -122 < z < 2.8e21

    1. Initial program 96.0%

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

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

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

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

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

Alternative 16: 59.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.1 \cdot 10^{-23} \lor \neg \left(t \leq 3 \cdot 10^{-85}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.10000000000000011e-23 or 3.00000000000000022e-85 < t

    1. Initial program 85.5%

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

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

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

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

    if -5.10000000000000011e-23 < t < 3.00000000000000022e-85

    1. Initial program 71.9%

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

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

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

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

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

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

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

Alternative 17: 59.7% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 69.9%

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

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

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

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

    if -1.19999999999999997e102 < x < 1.3e19

    1. Initial program 83.3%

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

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

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

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

    if 1.3e19 < x

    1. Initial program 76.6%

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

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

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

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

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

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

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

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

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

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

Alternative 18: 38.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 68000000000000:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.1000000000000002e71 or 6.8e13 < z

    1. Initial program 64.0%

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

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

    if -4.1000000000000002e71 < z < 6.8e13

    1. Initial program 93.6%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.1 \cdot 10^{+71}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 68000000000000:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 24.8% accurate, 13.0× speedup?

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

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

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

    \[\leadsto \color{blue}{t} \]
  4. Final simplification24.7%

    \[\leadsto t \]
  5. Add Preprocessing

Reproduce

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