Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.2% → 95.0%
Time: 15.9s
Alternatives: 17
Speedup: 0.3×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 80.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: 95.0% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 86.3%

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 95.0% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 86.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine86.3%

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

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

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

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

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

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

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

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

    1. Initial program 3.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 90.4% accurate, 0.3× speedup?

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

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

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


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

    1. Initial program 89.7%

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

    if -5.0000000000000002e-203 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 1e-236

    1. Initial program 9.5%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Taylor expanded in z around inf 75.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+75.8%

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 43.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -5.8 \cdot 10^{+27}:\\
\;\;\;\;x\\

\mathbf{elif}\;z \leq -5.3 \cdot 10^{-140}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.6 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.54999999999999999e69 or 3.19999999999999986e-5 < z

    1. Initial program 57.4%

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

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

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

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

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

    if -2.54999999999999999e69 < z < -5.8000000000000002e27 or -5.29999999999999984e-140 < z < -3.50000000000000007e-191 or 1.59999999999999991e-105 < z < 3.19999999999999986e-5

    1. Initial program 89.0%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    3. Simplified89.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 inf 64.3%

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

    if -5.8000000000000002e27 < z < -5.29999999999999984e-140 or -3.50000000000000007e-191 < z < 1.59999999999999991e-105

    1. Initial program 89.3%

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

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

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

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

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

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

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

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

Alternative 5: 37.9% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;z \leq -5.6 \cdot 10^{+28}:\\
\;\;\;\;x\\

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

