Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.8% → 93.3%
Time: 13.8s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 80.8% accurate, 1.0× speedup?

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

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

Alternative 1: 93.3% 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 -4 \cdot 10^{-279}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\ \mathbf{elif}\;t_1 \leq 0:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\ \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 -4e-279)
     (fma (- t x) (/ (- y z) (- a z)) x)
     (if (<= t_1 0.0)
       (+ t (/ (* (- t x) (- a y)) z))
       (+ x (/ (- t x) (/ (- a z) (- y 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 <= -4e-279) {
		tmp = fma((t - x), ((y - z) / (a - z)), x);
	} else if (t_1 <= 0.0) {
		tmp = t + (((t - x) * (a - y)) / z);
	} else {
		tmp = x + ((t - x) / ((a - z) / (y - 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 <= -4e-279)
		tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x);
	elseif (t_1 <= 0.0)
		tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / z));
	else
		tmp = Float64(x + Float64(Float64(t - x) / Float64(Float64(a - z) / Float64(y - 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[LessEqual[t$95$1, -4e-279], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(y - z), $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 -4 \cdot 10^{-279}:\\
\;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\

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

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


\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)))) < -4.00000000000000022e-279

    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. associate-*r/71.6%

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

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

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

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

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

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

    1. Initial program 3.8%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative96.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} \]
      2. associate--l+96.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)} \]
      3. associate-*r/96.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) \]
      4. associate-*r/96.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) \]
      5. div-sub96.7%

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

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

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

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

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

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

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

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

    1. Initial program 91.7%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -4 \cdot 10^{-279}:\\ \;\;\;\;\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)\\ \mathbf{elif}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 0:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\ \end{array} \]

Alternative 2: 89.2% accurate, 0.3× speedup?

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

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

    1. Initial program 92.2%

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

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

    1. Initial program 9.2%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative91.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} \]
      2. associate--l+91.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)} \]
      3. associate-*r/91.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) \]
      4. associate-*r/91.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) \]
      5. div-sub91.7%

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

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

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

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

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

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

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

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

Alternative 3: 93.4% 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 -4 \cdot 10^{-279} \lor \neg \left(t_1 \leq 0\right):\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\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 -4e-279) (not (<= t_1 0.0)))
     (+ x (/ (- t x) (/ (- a z) (- y z))))
     (+ t (/ (* (- t x) (- a y)) 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 <= -4e-279) || !(t_1 <= 0.0)) {
		tmp = x + ((t - x) / ((a - z) / (y - z)));
	} else {
		tmp = t + (((t - x) * (a - y)) / 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 <= (-4d-279)) .or. (.not. (t_1 <= 0.0d0))) then
        tmp = x + ((t - x) / ((a - z) / (y - z)))
    else
        tmp = t + (((t - x) * (a - y)) / 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 <= -4e-279) || !(t_1 <= 0.0)) {
		tmp = x + ((t - x) / ((a - z) / (y - z)));
	} else {
		tmp = t + (((t - x) * (a - y)) / z);
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x + ((y - z) * ((t - x) / (a - z)))
	tmp = 0
	if (t_1 <= -4e-279) or not (t_1 <= 0.0):
		tmp = x + ((t - x) / ((a - z) / (y - z)))
	else:
		tmp = t + (((t - x) * (a - y)) / 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 <= -4e-279) || !(t_1 <= 0.0))
		tmp = Float64(x + Float64(Float64(t - x) / Float64(Float64(a - z) / Float64(y - z))));
	else
		tmp = Float64(t + Float64(Float64(Float64(t - x) * Float64(a - y)) / 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 <= -4e-279) || ~((t_1 <= 0.0)))
		tmp = x + ((t - x) / ((a - z) / (y - z)));
	else
		tmp = t + (((t - x) * (a - y)) / 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, -4e-279], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(x + N[(N[(t - x), $MachinePrecision] / N[(N[(a - z), $MachinePrecision] / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(N[(t - x), $MachinePrecision] * N[(a - y), $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 -4 \cdot 10^{-279} \lor \neg \left(t_1 \leq 0\right):\\
\;\;\;\;x + \frac{t - x}{\frac{a - z}{y - z}}\\

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


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

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

    1. Initial program 3.8%

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

      \[\leadsto \color{blue}{\left(-1 \cdot \frac{y \cdot \left(t - x\right)}{z} + t\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}} \]
    3. Step-by-step derivation
      1. +-commutative96.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} \]
      2. associate--l+96.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)} \]
      3. associate-*r/96.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) \]
      4. associate-*r/96.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) \]
      5. div-sub96.7%

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

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

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

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

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

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

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

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

