Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.5% → 93.1%
Time: 15.5s
Alternatives: 17
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 17 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.5% accurate, 1.0× speedup?

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

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

Alternative 1: 93.1% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 90.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.3%

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

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

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

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

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

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

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

Alternative 2: 89.6% accurate, 0.2× 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^{-292}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_1 \leq 10^{-285}:\\ \;\;\;\;t - \frac{\left(t - x\right) \cdot \left(y - a\right) - a \cdot \left(\left(t - x\right) \cdot \frac{a - y}{z}\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t - x}}\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
   (if (<= t_1 -2e-292)
     t_1
     (if (<= t_1 1e-285)
       (- t (/ (- (* (- t x) (- y a)) (* a (* (- t x) (/ (- a y) z)))) z))
       (+ x (/ (- y z) (/ (- a z) (- t x))))))))
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-292) {
		tmp = t_1;
	} else if (t_1 <= 1e-285) {
		tmp = t - ((((t - x) * (y - a)) - (a * ((t - x) * ((a - y) / z)))) / z);
	} else {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y - z) * ((t - x) / (a - z)))
    if (t_1 <= (-2d-292)) then
        tmp = t_1
    else if (t_1 <= 1d-285) then
        tmp = t - ((((t - x) * (y - a)) - (a * ((t - x) * ((a - y) / z)))) / z)
    else
        tmp = x + ((y - z) / ((a - z) / (t - x)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if (t_1 <= -2e-292) {
		tmp = t_1;
	} else if (t_1 <= 1e-285) {
		tmp = t - ((((t - x) * (y - a)) - (a * ((t - x) * ((a - y) / z)))) / z);
	} else {
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if t_1 <= -2e-292:
		tmp = t_1
	elif t_1 <= 1e-285:
		tmp = t - ((((t - x) * (y - a)) - (a * ((t - x) * ((a - y) / z)))) / z)
	else:
		tmp = x + ((y - z) / ((a - z) / (t - x)))
	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-292)
		tmp = t_1;
	elseif (t_1 <= 1e-285)
		tmp = Float64(t - Float64(Float64(Float64(Float64(t - x) * Float64(y - a)) - Float64(a * Float64(Float64(t - x) * Float64(Float64(a - y) / z)))) / z));
	else
		tmp = Float64(x + Float64(Float64(y - z) / Float64(Float64(a - z) / Float64(t - x))));
	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-292)
		tmp = t_1;
	elseif (t_1 <= 1e-285)
		tmp = t - ((((t - x) * (y - a)) - (a * ((t - x) * ((a - y) / z)))) / z);
	else
		tmp = x + ((y - z) / ((a - z) / (t - x)));
	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[LessEqual[t$95$1, -2e-292], t$95$1, If[LessEqual[t$95$1, 1e-285], N[(t - N[(N[(N[(N[(t - x), $MachinePrecision] * N[(y - a), $MachinePrecision]), $MachinePrecision] - N[(a * N[(N[(t - x), $MachinePrecision] * N[(N[(a - y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y - z), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(t - x), $MachinePrecision]), $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^{-292}:\\
\;\;\;\;t\_1\\

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

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


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

    1. Initial program 90.9%

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

    if -2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-285

    1. Initial program 3.4%

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

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

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

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

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

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

    if 1.00000000000000007e-285 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.7%

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

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

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

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

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

Alternative 3: 89.7% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 90.8%

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

    if -2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-285

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 89.7% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 90.9%

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

    if -2.0000000000000001e-292 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.00000000000000007e-285

    1. Initial program 3.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-285 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 90.7%

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

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

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

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

Alternative 5: 50.1% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -8.7999999999999998e139 or 5.99999999999999994e170 < z

    1. Initial program 54.7%

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

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

    if -8.7999999999999998e139 < z < -1.15000000000000002e-107

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(x - t\right)}{z}} \]
    10. Step-by-step derivation
      1. sub-neg40.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot \color{blue}{\left(0 - \left(t - x\right)\right)} \]
      13. associate--r-46.1%

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

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

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

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

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

    if -1.15000000000000002e-107 < z < 2.25e70

    1. Initial program 93.4%

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

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

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

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

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

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

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

    if 2.25e70 < z < 5.99999999999999994e170

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 50.5% accurate, 0.5× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.87999999999999992e142 or 2.99999999999999998e166 < z

    1. Initial program 54.7%

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

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

    if -1.87999999999999992e142 < z < -2.0800000000000001e-106

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(x - t\right)}{z}} \]
    10. Step-by-step derivation
      1. sub-neg40.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot \color{blue}{\left(0 - \left(t - x\right)\right)} \]
      13. associate--r-46.1%

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

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

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

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

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

    if -2.0800000000000001e-106 < z < 3.0999999999999998e69

    1. Initial program 93.4%

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

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

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

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

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

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

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

    if 3.0999999999999998e69 < z < 2.99999999999999998e166

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 52.7% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.22e69 or 2.60000000000000009e27 < z

    1. Initial program 64.7%

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

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

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

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

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

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

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

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

    if -1.22e69 < z < -2.0800000000000001e-106

    1. Initial program 85.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot \color{blue}{\left(0 - \left(t - x\right)\right)} \]
      13. associate--r-51.7%

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

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

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

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

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

    if -2.0800000000000001e-106 < z < 2.60000000000000009e27

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

Alternative 8: 47.8% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.99999999999999993e140 or 2.3e30 < z

    1. Initial program 62.5%

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

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

    if -5.99999999999999993e140 < z < -2.05e-106

    1. Initial program 82.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y \cdot \left(x - t\right)}{z}} \]
    10. Step-by-step derivation
      1. sub-neg40.0%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{y}{z} \cdot \color{blue}{\left(0 - \left(t - x\right)\right)} \]
      13. associate--r-46.1%

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

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

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

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

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

    if -2.05e-106 < z < 2.3e30

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

Alternative 9: 72.2% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.25000000000000008e-38 or 1.72e-71 < a

    1. Initial program 84.4%

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

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

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

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

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

    if -1.25000000000000008e-38 < a < 1.72e-71

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 66.4% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.08 \cdot 10^{-106} \lor \neg \left(z \leq 0.036\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.0800000000000001e-106 or 0.0359999999999999973 < z

    1. Initial program 68.9%

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

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

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

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

    if -2.0800000000000001e-106 < z < 0.0359999999999999973

    1. Initial program 94.9%

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

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

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

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

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

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

Alternative 11: 65.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{-106} \lor \neg \left(z \leq 0.084\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.95000000000000005e-106 or 0.0840000000000000052 < z

    1. Initial program 68.9%

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

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

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

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

    if -1.95000000000000005e-106 < z < 0.0840000000000000052

    1. Initial program 94.9%

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t - x}}} \]
      3. div-inv81.3%

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
      4. add-cube-cbrt80.9%

        \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\frac{a}{t - x}} \]
      5. *-un-lft-identity80.9%

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

        \[\leadsto x + \color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{1} \cdot \frac{\sqrt[3]{y}}{\frac{a}{t - x}}} \]
      7. pow280.9%

        \[\leadsto x + \frac{\color{blue}{{\left(\sqrt[3]{y}\right)}^{2}}}{1} \cdot \frac{\sqrt[3]{y}}{\frac{a}{t - x}} \]
    5. Applied egg-rr80.9%

      \[\leadsto x + \color{blue}{\frac{{\left(\sqrt[3]{y}\right)}^{2}}{1} \cdot \frac{\sqrt[3]{y}}{\frac{a}{t - x}}} \]
    6. Step-by-step derivation
      1. times-frac80.9%

        \[\leadsto x + \color{blue}{\frac{{\left(\sqrt[3]{y}\right)}^{2} \cdot \sqrt[3]{y}}{1 \cdot \frac{a}{t - x}}} \]
      2. unpow280.9%

        \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right)} \cdot \sqrt[3]{y}}{1 \cdot \frac{a}{t - x}} \]
      3. rem-3cbrt-lft81.3%

        \[\leadsto x + \frac{\color{blue}{y}}{1 \cdot \frac{a}{t - x}} \]
      4. *-lft-identity81.3%

        \[\leadsto x + \frac{y}{\color{blue}{\frac{a}{t - x}}} \]
    7. Simplified81.3%

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

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