\mathbf{elif}\;z \leq -1.15 \cdot 10^{-191}:\\
\;\;\;\;x\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.2000000000000002e69 or 1.00000000000000008e-5 < z

    1. Initial program 57.4%

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

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

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

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

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

    if -2.2000000000000002e69 < z < -5.6000000000000003e28 or -6.60000000000000017e-119 < z < -1.15000000000000005e-191 or 2.2999999999999999e-104 < z < 1.00000000000000008e-5

    1. Initial program 87.6%

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

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

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

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

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

    if -5.6000000000000003e28 < z < -6.60000000000000017e-119

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

    if -1.15000000000000005e-191 < z < 2.2999999999999999e-104

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.2 \cdot 10^{+69}:\\ \;\;\;\;t\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{+28}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-119}:\\ \;\;\;\;\frac{x \cdot \left(-y\right)}{a}\\ \mathbf{elif}\;z \leq -1.15 \cdot 10^{-191}:\\ \;\;\;\;x\\ \mathbf{elif}\;z \leq 2.3 \cdot 10^{-104}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 10^{-5}:\\ \;\;\;\;x\\ \mathbf{else}:\\ \;\;\;\;t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+69} \lor \neg \left(z \leq -3.55 \cdot 10^{+61} \lor \neg \left(z \leq -1.4 \cdot 10^{-25}\right) \land z \leq 6.2 \cdot 10^{+34}\right):\\
\;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.6499999999999999e69 or -3.55e61 < z < -1.39999999999999994e-25 or 6.19999999999999955e34 < z

    1. Initial program 61.0%

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

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

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

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

      \[\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+66.6%

        \[\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/66.6%

        \[\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/66.6%

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

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

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

        \[\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--66.6%

        \[\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/66.6%

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

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

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

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

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

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

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

    if -1.6499999999999999e69 < z < -3.55e61 or -1.39999999999999994e-25 < z < 6.19999999999999955e34

    1. Initial program 89.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.65 \cdot 10^{+69} \lor \neg \left(z \leq -3.55 \cdot 10^{+61} \lor \neg \left(z \leq -1.4 \cdot 10^{-25}\right) \land z \leq 6.2 \cdot 10^{+34}\right):\\ \;\;\;\;t + \left(t - x\right) \cdot \frac{a - y}{z}\\ \mathbf{else}:\\ \;\;\;\;x + \left(x - t\right) \cdot \frac{z - y}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 73.1% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -2 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.42e69 or -2.3500000000000001e51 < z < -1.99999999999999989e-20

    1. Initial program 64.0%

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

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

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

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

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

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

        \[\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/64.9%

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

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

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

        \[\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--64.9%

        \[\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/64.9%

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y - a}{z}} \]
    7. Simplified74.6%

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

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

    if -1.42e69 < z < -2.3500000000000001e51

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if -1.99999999999999989e-20 < z < 6.19999999999999955e34

    1. Initial program 89.0%

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

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

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

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

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

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

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

    if 6.19999999999999955e34 < z

    1. Initial program 57.3%

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

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

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

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

      \[\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+69.2%

        \[\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/69.2%

        \[\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/69.2%

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

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

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

        \[\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--69.2%

        \[\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/69.2%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 71.2% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -6.5 \cdot 10^{-25} \lor \neg \left(z \leq 6.8 \cdot 10^{-9}\right):\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.54999999999999999e69 or -1.34999999999999996e51 < z < -6.5e-25 or 6.7999999999999997e-9 < z

    1. Initial program 61.7%

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

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

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

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

      \[\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+66.5%

        \[\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/66.5%

        \[\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/66.5%

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

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

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

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

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

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

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

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

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

        \[\leadsto t - \frac{\left(t - x\right) \cdot \left(y - a\right)}{\color{blue}{1 \cdot z}} \]
      13. times-frac79.1%

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

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

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

    if -2.54999999999999999e69 < z < -1.34999999999999996e51

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if -6.5e-25 < z < 6.7999999999999997e-9

    1. Initial program 88.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine88.8%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.55 \cdot 10^{+69}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{+51}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq -6.5 \cdot 10^{-25} \lor \neg \left(z \leq 6.8 \cdot 10^{-9}\right):\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{else}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 70.8% accurate, 0.4× speedup?

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

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

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

\mathbf{elif}\;z \leq -1.1 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.14999999999999996e69 or -1.34999999999999996e51 < z < -1.1e-21

    1. Initial program 64.0%

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

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

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

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

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

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

        \[\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/64.9%

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

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

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

        \[\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--64.9%

        \[\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/64.9%

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y - a}{z}} \]
    7. Simplified74.6%

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

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

    if -2.14999999999999996e69 < z < -1.34999999999999996e51

    1. Initial program 86.5%

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

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

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

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

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

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

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

    if -1.1e-21 < z < 5.59999999999999975e-6

    1. Initial program 88.8%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine88.8%

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

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

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

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

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

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

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

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

    if 5.59999999999999975e-6 < z

    1. Initial program 58.7%

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

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

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

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

      \[\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+68.6%

        \[\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/68.6%

        \[\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/68.6%

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

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

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

        \[\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--68.6%

        \[\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/68.6%

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

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

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

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

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

        \[\leadsto t - \color{blue}{\frac{t - x}{1} \cdot \frac{y - a}{z}} \]
    7. Simplified85.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.15 \cdot 10^{+69}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq -1.35 \cdot 10^{+51}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \mathbf{elif}\;z \leq -1.1 \cdot 10^{-21}:\\ \;\;\;\;t + \frac{y}{z} \cdot \left(x - t\right)\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-6}:\\ \;\;\;\;x + \frac{t - x}{\frac{a}{y}}\\ \mathbf{else}:\\ \;\;\;\;t + x \cdot \frac{y - a}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 48.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - x \cdot \frac{y}{a}\\ t_2 := t \cdot \frac{z}{z - a}\\ \mathbf{if}\;z \leq -1.8 \cdot 10^{+129}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-274}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-222}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+92}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a)
 :precision binary64
 (let* ((t_1 (- x (* x (/ y a)))) (t_2 (* t (/ z (- z a)))))
   (if (<= z -1.8e+129)
     t_2
     (if (<= z -5.6e-274)
       t_1
       (if (<= z 2.1e-222)
         (* t (/ y (- a z)))
         (if (<= z 1.18e+92) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x * (y / a));
	double t_2 = t * (z / (z - a));
	double tmp;
	if (z <= -1.8e+129) {
		tmp = t_2;
	} else if (z <= -5.6e-274) {
		tmp = t_1;
	} else if (z <= 2.1e-222) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.18e+92) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x - (x * (y / a))
    t_2 = t * (z / (z - a))
    if (z <= (-1.8d+129)) then
        tmp = t_2
    else if (z <= (-5.6d-274)) then
        tmp = t_1
    else if (z <= 2.1d-222) then
        tmp = t * (y / (a - z))
    else if (z <= 1.18d+92) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
	double t_1 = x - (x * (y / a));
	double t_2 = t * (z / (z - a));
	double tmp;
	if (z <= -1.8e+129) {
		tmp = t_2;
	} else if (z <= -5.6e-274) {
		tmp = t_1;
	} else if (z <= 2.1e-222) {
		tmp = t * (y / (a - z));
	} else if (z <= 1.18e+92) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a):
	t_1 = x - (x * (y / a))
	t_2 = t * (z / (z - a))
	tmp = 0
	if z <= -1.8e+129:
		tmp = t_2
	elif z <= -5.6e-274:
		tmp = t_1
	elif z <= 2.1e-222:
		tmp = t * (y / (a - z))
	elif z <= 1.18e+92:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a)
	t_1 = Float64(x - Float64(x * Float64(y / a)))
	t_2 = Float64(t * Float64(z / Float64(z - a)))
	tmp = 0.0
	if (z <= -1.8e+129)
		tmp = t_2;
	elseif (z <= -5.6e-274)
		tmp = t_1;
	elseif (z <= 2.1e-222)
		tmp = Float64(t * Float64(y / Float64(a - z)));
	elseif (z <= 1.18e+92)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a)
	t_1 = x - (x * (y / a));
	t_2 = t * (z / (z - a));
	tmp = 0.0;
	if (z <= -1.8e+129)
		tmp = t_2;
	elseif (z <= -5.6e-274)
		tmp = t_1;
	elseif (z <= 2.1e-222)
		tmp = t * (y / (a - z));
	elseif (z <= 1.18e+92)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x - N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+129], t$95$2, If[LessEqual[z, -5.6e-274], t$95$1, If[LessEqual[z, 2.1e-222], N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.18e+92], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;z \leq -5.6 \cdot 10^{-274}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.18 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.8000000000000001e129 or 1.18e92 < z

    1. Initial program 53.1%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{-\frac{t \cdot z}{a - z}} \]
      2. associate-/l*58.3%

        \[\leadsto -\color{blue}{t \cdot \frac{z}{a - z}} \]
      3. distribute-rgt-neg-in58.3%

        \[\leadsto \color{blue}{t \cdot \left(-\frac{z}{a - z}\right)} \]
      4. distribute-frac-neg258.3%

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

        \[\leadsto t \cdot \frac{z}{-\color{blue}{\left(a + \left(-z\right)\right)}} \]
      6. distribute-neg-in58.3%

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

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

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

    if -1.8000000000000001e129 < z < -5.5999999999999995e-274 or 2.0999999999999999e-222 < z < 1.18e92

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.5999999999999995e-274 < z < 2.0999999999999999e-222

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.8 \cdot 10^{+129}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \mathbf{elif}\;z \leq -5.6 \cdot 10^{-274}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-222}:\\ \;\;\;\;t \cdot \frac{y}{a - z}\\ \mathbf{elif}\;z \leq 1.18 \cdot 10^{+92}:\\ \;\;\;\;x - x \cdot \frac{y}{a}\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{z}{z - a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 47.2% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -3 \cdot 10^{-275}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 1.15 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.5000000000000001e130 or 1.14999999999999999e92 < z

    1. Initial program 53.1%

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

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

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

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

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

    if -3.5000000000000001e130 < z < -3e-275 or 3.59999999999999974e-222 < z < 1.14999999999999999e92

    1. Initial program 86.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e-275 < z < 3.59999999999999974e-222

    1. Initial program 83.1%

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

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

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

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

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

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

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

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

Alternative 12: 68.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+69} \lor \neg \left(z \leq 5 \cdot 10^{-6}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.49999999999999992e69 or 5.00000000000000041e-6 < z

    1. Initial program 57.4%

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

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

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

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

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

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

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

    if -1.49999999999999992e69 < z < 5.00000000000000041e-6

    1. Initial program 89.3%

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-undefine89.3%

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

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

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

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

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

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

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

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

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

Alternative 13: 67.2% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.4499999999999999e69 or 1.25000000000000006e-5 < z

    1. Initial program 57.4%

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

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

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

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

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

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

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

    if -1.4499999999999999e69 < z < 1.25000000000000006e-5

    1. Initial program 89.3%

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

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

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

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

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

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

      \[\leadsto \color{blue}{x + 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 -1.45 \cdot 10^{+69} \lor \neg \left(z \leq 1.25 \cdot 10^{-5}\right):\\ \;\;\;\;t \cdot \frac{y - z}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{t - x}{a}\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 60.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -380 \lor \neg \left(x \leq 2.2 \cdot 10^{+118}\right):\\
\;\;\;\;x - x \cdot \frac{y}{a}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -380 or 2.19999999999999986e118 < x

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -380 < x < 2.19999999999999986e118

    1. Initial program 76.8%

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

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

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

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

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

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

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

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

Alternative 15: 39.8% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 3.6 \cdot 10^{+56}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -3.80000000000000006e72 or 3.59999999999999998e56 < a

    1. Initial program 86.1%

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(y - z, \frac{t - x}{a - z}, x\right)} \]
    3. Simplified86.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 inf 56.6%

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

    if -3.80000000000000006e72 < a < 3.59999999999999998e56

    1. Initial program 67.6%

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

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

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

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

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

Alternative 16: 26.0% 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 74.3%

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

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

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

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

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

Alternative 17: 2.8% accurate, 13.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \color{blue}{0} \]
  9. Add Preprocessing

Reproduce

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