Alternative 4: 40.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := y \cdot \frac{t - x}{a}\\ \mathbf{if}\;z \leq -2.05 \cdot 10^{+37}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-25}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-283}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-214}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-172}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (* y (/ (- t x) a))))
   (if (<= z -2.05e+37)
     t
     (if (<= z -1.85e-25)
       t_1
       (if (<= z -1.3e-87)
         x
         (if (<= z -1.1e-283)
           t_1
           (if (<= z 1.7e-214)
             x
             (if (<= z 1.8e-172) t_1 (if (<= z 1.4e+18) x t)))))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / a);
	double tmp;
	if (z <= -2.05e+37) {
		tmp = t;
	} else if (z <= -1.85e-25) {
		tmp = t_1;
	} else if (z <= -1.3e-87) {
		tmp = x;
	} else if (z <= -1.1e-283) {
		tmp = t_1;
	} else if (z <= 1.7e-214) {
		tmp = x;
	} else if (z <= 1.8e-172) {
		tmp = t_1;
	} else if (z <= 1.4e+18) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: tmp
    t_1 = y * ((t - x) / a)
    if (z <= (-2.05d+37)) then
        tmp = t
    else if (z <= (-1.85d-25)) then
        tmp = t_1
    else if (z <= (-1.3d-87)) then
        tmp = x
    else if (z <= (-1.1d-283)) then
        tmp = t_1
    else if (z <= 1.7d-214) then
        tmp = x
    else if (z <= 1.8d-172) then
        tmp = t_1
    else if (z <= 1.4d+18) then
        tmp = x
    else
        tmp = t
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = y * ((t - x) / a);
	double tmp;
	if (z <= -2.05e+37) {
		tmp = t;
	} else if (z <= -1.85e-25) {
		tmp = t_1;
	} else if (z <= -1.3e-87) {
		tmp = x;
	} else if (z <= -1.1e-283) {
		tmp = t_1;
	} else if (z <= 1.7e-214) {
		tmp = x;
	} else if (z <= 1.8e-172) {
		tmp = t_1;
	} else if (z <= 1.4e+18) {
		tmp = x;
	} else {
		tmp = t;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = y * ((t - x) / a)
	tmp = 0
	if z <= -2.05e+37:
		tmp = t
	elif z <= -1.85e-25:
		tmp = t_1
	elif z <= -1.3e-87:
		tmp = x
	elif z <= -1.1e-283:
		tmp = t_1
	elif z <= 1.7e-214:
		tmp = x
	elif z <= 1.8e-172:
		tmp = t_1
	elif z <= 1.4e+18:
		tmp = x
	else:
		tmp = t
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(y * Float64(Float64(t - x) / a))
	tmp = 0.0
	if (z <= -2.05e+37)
		tmp = t;
	elseif (z <= -1.85e-25)
		tmp = t_1;
	elseif (z <= -1.3e-87)
		tmp = x;
	elseif (z <= -1.1e-283)
		tmp = t_1;
	elseif (z <= 1.7e-214)
		tmp = x;
	elseif (z <= 1.8e-172)
		tmp = t_1;
	elseif (z <= 1.4e+18)
		tmp = x;
	else
		tmp = t;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = y * ((t - x) / a);
	tmp = 0.0;
	if (z <= -2.05e+37)
		tmp = t;
	elseif (z <= -1.85e-25)
		tmp = t_1;
	elseif (z <= -1.3e-87)
		tmp = x;
	elseif (z <= -1.1e-283)
		tmp = t_1;
	elseif (z <= 1.7e-214)
		tmp = x;
	elseif (z <= 1.8e-172)
		tmp = t_1;
	elseif (z <= 1.4e+18)
		tmp = x;
	else
		tmp = t;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.05e+37], t, If[LessEqual[z, -1.85e-25], t$95$1, If[LessEqual[z, -1.3e-87], x, If[LessEqual[z, -1.1e-283], t$95$1, If[LessEqual[z, 1.7e-214], x, If[LessEqual[z, 1.8e-172], t$95$1, If[LessEqual[z, 1.4e+18], x, t]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -1.85 \cdot 10^{-25}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-283}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq 1.7 \cdot 10^{-214}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq 1.8 \cdot 10^{-172}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.0499999999999999e37 or 1.4e18 < z

    1. Initial program 69.4%

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

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

    if -2.0499999999999999e37 < z < -1.85000000000000004e-25 or -1.30000000000000001e-87 < z < -1.0999999999999999e-283 or 1.7e-214 < z < 1.80000000000000007e-172

    1. Initial program 87.1%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Taylor expanded in a around inf 76.6%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{a}}, x\right) \]
    5. Taylor expanded in y around inf 52.0%

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

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

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

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

    if -1.85000000000000004e-25 < z < -1.30000000000000001e-87 or -1.0999999999999999e-283 < z < 1.7e-214 or 1.80000000000000007e-172 < z < 1.4e18

    1. Initial program 92.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.05 \cdot 10^{+37}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-25}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq -1.3 \cdot 10^{-87}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-283}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-214}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-172}:\\ \;\;\;\;y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 5: 74.7% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -7.8000000000000001e43 or 1.94999999999999994e61 < z

    1. Initial program 66.2%

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{a - z}{y - z}}} \]
    4. Simplified67.3%

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

    if -7.8000000000000001e43 < z < 1.94999999999999994e61

    1. Initial program 90.6%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+43} \lor \neg \left(z \leq 1.95 \cdot 10^{+61}\right):\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \end{array} \]

