Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.2% → 93.1%
Time: 16.6s
Alternatives: 20
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 20 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.2% 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 -5 \cdot 10^{-263} \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)}{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 -5e-263) (not (<= t_1 0.0)))
     (fma (- t x) (/ (- y z) (- a z)) x)
     (- t (/ (* (- t x) (- y a)) z)))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x + ((y - z) * ((t - x) / (a - z)));
	double tmp;
	if ((t_1 <= -5e-263) || !(t_1 <= 0.0)) {
		tmp = fma((t - x), ((y - z) / (a - z)), x);
	} 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 <= -5e-263) || !(t_1 <= 0.0))
		tmp = fma(Float64(t - x), Float64(Float64(y - z) / Float64(a - z)), x);
	else
		tmp = Float64(t - Float64(Float64(Float64(t - x) * Float64(y - a)) / 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, -5e-263], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(t - x), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(t - N[(N[(N[(t - x), $MachinePrecision] * 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 -5 \cdot 10^{-263} \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)}{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)))) < -5.00000000000000006e-263 or 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z))))

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.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/87.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/87.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-neg87.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-sub87.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-neg87.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--87.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/87.3%

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

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

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

        \[\leadsto t - \frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z} \]
    7. Simplified87.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 simplification95.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-263} \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)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 93.1% accurate, 0.3× speedup?

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

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.0%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.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/87.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/87.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-neg87.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-sub87.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-neg87.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--87.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/87.3%

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

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

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

        \[\leadsto t - \frac{\color{blue}{\left(t - x\right) \cdot \left(y - a\right)}}{z} \]
    7. Simplified87.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 simplification95.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-263} \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(y - a\right)}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 89.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-263} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-308}\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 -5e-263) (not (<= t_1 2e-308)))
     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 <= -5e-263) || !(t_1 <= 2e-308)) {
		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 <= (-5d-263)) .or. (.not. (t_1 <= 2d-308))) 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 <= -5e-263) || !(t_1 <= 2e-308)) {
		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 <= -5e-263) or not (t_1 <= 2e-308):
		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 <= -5e-263) || !(t_1 <= 2e-308))
		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 <= -5e-263) || ~((t_1 <= 2e-308)))
		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, -5e-263], N[Not[LessEqual[t$95$1, 2e-308]], $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 -5 \cdot 10^{-263} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-308}\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)))) < -5.00000000000000006e-263 or 1.9999999999999998e-308 < (+.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. Add Preprocessing

    if -5.00000000000000006e-263 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1.9999999999999998e-308

    1. Initial program 3.1%

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(t - x, \frac{y - z}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 87.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}} \]
    6. Step-by-step derivation
      1. associate--l+87.8%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq -5 \cdot 10^{-263} \lor \neg \left(x + \left(y - z\right) \cdot \frac{t - x}{a - z} \leq 2 \cdot 10^{-308}\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: 75.6% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 51.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac239.5%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified39.5%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 71.0%

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

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

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

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

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

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

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

    if -6.40000000000000005e156 < z < -7.3999999999999999e-67

    1. Initial program 91.3%

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

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

    if -7.3999999999999999e-67 < z < 1.5999999999999999e24

    1. Initial program 91.5%

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

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

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

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

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

    if 1.5999999999999999e24 < z

    1. Initial program 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 75.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{-66} \lor \neg \left(z \leq 1.2 \cdot 10^{+20}\right):\\
\;\;\;\;x - t \cdot \frac{z - y}{a - z}\\

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


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

    1. Initial program 51.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac239.5%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified39.5%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 71.0%

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

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

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

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

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

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

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

    if -5.80000000000000021e156 < z < -3.0000000000000002e-66 or 1.2e20 < z

    1. Initial program 82.8%

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

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

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

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

    if -3.0000000000000002e-66 < z < 1.2e20

    1. Initial program 91.5%

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

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

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

Alternative 6: 75.1% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 51.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac239.5%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified39.5%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 71.0%

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

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

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

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

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

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

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

    if -1.6499999999999999e156 < z < -5.60000000000000021e-67

    1. Initial program 91.3%

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

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

    if -5.60000000000000021e-67 < z < 8.5e19

    1. Initial program 91.5%

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

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

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

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

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

    if 8.5e19 < z

    1. Initial program 76.7%

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

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

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

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

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

Alternative 7: 75.0% accurate, 0.5× speedup?

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

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

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

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

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


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

    1. Initial program 51.8%

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{-\frac{t - x}{z}}, x\right) \]
      2. distribute-neg-frac239.5%

        \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    7. Simplified39.5%

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 71.0%

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

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

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

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

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

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

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

    if -1.45000000000000003e162 < z < -1.2999999999999999e-66

    1. Initial program 91.3%

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

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

    if -1.2999999999999999e-66 < z < 8.5e19

    1. Initial program 91.5%

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

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

    if 8.5e19 < z

    1. Initial program 76.7%

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

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

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

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

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