Alternative 12: 65.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.08 \cdot 10^{-106} \lor \neg \left(z \leq 0.04\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.0800000000000001e-106 or 0.0400000000000000008 < z

    1. Initial program 68.9%

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

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

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

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

    if -2.0800000000000001e-106 < z < 0.0400000000000000008

    1. Initial program 94.9%

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

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

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

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

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

Alternative 13: 59.2% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+168} \lor \neg \left(x \leq 7.5 \cdot 10^{+26}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{a}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.99999999999999967e168 or 7.49999999999999941e26 < x

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

    if -4.99999999999999967e168 < x < 7.49999999999999941e26

    1. Initial program 83.3%

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

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

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

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

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

Alternative 14: 49.2% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.7000000000000002e85 or 2.4999999999999999e30 < z

    1. Initial program 64.1%

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

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

    if -3.7000000000000002e85 < z < 2.4999999999999999e30

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

Alternative 15: 36.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -5 \cdot 10^{-109}:\\
\;\;\;\;\frac{y \cdot \left(-t\right)}{z}\\

\mathbf{elif}\;z \leq 9 \cdot 10^{-5}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.4000000000000003e85 or 9.00000000000000057e-5 < z

    1. Initial program 64.8%

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

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

    if -3.4000000000000003e85 < z < -5.0000000000000002e-109

    1. Initial program 84.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{t \cdot y}{z}} \]
    10. Step-by-step derivation
      1. associate-*r/32.9%

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

        \[\leadsto \frac{\color{blue}{-t \cdot y}}{z} \]
      3. *-commutative32.9%

        \[\leadsto \frac{-\color{blue}{y \cdot t}}{z} \]
      4. distribute-lft-neg-in32.9%

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

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

    if -5.0000000000000002e-109 < z < 9.00000000000000057e-5

    1. Initial program 94.8%

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

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

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

Alternative 16: 38.6% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;z \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;x\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.89999999999999998e61 or 3.4999999999999997e-5 < z

    1. Initial program 65.8%

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

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

    if -1.89999999999999998e61 < z < 3.4999999999999997e-5

    1. Initial program 93.0%

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

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

Alternative 17: 24.9% 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 80.9%

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

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

Reproduce

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