Alternative 6: 74.2% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.6000000000000001e42 or 1.85e32 < z

    1. Initial program 68.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.6000000000000001e42 < z < 1.85e32

    1. Initial program 90.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.6 \cdot 10^{+42} \lor \neg \left(z \leq 1.85 \cdot 10^{+32}\right):\\ \;\;\;\;t + \frac{\left(t - x\right) \cdot \left(a - y\right)}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a - z}{y}}\\ \end{array} \]

Alternative 7: 52.2% accurate, 0.9× speedup?

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

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -4.40000000000000013e38 or 1.55e18 < z

    1. Initial program 69.4%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t - x}{\frac{a - z}{z}}} \]
      5. div-sub58.5%

        \[\leadsto x - \frac{t - x}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      6. *-inverses58.5%

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

      \[\leadsto \color{blue}{x - \frac{t - x}{\frac{a}{z} - 1}} \]
    5. Taylor expanded in x around 0 59.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{t}{\frac{a}{z} - 1}} \]
    6. Step-by-step derivation
      1. sub-neg59.0%

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

        \[\leadsto -1 \cdot \frac{t}{\frac{a}{z} + \color{blue}{-1}} \]
      3. associate-*r/59.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot t}{\frac{a}{z} + -1}} \]
      4. mul-1-neg59.0%

        \[\leadsto \frac{\color{blue}{-t}}{\frac{a}{z} + -1} \]
      5. +-commutative59.0%

        \[\leadsto \frac{-t}{\color{blue}{-1 + \frac{a}{z}}} \]
    7. Simplified59.0%

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

    if -4.40000000000000013e38 < z < -6.4000000000000001e-186

    1. Initial program 89.2%

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t - x}{a - z}} \cdot y \]
      2. *-commutative59.3%

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

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

    if -6.4000000000000001e-186 < z < 1.55e18

    1. Initial program 90.9%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot x}{a} + x} \]
    6. Step-by-step derivation
      1. +-commutative61.3%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot x}{a}} \]
      2. mul-1-neg61.3%

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

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

        \[\leadsto x - \color{blue}{\frac{y}{\frac{a}{x}}} \]
    7. Simplified60.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.4 \cdot 10^{+38}:\\ \;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\ \mathbf{elif}\;z \leq -6.4 \cdot 10^{-186}:\\ \;\;\;\;y \cdot \frac{t - x}{a - z}\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\ \end{array} \]

