Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.8% → 91.6%
Time: 16.1s
Alternatives: 18
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

Initial Program: 80.8% 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: 91.6% accurate, 0.3× speedup?

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

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

    1. Initial program 92.2%

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

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

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

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

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

    1. Initial program 3.5%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub83.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*87.1%

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

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

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

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

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

Alternative 2: 91.6% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-282} \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 -2e-282) (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 <= -2e-282) || !(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 <= (-2d-282)) .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 <= -2e-282) || !(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 <= -2e-282) 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 <= -2e-282) || !(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 <= -2e-282) || ~((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, -2e-282], 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 -2 \cdot 10^{-282} \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)))) < -2e-282 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 92.2%

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

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

    1. Initial program 3.5%

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

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

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

        \[\leadsto \color{blue}{t - \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}} \]
      6. div-sub83.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*87.1%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -2 \cdot 10^{-282} \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 3: 50.9% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;a \leq 5.9 \cdot 10^{+54}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 2.9 \cdot 10^{+235} \lor \neg \left(a \leq 2 \cdot 10^{+246}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -1.7500000000000001e23 or 5.8999999999999997e54 < a < 2.90000000000000021e235 or 2.00000000000000014e246 < a

    1. Initial program 86.8%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    8. Step-by-step derivation
      1. mul-1-neg49.2%

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

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

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

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

    if -1.7500000000000001e23 < a < -1.1e-182 or -2.3500000000000001e-245 < a < 5.8999999999999997e54

    1. Initial program 75.8%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t}{z} + \frac{t}{y}\right)} \]
    8. Taylor expanded in y around 0 55.9%

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

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

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

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

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

    if -1.1e-182 < a < -2.3500000000000001e-245

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.90000000000000021e235 < a < 2.00000000000000014e246

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.75 \cdot 10^{+23}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -1.1 \cdot 10^{-182}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq -2.35 \cdot 10^{-245}:\\ \;\;\;\;x \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 5.9 \cdot 10^{+54}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq 2.9 \cdot 10^{+235} \lor \neg \left(a \leq 2 \cdot 10^{+246}\right):\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{t}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 47.5% accurate, 0.4× speedup?

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

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

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

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

\mathbf{elif}\;a \leq 3.7 \cdot 10^{+59}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq 1.95 \cdot 10^{+236}:\\
\;\;\;\;x\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -3.1000000000000001e60 or 3.69999999999999997e59 < a < 1.95e236 or 3.6e246 < a

    1. Initial program 86.7%

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

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

    if -3.1000000000000001e60 < a < -1.1e-182 or -2.3000000000000002e-245 < a < 3.69999999999999997e59

    1. Initial program 76.5%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t}{z} + \frac{t}{y}\right)} \]
    8. Taylor expanded in y around 0 53.5%

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

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

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

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

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

    if -1.1e-182 < a < -2.3000000000000002e-245

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.95e236 < a < 3.6e246

    1. Initial program 99.5%

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

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

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

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

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

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

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

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

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

