Numeric.Signal:interpolate from hsignal-0.2.7.1

Percentage Accurate: 80.2% → 91.7%
Time: 15.3s
Alternatives: 18
Speedup: 0.2×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 18 alternatives:

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

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

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

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

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

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

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


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

    1. Initial program 96.3%

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

    if -4e8 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999999e-267

    1. Initial program 84.7%

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

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

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

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

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

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

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

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

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

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

    1. Initial program 3.1%

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

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

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

      \[\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 69.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+69.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--69.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-sub69.8%

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

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

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

        \[\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 3 regimes into one program.
  4. Final simplification97.2%

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

Alternative 2: 91.4% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-267}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y - z}}\\

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

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


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

    1. Initial program 96.6%

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

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

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

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

    if -4.99999999999999968e-149 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999999e-267

    1. Initial program 63.0%

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

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

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

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

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

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

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

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

    1. Initial program 3.1%

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

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

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

      \[\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 69.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+69.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--69.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-sub69.8%

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

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

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

        \[\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)} \]

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

    1. Initial program 96.6%

      \[x + \left(y - z\right) \cdot \frac{t - x}{a - z} \]
    2. Add Preprocessing
  3. Recombined 4 regimes into one program.
  4. Final simplification97.0%

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

Alternative 3: 91.3% accurate, 0.2× speedup?

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