Alternative 8: 73.9% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{-230} \lor \neg \left(a \leq 9.5 \cdot 10^{-132}\right):\\
\;\;\;\;x - t \cdot \frac{z - y}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.55e-230 or 9.49999999999999987e-132 < a

    1. Initial program 85.2%

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

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

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

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

    if -1.55e-230 < a < 9.49999999999999987e-132

    1. Initial program 76.4%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 77.2%

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

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

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

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

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

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

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

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

Alternative 9: 37.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;y \leq -2.6 \cdot 10^{-48} \lor \neg \left(y \leq 1.22 \cdot 10^{+117}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


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

    1. Initial program 91.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.19999999999999965e112 < y < -2.59999999999999987e-48 or 1.22000000000000004e117 < y

    1. Initial program 86.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999987e-48 < y < 1.22000000000000004e117

    1. Initial program 79.5%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -6.2 \cdot 10^{+112}:\\ \;\;\;\;x \cdot \frac{-y}{a}\\ \mathbf{elif}\;y \leq -2.6 \cdot 10^{-48} \lor \neg \left(y \leq 1.22 \cdot 10^{+117}\right):\\ \;\;\;\;t \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;x + t\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 71.4% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -4.5000000000000001e-20 or 2e7 < z

    1. Initial program 72.8%

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

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

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

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

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

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

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

      \[\leadsto \mathsf{fma}\left(y - z, \color{blue}{\frac{t - x}{-z}}, x\right) \]
    8. Taylor expanded in y around 0 68.4%

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

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

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

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

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

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

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

    if -4.5000000000000001e-20 < z < 2e7

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 64.5% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.6e-13 or 2.5499999999999999e26 < z

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.6e-13 < z < 2.5499999999999999e26

    1. Initial program 91.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 63.4% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.45000000000000016e-13 or 1.69999999999999991e29 < z

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000016e-13 < z < 1.69999999999999991e29

    1. Initial program 91.4%

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

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

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

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

        \[\leadsto x + y \cdot \color{blue}{\frac{1}{\frac{a}{t - x}}} \]
      2. un-div-inv76.7%

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

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

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

Alternative 13: 63.3% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.45000000000000016e-13 or 2.90000000000000013e23 < z

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.45000000000000016e-13 < z < 2.90000000000000013e23

    1. Initial program 91.4%

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

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

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

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

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

Alternative 14: 59.1% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-13} \lor \neg \left(z \leq 4.1 \cdot 10^{+33}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.19999999999999997e-13 or 4.09999999999999995e33 < z

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.19999999999999997e-13 < z < 4.09999999999999995e33

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

Alternative 15: 56.5% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.0000000000000006e-15 < z < 2.8e21

    1. Initial program 91.4%

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

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

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

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

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

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

Alternative 16: 52.9% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-87} \lor \neg \left(z \leq 10^{+30}\right):\\
\;\;\;\;t \cdot \left(1 - \frac{y}{z}\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.50000000000000021e-87 or 1e30 < z

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.50000000000000021e-87 < z < 1e30

    1. Initial program 91.2%

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

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

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

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

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

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

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

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

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

Alternative 17: 50.3% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -5.5e66 or 2.65e70 < a

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

    if -5.5e66 < a < 2.65e70

    1. Initial program 78.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 38.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-48} \lor \neg \left(y \leq 1.05 \cdot 10^{+117}\right):\\
\;\;\;\;t \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.59999999999999987e-48 or 1.0500000000000001e117 < y

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.59999999999999987e-48 < y < 1.0500000000000001e117

    1. Initial program 79.5%

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

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

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

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

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

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

Alternative 19: 39.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 2 \cdot 10^{+70}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.5000000000000003e62 or 2.00000000000000015e70 < a

    1. Initial program 91.8%

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

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

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

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

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

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

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

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

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

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

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

    if -6.5000000000000003e62 < a < 2.00000000000000015e70

    1. Initial program 78.0%

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

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

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

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

      \[\leadsto x + \color{blue}{t} \]
    7. Taylor expanded in x around 0 33.3%

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

Alternative 20: 25.5% 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 83.4%

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

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

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

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

    \[\leadsto x + \color{blue}{t} \]
  7. Taylor expanded in x around 0 22.6%

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

Reproduce

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