Alternative 5: 75.7% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.15e139 or 1.99999999999999991e158 < z

    1. Initial program 56.4%

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

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

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

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

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

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

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

        \[\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*67.2%

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

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

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

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

    if -1.15e139 < z < -4.3e-113

    1. Initial program 94.2%

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

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

    if -4.3e-113 < z < 5.7999999999999999e-229

    1. Initial program 96.0%

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

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

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

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

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

    if 5.7999999999999999e-229 < z < 1.99999999999999991e158

    1. Initial program 88.2%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.15 \cdot 10^{+139}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \mathbf{elif}\;z \leq -4.3 \cdot 10^{-113}:\\ \;\;\;\;x + \left(y - z\right) \cdot \frac{t}{a - z}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{-229}:\\ \;\;\;\;x + \frac{y - z}{\frac{a}{t - x}}\\ \mathbf{elif}\;z \leq 2 \cdot 10^{+158}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{t - x}{z} \cdot \left(a - y\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 51.2% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t - t \cdot \frac{y}{z}\\ t_2 := x - x \cdot \frac{y}{a}\\ \mathbf{if}\;a \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \leq -1.4 \cdot 10^{-175}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-246}:\\ \;\;\;\;x \cdot \frac{y}{z - a}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+55}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- t (* t (/ y z)))) (t_2 (- x (* x (/ y a)))))
   (if (<= a -3.7e+22)
     t_2
     (if (<= a -1.4e-175)
       t_1
       (if (<= a -5.8e-246)
         (* x (/ y (- z a)))
         (if (<= a 1.5e+55) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t - (t * (y / z));
	double t_2 = x - (x * (y / a));
	double tmp;
	if (a <= -3.7e+22) {
		tmp = t_2;
	} else if (a <= -1.4e-175) {
		tmp = t_1;
	} else if (a <= -5.8e-246) {
		tmp = x * (y / (z - a));
	} else if (a <= 1.5e+55) {
		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 - (t * (y / z))
    t_2 = x - (x * (y / a))
    if (a <= (-3.7d+22)) then
        tmp = t_2
    else if (a <= (-1.4d-175)) then
        tmp = t_1
    else if (a <= (-5.8d-246)) then
        tmp = x * (y / (z - a))
    else if (a <= 1.5d+55) 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 - (t * (y / z));
	double t_2 = x - (x * (y / a));
	double tmp;
	if (a <= -3.7e+22) {
		tmp = t_2;
	} else if (a <= -1.4e-175) {
		tmp = t_1;
	} else if (a <= -5.8e-246) {
		tmp = x * (y / (z - a));
	} else if (a <= 1.5e+55) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t - (t * (y / z))
	t_2 = x - (x * (y / a))
	tmp = 0
	if a <= -3.7e+22:
		tmp = t_2
	elif a <= -1.4e-175:
		tmp = t_1
	elif a <= -5.8e-246:
		tmp = x * (y / (z - a))
	elif a <= 1.5e+55:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t - Float64(t * Float64(y / z)))
	t_2 = Float64(x - Float64(x * Float64(y / a)))
	tmp = 0.0
	if (a <= -3.7e+22)
		tmp = t_2;
	elseif (a <= -1.4e-175)
		tmp = t_1;
	elseif (a <= -5.8e-246)
		tmp = Float64(x * Float64(y / Float64(z - a)));
	elseif (a <= 1.5e+55)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t - (t * (y / z));
	t_2 = x - (x * (y / a));
	tmp = 0.0;
	if (a <= -3.7e+22)
		tmp = t_2;
	elseif (a <= -1.4e-175)
		tmp = t_1;
	elseif (a <= -5.8e-246)
		tmp = x * (y / (z - a));
	elseif (a <= 1.5e+55)
		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[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.7e+22], t$95$2, If[LessEqual[a, -1.4e-175], t$95$1, If[LessEqual[a, -5.8e-246], N[(x * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e+55], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -3.6999999999999998e22 or 1.50000000000000008e55 < a

    1. Initial program 87.4%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    8. Step-by-step derivation
      1. mul-1-neg46.8%

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

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

        \[\leadsto x - \color{blue}{x \cdot \frac{y}{a}} \]
    9. Simplified53.1%

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

    if -3.6999999999999998e22 < a < -1.4e-175 or -5.7999999999999999e-246 < a < 1.50000000000000008e55

    1. Initial program 75.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{y \cdot \left(-1 \cdot \frac{t}{z} + \frac{t}{y}\right)} \]
    8. Taylor expanded in y around 0 56.0%

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

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

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

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

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

    if -1.4e-175 < a < -5.7999999999999999e-246

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -3.7 \cdot 10^{+22}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;a \leq -1.4 \cdot 10^{-175}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{elif}\;a \leq -5.8 \cdot 10^{-246}:\\ \;\;\;\;x \cdot \frac{y}{z - a}\\ \mathbf{elif}\;a \leq 1.5 \cdot 10^{+55}:\\ \;\;\;\;t - t \cdot \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 41.9% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y}{a - z}\\ \mathbf{if}\;y \leq -8 \cdot 10^{+143}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -1.35 \cdot 10^{-32}:\\ \;\;\;\;x + t\\ \mathbf{elif}\;y \leq -4 \cdot 10^{-145}:\\ \;\;\;\;y \cdot \frac{t}{y}\\ \mathbf{elif}\;y \leq 980000:\\ \;\;\;\;x + t\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* t (/ y (- a z)))))
   (if (<= y -8e+143)
     t_1
     (if (<= y -1.35e-32)
       (+ x t)
       (if (<= y -4e-145) (* y (/ t y)) (if (<= y 980000.0) (+ x t) t_1))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = t * (y / (a - z));
	double tmp;
	if (y <= -8e+143) {
		tmp = t_1;
	} else if (y <= -1.35e-32) {
		tmp = x + t;
	} else if (y <= -4e-145) {
		tmp = y * (t / y);
	} else if (y <= 980000.0) {
		tmp = x + t;
	} 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 / (a - z))
    if (y <= (-8d+143)) then
        tmp = t_1
    else if (y <= (-1.35d-32)) then
        tmp = x + t
    else if (y <= (-4d-145)) then
        tmp = y * (t / y)
    else if (y <= 980000.0d0) then
        tmp = x + t
    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 / (a - z));
	double tmp;
	if (y <= -8e+143) {
		tmp = t_1;
	} else if (y <= -1.35e-32) {
		tmp = x + t;
	} else if (y <= -4e-145) {
		tmp = y * (t / y);
	} else if (y <= 980000.0) {
		tmp = x + t;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = t * (y / (a - z))
	tmp = 0
	if y <= -8e+143:
		tmp = t_1
	elif y <= -1.35e-32:
		tmp = x + t
	elif y <= -4e-145:
		tmp = y * (t / y)
	elif y <= 980000.0:
		tmp = x + t
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(t * Float64(y / Float64(a - z)))
	tmp = 0.0
	if (y <= -8e+143)
		tmp = t_1;
	elseif (y <= -1.35e-32)
		tmp = Float64(x + t);
	elseif (y <= -4e-145)
		tmp = Float64(y * Float64(t / y));
	elseif (y <= 980000.0)
		tmp = Float64(x + t);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = t * (y / (a - z));
	tmp = 0.0;
	if (y <= -8e+143)
		tmp = t_1;
	elseif (y <= -1.35e-32)
		tmp = x + t;
	elseif (y <= -4e-145)
		tmp = y * (t / y);
	elseif (y <= 980000.0)
		tmp = x + t;
	else
		tmp = t_1;
	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[y, -8e+143], t$95$1, If[LessEqual[y, -1.35e-32], N[(x + t), $MachinePrecision], If[LessEqual[y, -4e-145], N[(y * N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 980000.0], N[(x + t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;y \leq -1.35 \cdot 10^{-32}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;y \leq -4 \cdot 10^{-145}:\\
\;\;\;\;y \cdot \frac{t}{y}\\

\mathbf{elif}\;y \leq 980000:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.0000000000000002e143 or 9.8e5 < y

    1. Initial program 86.4%

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

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

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

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

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

    if -8.0000000000000002e143 < y < -1.3499999999999999e-32 or -3.99999999999999966e-145 < y < 9.8e5

    1. Initial program 81.4%

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

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

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

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

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

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

    if -1.3499999999999999e-32 < y < -3.99999999999999966e-145

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 38.3% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;y \leq -8.8 \cdot 10^{-33}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;y \leq -4.5 \cdot 10^{-146}:\\
\;\;\;\;y \cdot \frac{t}{y}\\

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+167}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.05e163

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.05e163 < y < -8.80000000000000022e-33 or -4.5000000000000001e-146 < y < 1.14999999999999994e167

    1. Initial program 80.5%

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

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

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

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

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

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

    if -8.80000000000000022e-33 < y < -4.5000000000000001e-146

    1. Initial program 61.4%

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

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

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

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

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

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

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

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

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

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

    if 1.14999999999999994e167 < y

    1. Initial program 99.7%

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

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

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

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

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

Alternative 9: 60.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := t \cdot \frac{y - z}{a - z}\\ \mathbf{if}\;t \leq -1.15 \cdot 10^{-13}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq -1.05 \cdot 10^{-183}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;t \leq 9000000000000:\\ \;\;\;\;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 (<= t -1.15e-13)
     t_1
     (if (<= t -1.05e-183)
       (* y (/ (- t x) (- a z)))
       (if (<= t 9000000000000.0) (+ 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 (t <= -1.15e-13) {
		tmp = t_1;
	} else if (t <= -1.05e-183) {
		tmp = y * ((t - x) / (a - z));
	} else if (t <= 9000000000000.0) {
		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 (t <= (-1.15d-13)) then
        tmp = t_1
    else if (t <= (-1.05d-183)) then
        tmp = y * ((t - x) / (a - z))
    else if (t <= 9000000000000.0d0) 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 (t <= -1.15e-13) {
		tmp = t_1;
	} else if (t <= -1.05e-183) {
		tmp = y * ((t - x) / (a - z));
	} else if (t <= 9000000000000.0) {
		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 t <= -1.15e-13:
		tmp = t_1
	elif t <= -1.05e-183:
		tmp = y * ((t - x) / (a - z))
	elif t <= 9000000000000.0:
		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 (t <= -1.15e-13)
		tmp = t_1;
	elseif (t <= -1.05e-183)
		tmp = Float64(y * Float64(Float64(t - x) / Float64(a - z)));
	elseif (t <= 9000000000000.0)
		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 (t <= -1.15e-13)
		tmp = t_1;
	elseif (t <= -1.05e-183)
		tmp = y * ((t - x) / (a - z));
	elseif (t <= 9000000000000.0)
		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[t, -1.15e-13], t$95$1, If[LessEqual[t, -1.05e-183], N[(y * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9000000000000.0], 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}\;t \leq -1.15 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;t \leq 9000000000000:\\
\;\;\;\;x + y \cdot \frac{t - x}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.1499999999999999e-13 or 9e12 < t

    1. Initial program 91.8%

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

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

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

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

    if -1.1499999999999999e-13 < t < -1.0500000000000001e-183

    1. Initial program 68.3%

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

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

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

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

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

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

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

    if -1.0500000000000001e-183 < t < 9e12

    1. Initial program 71.1%

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

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

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

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

Alternative 10: 59.4% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.1999999999999999e-13 or 4.00000000000000036e25 < t

    1. Initial program 91.8%

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

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

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

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

    if -1.1999999999999999e-13 < t < -1.05e-195

    1. Initial program 70.5%

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

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

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

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

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

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

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

    if -1.05e-195 < t < 4.00000000000000036e25

    1. Initial program 70.0%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + -1 \cdot \frac{x \cdot y}{a}} \]
    8. Step-by-step derivation
      1. mul-1-neg46.8%

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

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

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

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

Alternative 11: 58.4% accurate, 0.5× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -8.1999999999999997e-27 or 3.5e9 < t

    1. Initial program 91.2%

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

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

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

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

    if -8.1999999999999997e-27 < t < -1.15000000000000008e-183

    1. Initial program 69.2%

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

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

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

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

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

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

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

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

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

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

    if -1.15000000000000008e-183 < t < 3.5e9

    1. Initial program 71.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8.2 \cdot 10^{-27}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{elif}\;t \leq -1.15 \cdot 10^{-183}:\\ \;\;\;\;x \cdot \frac{y}{z - a}\\ \mathbf{elif}\;t \leq 3500000000:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 40.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-56}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;z \leq 4.9 \cdot 10^{-173}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{+142}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.15000000000000004e138 or 1.4e142 < z

    1. Initial program 58.0%

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

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

    if -1.15000000000000004e138 < z < -1.15000000000000001e-56 or 4.89999999999999991e-173 < z < 1.4e142

    1. Initial program 89.9%

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

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

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

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

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

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

    if -1.15000000000000001e-56 < z < 4.89999999999999991e-173

    1. Initial program 96.0%

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

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

Alternative 13: 71.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.2000000000000003e164 or 2.1e64 < y

    1. Initial program 87.6%

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

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

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

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

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

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

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

    if -6.2000000000000003e164 < y < 2.1e64

    1. Initial program 78.9%

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

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

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

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

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

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

Alternative 14: 71.0% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.39999999999999995e168 or 3.60000000000000014e64 < y

    1. Initial program 87.6%

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

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

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

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

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

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

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

    if -1.39999999999999995e168 < y < 3.60000000000000014e64

    1. Initial program 78.9%

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

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

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

Alternative 15: 39.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{+177} \lor \neg \left(y \leq 1.15 \cdot 10^{+167}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.60000000000000003e177 or 1.14999999999999994e167 < y

    1. Initial program 91.3%

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

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

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

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

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

    if -3.60000000000000003e177 < y < 1.14999999999999994e167

    1. Initial program 79.0%

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

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

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

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

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

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

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

Alternative 16: 39.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;y \leq 1.15 \cdot 10^{+167}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.11999999999999996e169

    1. Initial program 85.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.11999999999999996e169 < y < 1.14999999999999994e167

    1. Initial program 78.5%

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

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

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

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

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

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

    if 1.14999999999999994e167 < y

    1. Initial program 99.7%

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

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

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

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

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

Alternative 17: 35.0% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.2000000000000002e127 or 1.2999999999999999e-167 < z

    1. Initial program 70.1%

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

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

    if -2.2000000000000002e127 < z < 1.2999999999999999e-167

    1. Initial program 95.4%

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

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

Alternative 18: 25.4% accurate, 13.0× speedup?

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

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

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

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

Reproduce

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