\mathbf{elif}\;t\_1 \leq -5 \cdot 10^{-267}:\\
\;\;\;\;x + \frac{t}{\frac{a - z}{y - z}}\\

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

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


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

    1. Initial program 96.6%

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

    if -4.99999999999999968e-149 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -4.9999999999999999e-267

    1. Initial program 63.0%

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

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

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

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

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

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

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

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

    1. Initial program 3.1%

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

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

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

      \[\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 69.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+69.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--69.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-sub69.8%

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

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

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

        \[\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 3 regimes into one program.
  4. Final simplification97.0%

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

Alternative 4: 75.4% accurate, 0.4× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < -9.99999999999999977e101 or 1.99999999999999997e157 < a

    1. Initial program 89.8%

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

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

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

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

    if -9.99999999999999977e101 < a < -1.85e-103

    1. Initial program 90.6%

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

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

    if -1.85e-103 < a < 2.8e38

    1. Initial program 71.4%

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

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

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

      \[\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 74.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+74.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. distribute-lft-out--74.2%

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

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

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

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

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

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

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

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

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

    if 2.8e38 < a < 1.99999999999999997e157

    1. Initial program 91.4%

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

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

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

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

        \[\leadsto x + \color{blue}{\frac{t - x}{1} \cdot \frac{y}{a - z}} \]
      4. /-rgt-identity82.7%

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

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

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

Alternative 5: 51.7% accurate, 0.6× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5e79 or 7.4999999999999994e172 < z

    1. Initial program 71.4%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5e79 < z < 1.08e-76

    1. Initial program 92.7%

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

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

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

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

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

    if 1.08e-76 < z < 7.4999999999999994e172

    1. Initial program 79.6%

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
      4. times-frac81.1%

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 52.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;z \leq 7200000:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\

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

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


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

    1. Initial program 77.1%

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
      4. times-frac87.4%

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

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

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

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

    if -4.49999999999999994e79 < z < 7.2e6

    1. Initial program 91.5%

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

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

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

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

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

    if 7.2e6 < z < 4.4000000000000005e34

    1. Initial program 63.3%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{y}{\frac{a - z}{t - x}}} \]
    8. Step-by-step derivation
      1. associate-/r/87.4%

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

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

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

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

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

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

    if 4.4000000000000005e34 < z

    1. Initial program 72.4%

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

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

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

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

Alternative 7: 73.7% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.15e164 or 3.3999999999999997e-20 < y

    1. Initial program 88.8%

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

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

    if -1.15e164 < y < 3.3999999999999997e-20

    1. Initial program 79.3%

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

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

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

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

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

Alternative 8: 70.8% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -6.5000000000000004e201 or 3.5999999999999998e-14 < y

    1. Initial program 89.7%

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

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

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

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

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

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

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

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

    if -6.5000000000000004e201 < y < 3.5999999999999998e-14

    1. Initial program 79.8%

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

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

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

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

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

Alternative 9: 65.3% accurate, 0.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -12500 or 6.9000000000000004e-31 < t

    1. Initial program 88.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -12500 < t < 6.9000000000000004e-31

    1. Initial program 78.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 63.8% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -1.95 \cdot 10^{+78} \lor \neg \left(z \leq 5 \cdot 10^{-117}\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.95e+78) (not (<= z 5e-117)))
   (* 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.95e+78) || !(z <= 5e-117)) {
		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.95d+78)) .or. (.not. (z <= 5d-117))) 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.95e+78) || !(z <= 5e-117)) {
		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.95e+78) or not (z <= 5e-117):
		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.95e+78) || !(z <= 5e-117))
		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.95e+78) || ~((z <= 5e-117)))
		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.95e+78], N[Not[LessEqual[z, 5e-117]], $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.95 \cdot 10^{+78} \lor \neg \left(z \leq 5 \cdot 10^{-117}\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.9500000000000002e78 or 5e-117 < z

    1. Initial program 75.5%

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
      4. times-frac82.6%

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

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

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

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

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

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

    if -1.9500000000000002e78 < z < 5e-117

    1. Initial program 92.5%

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

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

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

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

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

Alternative 11: 64.2% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.8e22 or 4.2499999999999998e83 < a

    1. Initial program 89.1%

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

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

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

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

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

    if -1.8e22 < a < 4.2499999999999998e83

    1. Initial program 77.7%

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
      4. times-frac81.8%

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

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

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

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

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

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

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

Alternative 12: 58.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.5 \cdot 10^{-189} \lor \neg \left(t \leq 5.4 \cdot 10^{-55}\right):\\
\;\;\;\;t \cdot \frac{y - z}{a - z}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.4999999999999999e-189 or 5.40000000000000008e-55 < t

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4999999999999999e-189 < t < 5.40000000000000008e-55

    1. Initial program 79.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 46.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{-7} \lor \neg \left(z \leq 1.05 \cdot 10^{+69}\right):\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.1999999999999999e-7 or 1.05000000000000008e69 < z

    1. Initial program 75.6%

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

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

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

    if -6.1999999999999999e-7 < z < 1.05000000000000008e69

    1. Initial program 91.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 52.1% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 77.1%

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
      4. times-frac87.4%

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

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

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

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

    if -2.89999999999999992e79 < z < 7.2e90

    1. Initial program 89.0%

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

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

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

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

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

    if 7.2e90 < z

    1. Initial program 71.0%

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

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

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

Alternative 15: 38.4% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{-103}:\\
\;\;\;\;x + t\\

\mathbf{elif}\;a \leq 1.28 \cdot 10^{+64}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1.24999999999999992e-103

    1. Initial program 89.3%

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

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

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

    if -1.24999999999999992e-103 < a < 1.28000000000000004e64

    1. Initial program 73.8%

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

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

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

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

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

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

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

        \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
      4. times-frac81.7%

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

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

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

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

    if 1.28000000000000004e64 < a

    1. Initial program 90.3%

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

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

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

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

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

Alternative 16: 38.5% accurate, 1.2× speedup?

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

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

\mathbf{elif}\;a \leq 2.35 \cdot 10^{+67}:\\
\;\;\;\;t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.6e22 or 2.35000000000000009e67 < a

    1. Initial program 89.5%

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

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

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

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

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

    if -2.6e22 < a < 2.35000000000000009e67

    1. Initial program 77.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 17: 35.9% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.6 \cdot 10^{-19}:\\
\;\;\;\;x + t\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < 1.59999999999999991e-19

    1. Initial program 81.2%

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

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

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

    if 1.59999999999999991e-19 < y

    1. Initial program 88.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 18: 25.1% accurate, 13.0× speedup?

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

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

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

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

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

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

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

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

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

      \[\leadsto \left(-x\right) \cdot \left(\color{blue}{\mathsf{fma}\left(-1, \frac{t \cdot \left(y - z\right)}{x \cdot \left(a - z\right)}, \frac{y}{a - z}\right)} - \left(1 + \frac{z}{a - z}\right)\right) \]
    4. times-frac84.1%

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

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

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

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

Reproduce

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