Alternative 8: 61.9% accurate, 1.0× speedup?

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

    1. Initial program 66.6%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t - x}{\frac{a - z}{z}}} \]
      5. div-sub58.8%

        \[\leadsto x - \frac{t - x}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      6. *-inverses58.8%

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

      \[\leadsto \color{blue}{x - \frac{t - x}{\frac{a}{z} - 1}} \]
    5. Taylor expanded in x around 0 62.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{t}{\frac{a}{z} - 1}} \]
    6. Step-by-step derivation
      1. sub-neg62.1%

        \[\leadsto -1 \cdot \frac{t}{\color{blue}{\frac{a}{z} + \left(-1\right)}} \]
      2. metadata-eval62.1%

        \[\leadsto -1 \cdot \frac{t}{\frac{a}{z} + \color{blue}{-1}} \]
      3. associate-*r/62.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t}{\frac{a}{z} + -1}} \]
      4. mul-1-neg62.1%

        \[\leadsto \frac{\color{blue}{-t}}{\frac{a}{z} + -1} \]
      5. +-commutative62.1%

        \[\leadsto \frac{-t}{\color{blue}{-1 + \frac{a}{z}}} \]
    7. Simplified62.1%

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

    if -3.5000000000000001e43 < z < 2.19999999999999996e60

    1. Initial program 90.5%

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

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

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

        \[\leadsto x + \color{blue}{\frac{y}{\frac{a}{t - x}}} \]
    4. Simplified70.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.5 \cdot 10^{+43} \lor \neg \left(z \leq 2.2 \cdot 10^{+60}\right):\\ \;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{\frac{a}{t - x}}\\ \end{array} \]

Alternative 9: 62.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+42} \lor \neg \left(z \leq 1.5 \cdot 10^{+61}\right):\\
\;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -9.00000000000000025e42 or 1.5e61 < z

    1. Initial program 66.6%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t - x}{\frac{a - z}{z}}} \]
      5. div-sub58.8%

        \[\leadsto x - \frac{t - x}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      6. *-inverses58.8%

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

      \[\leadsto \color{blue}{x - \frac{t - x}{\frac{a}{z} - 1}} \]
    5. Taylor expanded in x around 0 62.1%

      \[\leadsto \color{blue}{-1 \cdot \frac{t}{\frac{a}{z} - 1}} \]
    6. Step-by-step derivation
      1. sub-neg62.1%

        \[\leadsto -1 \cdot \frac{t}{\color{blue}{\frac{a}{z} + \left(-1\right)}} \]
      2. metadata-eval62.1%

        \[\leadsto -1 \cdot \frac{t}{\frac{a}{z} + \color{blue}{-1}} \]
      3. associate-*r/62.1%

        \[\leadsto \color{blue}{\frac{-1 \cdot t}{\frac{a}{z} + -1}} \]
      4. mul-1-neg62.1%

        \[\leadsto \frac{\color{blue}{-t}}{\frac{a}{z} + -1} \]
      5. +-commutative62.1%

        \[\leadsto \frac{-t}{\color{blue}{-1 + \frac{a}{z}}} \]
    7. Simplified62.1%

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

    if -9.00000000000000025e42 < z < 1.5e61

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9 \cdot 10^{+42} \lor \neg \left(z \leq 1.5 \cdot 10^{+61}\right):\\ \;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]

Alternative 10: 67.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -8 \cdot 10^{+41} \lor \neg \left(z \leq 1.45 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -8.00000000000000005e41 or 1.45e18 < z

    1. Initial program 68.9%

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

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

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

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

    if -8.00000000000000005e41 < z < 1.45e18

    1. Initial program 90.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -8 \cdot 10^{+41} \lor \neg \left(z \leq 1.45 \cdot 10^{+18}\right):\\ \;\;\;\;\frac{t}{\frac{a - z}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]

Alternative 11: 50.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+44} \lor \neg \left(z \leq 1.5 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4500000000000001e44 or 1.5e18 < z

    1. Initial program 68.9%

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

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

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

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

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

        \[\leadsto x - \color{blue}{\frac{t - x}{\frac{a - z}{z}}} \]
      5. div-sub57.8%

        \[\leadsto x - \frac{t - x}{\color{blue}{\frac{a}{z} - \frac{z}{z}}} \]
      6. *-inverses57.8%

        \[\leadsto x - \frac{t - x}{\frac{a}{z} - \color{blue}{1}} \]
    4. Simplified57.8%

      \[\leadsto \color{blue}{x - \frac{t - x}{\frac{a}{z} - 1}} \]
    5. Taylor expanded in x around 0 60.0%

      \[\leadsto \color{blue}{-1 \cdot \frac{t}{\frac{a}{z} - 1}} \]
    6. Step-by-step derivation
      1. sub-neg60.0%

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

        \[\leadsto -1 \cdot \frac{t}{\frac{a}{z} + \color{blue}{-1}} \]
      3. associate-*r/60.0%

        \[\leadsto \color{blue}{\frac{-1 \cdot t}{\frac{a}{z} + -1}} \]
      4. mul-1-neg60.0%

        \[\leadsto \frac{\color{blue}{-t}}{\frac{a}{z} + -1} \]
      5. +-commutative60.0%

        \[\leadsto \frac{-t}{\color{blue}{-1 + \frac{a}{z}}} \]
    7. Simplified60.0%

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

    if -1.4500000000000001e44 < z < 1.5e18

    1. Initial program 90.5%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot x}{a} + x} \]
    6. Step-by-step derivation
      1. +-commutative52.0%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot x}{a}} \]
      2. mul-1-neg52.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.45 \cdot 10^{+44} \lor \neg \left(z \leq 1.5 \cdot 10^{+18}\right):\\ \;\;\;\;\frac{-t}{-1 + \frac{a}{z}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x}}\\ \end{array} \]

Alternative 12: 51.8% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.25 \cdot 10^{+42} \lor \neg \left(z \leq 1.6 \cdot 10^{+18}\right):\\
\;\;\;\;\frac{t}{\frac{z}{z - y}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.25000000000000002e42 or 1.6e18 < z

    1. Initial program 68.9%

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{t}{\frac{z}{z - y}}} \]
    8. Simplified55.9%

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

    if -1.25000000000000002e42 < z < 1.6e18

    1. Initial program 90.5%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot x}{a} + x} \]
    6. Step-by-step derivation
      1. +-commutative52.0%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot x}{a}} \]
      2. mul-1-neg52.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.25 \cdot 10^{+42} \lor \neg \left(z \leq 1.6 \cdot 10^{+18}\right):\\ \;\;\;\;\frac{t}{\frac{z}{z - y}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x}}\\ \end{array} \]

Alternative 13: 48.1% accurate, 1.2× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.5500000000000001e43 or 1.55e18 < z

    1. Initial program 68.9%

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

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

    if -1.5500000000000001e43 < z < 1.55e18

    1. Initial program 90.5%

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

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

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

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

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

      \[\leadsto \color{blue}{-1 \cdot \frac{y \cdot x}{a} + x} \]
    6. Step-by-step derivation
      1. +-commutative52.0%

        \[\leadsto \color{blue}{x + -1 \cdot \frac{y \cdot x}{a}} \]
      2. mul-1-neg52.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{+43}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{+18}:\\ \;\;\;\;x - \frac{y}{\frac{a}{x}}\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 14: 39.2% accurate, 2.5× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.50000000000000052e42 or 1.4e18 < z

    1. Initial program 68.9%

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

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

    if -6.50000000000000052e42 < z < 1.4e18

    1. Initial program 90.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.5 \cdot 10^{+42}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{+18}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]

Alternative 15: 2.8% accurate, 13.0× speedup?

\[\begin{array}{l} \\ 0 \end{array} \]
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
	return 0.0;
}
def code(x, y, z, t, a):
	return 0.0
function code(x, y, z, t, a)
	return 0.0
end
function tmp = code(x, y, z, t, a)
	tmp = 0.0;
end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}

\\
0
\end{array}
Derivation
  1. Initial program 80.5%

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

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

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

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

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

    \[\leadsto \color{blue}{-1 \cdot x + x} \]
  6. Step-by-step derivation
    1. distribute-lft1-in2.9%

      \[\leadsto \color{blue}{\left(-1 + 1\right) \cdot x} \]
    2. metadata-eval2.9%

      \[\leadsto \color{blue}{0} \cdot x \]
    3. mul0-lft2.9%

      \[\leadsto \color{blue}{0} \]
  7. Simplified2.9%

    \[\leadsto \color{blue}{0} \]
  8. Final simplification2.9%

    \[\leadsto 0 \]

Alternative 16: 25.1% 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.5%

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

    \[\leadsto \color{blue}{t} \]
  3. Final simplification28.9%

    \[\leadsto t \]

Reproduce

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